Class: Dpl::Support::Gems
- Inherits:
-
Struct
- Object
- Struct
- Dpl::Support::Gems
- Defined in:
- lib/dpl/support/gems.rb
Defined Under Namespace
Classes: Parse
Instance Attribute Summary collapse
-
#glob ⇒ Object
Returns the value of attribute glob.
-
#opts ⇒ Object
Returns the value of attribute opts.
Instance Method Summary collapse
Instance Attribute Details
#glob ⇒ Object
Returns the value of attribute glob
7 8 9 |
# File 'lib/dpl/support/gems.rb', line 7 def glob @glob end |
#opts ⇒ Object
Returns the value of attribute opts
7 8 9 |
# File 'lib/dpl/support/gems.rb', line 7 def opts @opts end |
Instance Method Details
#all ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/dpl/support/gems.rb', line 12 def all Dir[glob].sort.inject([]) do |gems, path| next gems if except.any? { |str| path.include?(str) } gems + Parse.new(File.read(path)).gems end end |
#each(&block) ⇒ Object
8 9 10 |
# File 'lib/dpl/support/gems.rb', line 8 def each(&block) all.uniq.each(&block) end |
#except ⇒ Object
20 21 22 |
# File 'lib/dpl/support/gems.rb', line 20 def except @except ||= Array(opts[:except]).map(&:to_s) end |