Class: Prebundler::Gemfile

Inherits:
Object
  • Object
show all
Includes:
Enumerable, TSort
Defined in:
lib/prebundler/gemfile.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gems) ⇒ Gemfile

Returns a new instance of Gemfile.



10
11
12
13
14
15
16
# File 'lib/prebundler/gemfile.rb', line 10

def initialize(gems)
  @gems = gems

  gems.each do |_, gem_ref|
    assign_groups(gem_ref, [])
  end
end

Instance Attribute Details

#gemsObject (readonly)

Returns the value of attribute gems.



8
9
10
# File 'lib/prebundler/gemfile.rb', line 8

def gems
  @gems
end

Instance Method Details

#eachObject Also known as: each_pair



18
19
20
21
22
23
24
# File 'lib/prebundler/gemfile.rb', line 18

def each
  return to_enum(__method__) unless block_given?

  tsort_each do |name|
    yield name, gems[name]
  end
end