Class: Topkit::AppGenerator

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

Instance Method Summary collapse

Instance Method Details

#configure_adminObject



85
86
87
88
89
90
91
92
# File 'lib/topkit/generators/app_generator.rb', line 85

def configure_admin
  return if options[:skip_admin]
  say "Generating devise with admin"
  build :add_admin_to_gemfile
  build :generate_devise
  build :generate_admin
  build :generate_rich_editor
end

#configure_backboneObject



80
81
82
83
# File 'lib/topkit/generators/app_generator.rb', line 80

def configure_backbone
  say "Generating backbone"
  build :generate_backbone
end

#configure_cucumberObject



94
95
96
97
# File 'lib/topkit/generators/app_generator.rb', line 94

def configure_cucumber
  say "Installing cucumber"
  build :generate_cucumber
end

#configure_generatorsObject



30
31
32
33
# File 'lib/topkit/generators/app_generator.rb', line 30

def configure_generators
  say "Configuring rspec generators"
  build :configure_rspec_generators
end

#configure_rspecObject



74
75
76
77
78
# File 'lib/topkit/generators/app_generator.rb', line 74

def configure_rspec
  say "Generating rspec"
  build :generate_rspec
  build :enable_database_cleaner
end

#copy_miscellaneous_filesObject



70
71
72
# File 'lib/topkit/generators/app_generator.rb', line 70

def copy_miscellaneous_files
  build :setup_stylesheets
end

#create_views_and_layoutsObject



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

def create_views_and_layouts
  say "Creating partials and default layout"
  build :create_partials_directory
  build :create_status_partials
  build :create_application_layout
end

#customize_gemfileObject



35
36
37
38
39
40
# File 'lib/topkit/generators/app_generator.rb', line 35

def customize_gemfile
  say "Setting up gems"
  build :replace_gemfile
  bundle_command "install"
  bundle_command "package"
end

#finish_templateObject



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

def finish_template
  invoke :topkit_customization
  super
end

#outroObject



105
106
107
# File 'lib/topkit/generators/app_generator.rb', line 105

def outro
  say 'You are good to go!'
end

#remove_routes_comment_linesObject



53
54
55
# File 'lib/topkit/generators/app_generator.rb', line 53

def remove_routes_comment_lines
  build :remove_routes_comment_lines
end

#remove_useless_filesObject



48
49
50
51
# File 'lib/topkit/generators/app_generator.rb', line 48

def remove_useless_files
  build :remove_public_index
  build :remove_rails_logo_image
end

#run_bundleObject



109
110
# File 'lib/topkit/generators/app_generator.rb', line 109

def run_bundle
end

#setup_databaseObject



42
43
44
45
46
# File 'lib/topkit/generators/app_generator.rb', line 42

def setup_database
  say "Setting up database"
  build :template_database_file
  build :create_database
end

#setup_gitObject



99
100
101
102
103
# File 'lib/topkit/generators/app_generator.rb', line 99

def setup_git
  say "Initializing git repo"
  build :add_to_git_ignore
  build :init_git
end

#setup_staging_environmentObject



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

def setup_staging_environment
  say "Setting up staging environment"
  build :setup_staging_environment
  #build :setup_staging_recipes
end

#topkit_customizationObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/topkit/generators/app_generator.rb', line 14

def topkit_customization
  invoke :configure_generators
  invoke :customize_gemfile
  invoke :setup_database
  invoke :remove_useless_files
  invoke :remove_routes_comment_lines
  invoke :setup_staging_environment
  invoke :create_views_and_layouts
  invoke :copy_miscellaneous_files
  invoke :configure_rspec
  invoke :configure_backbone
  invoke :configure_admin
  invoke :configure_cucumber
  invoke :setup_git
end