Class: Gemstash::SpecsBuilder
- Inherits:
-
Object
- Object
- Gemstash::SpecsBuilder
- Defined in:
- lib/gemstash/specs_builder.rb
Overview
Builds a Marshal’ed and GZipped array of arrays containing specs as:
- name, Gem::Version, platform
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Class Method Summary collapse
-
.all ⇒ Object
Used for the /private/specs.4.8.gz endpoint.
- .invalidate_stored ⇒ Object
-
.prerelease ⇒ Object
Used for the /private/prerelease_specs.4.8.gz endpoint.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(prerelease: false) ⇒ SpecsBuilder
constructor
A new instance of SpecsBuilder.
Constructor Details
#initialize(prerelease: false) ⇒ SpecsBuilder
Returns a new instance of SpecsBuilder.
29 30 31 |
# File 'lib/gemstash/specs_builder.rb', line 29 def initialize(prerelease: false) @prerelease = prerelease end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
9 10 11 |
# File 'lib/gemstash/specs_builder.rb', line 9 def result @result end |
Class Method Details
.all ⇒ Object
Used for the /private/specs.4.8.gz endpoint. Fetches non-prerelease, indexed private gems.
13 14 15 |
# File 'lib/gemstash/specs_builder.rb', line 13 def self.all new.build end |
.invalidate_stored ⇒ Object
23 24 25 26 27 |
# File 'lib/gemstash/specs_builder.rb', line 23 def self.invalidate_stored storage = Gemstash::Storage.for("private").for("specs_collection") storage.resource("specs.4.8.gz").delete(:specs) storage.resource("prerelease_specs.4.8.gz").delete(:specs) end |
.prerelease ⇒ Object
Used for the /private/prerelease_specs.4.8.gz endpoint. Fetches prerelease, indexed private gems.
19 20 21 |
# File 'lib/gemstash/specs_builder.rb', line 19 def self.prerelease new(prerelease: true).build end |
Instance Method Details
#build ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/gemstash/specs_builder.rb', line 33 def build fetch_from_storage return result if result fetch_versions marshal gzip store_result result end |