Module: ChameleonSass
- Defined in:
- lib/chameleon-sass.rb
Constant Summary collapse
- VERSION =
"0.5.7"- DATE =
"2015-03-01"
Class Method Summary collapse
- .add_sass_load_path ⇒ Object
- .add_sass_load_path_to_env ⇒ Object
- .assets_path ⇒ Object
- .compass? ⇒ Boolean
- .defined_framework ⇒ Object
- .load ⇒ Object
- .project_path ⇒ Object
- .register_compass ⇒ Object
- .sass? ⇒ Boolean
- .stylesheets_path ⇒ Object
Class Method Details
.add_sass_load_path ⇒ Object
49 50 51 |
# File 'lib/chameleon-sass.rb', line 49 def add_sass_load_path ::Sass.load_paths << stylesheets_path end |
.add_sass_load_path_to_env ⇒ Object
53 54 55 56 57 58 |
# File 'lib/chameleon-sass.rb', line 53 def add_sass_load_path_to_env ENV["SASS_PATH"] = [ ENV["SASS_PATH"], stylesheets_path ].join(File::PATH_SEPARATOR) end |
.assets_path ⇒ Object
21 22 23 |
# File 'lib/chameleon-sass.rb', line 21 def assets_path File.join(project_path, 'assets') end |
.compass? ⇒ Boolean
33 34 35 |
# File 'lib/chameleon-sass.rb', line 33 def compass? return :compass if defined?(::Compass) end |
.defined_framework ⇒ Object
29 30 31 |
# File 'lib/chameleon-sass.rb', line 29 def defined_framework compass? || sass? || :none end |
.load ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/chameleon-sass.rb', line 7 def load methods = { sass: 'add_sass_load_path', compass: 'register_compass', none: 'add_sass_load_path_to_env' } self.send(methods[defined_framework]) end |
.project_path ⇒ Object
17 18 19 |
# File 'lib/chameleon-sass.rb', line 17 def project_path File.(File.join(File.dirname(__FILE__), '..')) end |
.register_compass ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/chameleon-sass.rb', line 41 def register_compass ::Compass::Frameworks.register( 'chameleon-sass', :path => project_path, :stylesheets_directory => stylesheets_path ) end |
.sass? ⇒ Boolean
37 38 39 |
# File 'lib/chameleon-sass.rb', line 37 def sass? return :sass if defined?(::Sass) end |
.stylesheets_path ⇒ Object
25 26 27 |
# File 'lib/chameleon-sass.rb', line 25 def stylesheets_path File.join(assets_path, 'stylesheets') end |