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.4.27 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.4 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.26 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.3 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.25 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.2 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.24 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.1 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.23 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.22 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.0 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.21 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.5.0.beta.1 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.20 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.19 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.18 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.17 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.16 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.15 lib/generators/workarea/js_module/js_module_generator.rb
workarea-core-3.4.14 lib/generators/workarea/js_module/js_module_generator.rb