Sha256: 5b49e58e7ef796b0a592c407c23e523c393d0d2d1fdd8515d3bd31fb829df8e7

Contents?: true

Size: 638 Bytes

Versions: 7

Compression:

Stored size: 638 Bytes

Contents

module Chili
  module GeneratorProxy
    def self.included(base)
      base.class_eval do
        argument :generator, type: :string
        argument :generator_options, type: :array, default: [], banner: "GENERATOR_OPTIONS"

        def self.desc
          "Generates resources (scaffold, model, migration etc) for #{generator_name}"
        end

        def delegate
          engine = self.class.generator_name.classify.constantize
          Rails::Generators.namespace = engine
          Rails::Generators.invoke ARGV.shift, ARGV, destination_root: Feature.new(engine).path, behavior: behavior
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
chili-4.0.1 lib/generators/chili/generator_proxy.rb
chili-4.0.0 lib/generators/chili/generator_proxy.rb
chili-3.1.1 lib/generators/chili/generator_proxy.rb
chili-3.1.0 lib/generators/chili/generator_proxy.rb
chili-3.0.0 lib/generators/chili/generator_proxy.rb
chili-2.0.1 lib/generators/chili/generator_proxy.rb
chili-2.0.0 lib/generators/chili/generator_proxy.rb