Module: JekyllRecker::Generators::Base
Overview
Instance Method Summary
collapse
Methods included from Math
#average, #total
Methods included from Logging
included, #logger
Methods included from Date
#calculate_streaks, #slice_by_consecutive
Instance Method Details
#bodies ⇒ Object
26
27
28
|
# File 'lib/jekyll_recker/generators.rb', line 26
def bodies
entries.collect(&:content)
end
|
#dates ⇒ Object
34
35
36
|
# File 'lib/jekyll_recker/generators.rb', line 34
def dates
entries.collect(&:date).map { |t| ::Date.new(t.year, t.month, t.day) }
end
|
#entries ⇒ Object
30
31
32
|
# File 'lib/jekyll_recker/generators.rb', line 30
def entries
@site.posts.docs.select(&:published?).sort_by(&:date).reverse
end
|
#production? ⇒ Boolean
14
15
16
|
# File 'lib/jekyll_recker/generators.rb', line 14
def production?
ENV['JEKYLL_ENV'] == 'production'
end
|
#word_counts ⇒ Object
18
19
20
|
# File 'lib/jekyll_recker/generators.rb', line 18
def word_counts
@word_counts ||= bodies.map(&:split).map(&:size)
end
|
#words ⇒ Object
22
23
24
|
# File 'lib/jekyll_recker/generators.rb', line 22
def words
bodies.map(&:split).flatten
end
|