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?, #property_editable?
Methods included from GetText
Constructor Details
#initialize(logger, name) ⇒ GemEntry
Returns a new instance of GemEntry.
158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/rabbit/theme/entry.rb', line 158 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
172 173 174 |
# File 'lib/rabbit/theme/entry.rb', line 172 def available? @theme_dir and super end |
#files ⇒ Object
184 185 186 |
# File 'lib/rabbit/theme/entry.rb', line 184 def files Dir.glob(File.join(data_dir, "*")).sort end |
#full_path(target) ⇒ Object
180 181 182 |
# File 'lib/rabbit/theme/entry.rb', line 180 def full_path(target) File.join(data_dir, target) end |
#theme_file ⇒ Object
176 177 178 |
# File 'lib/rabbit/theme/entry.rb', line 176 def theme_file File.join(@theme_dir, "#{THEME_BASE_NAME}.rb") end |