class Revelry::Generators::Content::CssGenerator
Constants
- CSS_FILE_EXTENSIONS
Public Instance Methods
add_css_assets()
click to toggle source
# File lib/generators/revelry/content/css_generator.rb, line 15 def add_css_assets if using_sass? append_to_file css_app_bundle do '@import "revelry_content";' end else insert_into_file css_app_bundle, before: %r{(//|\*)= require_self} do "*= require revelry_content\n " end end end
Private Instance Methods
css_app_bundle()
click to toggle source
# File lib/generators/revelry/content/css_generator.rb, line 33 def css_app_bundle File.join(css_base_dir, "revelry-app#{ css_file_extname }") end
css_base_dir()
click to toggle source
# File lib/generators/revelry/content/css_generator.rb, line 37 def css_base_dir File.join('app', 'assets', 'stylesheets') end
css_file_extname()
click to toggle source
# File lib/generators/revelry/content/css_generator.rb, line 45 def css_file_extname CSS_FILE_EXTENSIONS.find { |fmt| test_css_format(fmt) } end
test_css_format(fmt)
click to toggle source
# File lib/generators/revelry/content/css_generator.rb, line 41 def test_css_format(fmt) File.exist?(File.join(css_base_dir, "revelry-app#{ fmt }")) end
using_sass?()
click to toggle source
# File lib/generators/revelry/content/css_generator.rb, line 29 def using_sass? /s(c|a)ss/.match(css_file_extname) end