checkup 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -1,8 +1,11 @@
1
1
  module Checkup
2
2
  module Config
3
3
  DEFAULT_ROOT_PATH = '~/.checkup'
4
-
4
+
5
5
  class << self
6
+ attr_accessor :root_path
7
+
8
+
6
9
  def add_dsl_constants!
7
10
  create_modules(
8
11
  self,
@@ -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
- # File.open(File.join(Config.log_path, 'checkup.log'), 'a') do |file|
122
- # lines.each {|line| file.puts line }
123
- # end
124
- # messages.push(*lines)
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
  ##
@@ -13,7 +13,7 @@ module Checkup
13
13
  # Defines the minor version
14
14
  # PATCH:
15
15
  # Defines the patch version
16
- MAJOR, MINOR, PATCH = 0, 0, 3
16
+ MAJOR, MINOR, PATCH = 0, 0, 4
17
17
 
18
18
  ##
19
19
  # Returns the major version ( big release based off of multiple minor releases )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: