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.



196
197
198
199
200
201
202
203
204
205
206
# File 'lib/jars/gemspec_artifacts.rb', line 196

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

#artifactsObject (readonly)

Returns the value of attribute artifacts.



194
195
196
# File 'lib/jars/gemspec_artifacts.rb', line 194

def artifacts
  @artifacts
end

Instance Method Details

#[](index) ⇒ Object



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

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

#each(&block) ⇒ Object



212
213
214
# File 'lib/jars/gemspec_artifacts.rb', line 212

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

#sizeObject



216
217
218
# File 'lib/jars/gemspec_artifacts.rb', line 216

def size
  @artifacts.size
end