Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate an capify! method in generators and templates #29493

Merged
merged 1 commit into from Jun 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 0 additions & 8 deletions guides/source/generators.md
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions railties/CHANGELOG.md
@@ -1,3 +1,7 @@
* Deprecate `capify!` method in generators and templates.

*Yuji Yaginuma*

* Allow irb options to be passed from `rails console` command.

Fixes #28988.
Expand Down
1 change: 1 addition & 0 deletions railties/lib/rails/generators/actions.rb
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions railties/test/generators/actions_test.rb
Expand Up @@ -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
Expand Down