Class: MyBloodyValentine::AppBuilder

Inherits:
Rails::AppBuilder
  • Object
show all
Defined in:
lib/my_bloody_valentine/app_builder.rb

Instance Method Summary collapse

Instance Method Details

#add_custom_gemsObject



18
19
20
21
22
23
# File 'lib/my_bloody_valentine/app_builder.rb', line 18

def add_custom_gems
	additions_path = find_in_source_paths 'Gemfile_additions'
	new_gems = File.open(additions_path).read
	inject_into_file 'Gemfile', "\n #{new_gems}",
		:after => /gem 'jquery-rails'/
end

#initialize_on_precompileObject



7
8
9
10
11
# File 'lib/my_bloody_valentine/app_builder.rb', line 7

def initialize_on_precompile
  inject_into_file 'config/application.rb',
  "\n    config.assets.initialize_on_precompile = false",
	:after => 'config.assets.enabled = true'
end

#remove_public_indexObject



3
4
5
# File 'lib/my_bloody_valentine/app_builder.rb', line 3

def remove_public_index
	remove_file 'public/index.html'
end

#setup_staging_environmentObject



25
26
27
# File 'lib/my_bloody_valentine/app_builder.rb', line 25

def setup_staging_environment
	run 'cp config/environments/production.rb config/environments/staging.rb'
end

#use_postgres_config_templateObject



13
14
15
16
# File 'lib/my_bloody_valentine/app_builder.rb', line 13

def use_postgres_config_template
	template 'postgresql_database.yml.erb', 'config/database.yml',
		:force => true
end