Module: Ossert

Defined in:
lib/ossert/fetch.rb,
lib/ossert.rb,
lib/ossert/stats.rb,
lib/ossert/config.rb,
lib/ossert/project.rb,
lib/ossert/version.rb,
lib/ossert/workers.rb,
lib/ossert/saveable.rb,
lib/ossert/reference.rb,
lib/ossert/presenters.rb,
lib/ossert/stats/base.rb,
lib/ossert/classifiers.rb,
lib/ossert/fetch/github.rb,
lib/ossert/workers/fetch.rb,
lib/ossert/fetch/bestgems.rb,
lib/ossert/fetch/rubygems.rb,
lib/ossert/quarters_store.rb,
lib/ossert/presenters/project.rb,
lib/ossert/classifiers/growing.rb,
lib/ossert/stats/agility_total.rb,
lib/ossert/presenters/project_v2.rb,
lib/ossert/stats/agility_quarter.rb,
lib/ossert/stats/community_total.rb,
lib/ossert/workers/refresh_fetch.rb,
lib/ossert/stats/community_quarter.rb,
lib/ossert/classifiers/decision_tree.rb,
lib/ossert/classifiers/growing/check.rb,
lib/ossert/workers/fetch_bestgems_page.rb,
lib/ossert/classifiers/growing/classifier.rb

Overview

TODO: Add logging

Defined Under Namespace

Modules: Classifiers, Fetch, Presenters, Reference, Saveable, Stats, Workers Classes: Config, Project, QuartersStore, TooLong, Zero

Constant Summary collapse

NO_GITHUB_NAME =
'__unknown__'
VERSION =
'0.1.0'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descrObject



31
32
33
# File 'lib/ossert.rb', line 31

def description(key)
  descriptions.fetch(key.to_s, "Description for '#{key}' - not found")
end

.descriptionsObject



34
35
36
# File 'lib/ossert.rb', line 34

def descriptions
  @descriptions ||= ::Settings['descriptions']
end

.init(database_url = nil) ⇒ Object



22
23
24
25
# File 'lib/ossert.rb', line 22

def init(database_url = nil)
  Sequel.connect(database_url || ENV.fetch('DATABASE_URL'))
  require 'ossert/repositories'
end

.tObject



42
43
44
# File 'lib/ossert.rb', line 42

def translate(key)
  translations.fetch(key.to_s, "Translation for '#{key}' - not found")
end

.translationsObject



45
46
47
# File 'lib/ossert.rb', line 45

def translations
  @translations ||= ::Settings['translations']
end

Instance Method Details

#description(key) ⇒ Object Also known as: descr



28
29
30
# File 'lib/ossert.rb', line 28

def description(key)
  descriptions.fetch(key.to_s, "Description for '#{key}' - not found")
end

#translate(key) ⇒ Object Also known as: t



39
40
41
# File 'lib/ossert.rb', line 39

def translate(key)
  translations.fetch(key.to_s, "Translation for '#{key}' - not found")
end