Module: GemWrappers::Specification

Defined in:
lib/gem-wrappers/specification.rb

Class Method Summary collapse

Class Method Details

.find(name = "gem-wrappers") ⇒ Object



11
12
13
# File 'lib/gem-wrappers/specification.rb', line 11

def self.find(name = "gem-wrappers")
  @gem_wrappers_spec ||= installed_gems.find{|spec| spec.name == name }
end

.installed_gemsObject



3
4
5
6
7
8
9
# File 'lib/gem-wrappers/specification.rb', line 3

def self.installed_gems
  if Gem::VERSION > '1.8' then
    Gem::Specification.to_a
  else
    Gem.source_index.map{|name,spec| spec}
  end
end

.versionObject



15
16
17
# File 'lib/gem-wrappers/specification.rb', line 15

def self.version
  find ? find.version.to_s : nil
end