Class: SystemBrowser::Gem2Markdown

Inherits:
Object
  • Object
show all
Defined in:
lib/system_browser/gem2markdown.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gem) ⇒ Gem2Markdown

Returns a new instance of Gem2Markdown.



7
8
9
# File 'lib/system_browser/gem2markdown.rb', line 7

def initialize(gem)
  @gem = gem
end

Class Method Details

.convert(gem) ⇒ Object



3
4
5
# File 'lib/system_browser/gem2markdown.rb', line 3

def self.convert(gem)
  self.new(gem).convert
end

Instance Method Details

#convertObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/system_browser/gem2markdown.rb', line 11

def convert
  description = ''

  [header,
   summary,
   homepage,
   license,
   author,
   email,
   newline,
   description,
   newline(2)
  ].each do |desc|
    description += (desc || '')
   end

  {
    description: description,
    development_deps: development_deps,
    runtime_deps: runtime_deps
  }
end