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
5 6 7 |
# File 'lib/dpl/support/gems.rb', line 5 def glob @glob end |
#opts ⇒ Object
Returns the value of attribute opts
5 6 7 |
# File 'lib/dpl/support/gems.rb', line 5 def opts @opts end |
Instance Method Details
#all ⇒ Object
10 11 12 13 14 15 |
# File 'lib/dpl/support/gems.rb', line 10 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
6 7 8 |
# File 'lib/dpl/support/gems.rb', line 6 def each(&block) all.uniq.each(&block) end |
#except ⇒ Object
17 18 19 |
# File 'lib/dpl/support/gems.rb', line 17 def except @except ||= Array(opts[:except]).map(&:to_s) end |