Detect the version of rails and print out instructions accordingly.
This commit is contained in:
parent
04eb17968e
commit
f44e1ea492
@ -27,24 +27,30 @@ module Compass
|
|||||||
write_file targetize('config/initializers/compass.rb'), initializer_contents
|
write_file targetize('config/initializers/compass.rb'), initializer_contents
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def rails3?
|
||||||
|
File.exists?(targetize('config/application.rb'))
|
||||||
|
end
|
||||||
|
|
||||||
def prepare
|
def prepare
|
||||||
write_configuration_files
|
write_configuration_files
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def gem_config_instructions
|
||||||
|
if rails3?
|
||||||
|
%Q{Add the following to your Gemfile:\n\n gem "compass", ">= #{Compass::VERSION}"}
|
||||||
|
else
|
||||||
|
%Q{Add the following to your evironment.rb:\n\n config.gem "compass", :version => ">= #{Compass::VERSION}"}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def finalize(options = {})
|
def finalize(options = {})
|
||||||
if options[:create]
|
if options[:create]
|
||||||
puts <<-NEXTSTEPS
|
puts <<-NEXTSTEPS
|
||||||
|
|
||||||
Congratulations! Your rails project has been configured to use Compass.
|
Congratulations! Your rails project has been configured to use Compass.
|
||||||
Just one more thing left to do: Register the compass gem.
|
Just one more thing left to do if you haven't yet: Register the compass gem.
|
||||||
|
|
||||||
In Rails 2.2 & 2.3, add the following to your evironment.rb:
|
#{gem_config_instructions}
|
||||||
|
|
||||||
config.gem "compass", :version => ">= #{Compass::VERSION}"
|
|
||||||
|
|
||||||
In Rails 3, add the following to your Gemfile:
|
|
||||||
|
|
||||||
gem "compass", ">= #{Compass::VERSION}"
|
|
||||||
|
|
||||||
Then, make sure you restart your server.
|
Then, make sure you restart your server.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user