diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2019-01-17 13:28:12 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2019-01-17 16:08:35 -0500 |
commit | 4d51efe24e461a2a3ed562787308484cd48370c7 (patch) | |
tree | 17eac6cc7a6c8f71740499d4a97f0d7fbc640ec3 /railties/lib | |
parent | fa791fb8e2a718b5d0430c7ca5a454678dfc192d (diff) | |
download | rails-4d51efe24e461a2a3ed562787308484cd48370c7.tar.gz rails-4d51efe24e461a2a3ed562787308484cd48370c7.tar.bz2 rails-4d51efe24e461a2a3ed562787308484cd48370c7.zip |
Remove deprecated `after_bundle` helper inside plugins templates
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/actions.rb | 11 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 12 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/plugin/plugin_generator.rb | 10 |
3 files changed, 12 insertions, 21 deletions
diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb index 5b056045b3..3856a74a39 100644 --- a/railties/lib/rails/generators/actions.rb +++ b/railties/lib/rails/generators/actions.rb @@ -8,7 +8,6 @@ module Rails def initialize(*) # :nodoc: super @indentation = 0 - @after_bundle_callbacks = [] end # Adds an entry into +Gemfile+ for the supplied gem. @@ -267,16 +266,6 @@ module Rails log File.read(find_in_source_paths(path)) end - # Registers a callback to be executed after bundle and spring binstubs - # have run. - # - # after_bundle do - # git add: '.' - # end - def after_bundle(&block) - @after_bundle_callbacks << block - end - private # Define log for backwards compatibility. If just one argument is sent, diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 337a71ac06..f2f46d6e25 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -276,6 +276,8 @@ module Rails if options[:api] self.options = options.merge(skip_sprockets: true, skip_javascript: true).freeze end + + @after_bundle_callbacks = [] end public_task :set_default_accessors! @@ -497,6 +499,16 @@ module Rails create_file(*args, &block) end + # Registers a callback to be executed after bundle and spring binstubs + # have run. + # + # after_bundle do + # git add: '.' + # end + def after_bundle(&block) # :doc: + @after_bundle_callbacks << block + end + def get_builder_class defined?(::AppBuilder) ? ::AppBuilder : Rails::AppBuilder end diff --git a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb index 294c8a2609..79a06648b5 100644 --- a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb +++ b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb @@ -263,16 +263,6 @@ task default: :test public_task :apply_rails_template - def run_after_bundle_callbacks - unless @after_bundle_callbacks.empty? - ActiveSupport::Deprecation.warn("`after_bundle` is deprecated and will be removed in the next version of Rails. ") - end - - @after_bundle_callbacks.each do |callback| - callback.call - end - end - def name @name ||= begin # same as ActiveSupport::Inflector#underscore except not replacing '-' |