Class: Maglove::Theme
- Inherits:
-
Object
- Object
- Maglove::Theme
- Includes:
- Singleton
- Defined in:
- lib/maglove/theme.rb
Instance Attribute Summary collapse
-
#base_dir ⇒ Object
readonly
Returns the value of attribute base_dir.
-
#base_version ⇒ Object
readonly
Returns the value of attribute base_version.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#dist_dir ⇒ Object
readonly
Returns the value of attribute dist_dir.
-
#fonts ⇒ Object
readonly
Returns the value of attribute fonts.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#src_dir ⇒ Object
readonly
Returns the value of attribute src_dir.
-
#templates ⇒ Object
readonly
Returns the value of attribute templates.
-
#widgets ⇒ Object
readonly
Returns the value of attribute widgets.
Instance Method Summary collapse
Instance Attribute Details
#base_dir ⇒ Object (readonly)
Returns the value of attribute base_dir.
5 6 7 |
# File 'lib/maglove/theme.rb', line 5 def base_dir @base_dir end |
#base_version ⇒ Object (readonly)
Returns the value of attribute base_version.
4 5 6 |
# File 'lib/maglove/theme.rb', line 4 def base_version @base_version end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/maglove/theme.rb', line 4 def description @description end |
#dist_dir ⇒ Object (readonly)
Returns the value of attribute dist_dir.
5 6 7 |
# File 'lib/maglove/theme.rb', line 5 def dist_dir @dist_dir end |
#fonts ⇒ Object (readonly)
Returns the value of attribute fonts.
4 5 6 |
# File 'lib/maglove/theme.rb', line 4 def fonts @fonts end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
4 5 6 |
# File 'lib/maglove/theme.rb', line 4 def identifier @identifier end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/maglove/theme.rb', line 4 def name @name end |
#src_dir ⇒ Object (readonly)
Returns the value of attribute src_dir.
5 6 7 |
# File 'lib/maglove/theme.rb', line 5 def src_dir @src_dir end |
#templates ⇒ Object (readonly)
Returns the value of attribute templates.
4 5 6 |
# File 'lib/maglove/theme.rb', line 4 def templates @templates end |
#widgets ⇒ Object (readonly)
Returns the value of attribute widgets.
4 5 6 |
# File 'lib/maglove/theme.rb', line 4 def @widgets end |
Instance Method Details
#load(identifier) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/maglove/theme.rb', line 11 def load(identifier) yaml = Workspace::Dir.new(Dir.pwd, "src/themes/#{identifier}").file("theme.yml").read_yaml # theme properties @identifier = yaml["identifier"] @name = yaml["name"] @base_version = yaml["base_version"] @description = yaml["description"] @templates = yaml["templates"] @fonts = yaml["fonts"] @widgets = yaml["widgets"] # directories @src_dir = Workspace.dir(File.join(Dir.pwd, "src/themes/#{@identifier}")) @dist_dir = Workspace.dir(File.join(Dir.pwd, "dist/themes/#{@identifier}")) @base_dir = Workspace.dir(File.join(Dir.pwd, "src/base/#{@base_version}")) end |
#loaded? ⇒ Boolean
7 8 9 |
# File 'lib/maglove/theme.rb', line 7 def loaded? !identifier.nil? end |