diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2019-04-23 14:21:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-23 14:21:30 -0400 |
commit | d33f5e55f1a5eb43bac7f9d603db8882b0070b84 (patch) | |
tree | 1a8b096c88f0217b6ff29ce3d4cadd263d6bc545 /railties/lib/rails | |
parent | fd6648d5979df6e6daf9fa7eb1d01cd87922ae32 (diff) | |
parent | cf5049f88b97f1a813b5b465500127506febb3b0 (diff) | |
download | rails-d33f5e55f1a5eb43bac7f9d603db8882b0070b84.tar.gz rails-d33f5e55f1a5eb43bac7f9d603db8882b0070b84.tar.bz2 rails-d33f5e55f1a5eb43bac7f9d603db8882b0070b84.zip |
Merge pull request #35852 from larouxn/resurrection
Resurrect external JS/CS generation
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/assets/assets_generator.rb | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb index b835b3f3fd..0be00d5151 100644 --- a/railties/lib/rails/generators.rb +++ b/railties/lib/rails/generators.rb @@ -35,6 +35,8 @@ module Rails rails: { actions: "-a", orm: "-o", + javascripts: "-j", + javascript_engine: "-je", resource_controller: "-c", scaffold_controller: "-c", stylesheets: "-y", diff --git a/railties/lib/rails/generators/rails/assets/assets_generator.rb b/railties/lib/rails/generators/rails/assets/assets_generator.rb index 9ce8570172..e60637ff37 100644 --- a/railties/lib/rails/generators/rails/assets/assets_generator.rb +++ b/railties/lib/rails/generators/rails/assets/assets_generator.rb @@ -3,7 +3,10 @@ module Rails module Generators class AssetsGenerator < NamedBase # :nodoc: + class_option :javascripts, type: :boolean, desc: "Generate JavaScripts" class_option :stylesheets, type: :boolean, desc: "Generate Stylesheets" + + class_option :javascript_engine, desc: "Engine for JavaScripts" class_option :stylesheet_engine, desc: "Engine for Stylesheets" private @@ -11,6 +14,10 @@ module Rails file_name end + hook_for :javascript_engine do |javascript_engine| + invoke javascript_engine, [name] if options[:javascripts] + end + hook_for :stylesheet_engine do |stylesheet_engine| invoke stylesheet_engine, [name] if options[:stylesheets] end |