Class: Devpack::Gems

Inherits:
Object
  • Object
show all
Includes:
Timeable
Defined in:
lib/devpack/gems.rb

Overview

Loads requested gems from configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Timeable

#timed

Constructor Details

#initialize(config, glob = GemGlob.new) ⇒ Gems

Returns a new instance of Gems.



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

def initialize(config, glob = GemGlob.new)
  @config = config
  @gem_glob = glob
  @failures = []
  @missing = []
  @incompatible = []
end

Instance Attribute Details

#missingObject (readonly)

Returns the value of attribute missing.



8
9
10
# File 'lib/devpack/gems.rb', line 8

def missing
  @missing
end

Instance Method Details

#load(silent: false) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/devpack/gems.rb', line 18

def load(silent: false)
  return [] if @config.requested_gems.nil?

  gems, time = timed { load_devpack }
  names = gems.map(&:first)
  summarize(gems, time) unless silent
  names
end