class Rabbit::Theme::GemEntry
Public Class Methods
Source
# File lib/rabbit/theme/entry.rb, line 156 def initialize(name) @spec = nil if valid_gem_name?(name) finder = GemFinder.new 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(theme_dir, name) end
Calls superclass method
Rabbit::Theme::Entry::new
Public Instance Methods
Source
# File lib/rabbit/theme/entry.rb, line 170 def available? @theme_dir and super end
Calls superclass method
Rabbit::Theme::Entry#available?
Source
# File lib/rabbit/theme/entry.rb, line 182 def files Dir.glob(File.join(data_dir, "*")).sort end
Source
# File lib/rabbit/theme/entry.rb, line 178 def full_path(target) File.join(data_dir, target) end
Source
# File lib/rabbit/theme/entry.rb, line 174 def theme_file File.join(@theme_dir, "#{THEME_BASE_NAME}.rb") end
Private Instance Methods
Source
# File lib/rabbit/theme/entry.rb, line 187 def valid_gem_name?(name) /\A[a-z\d_\-]+\z/i =~ name end