Class: Jekyll::GeneratorSingleSource::Product::Edition

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/generator-single-source/product/edition.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(edition:, site:) ⇒ Edition

Returns a new instance of Edition.



12
13
14
15
# File 'lib/jekyll/generator-single-source/product/edition.rb', line 12

def initialize(edition:, site:)
  @edition = edition
  @site = site
end

Class Method Details

.all(site:) ⇒ Object



8
9
10
# File 'lib/jekyll/generator-single-source/product/edition.rb', line 8

def self.all(site:)
  GeneratorConfig.new(site).editions
end

Instance Method Details

#latest_releaseObject



25
26
27
# File 'lib/jekyll/generator-single-source/product/edition.rb', line 25

def latest_release
  @latest_release ||= releases.detect(&:latest?)
end

#nameObject



29
30
31
# File 'lib/jekyll/generator-single-source/product/edition.rb', line 29

def name
  @name ||= @edition
end

#releasesObject



17
18
19
20
21
22
23
# File 'lib/jekyll/generator-single-source/product/edition.rb', line 17

def releases
  @releases ||= releases_data
    .map { |r| Product::Release.new(r) }
    .reject do |r|
      r.label && ENV["SKIP_#{name.upcase.gsub('-','_')}_#{r.label.upcase}"]
    end
end