Sha256: c65288c2c19dc08eab85faaf6cfa46b1ebee20c570b36d3084b4bf1b6b02d09a

Contents?: true

Size: 633 Bytes

Versions: 1

Compression:

Stored size: 633 Bytes

Contents

require 'rails/generators'

module ComponentGenerator
  class NewGenerator < Rails::Generators::NamedBase
    desc "Create rails engine in components directory."

    source_root File.expand_path("../templates", __FILE__)

    def copy_component_directory
      self.destination_root = "components"

      directory "engine_template", file_name

      empty_directory "#{file_name}/app/src/#{file_name}"
      empty_directory "#{file_name}/spec/src/#{file_name}"
      empty_directory "#{file_name}/spec/dummy/db"

      create_file ".rspec" do
        "--color"
      end

      chmod "#{file_name}/test.sh", 0755
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
component_generator-0.1.3 lib/generators/component_generator/new_generator.rb