Module: WonkoTheSane

Defined in:
lib/wonko_the_sane.rb,
lib/wonko_the_sane/version.rb,
lib/wonko_the_sane/util/benchmark.rb,
lib/wonko_the_sane/util/task_stack.rb,
lib/wonko_the_sane/util/configuration.rb,
lib/wonko_the_sane/util/version_parser.rb,
lib/wonko_the_sane/util/maven_identifier.rb,
lib/wonko_the_sane/util/deep_storage_cache.rb

Defined Under Namespace

Modules: Util

Constant Summary collapse

VERSION =
'0.1.6'

Class Method Summary collapse

Class Method Details

.configurationObject



78
79
80
# File 'lib/wonko_the_sane.rb', line 78

def self.configuration
  @configuration ||= Util::Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



74
75
76
# File 'lib/wonko_the_sane.rb', line 74

def self.configure(&block)
  yield configuration
end

.data(file) ⇒ Object



61
62
63
# File 'lib/wonko_the_sane.rb', line 61

def self.data(file)
  Pathname.new(configuration.data_path) + file
end

.data_json(file) ⇒ Object



65
66
67
68
# File 'lib/wonko_the_sane.rb', line 65

def self.data_json(file)
  res = JSON.parse File.read data file
  res.is_a?(Hash) ? HashWithIndifferentAccess.new(res) : res
end

.listsObject



53
54
55
# File 'lib/wonko_the_sane.rb', line 53

def self.lists
  configuration.lists
end

.set_data_json(file, obj) ⇒ Object



70
71
72
# File 'lib/wonko_the_sane.rb', line 70

def self.set_data_json(file, obj)
  File.write data(file), JSON.pretty_generate(obj)
end

.tasksObject



57
58
59
# File 'lib/wonko_the_sane.rb', line 57

def self.tasks
  @tasks ||= WonkoTheSane::Util::TaskStack.new
end