Class: Jars::GemspecArtifacts
- Inherits:
-
Object
- Object
- Jars::GemspecArtifacts
- Defined in:
- lib/jars/gemspec_artifacts.rb
Defined Under Namespace
Classes: Artifact, Exclusion, Exclusions
Instance Attribute Summary collapse
-
#artifacts ⇒ Object
readonly
Returns the value of attribute artifacts.
Instance Method Summary collapse
- #[](index) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(spec) ⇒ GemspecArtifacts
constructor
A new instance of GemspecArtifacts.
- #size ⇒ Object
Constructor Details
#initialize(spec) ⇒ GemspecArtifacts
Returns a new instance of GemspecArtifacts.
198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/jars/gemspec_artifacts.rb', line 198 def initialize( spec ) @artifacts = [] spec.requirements.each do |req| req.split( /\n/ ).each do |line| if ( a = Artifact.new( line ) ) @artifacts << a end end end @artifacts.freeze end |
Instance Attribute Details
#artifacts ⇒ Object (readonly)
Returns the value of attribute artifacts.
196 197 198 |
# File 'lib/jars/gemspec_artifacts.rb', line 196 def artifacts @artifacts end |
Instance Method Details
#[](index) ⇒ Object
210 211 212 |
# File 'lib/jars/gemspec_artifacts.rb', line 210 def [](index) @artifacts[index] end |
#each(&block) ⇒ Object
214 215 216 |
# File 'lib/jars/gemspec_artifacts.rb', line 214 def each(&block) @artifacts.each(&block) end |
#size ⇒ Object
218 219 220 |
# File 'lib/jars/gemspec_artifacts.rb', line 218 def size @artifacts.size end |