checkup 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/checkup/cli/utility.rb +4 -2
- data/lib/checkup/config.rb +4 -1
- data/lib/checkup/logger.rb +8 -4
- data/lib/checkup/version.rb +1 -1
- metadata +1 -1
data/lib/checkup/cli/utility.rb
CHANGED
@@ -47,11 +47,13 @@ module Checkup
|
|
47
47
|
|
48
48
|
def load (path)
|
49
49
|
path = File.expand_path path
|
50
|
-
|
50
|
+
|
51
|
+
Checkup::Config.root_path = path
|
52
|
+
|
51
53
|
if !Dir.exists? path
|
52
54
|
FileUtils.mkdir_p path
|
53
55
|
end
|
54
|
-
|
56
|
+
|
55
57
|
Dir[File.join(path, "*.rb")].each do |file|
|
56
58
|
Checkup::Config.class_eval File.read(File.expand_path(File.basename(file), path))
|
57
59
|
end
|
data/lib/checkup/config.rb
CHANGED
data/lib/checkup/logger.rb
CHANGED
@@ -118,10 +118,14 @@ module Checkup
|
|
118
118
|
##
|
119
119
|
# Receives an Array of Strings to be written to the log file.
|
120
120
|
def to_file(lines)
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
121
|
+
if !Dir.exists? File.join(Config.root_path, 'logs')
|
122
|
+
FileUtils.mkdir_p File.join(Config.root_path, 'logs')
|
123
|
+
end
|
124
|
+
|
125
|
+
File.open(File.join(Config.root_path, 'logs', 'checkup.log'), 'a') do |file|
|
126
|
+
lines.each {|line| file.puts line }
|
127
|
+
end
|
128
|
+
messages.push(*lines)
|
125
129
|
end
|
126
130
|
|
127
131
|
##
|
data/lib/checkup/version.rb
CHANGED