Class: Label::GemspecInfo

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_nameObject (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

#sourceObject (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

#contentObject

Raw contents of the gemspec file



23
24
25
# File 'lib/label/gemspec_info.rb', line 23

def content
  @content ||= fetch_gemspec_content!
end

#summaryObject

Extracts the gemspec summary string



18
19
20
# File 'lib/label/gemspec_info.rb', line 18

def summary
  SummaryExtractor.new(content).extract_summary
end