Class: Bunto::Theme
- Inherits:
-
Object
- Object
- Bunto::Theme
- Extended by:
- Forwardable
- Defined in:
- lib/bunto/theme.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #configure_sass ⇒ Object
- #includes_path ⇒ Object
-
#initialize(name) ⇒ Theme
constructor
A new instance of Theme.
- #layouts_path ⇒ Object
- #root ⇒ Object
- #sass_path ⇒ Object
Constructor Details
#initialize(name) ⇒ Theme
Returns a new instance of Theme.
7 8 9 10 |
# File 'lib/bunto/theme.rb', line 7 def initialize(name) @name = name.downcase.strip configure_sass end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/bunto/theme.rb', line 4 def name @name end |
Instance Method Details
#configure_sass ⇒ Object
32 33 34 35 36 |
# File 'lib/bunto/theme.rb', line 32 def configure_sass return unless sass_path require "sass" Sass.load_paths << sass_path end |
#includes_path ⇒ Object
20 21 22 |
# File 'lib/bunto/theme.rb', line 20 def includes_path path_for :includes end |
#layouts_path ⇒ Object
24 25 26 |
# File 'lib/bunto/theme.rb', line 24 def layouts_path path_for :layouts end |
#root ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/bunto/theme.rb', line 12 def root # Must use File.realpath to resolve symlinks created by rbenv # Otherwise, Bunto.sanitized path with prepend the unresolved root @root ||= File.realpath(gemspec.full_gem_path) rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP nil end |
#sass_path ⇒ Object
28 29 30 |
# File 'lib/bunto/theme.rb', line 28 def sass_path path_for :sass end |