dohruby 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -69,3 +69,6 @@
69
69
  * fix bug in DohLogger::Formatter when no Exception object is given
70
70
  *0.1.21* (May 27th, 2008)
71
71
  * rollback to_s changes to Array, Set, and Hash
72
+ *0.1.22* (May 27th, 2008)
73
+ * implement DohApp::home, and file to add it to rubylib search path
74
+ * move Doh::Options into DohApp
@@ -0,0 +1,19 @@
1
+ module DohApp
2
+
3
+ def self.find_home(dir, max_tries = 20)
4
+ abspath = File.expand_path(dir)
5
+ raise "unable to find a DohApp home" if (abspath == '/') || (max_tries <= 0)
6
+
7
+ if File.exist?(File.join(abspath, 'dohapp_home'))
8
+ abspath
9
+ else
10
+ find_home(File.join(abspath, '..'), max_tries - 1)
11
+ end
12
+ end
13
+
14
+ @@home = nil
15
+ def self.home
16
+ @@home ||= find_home(File.dirname($0))
17
+ end
18
+
19
+ end
@@ -0,0 +1,3 @@
1
+ require 'doh/app/home'
2
+
3
+ $:.push(File.join(DohApp::home, 'lib'))
@@ -1,7 +1,7 @@
1
1
  require 'ostruct'
2
2
  require 'optparse'
3
3
 
4
- module Doh
4
+ module DohApp
5
5
 
6
6
  class Options
7
7
  # this class is for command line parsing
data/lib/doh/app.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'doh/app/include_lib_directory'
2
+ require 'doh/app/options'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dohruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.21
4
+ version: 0.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Makani & Kem Mason
@@ -36,6 +36,11 @@ files:
36
36
  - bin/rcov-preprocess-files.rb
37
37
  - bin/run_tests.rb
38
38
  - lib/doh
39
+ - lib/doh/app
40
+ - lib/doh/app/home.rb
41
+ - lib/doh/app/include_lib_directory.rb
42
+ - lib/doh/app/options.rb
43
+ - lib/doh/app.rb
39
44
  - lib/doh/core
40
45
  - lib/doh/core/bigdecimal.rb
41
46
  - lib/doh/core/date.rb
@@ -86,7 +91,6 @@ files:
86
91
  - lib/doh/util/blank_slate.rb
87
92
  - lib/doh/util/current_date.rb
88
93
  - lib/doh/util/num_or_self.rb
89
- - lib/doh/util/options.rb
90
94
  - lib/doh/util/run_tests.rb
91
95
  - lib/doh/util/source_ip.rb
92
96
  - lib/doh/util/time_util.rb