Remove class level conditions and ensure that RAILS_GEM_VERSION is commented when freeze.
This commit is contained in:
parent
2c3ebc00b7
commit
6dd196914c
@ -79,8 +79,8 @@ def create_config_files
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
conditions :skip_activerecord => false
|
|
||||||
def create_activerecord_files
|
def create_activerecord_files
|
||||||
|
return if options[:skip_activerecord]
|
||||||
template "config/databases/#{options[:database]}.yml", "config/database.yml"
|
template "config/databases/#{options[:database]}.yml", "config/database.yml"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -112,8 +112,8 @@ def create_public_files
|
|||||||
directory "public", "public", false # Non-recursive. Do small steps, so anyone can overwrite it.
|
directory "public", "public", false # Non-recursive. Do small steps, so anyone can overwrite it.
|
||||||
end
|
end
|
||||||
|
|
||||||
conditions :with_dispatchers => true
|
|
||||||
def create_dispatch_files
|
def create_dispatch_files
|
||||||
|
return unless options[:with_dispatchers]
|
||||||
copy_file "dispatchers/config.ru", "config.ru"
|
copy_file "dispatchers/config.ru", "config.ru"
|
||||||
|
|
||||||
template "dispatchers/dispatch.rb", "public/dispatch.rb"
|
template "dispatchers/dispatch.rb", "public/dispatch.rb"
|
||||||
@ -134,8 +134,8 @@ def create_public_stylesheets_files
|
|||||||
directory "public/stylesheets"
|
directory "public/stylesheets"
|
||||||
end
|
end
|
||||||
|
|
||||||
conditions :skip_prototype => false
|
|
||||||
def create_prototype_files
|
def create_prototype_files
|
||||||
|
return if options[:skip_prototype]
|
||||||
directory "public/javascripts"
|
directory "public/javascripts"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -144,8 +144,8 @@ def create_script_files
|
|||||||
chmod "script", 0755, false
|
chmod "script", 0755, false
|
||||||
end
|
end
|
||||||
|
|
||||||
conditions :skip_testunit => false
|
|
||||||
def create_test_files
|
def create_test_files
|
||||||
|
return if options[:skip_testunit]
|
||||||
directory "test"
|
directory "test"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -169,9 +169,8 @@ def apply_rails_template
|
|||||||
raise Error, "The template [#{options[:template]}] could not be loaded. Error: #{e}"
|
raise Error, "The template [#{options[:template]}] could not be loaded. Error: #{e}"
|
||||||
end
|
end
|
||||||
|
|
||||||
conditions :freeze => true
|
def freeze?
|
||||||
def vendorize_rails
|
freeze! if options[:freeze]
|
||||||
freeze!
|
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
@ -98,9 +98,10 @@ def test_shebang_is_added_to_files
|
|||||||
).each { |path| assert_file "script/#{path}", /#!foo\/bar\/baz/ }
|
).each { |path| assert_file "script/#{path}", /#!foo\/bar\/baz/ }
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_rails_is_vendorized_if_freeze_is_supplied
|
def test_rails_is_frozen
|
||||||
generator(:freeze => true, :database => "sqlite3").expects(:run).with("rake rails:freeze:edge", false)
|
generator(:freeze => true, :database => "sqlite3").expects(:run).with("rake rails:freeze:edge", false)
|
||||||
silence(:stdout){ generator.invoke(:all) }
|
silence(:stdout){ generator.invoke(:all) }
|
||||||
|
assert_file 'config/environment.rb', /# RAILS_GEM_VERSION/
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_template_raises_an_error_with_invalid_path
|
def test_template_raises_an_error_with_invalid_path
|
||||||
|
Loading…
Reference in New Issue
Block a user