Class: Label::GemspecInfo
- Inherits:
-
Object
- Object
- Label::GemspecInfo
- Defined in:
- lib/label/gemspec_info.rb
Overview
A class to represent a gemspec file in order to extract info from it
Constant Summary collapse
- GITHUB_RAW_URL =
"https://raw.githubusercontent.com"
Instance Attribute Summary collapse
-
#gem_name ⇒ Object
readonly
Returns the value of attribute gem_name.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#content ⇒ Object
Raw contents of the gemspec file.
-
#initialize(gem_name, source) ⇒ GemspecInfo
constructor
A new instance of GemspecInfo.
-
#summary ⇒ Object
Extracts the gemspec summary string.
Constructor Details
#initialize(gem_name, source) ⇒ GemspecInfo
Returns a new instance of GemspecInfo.
12 13 14 15 |
# File 'lib/label/gemspec_info.rb', line 12 def initialize gem_name, source @gem_name = gem_name @source = source end |
Instance Attribute Details
#gem_name ⇒ Object (readonly)
Returns the value of attribute gem_name.
8 9 10 |
# File 'lib/label/gemspec_info.rb', line 8 def gem_name @gem_name end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
8 9 10 |
# File 'lib/label/gemspec_info.rb', line 8 def source @source end |
Instance Method Details
#content ⇒ Object
Raw contents of the gemspec file
23 24 25 |
# File 'lib/label/gemspec_info.rb', line 23 def content @content ||= fetch_gemspec_content! end |
#summary ⇒ Object
Extracts the gemspec summary string
18 19 20 |
# File 'lib/label/gemspec_info.rb', line 18 def summary SummaryExtractor.new(content).extract_summary end |