Class: Jekyll::Theme
- Inherits:
-
Object
- Object
- Jekyll::Theme
- Extended by:
- Forwardable
- Defined in:
- lib/jekyll/theme.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #assets_path ⇒ Object
- #configure_sass ⇒ Object
- #includes_path ⇒ Object
-
#initialize(name) ⇒ Theme
constructor
A new instance of Theme.
- #layouts_path ⇒ Object
- #root ⇒ Object
- #runtime_dependencies ⇒ Object
- #sass_path ⇒ Object
Constructor Details
#initialize(name) ⇒ Theme
Returns a new instance of Theme.
9 10 11 12 |
# File 'lib/jekyll/theme.rb', line 9 def initialize(name) @name = name.downcase.strip configure_sass end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/jekyll/theme.rb', line 6 def name @name end |
Instance Method Details
#assets_path ⇒ Object
34 35 36 |
# File 'lib/jekyll/theme.rb', line 34 def assets_path path_for "assets".freeze end |
#configure_sass ⇒ Object
38 39 40 41 42 |
# File 'lib/jekyll/theme.rb', line 38 def configure_sass return unless sass_path require "sass" Sass.load_paths << sass_path end |
#includes_path ⇒ Object
22 23 24 |
# File 'lib/jekyll/theme.rb', line 22 def includes_path path_for "_includes".freeze end |
#layouts_path ⇒ Object
26 27 28 |
# File 'lib/jekyll/theme.rb', line 26 def layouts_path path_for "_layouts".freeze end |
#root ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/jekyll/theme.rb', line 14 def root # Must use File.realpath to resolve symlinks created by rbenv # Otherwise, Jekyll.sanitized path with prepend the unresolved root @root ||= File.realpath(gemspec.full_gem_path) rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP nil end |
#runtime_dependencies ⇒ Object
44 45 46 |
# File 'lib/jekyll/theme.rb', line 44 def runtime_dependencies gemspec.runtime_dependencies end |
#sass_path ⇒ Object
30 31 32 |
# File 'lib/jekyll/theme.rb', line 30 def sass_path path_for "_sass".freeze end |