Skip to content

Commit

Permalink
Replace all sync in headers with gem
Browse files Browse the repository at this point in the history
  • Loading branch information
paracycle committed Sep 13, 2021
1 parent 624816f commit f9c3bfc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions lib/tapioca/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def build_requires
say("Done", :green)

say("All requires from this application have been written to #{name}.", [:green, :bold])
cmd = set_color("#{Config::DEFAULT_COMMAND} sync", :yellow, :bold)
cmd = set_color("#{Config::DEFAULT_COMMAND} gem", :yellow, :bold)
say("Please review changes and commit them, then run `#{cmd}`.", [:green, :bold])
end

Expand Down Expand Up @@ -537,7 +537,7 @@ def compile_gem_rbi(gem)
rbi_body_content = compiler.compile(gem)
content = String.new
content << rbi_header(
"#{Config::DEFAULT_COMMAND} sync",
"#{Config::DEFAULT_COMMAND} gem #{gem.name}",
reason: "types exported from the `#{gem.name}` gem",
strictness: strictness
)
Expand Down Expand Up @@ -670,7 +670,7 @@ def perform_sync_verification
diff[filename] = gem_rbi_exists?(gem_name) ? :changed : :added
end

report_diff_and_exit_if_out_of_date(diff, "sync")
report_diff_and_exit_if_out_of_date(diff, "gem")
end

sig { params(diff: T::Hash[String, Symbol], command: String).void }
Expand Down
12 changes: 6 additions & 6 deletions spec/tapioca/cli/gem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class GemSpec < CliSpec
FOO_RBI = <<~CONTENTS
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `foo` gem.
# Please instead update this file by running `bin/tapioca sync`.
# Please instead update this file by running `bin/tapioca gem foo`.
# typed: true
Expand All @@ -26,7 +26,7 @@ def bar(a = T.unsafe(nil), b: T.unsafe(nil), **opts); end
BAR_RBI = <<~CONTENTS
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `bar` gem.
# Please instead update this file by running `bin/tapioca sync`.
# Please instead update this file by running `bin/tapioca gem bar`.
# typed: true
Expand All @@ -42,7 +42,7 @@ def bar(a = T.unsafe(nil), b: T.unsafe(nil), **opts); end
BAZ_RBI = <<~CONTENTS
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `baz` gem.
# Please instead update this file by running `bin/tapioca sync`.
# Please instead update this file by running `bin/tapioca gem baz`.
# typed: true
Expand Down Expand Up @@ -315,7 +315,7 @@ class Foo::Secret; end
assert_equal(<<~CONTENTS.chomp, File.read("#{outdir}/[email protected]"))
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `qux` gem.
# Please instead update this file by running `bin/tapioca sync`.
# Please instead update this file by running `bin/tapioca gem qux`.
# typed: true
Expand Down Expand Up @@ -463,7 +463,7 @@ class Foo::Secret; end
Checking for out-of-date RBIs...
RBI files are out-of-date. In your development environment, please run:
`bin/tapioca sync`
`bin/tapioca gem`
Once it is complete, be sure to commit and push any changes
Reason:
Expand Down Expand Up @@ -493,7 +493,7 @@ class Foo::Secret; end
Checking for out-of-date RBIs...
RBI files are out-of-date. In your development environment, please run:
`bin/tapioca sync`
`bin/tapioca gem`
Once it is complete, be sure to commit and push any changes
Reason:
Expand Down
6 changes: 3 additions & 3 deletions spec/tapioca/cli/generate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class GenerateSpec < CliSpec
FOO_RBI = <<~CONTENTS
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `foo` gem.
# Please instead update this file by running `bin/tapioca sync`.
# Please instead update this file by running `bin/tapioca gem foo`.
# typed: true
Expand All @@ -26,7 +26,7 @@ def bar(a = T.unsafe(nil), b: T.unsafe(nil), **opts); end
BAR_RBI = <<~CONTENTS
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `bar` gem.
# Please instead update this file by running `bin/tapioca sync`.
# Please instead update this file by running `bin/tapioca gem bar`.
# typed: true
Expand All @@ -42,7 +42,7 @@ def bar(a = T.unsafe(nil), b: T.unsafe(nil), **opts); end
BAZ_RBI = <<~CONTENTS
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `baz` gem.
# Please instead update this file by running `bin/tapioca sync`.
# Please instead update this file by running `bin/tapioca gem baz`.
# typed: true
Expand Down
4 changes: 2 additions & 2 deletions spec/tapioca/cli/require_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class RequireSpec < CliSpec
assert_equal(<<~OUTPUT, output)
Compiling sorbet/tapioca/require.rb, this may take a few seconds... Done
All requires from this application have been written to sorbet/tapioca/require.rb.
Please review changes and commit them, then run `bin/tapioca sync`.
Please review changes and commit them, then run `bin/tapioca gem`.
OUTPUT

assert_path_exists(repo_path / "sorbet/tapioca/require.rb")
Expand Down Expand Up @@ -69,7 +69,7 @@ class RequireSpec < CliSpec
assert_equal(<<~OUTPUT, output)
Compiling sorbet/tapioca/require.rb, this may take a few seconds... Done
All requires from this application have been written to sorbet/tapioca/require.rb.
Please review changes and commit them, then run `bin/tapioca sync`.
Please review changes and commit them, then run `bin/tapioca gem`.
OUTPUT

assert_path_exists(repo_path / "sorbet/tapioca/require.rb")
Expand Down
6 changes: 3 additions & 3 deletions spec/tapioca/cli/sync_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class SyncSpec < CliSpec
assert_equal(<<~CONTENTS.chomp, File.read("#{outdir}/[email protected]"))
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `qux` gem.
# Please instead update this file by running `bin/tapioca sync`.
# Please instead update this file by running `bin/tapioca gem qux`.
# typed: true
Expand Down Expand Up @@ -231,7 +231,7 @@ class SyncSpec < CliSpec
Checking for out-of-date RBIs...
RBI files are out-of-date. In your development environment, please run:
`bin/tapioca sync`
`bin/tapioca gem`
Once it is complete, be sure to commit and push any changes
Reason:
Expand Down Expand Up @@ -261,7 +261,7 @@ class SyncSpec < CliSpec
Checking for out-of-date RBIs...
RBI files are out-of-date. In your development environment, please run:
`bin/tapioca sync`
`bin/tapioca gem`
Once it is complete, be sure to commit and push any changes
Reason:
Expand Down

0 comments on commit f9c3bfc

Please sign in to comment.