提交 e062c961 编写于 作者: Y yuuji.yaginuma

Deprecate an `capify!` method in generators and templates

The `capify` command has been removed by Capistrano 3 and became to
`cap install`.
Therefore, the `capify!` method has no meaning in Capistrano 3.
I think that should deprecate.

Ref: https://github.com/capistrano/capistrano/commit/492793916acf32ffe1604daec6fd4892c8935018
上级 03fa6b29
......@@ -689,14 +689,6 @@ Available options are:
* `:env` - Specifies the environment in which to run this rake task.
* `:sudo` - Whether or not to run this task using `sudo`. Defaults to `false`.
### `capify!`
Runs the `capify` command from Capistrano at the root of the application which generates Capistrano configuration.
```ruby
capify!
```
### `route`
Adds text to the `config/routes.rb` file:
......
* Deprecate `capify!` method in generators and templates.
*Yuji Yaginuma*
* Allow irb options to be passed from `rails console` command.
Fixes #28988.
......
......@@ -227,6 +227,7 @@ def rails_command(command, options = {})
#
# capify!
def capify!
ActiveSupport::Deprecation.warn("`capify!` is deprecated and will be removed in the next version of Rails.")
log :capify, ""
in_root { run("#{extify(:capify)} .", verbose: false) }
end
......
......@@ -278,9 +278,12 @@ def test_env_option_should_win_over_rails_env_variable_when_running_rails
end
def test_capify_should_run_the_capify_command
assert_called_with(generator, :run, ["capify .", verbose: false]) do
action :capify!
content = capture(:stderr) do
assert_called_with(generator, :run, ["capify .", verbose: false]) do
action :capify!
end
end
assert_match(/DEPRECATION WARNING: `capify!` is deprecated/, content)
end
def test_route_should_add_data_to_the_routes_block_in_config_routes
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册