Class: Rabbit::Theme::GemEntry
Direct Known Subclasses
Constant Summary
Constants inherited from Entry
Entry::PROPERTY_BASE_NAME, Entry::THEME_BASE_NAME
Constants included from GetText
Instance Attribute Summary
Attributes inherited from Entry
#abstract, #dependencies, #description, #logger, #name, #parameters, #title
Instance Method Summary collapse
- #available? ⇒ Boolean
- #files ⇒ Object
- #full_path(target) ⇒ Object
-
#initialize(logger, name) ⇒ GemEntry
constructor
A new instance of GemEntry.
- #theme_file ⇒ Object
Methods inherited from Entry
#<=>, #category, #data_dir, #have_file?, #image_theme?, load_template, #property_editable?, reload_template, template_path
Methods included from GetText
Constructor Details
#initialize(logger, name) ⇒ GemEntry
Returns a new instance of GemEntry.
178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/rabbit/theme/entry.rb', line 178 def initialize(logger, name) @spec = nil if valid_gem_name?(name) finder = GemFinder.new(logger) begin @spec = finder.find(name, "#{ThemeConfiguration::GEM_NAME_PREFIX}-") rescue Gem::GemNotFoundException end end theme_dir = nil theme_dir = @spec.gem_dir if @spec super(logger, theme_dir, name) end |
Instance Method Details
#available? ⇒ Boolean
192 193 194 |
# File 'lib/rabbit/theme/entry.rb', line 192 def available? @theme_dir and super end |
#files ⇒ Object
204 205 206 |
# File 'lib/rabbit/theme/entry.rb', line 204 def files Dir.glob(File.join(data_dir, "*")).sort end |
#full_path(target) ⇒ Object
200 201 202 |
# File 'lib/rabbit/theme/entry.rb', line 200 def full_path(target) File.join(data_dir, target) end |
#theme_file ⇒ Object
196 197 198 |
# File 'lib/rabbit/theme/entry.rb', line 196 def theme_file File.join(@theme_dir, "#{THEME_BASE_NAME}.rb") end |