Class: Crt::CrtGenerator

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

Instance Method Summary collapse

Instance Method Details

#customize_gemfileObject



23
24
25
# File 'lib/crt.rb', line 23

def customize_gemfile
  build :replace_gemfile
end

#finish_templateObject



12
13
14
15
16
# File 'lib/crt.rb', line 12

def finish_template
  invoke :import_template
  invoke :setup_database
  super
end

#import_templateObject



18
19
20
21
# File 'lib/crt.rb', line 18

def import_template
	remove_file 'Gemfile'
  template 'Gemfile.erb', 'Gemfile'
end

#setup_databaseObject



27
28
29
30
31
32
33
# File 'lib/crt.rb', line 27

def setup_database

  if 'mysql' == options[:database]
    build :use_mysql2_template
  end

end