aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2018-07-25 04:10:29 +0930
committerGitHub <noreply@github.com>2018-07-25 04:10:29 +0930
commitec387c6dd975fecea69db2ed9ff0c090ac59cf83 (patch)
treeb3720e23e2f1832c894f75a167a57bcf4ef5259b /railties
parent48c287d1963fba09cf620527d35519f67d5ca01a (diff)
parent2e194d0c9edfa54cb955b48fa204de2f4c980239 (diff)
downloadrails-ec387c6dd975fecea69db2ed9ff0c090ac59cf83.tar.gz
rails-ec387c6dd975fecea69db2ed9ff0c090ac59cf83.tar.bz2
rails-ec387c6dd975fecea69db2ed9ff0c090ac59cf83.zip
Merge pull request #33229 from albertoalmagro/albertoalmagro/prefer-rails-command-over-bin-rails
Prefer rails command over bin/rails
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/application.rb2
-rw-r--r--railties/lib/rails/command/base.rb2
-rw-r--r--railties/lib/rails/commands/credentials/USAGE2
-rw-r--r--railties/lib/rails/commands/credentials/credentials_command.rb4
-rw-r--r--railties/lib/rails/commands/encrypted/encrypted_command.rb4
-rw-r--r--railties/lib/rails/commands/secrets/USAGE6
-rw-r--r--railties/lib/rails/commands/secrets/secrets_command.rb4
-rw-r--r--railties/lib/rails/generators/rails/app/app_generator.rb2
-rw-r--r--railties/lib/rails/generators/rails/app/templates/bin/update.tt6
-rw-r--r--railties/lib/rails/generators/rails/credentials/credentials_generator.rb2
-rw-r--r--railties/lib/rails/test_unit/reporter.rb2
-rw-r--r--railties/test/application/test_runner_test.rb4
-rw-r--r--railties/test/commands/credentials_test.rb2
-rw-r--r--railties/test/commands/dbconsole_test.rb4
-rw-r--r--railties/test/commands/encrypted_test.rb2
-rw-r--r--railties/test/generators/test_runner_in_engine_test.rb2
-rw-r--r--railties/test/test_unit/reporter_test.rb10
17 files changed, 30 insertions, 30 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index e346d5cc3a..76a8ccb8f1 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -444,7 +444,7 @@ module Rails
# Shorthand to decrypt any encrypted configurations or files.
#
- # For any file added with <tt>bin/rails encrypted:edit</tt> call +read+ to decrypt
+ # For any file added with <tt>rails encrypted:edit</tt> call +read+ to decrypt
# the file with the master key.
# The master key is either stored in +config/master.key+ or <tt>ENV["RAILS_MASTER_KEY"]</tt>.
#
diff --git a/railties/lib/rails/command/base.rb b/railties/lib/rails/command/base.rb
index fa462ef7e9..766872de8a 100644
--- a/railties/lib/rails/command/base.rb
+++ b/railties/lib/rails/command/base.rb
@@ -70,7 +70,7 @@ module Rails
end
def executable
- "bin/rails #{command_name}"
+ "rails #{command_name}"
end
# Use Rails' default banner.
diff --git a/railties/lib/rails/commands/credentials/USAGE b/railties/lib/rails/commands/credentials/USAGE
index 85877c71b7..ea429f58d8 100644
--- a/railties/lib/rails/commands/credentials/USAGE
+++ b/railties/lib/rails/commands/credentials/USAGE
@@ -14,7 +14,7 @@ that just contains the secret_key_base used by MessageVerifiers/MessageEncryptor
signing and encrypting cookies.
For applications created prior to Rails 5.2, we'll automatically generate a new
-credentials file in `config/credentials.yml.enc` the first time you run `bin/rails credentials:edit`.
+credentials file in `config/credentials.yml.enc` the first time you run `rails credentials:edit`.
If you didn't have a master key saved in `config/master.key`, that'll be created too.
Don't lose this master key! Put it in a password manager your team can access.
diff --git a/railties/lib/rails/commands/credentials/credentials_command.rb b/railties/lib/rails/commands/credentials/credentials_command.rb
index fa54c0362a..65c5218fc8 100644
--- a/railties/lib/rails/commands/credentials/credentials_command.rb
+++ b/railties/lib/rails/commands/credentials/credentials_command.rb
@@ -69,9 +69,9 @@ module Rails
def missing_credentials_message
if Rails.application.credentials.key.nil?
- "Missing master key to decrypt credentials. See bin/rails credentials:help"
+ "Missing master key to decrypt credentials. See `rails credentials:help`"
else
- "No credentials have been added yet. Use bin/rails credentials:edit to change that."
+ "No credentials have been added yet. Use `rails credentials:edit` to change that."
end
end
end
diff --git a/railties/lib/rails/commands/encrypted/encrypted_command.rb b/railties/lib/rails/commands/encrypted/encrypted_command.rb
index 3bc8f76ce4..8d5947652a 100644
--- a/railties/lib/rails/commands/encrypted/encrypted_command.rb
+++ b/railties/lib/rails/commands/encrypted/encrypted_command.rb
@@ -76,9 +76,9 @@ module Rails
def missing_encrypted_message(key:, key_path:, file_path:)
if key.nil?
- "Missing '#{key_path}' to decrypt data. See bin/rails encrypted:help"
+ "Missing '#{key_path}' to decrypt data. See `rails encrypted:help`"
else
- "File '#{file_path}' does not exist. Use bin/rails encrypted:edit #{file_path} to change that."
+ "File '#{file_path}' does not exist. Use `rails encrypted:edit #{file_path}` to change that."
end
end
end
diff --git a/railties/lib/rails/commands/secrets/USAGE b/railties/lib/rails/commands/secrets/USAGE
index 96e322fe91..e205cdc001 100644
--- a/railties/lib/rails/commands/secrets/USAGE
+++ b/railties/lib/rails/commands/secrets/USAGE
@@ -7,7 +7,7 @@ with the code.
=== Setup
-Run `bin/rails secrets:setup` to opt in and generate the `config/secrets.yml.key`
+Run `rails secrets:setup` to opt in and generate the `config/secrets.yml.key`
and `config/secrets.yml.enc` files.
The latter contains all the keys to be encrypted while the former holds the
@@ -45,12 +45,12 @@ the key. Add this:
config.read_encrypted_secrets = true
-to the environment you'd like to read encrypted secrets. `bin/rails secrets:setup`
+to the environment you'd like to read encrypted secrets. `rails secrets:setup`
inserts this into the production environment by default.
=== Editing Secrets
-After `bin/rails secrets:setup`, run `bin/rails secrets:edit`.
+After `rails secrets:setup`, run `rails secrets:edit`.
That command opens a temporary file in `$EDITOR` with the decrypted contents of
`config/secrets.yml.enc` to edit the encrypted secrets.
diff --git a/railties/lib/rails/commands/secrets/secrets_command.rb b/railties/lib/rails/commands/secrets/secrets_command.rb
index a36ccf314c..3d2c2cc7c6 100644
--- a/railties/lib/rails/commands/secrets/secrets_command.rb
+++ b/railties/lib/rails/commands/secrets/secrets_command.rb
@@ -22,7 +22,7 @@ module Rails
if ENV["EDITOR"].to_s.empty?
say "No $EDITOR to open decrypted secrets in. Assign one like this:"
say ""
- say %(EDITOR="mate --wait" bin/rails secrets:edit)
+ say %(EDITOR="mate --wait" rails secrets:edit)
say ""
say "For editors that fork and exit immediately, it's important to pass a wait flag,"
say "otherwise the secrets will be saved immediately with no chance to edit."
@@ -56,7 +56,7 @@ module Rails
private
def deprecate_in_favor_of_credentials_and_exit
say "Encrypted secrets is deprecated in favor of credentials. Run:"
- say "bin/rails credentials:help"
+ say "rails credentials:help"
exit 1
end
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb
index e25ddcf548..d5d87f3dfd 100644
--- a/railties/lib/rails/generators/rails/app/app_generator.rb
+++ b/railties/lib/rails/generators/rails/app/app_generator.rb
@@ -249,7 +249,7 @@ module Rails
add_shared_options_for "application"
- # Add bin/rails options
+ # Add rails command options
class_option :version, type: :boolean, aliases: "-v", group: :rails,
desc: "Show Rails version number and quit"
diff --git a/railties/lib/rails/generators/rails/app/templates/bin/update.tt b/railties/lib/rails/generators/rails/app/templates/bin/update.tt
index 70cc71d83b..99c2430bc6 100644
--- a/railties/lib/rails/generators/rails/app/templates/bin/update.tt
+++ b/railties/lib/rails/generators/rails/app/templates/bin/update.tt
@@ -23,12 +23,12 @@ chdir APP_ROOT do
<% unless options.skip_active_record? -%>
puts "\n== Updating database =="
- system! 'bin/rails db:migrate'
+ system! 'rails db:migrate'
<% end -%>
puts "\n== Removing old logs and tempfiles =="
- system! 'bin/rails log:clear tmp:clear'
+ system! 'rails log:clear tmp:clear'
puts "\n== Restarting application server =="
- system! 'bin/rails restart'
+ system! 'rails restart'
end
diff --git a/railties/lib/rails/generators/rails/credentials/credentials_generator.rb b/railties/lib/rails/generators/rails/credentials/credentials_generator.rb
index 719e0c1e4c..99b935aa6a 100644
--- a/railties/lib/rails/generators/rails/credentials/credentials_generator.rb
+++ b/railties/lib/rails/generators/rails/credentials/credentials_generator.rb
@@ -20,7 +20,7 @@ module Rails
add_credentials_file_silently(template)
- say "You can edit encrypted credentials with `bin/rails credentials:edit`."
+ say "You can edit encrypted credentials with `rails credentials:edit`."
say ""
end
end
diff --git a/railties/lib/rails/test_unit/reporter.rb b/railties/lib/rails/test_unit/reporter.rb
index 28b93cee5a..417933836b 100644
--- a/railties/lib/rails/test_unit/reporter.rb
+++ b/railties/lib/rails/test_unit/reporter.rb
@@ -5,7 +5,7 @@ require "minitest"
module Rails
class TestUnitReporter < Minitest::StatisticsReporter
- class_attribute :executable, default: "bin/rails test"
+ class_attribute :executable, default: "rails test"
def record(result)
super
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb
index 8e5ccf94cc..455dc60efd 100644
--- a/railties/test/application/test_runner_test.rb
+++ b/railties/test/application/test_runner_test.rb
@@ -504,7 +504,7 @@ module ApplicationTests
create_test_file :models, "post", pass: false, print: false
output = run_test_command("test/models/post_test.rb")
- expect = %r{Running:\n\nF\n\nFailure:\nPostTest#test_truth \[[^\]]+test/models/post_test.rb:6\]:\nwups!\n\nbin/rails test test/models/post_test.rb:4\n\n\n\n}
+ expect = %r{Running:\n\nF\n\nFailure:\nPostTest#test_truth \[[^\]]+test/models/post_test.rb:6\]:\nwups!\n\nrails test test/models/post_test.rb:4\n\n\n\n}
assert_match expect, output
end
@@ -553,7 +553,7 @@ module ApplicationTests
create_test_file :models, "account"
create_test_file :models, "post", pass: false
# This specifically verifies TEST for backwards compatibility with rake test
- # as bin/rails test already supports running tests from a single file more cleanly.
+ # as `rails test` already supports running tests from a single file more cleanly.
output = Dir.chdir(app_path) { `bin/rake test TEST=test/models/post_test.rb` }
assert_match "PostTest", output, "passing TEST= should run selected test"
diff --git a/railties/test/commands/credentials_test.rb b/railties/test/commands/credentials_test.rb
index fc16b8194f..5b8b9e4eda 100644
--- a/railties/test/commands/credentials_test.rb
+++ b/railties/test/commands/credentials_test.rb
@@ -15,7 +15,7 @@ class Rails::Command::CredentialsCommandTest < ActiveSupport::TestCase
test "edit without editor gives hint" do
run_edit_command(editor: "").tap do |output|
assert_match "No $EDITOR to open file in", output
- assert_match "bin/rails credentials:edit", output
+ assert_match "rails credentials:edit", output
end
end
diff --git a/railties/test/commands/dbconsole_test.rb b/railties/test/commands/dbconsole_test.rb
index 0aea21051a..5e3eca6585 100644
--- a/railties/test/commands/dbconsole_test.rb
+++ b/railties/test/commands/dbconsole_test.rb
@@ -265,14 +265,14 @@ class Rails::DBConsoleTest < ActiveSupport::TestCase
stdout = capture(:stdout) do
Rails::Command.invoke(:dbconsole, ["-h"])
end
- assert_match(/bin\/rails dbconsole \[environment\]/, stdout)
+ assert_match(/rails dbconsole \[environment\]/, stdout)
end
def test_print_help_long
stdout = capture(:stdout) do
Rails::Command.invoke(:dbconsole, ["--help"])
end
- assert_match(/bin\/rails dbconsole \[environment\]/, stdout)
+ assert_match(/rails dbconsole \[environment\]/, stdout)
end
attr_reader :aborted, :output
diff --git a/railties/test/commands/encrypted_test.rb b/railties/test/commands/encrypted_test.rb
index 9fc73d5f18..8b608fe8c0 100644
--- a/railties/test/commands/encrypted_test.rb
+++ b/railties/test/commands/encrypted_test.rb
@@ -14,7 +14,7 @@ class Rails::Command::EncryptedCommandTest < ActiveSupport::TestCase
test "edit without editor gives hint" do
run_edit_command("config/tokens.yml.enc", editor: "").tap do |output|
assert_match "No $EDITOR to open file in", output
- assert_match "bin/rails encrypted:edit", output
+ assert_match "rails encrypted:edit", output
end
end
diff --git a/railties/test/generators/test_runner_in_engine_test.rb b/railties/test/generators/test_runner_in_engine_test.rb
index 0e15b5e388..bd102a32b5 100644
--- a/railties/test/generators/test_runner_in_engine_test.rb
+++ b/railties/test/generators/test_runner_in_engine_test.rb
@@ -19,7 +19,7 @@ class TestRunnerInEngineTest < ActiveSupport::TestCase
create_test_file "post", pass: false
output = run_test_command("test/post_test.rb")
- expect = %r{Running:\n\nPostTest\nF\n\nFailure:\nPostTest#test_truth \[[^\]]+test/post_test\.rb:6\]:\nwups!\n\nbin/rails test test/post_test\.rb:4}
+ expect = %r{Running:\n\nPostTest\nF\n\nFailure:\nPostTest#test_truth \[[^\]]+test/post_test\.rb:6\]:\nwups!\n\nrails test test/post_test\.rb:4}
assert_match expect, output
end
diff --git a/railties/test/test_unit/reporter_test.rb b/railties/test/test_unit/reporter_test.rb
index 91cb47779b..81b7ab19a1 100644
--- a/railties/test/test_unit/reporter_test.rb
+++ b/railties/test/test_unit/reporter_test.rb
@@ -18,7 +18,7 @@ class TestUnitReporterTest < ActiveSupport::TestCase
@reporter.record(failed_test)
@reporter.report
- assert_match %r{^bin/rails test .*test/test_unit/reporter_test\.rb:\d+$}, @output.string
+ assert_match %r{^rails test .*test/test_unit/reporter_test\.rb:\d+$}, @output.string
assert_rerun_snippet_count 1
end
@@ -64,7 +64,7 @@ class TestUnitReporterTest < ActiveSupport::TestCase
@reporter.record(failed_test)
@reporter.report
- expect = %r{\AF\n\nFailure:\nTestUnitReporterTest::ExampleTest#woot \[[^\]]+\]:\nboo\n\nbin/rails test test/test_unit/reporter_test\.rb:\d+\n\n\z}
+ expect = %r{\AF\n\nFailure:\nTestUnitReporterTest::ExampleTest#woot \[[^\]]+\]:\nboo\n\nrails test test/test_unit/reporter_test\.rb:\d+\n\n\z}
assert_match expect, @output.string
end
@@ -72,7 +72,7 @@ class TestUnitReporterTest < ActiveSupport::TestCase
@reporter.record(errored_test)
@reporter.report
- expect = %r{\AE\n\nError:\nTestUnitReporterTest::ExampleTest#woot:\nArgumentError: wups\n \n\nbin/rails test .*test/test_unit/reporter_test\.rb:\d+\n\n\z}
+ expect = %r{\AE\n\nError:\nTestUnitReporterTest::ExampleTest#woot:\nArgumentError: wups\n \n\nrails test .*test/test_unit/reporter_test\.rb:\d+\n\n\z}
assert_match expect, @output.string
end
@@ -81,7 +81,7 @@ class TestUnitReporterTest < ActiveSupport::TestCase
verbose.record(skipped_test)
verbose.report
- expect = %r{\ATestUnitReporterTest::ExampleTest#woot = 10\.00 s = S\n\n\nSkipped:\nTestUnitReporterTest::ExampleTest#woot \[[^\]]+\]:\nskipchurches, misstemples\n\nbin/rails test test/test_unit/reporter_test\.rb:\d+\n\n\z}
+ expect = %r{\ATestUnitReporterTest::ExampleTest#woot = 10\.00 s = S\n\n\nSkipped:\nTestUnitReporterTest::ExampleTest#woot \[[^\]]+\]:\nskipchurches, misstemples\n\nrails test test/test_unit/reporter_test\.rb:\d+\n\n\z}
assert_match expect, @output.string
end
@@ -159,7 +159,7 @@ class TestUnitReporterTest < ActiveSupport::TestCase
private
def assert_rerun_snippet_count(snippet_count)
- assert_equal snippet_count, @output.string.scan(%r{^bin/rails test }).size
+ assert_equal snippet_count, @output.string.scan(%r{^rails test }).size
end
def failed_test