Class: Jekyll::FDroidRepoInfoTag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/jekyll/FDroidRepoInfoTag.rb

Overview

Used to output the repo name/timestamp used to generate this F-Droid site.

Constant Summary collapse

@@repotag =
''

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, text, tokens) ⇒ FDroidRepoInfoTag

Returns a new instance of FDroidRepoInfoTag.



25
26
27
# File 'lib/jekyll/FDroidRepoInfoTag.rb', line 25

def initialize(tag_name, text, tokens)
  super
end

Instance Method Details

#render(context) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/jekyll/FDroidRepoInfoTag.rb', line 29

def render(context)
  if @@repotag == ''
    site = context.registers[:site]
    url = site.config['fdroid-repo']
    index = FDroid::IndexV1.download(url, 'en')
    @@repotag = "#{index.repo.name} #{index.repo.date}"
  end
  return @@repotag
end