Class: Bankai::Generator

Inherits:
Rails::Generators::AppGenerator
  • Object
show all
Defined in:
lib/bankai/generator.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



87
88
89
# File 'lib/bankai/generator.rb', line 87

def self.banner
  "bankai #{arguments.map(&:usage).join(' ')} [options]"
end

Instance Method Details

#configure_appObject



57
58
59
60
61
# File 'lib/bankai/generator.rb', line 57

def configure_app
  say 'Configuring app'
  # TODO: Configure ActionMailer
  build :setup_rack_mini_profiler
end

#customizationObject



35
36
37
38
39
40
41
42
# File 'lib/bankai/generator.rb', line 35

def customization
  invoke :customize_gemfile
  invoke :setup_development_environment
  invoke :configure_app
  invoke :setup_dotfiles
  invoke :generate_default
  invoke :setup_default_directories
end

#customize_gemfileObject



44
45
46
47
# File 'lib/bankai/generator.rb', line 44

def customize_gemfile
  build :replace_gemfile, options[:path]
  bundle_command 'install'
end

#depends_on_system_test?Boolean

Returns:

  • (Boolean)


83
84
85
# File 'lib/bankai/generator.rb', line 83

def depends_on_system_test?
  !(options[:skip_system_test] || options[:skip_rspec] || options[:api])
end

#finish_templateObject



30
31
32
33
# File 'lib/bankai/generator.rb', line 30

def finish_template
  invoke :customization
  super
end

#generate_defaultObject



67
68
69
70
71
72
73
74
75
76
77
# File 'lib/bankai/generator.rb', line 67

def generate_default
  run('spring stop')
  generate('bankai:testing') unless options[:skip_rspec]
  generate('bankai:ci')
  generate('bankai:json')
  generate('bankai:db_optimizations')
  generate('bankai:mailer')
  generate('bankai:deploy') unless options[:skip_capistrano]
  generate('annotate:install')
  generate('bankai:lint')
end

#setup_default_directoriesObject



79
80
81
# File 'lib/bankai/generator.rb', line 79

def setup_default_directories
  build :setup_default_directories
end

#setup_development_environmentObject



49
50
51
52
53
54
55
# File 'lib/bankai/generator.rb', line 49

def setup_development_environment
  say 'Setting up the development environment'
  build :configure_quiet_assets
  build :configure_generators
  build :clear_seed_file
  # TODO: Add setup script
end

#setup_dotfilesObject



63
64
65
# File 'lib/bankai/generator.rb', line 63

def setup_dotfiles
  build :copy_dotfiles
end