Class: Generators::ModuleBuilder

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

Instance Method Summary collapse

Instance Method Details

#appObject



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

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

#assets_manifestObject



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

def assets_manifest
  # do nothing
  # added in Rails 5; Houston requires ~> 4.2.7
end

#configObject



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

def config
  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



48
49
50
# File 'lib/generators/module_generator.rb', line 48

def readme
  template "README.md"
end

#stylesheetsObject



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

def stylesheets
  # do nothing
end

#testObject



52
53
54
55
56
57
58
59
# File 'lib/generators/module_generator.rb', line 52

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