Class: Bundler::Dependencies::Spec
- Inherits:
-
Object
- Object
- Bundler::Dependencies::Spec
- Defined in:
- lib/bundler/dependencies/spec.rb
Constant Summary collapse
- SPECS =
rubocop:disable Style/MutableConstant
{}
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
Returns the value of attribute dependencies.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #dependency_count ⇒ Object
- #flatten ⇒ Object
- #include_dependency?(gem) ⇒ Boolean
-
#initialize(name) ⇒ Spec
constructor
A new instance of Spec.
Constructor Details
Instance Attribute Details
#dependencies ⇒ Object
Returns the value of attribute dependencies.
6 7 8 |
# File 'lib/bundler/dependencies/spec.rb', line 6 def dependencies @dependencies end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/bundler/dependencies/spec.rb', line 6 def name @name end |
Class Method Details
.find(name) ⇒ Object
15 16 17 |
# File 'lib/bundler/dependencies/spec.rb', line 15 def self.find(name) SPECS[name.to_sym] end |
Instance Method Details
#dependency_count ⇒ Object
37 38 39 |
# File 'lib/bundler/dependencies/spec.rb', line 37 def dependency_count flatten.count end |
#flatten ⇒ Object
30 31 32 33 34 35 |
# File 'lib/bundler/dependencies/spec.rb', line 30 def flatten dependencies.inject([]) do |arr, dependency| arr << dependency arr.concat(dependency.flatten) end.uniq end |
#include_dependency?(gem) ⇒ Boolean
26 27 28 |
# File 'lib/bundler/dependencies/spec.rb', line 26 def include_dependency?(gem) dependencies.include_dependency?(gem) end |