Class: IPASend::DownloadPage

Inherits:
Object
  • Object
show all
Defined in:
lib/ipasend/download_page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ DownloadPage

Returns a new instance of DownloadPage.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ipasend/download_page.rb', line 12

def initialize(opts)
  @manifest = opts.manifest
  @display_name = opts.display_name
  @manifest_public_url = opts.manifest_public_url

  @markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)

  if opts.release_notes_path
    path = File.dirname(opts.config_path)
    path = File.join(path, opts.release_notes_path)
    @release_notes = @markdown.render(open(path, 'r').read)
  elsif opts.release_notes
    @release_notes = opts.release_notes
  end

end

Instance Attribute Details

#display_nameObject

Returns the value of attribute display_name.



9
10
11
# File 'lib/ipasend/download_page.rb', line 9

def display_name
  @display_name
end

#manifestObject (readonly)

Returns the value of attribute manifest.



8
9
10
# File 'lib/ipasend/download_page.rb', line 8

def manifest
  @manifest
end

#manifest_public_urlObject

Returns the value of attribute manifest_public_url.



9
10
11
# File 'lib/ipasend/download_page.rb', line 9

def manifest_public_url
  @manifest_public_url
end

#release_notesObject

Returns the value of attribute release_notes.



10
11
12
# File 'lib/ipasend/download_page.rb', line 10

def release_notes
  @release_notes
end

Instance Method Details

#dataObject



29
30
31
32
# File 'lib/ipasend/download_page.rb', line 29

def data
  template = ERB.new(open(File.join(IPASend.template_dir, 'download_page.html.erb')).read)
  StringIO.new(template.result(binding))
end