Class: Jars::GemspecArtifacts

Inherits:
Object
  • Object
show all
Defined in:
lib/jars/gemspec_artifacts.rb

Defined Under Namespace

Classes: Artifact, Exclusion, Exclusions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ GemspecArtifacts

Returns a new instance of GemspecArtifacts.



188
189
190
191
192
193
194
195
196
197
# File 'lib/jars/gemspec_artifacts.rb', line 188

def initialize(spec)
  @artifacts = []
  spec.requirements.each do |req|
    req.split("\n").each do |line|
      artifact = Artifact.parse(line)
      @artifacts << artifact if artifact
    end
  end
  @artifacts.freeze
end

Instance Attribute Details

#artifactsObject (readonly)

Returns the value of attribute artifacts.



186
187
188
# File 'lib/jars/gemspec_artifacts.rb', line 186

def artifacts
  @artifacts
end

Instance Method Details

#[](index) ⇒ Object



199
200
201
# File 'lib/jars/gemspec_artifacts.rb', line 199

def [](index)
  @artifacts[index]
end

#each(&block) ⇒ Object



203
204
205
# File 'lib/jars/gemspec_artifacts.rb', line 203

def each(&block)
  @artifacts.each(&block)
end

#sizeObject



207
208
209
# File 'lib/jars/gemspec_artifacts.rb', line 207

def size
  @artifacts.size
end