Class: Generators::ModuleBuilder

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

Instance Method Summary collapse

Instance Method Details

#appObject



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

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

#configObject



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

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



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

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

#javascriptsObject



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

def javascripts
  # do nothing
end

#libObject



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

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



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

def readme
  template "README.md"
end

#stylesheetsObject



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

def stylesheets
  # do nothing
end

#testObject



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

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