module Murk

Constants

DEFAULT_OPTIONS

Public Class Methods

config_dir() click to toggle source

rubocop:ensable Style/ClassVars

# File lib/murk.rb, line 50
def self.config_dir
  File.dirname(config_file)
end
config_file() click to toggle source
# File lib/murk.rb, line 41
def self.config_file
  @@config_file ||= File.absolute_path('./config')
end
config_file=(config_file) click to toggle source
# File lib/murk.rb, line 45
def self.config_file=(config_file)
  @@config_file = config_file
end
configure(options = {}) click to toggle source
# File lib/murk.rb, line 11
def self.configure(options = {})
  @options = self.options.merge(options)
end
load(file, user) click to toggle source
# File lib/murk.rb, line 19
def self.load(file, user)
  self.config_file = file
  config = File.read(config_file)
  builder = Murk::Builder::MurkBuilder.new user
  builder.instance_eval(config)
  builder.build
end
logger() click to toggle source

rubocop:disable Style/ClassVars

# File lib/murk.rb, line 28
def self.logger
  @@logger ||= Logger.new(STDOUT).tap do |log|
    log.level = Logger::INFO
    log.progname = 'Murk'
  end
end
logger=(logger) click to toggle source
# File lib/murk.rb, line 35
def self.logger=(logger)
  @@logger = logger.tap do |log|
    log.progname = 'Murk'
  end
end
options() click to toggle source
# File lib/murk.rb, line 15
def self.options
  @options ||= DEFAULT_OPTIONS
end

Public Instance Methods

logger() click to toggle source
# File lib/murk.rb, line 54
def logger
  Murk.logger
end