Sha256: 6c1b9b48cc4e398c34ac2876f34d3798b133d7e330def31c8fe442340d234bb4

Contents?: true

Size: 721 Bytes

Versions: 62

Compression:

Stored size: 721 Bytes

Contents

module Workarea
  module Generators
    class JsModuleGenerator < Rails::Generators::NamedBase
      source_root File.expand_path('../templates', __FILE__)
      desc File.read(File.expand_path('../USAGE', __FILE__))

      class_option :engine, type: :string, default: 'storefront', desc: 'The engine in which the JS module will be used'

      def generate_module
        template 'js_module.js.erb', module_file_path
      end

      protected

      def module_name
        name.camelize(:lower)
      end

      private

      def module_file_path
        "app/assets/javascripts/workarea/#{asset_path}.js"
      end

      def asset_path
        "#{options.engine}/modules/#{file_path}"
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.26 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.45 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.25 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.23 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.44 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.22 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.43 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.21 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.42 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.20 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.41 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.19 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.40 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.18 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.39 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.17 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.38 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.16 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.37 lib/generators/workarea/js_module/js_module_generator.rb