Module: Verkilo
- Defined in:
- lib/verkilo.rb,
lib/verkilo/cli.rb,
lib/verkilo/log.rb,
lib/verkilo/book.rb,
lib/verkilo/shelf.rb,
lib/verkilo/version.rb
Defined Under Namespace
Classes: Book, CLI, Error, Log, Shelf
Constant Summary
collapse
- ROOT =
Pathname.new(File.dirname(__FILE__) + "/..")
- VERSION =
"0.1.5"
Class Method Summary
collapse
Class Method Details
.config(root_dir = nil) ⇒ Object
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/verkilo.rb', line 17
def self.config(root_dir = nil)
root_dir ||= Pathname.new(Dir.pwd)
path = root_dir.join("_verkilo.yml")
raise "Invalid Verku directory; couldn't found #{path} file." unless File.file?(path)
content = File.read(path)
erb = ERB.new(content).result
SafeYAML::OPTIONS[:default_mode] = true
YAML.load(erb, :safe => true)
end
|
.logger ⇒ Object
27
28
29
|
# File 'lib/verkilo.rb', line 27
def self.logger
@logger ||= Logger.new(File.open("/tmp/verkilo.log", "a"))
end
|