Class: Generators::ModuleBuilder

Inherits:
Rails::PluginBuilder
  • Object
show all
Defined in:
lib/generators/module_generator.rb

Instance Method Summary collapse

Instance Method Details

#appObject



8
9
10
11
# File 'lib/generators/module_generator.rb', line 8

def app
  directory "app"
  empty_directory_with_keep_file "app/assets/images/houston/#{name}"
end

#configObject



13
14
15
16
17
18
# File 'lib/generators/module_generator.rb', line 13

def config
  template "config/initializers/add_navigation_renderer.rb"
  template "config/database.yml"
  template "config/routes.rb"
  empty_directory_with_keep_file "db"
end

#gemspecObject



30
31
32
# File 'lib/generators/module_generator.rb', line 30

def gemspec
  template "houston-%name%.gemspec"
end

#javascriptsObject



38
39
40
# File 'lib/generators/module_generator.rb', line 38

def javascripts
  # do nothing
end

#libObject



20
21
22
23
24
25
26
27
28
# File 'lib/generators/module_generator.rb', line 20

def lib
  template "lib/houston/%name%.rb"
  template "lib/houston/%name%/configuration.rb"
  template "lib/houston/%name%/engine.rb"
  template "lib/houston/%name%/railtie.rb"
  template "lib/houston/%name%/version.rb"
  template "lib/houston-%name%.rb"
  template "lib/tasks/%name%_tasks.rake"
end

#readmeObject



42
43
44
# File 'lib/generators/module_generator.rb', line 42

def readme
  template "README.md"
end

#stylesheetsObject



34
35
36
# File 'lib/generators/module_generator.rb', line 34

def stylesheets
  # do nothing
end

#testObject



46
47
48
49
50
51
52
53
# File 'lib/generators/module_generator.rb', line 46

def test
  template "test/test_helper.rb"
  template "test/dummy/houston.rb"
  template "test/fixtures/projects.yml"
  template "test/fixtures/users.yml"
  template "test/unit/fixtures_test.rb"
  template "test/acceptance/houston_dummy_test.rb"
end