Class: Stratagem::Model::Containers::Gem

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/stratagem/model/containers/gem.rb

Instance Method Summary collapse

Constructor Details

#initialize(app_model) ⇒ Gem

Returns a new instance of Gem.



5
6
7
8
# File 'lib/stratagem/model/containers/gem.rb', line 5

def initialize(app_model)
  @app_model = app_model
  @gems = ::Gem.loaded_specs
end

Instance Method Details

#eachObject



21
22
23
# File 'lib/stratagem/model/containers/gem.rb', line 21

def each
  @gems.each {|spec| yield spec }
end

#export(options = nil) ⇒ Object



14
15
16
17
18
19
# File 'lib/stratagem/model/containers/gem.rb', line 14

def export(options=nil)
  @gems.map {|g|
    name, spec = g
    [name, {:version => spec.version.version}]
  }
end

#namesObject



10
11
12
# File 'lib/stratagem/model/containers/gem.rb', line 10

def names
  @gems.map {|g| g[0] }
end