less stuff in the rails config file... more stuff coming from defaults.

This commit is contained in:
Chris Eppstein 2010-08-29 02:56:26 -07:00
parent 8a7fdd6fa3
commit ee6d537999
2 changed files with 24 additions and 15 deletions

View File

@ -8,6 +8,8 @@ module Compass
end end
def default_sass_dir def default_sass_dir
# XXX Maybe this should be: app/views/stylesheets
# or maybe layouts should be moved up a level.
File.join("app", "stylesheets") File.join("app", "stylesheets")
end end
@ -51,6 +53,18 @@ module Compass
File.join("tmp", "sass-cache") File.join("tmp", "sass-cache")
end end
def default_project_path
project_path = Compass::AppIntegration::Rails.root
end
def default_http_path
"/" # XXX Where is/was this stored in the Rails config?
end
def default_environment
Compass::AppIntegration::Rails.env
end
end end
end end
end end

View File

@ -81,8 +81,8 @@ NEXTSTEPS
recommended_location = separate('app/stylesheets') recommended_location = separate('app/stylesheets')
default_location = separate('public/stylesheets/sass') default_location = separate('public/stylesheets/sass')
print %Q{Compass recommends that you keep your stylesheets in #{recommended_location} print %Q{Compass recommends that you keep your stylesheets in #{recommended_location}
instead of the Sass default location of #{default_location}. instead of the Sass default location of #{default_location}.
Is this OK? (Y/n) } Is this OK? (Y/n) }
answer = $stdin.gets.downcase[0] answer = $stdin.gets.downcase[0]
answer == ?n ? default_location : recommended_location answer == ?n ? default_location : recommended_location
end end
@ -96,9 +96,9 @@ NEXTSTEPS
default_location = separate("public/stylesheets") default_location = separate("public/stylesheets")
puts puts
print %Q{Compass recommends that you keep your compiled css in #{recommended_location}/ print %Q{Compass recommends that you keep your compiled css in #{recommended_location}/
instead the Sass default of #{default_location}/. instead the Sass default of #{default_location}/.
However, if you're exclusively using Sass, then #{default_location}/ is recommended. However, if you're exclusively using Sass, then #{default_location}/ is recommended.
Emit compiled stylesheets to #{recommended_location}/? (Y/n) } Emit compiled stylesheets to #{recommended_location}/? (Y/n) }
answer = $stdin.gets answer = $stdin.gets
answer = answer.downcase[0] answer = answer.downcase[0]
answer == ?n ? default_location : recommended_location answer == ?n ? default_location : recommended_location
@ -106,16 +106,11 @@ NEXTSTEPS
end end
def config_contents def config_contents
"# This configuration file works with both the Compass command line tool and within Rails.\n" + project_path, Compass.configuration.project_path = Compass.configuration.project_path, nil
Compass.configuration.serialize do |prop, value| ("# This configuration file works with both the Compass command line tool and within Rails.\n" +
if prop == :project_path Compass.configuration.serialize)
"project_path = Compass::AppIntegration::Rails.root\n" ensure
elsif prop == :environment Compass.configuration.project_path = project_path
"environment = Compass::AppIntegration::Rails.env\n"
elsif prop == :output_style
""
end
end
end end
def initializer_contents def initializer_contents