Class: Gemgate::GemWrapper
- Inherits:
-
Object
- Object
- Gemgate::GemWrapper
- Defined in:
- lib/gemgate/gem_wrapper.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#spec ⇒ Object
Returns the value of attribute spec.
Class Method Summary collapse
Instance Method Summary collapse
- #data ⇒ Object
- #filename ⇒ Object
- #name ⇒ Object
- #platform ⇒ Object
- #prerelease? ⇒ Boolean
- #spec_filename ⇒ Object
- #version ⇒ Object
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
10 11 12 |
# File 'lib/gemgate/gem_wrapper.rb', line 10 def path @path end |
#spec ⇒ Object
Returns the value of attribute spec.
10 11 12 |
# File 'lib/gemgate/gem_wrapper.rb', line 10 def spec @spec end |
Class Method Details
.from_path(path) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/gemgate/gem_wrapper.rb', line 3 def self.from_path(path) new.tap do |gem_wrapper| gem_wrapper.spec = Gem::Package.open(File.open(path)) {|p| p. } gem_wrapper.path = path end end |
Instance Method Details
#data ⇒ Object
38 39 40 |
# File 'lib/gemgate/gem_wrapper.rb', line 38 def data File.open(path) end |
#filename ⇒ Object
12 13 14 |
# File 'lib/gemgate/gem_wrapper.rb', line 12 def filename spec.file_name end |
#name ⇒ Object
20 21 22 |
# File 'lib/gemgate/gem_wrapper.rb', line 20 def name spec.name end |
#platform ⇒ Object
32 33 34 35 36 |
# File 'lib/gemgate/gem_wrapper.rb', line 32 def platform platform = spec.original_platform platform = Gem::Platform::RUBY if platform.nil? or platform.empty? platform end |
#prerelease? ⇒ Boolean
28 29 30 |
# File 'lib/gemgate/gem_wrapper.rb', line 28 def prerelease? spec.version.prerelease? end |
#spec_filename ⇒ Object
16 17 18 |
# File 'lib/gemgate/gem_wrapper.rb', line 16 def spec_filename spec.spec_name end |
#version ⇒ Object
24 25 26 |
# File 'lib/gemgate/gem_wrapper.rb', line 24 def version spec.version end |