Class: Generapp::Generators::AppGenerator

Inherits:
Rails::Generators::AppGenerator
  • Object
show all
Defined in:
lib/generapp/generators/app_generator.rb

Overview

Rails App generator

Instance Method Summary collapse

Instance Method Details

#configure_appObject



84
85
86
87
88
89
# File 'lib/generapp/generators/app_generator.rb', line 84

def configure_app
  say 'Configuring app'
  Generapp::Actions::Configuration.instance_methods(false).each do |action|
    build action.to_sym
  end
end

#create_generapp_viewsObject



77
78
79
80
81
82
# File 'lib/generapp/generators/app_generator.rb', line 77

def create_generapp_views
  say 'Creating views'
  Generapp::Actions::Views.instance_methods(false).each do |action|
    build action.to_sym
  end
end

#finish_templateObject



31
32
33
34
# File 'lib/generapp/generators/app_generator.rb', line 31

def finish_template
  invoke :generapp_customization
  super
end

#generapp_customizationObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/generapp/generators/app_generator.rb', line 36

def generapp_customization
  invoke :setup_gems
  invoke :setup_development_environment
  invoke :setup_test_environment
  invoke :setup_production_environment
  invoke :create_generapp_views
  invoke :configure_app
  invoke :setup_stylesheets
  invoke :setup_database
  invoke :setup_git
  invoke :setup_bundler_audit
  invoke :setup_spring
  invoke :outro
end

#get_builder_classObject (protected)



131
132
133
# File 'lib/generapp/generators/app_generator.rb', line 131

def get_builder_class
  Generapp::AppBuilder
end

#init_gitObject



120
121
122
# File 'lib/generapp/generators/app_generator.rb', line 120

def init_git
  build :init_git
end

#outroObject



124
125
126
127
# File 'lib/generapp/generators/app_generator.rb', line 124

def outro
  say "Done generating #{app_name}"
  say "Remember to run 'bundle exec honeybadger install [YOUR API KEY HERE]'"
end

#setup_bundler_auditObject



110
111
112
113
# File 'lib/generapp/generators/app_generator.rb', line 110

def setup_bundler_audit
  say 'Setting up bundler-audit'
  build :setup_bundler_audit
end

#setup_databaseObject



96
97
98
99
100
101
102
# File 'lib/generapp/generators/app_generator.rb', line 96

def setup_database
  say 'Setting up database'
  if 'postgresql' == options[:database]
    build :use_postgres_config_template
  end
  build :create_database
end

#setup_development_environmentObject



56
57
58
59
60
61
# File 'lib/generapp/generators/app_generator.rb', line 56

def setup_development_environment
  say 'Setting up the development environment'
  Generapp::Actions::Develop.instance_methods(false).each do |action|
    build action.to_sym
  end
end

#setup_gemsObject



51
52
53
54
# File 'lib/generapp/generators/app_generator.rb', line 51

def setup_gems
  build :set_ruby_version
  bundle_command 'install'
end

#setup_gitObject



104
105
106
107
108
# File 'lib/generapp/generators/app_generator.rb', line 104

def setup_git
  return if options[:skip_git]
  say 'Initializing git'
  invoke :init_git
end

#setup_production_environmentObject



70
71
72
73
74
75
# File 'lib/generapp/generators/app_generator.rb', line 70

def setup_production_environment
  say 'Setting up the production environment'
  Generapp::Actions::Production.instance_methods(false).each do |action|
    build action.to_sym
  end
end

#setup_springObject



115
116
117
118
# File 'lib/generapp/generators/app_generator.rb', line 115

def setup_spring
  say 'Springifying executables'
  build :setup_spring
end

#setup_stylesheetsObject



91
92
93
94
# File 'lib/generapp/generators/app_generator.rb', line 91

def setup_stylesheets
  say 'Setting up stylesheets'
  build :setup_stylesheets
end

#setup_test_environmentObject



63
64
65
66
67
68
# File 'lib/generapp/generators/app_generator.rb', line 63

def setup_test_environment
  say 'Setting up the test environment'
  Generapp::Actions::Test.instance_methods(false).each do |action|
    build action.to_sym
  end
end

#using_active_record?Boolean (protected)

Returns:

  • (Boolean)


135
136
137
# File 'lib/generapp/generators/app_generator.rb', line 135

def using_active_record?
  !options[:skip_active_record]
end