aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/rails/assets/assets_generator.rb
blob: 9ce8570172892dfbf7282aa69afcf4c4c01306e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module Rails
  module Generators
    class AssetsGenerator < NamedBase # :nodoc:
      class_option :stylesheets, type: :boolean, desc: "Generate Stylesheets"
      class_option :stylesheet_engine, desc: "Engine for Stylesheets"

      private
        def asset_name
          file_name
        end

        hook_for :stylesheet_engine do |stylesheet_engine|
          invoke stylesheet_engine, [name] if options[:stylesheets]
        end
    end
  end
end