Class: ComponentGenerator::NewGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/component_generator/new_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_component_directoryObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/generators/component_generator/new_generator.rb', line 9

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 "#{file_name}/.rspec" do
    "--color"
  end

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