dohruby 0.1.26 → 0.1.27

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
@@ -80,3 +80,5 @@
80
80
  * DohDb::DatabaseCreator - use convention for default data_directory
81
81
  *0.1.26* (May 28th, 2008)
82
82
  * fixed unit_test_logging invalid require
83
+ *0.1.27* (May 30th, 2008)
84
+ * rework DohApp stuff to be simpler and more flexible
data/bin/run_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- require 'doh/app/home'
2
+ require 'doh/app/init'
3
3
 
4
4
  what_to_run = ARGV[0] || '.'
5
5
  if File.directory?(what_to_run)
@@ -7,8 +7,7 @@ if File.directory?(what_to_run)
7
7
  else
8
8
  start_dir = File.dirname(what_to_run)
9
9
  end
10
- DohApp::find_home(start_dir)
11
- require 'doh/app_init'
10
+ DohApp::init(start_dir)
12
11
 
13
12
  if File.directory?(what_to_run)
14
13
  require 'doh/util/run_tests'
data/lib/doh/app/home.rb CHANGED
@@ -2,17 +2,18 @@ module DohApp
2
2
 
3
3
  @@home = nil
4
4
  def self.home
5
+ raise "must call DohApp::find_home before calling DohApp::home" if @@home.nil?
5
6
  @@home
6
7
  end
7
8
 
8
9
  def self.find_home(dir, max_tries = 20)
9
- abspath = File.expand_path(dir)
10
- raise "unable to find a DohApp home" if (abspath == '/') || (max_tries <= 0)
10
+ path = File.expand_path(dir)
11
+ raise "unable to find a DohApp home" if (path == '/') || (max_tries <= 0)
11
12
 
12
- if File.exist?(File.join(abspath, 'dohapp_home'))
13
- @@home = abspath
13
+ if File.exist?(File.join(path, 'dohapp_home'))
14
+ @@home = path
14
15
  else
15
- find_home(File.join(abspath, '..'), max_tries - 1)
16
+ find_home(File.join(path, '..'), max_tries - 1)
16
17
  end
17
18
  end
18
19
 
@@ -0,0 +1,15 @@
1
+ require 'doh/app/home'
2
+
3
+ module DohApp
4
+
5
+ def self.init(file_or_directory)
6
+ if File.directory?(file_or_directory)
7
+ find_home(file_or_directory)
8
+ else
9
+ find_home(File.dirname(file_or_directory))
10
+ end
11
+ $LOAD_PATH.push(File.join(DohApp::home, 'lib'))
12
+ require 'doh/app_util'
13
+ end
14
+
15
+ end
data/lib/doh/app.rb CHANGED
@@ -1,2 +1,2 @@
1
- require 'doh/app/find_home_from_main_source'
2
- require 'doh/app_init'
1
+ require 'doh/app/init'
2
+ DohApp::init($PROGRAM_NAME)
@@ -0,0 +1 @@
1
+ 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.26
4
+ version: 0.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Makani & Kem Mason
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-05-28 00:00:00 -06:00
12
+ date: 2008-05-30 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -37,12 +37,11 @@ files:
37
37
  - bin/run_tests.rb
38
38
  - lib/doh
39
39
  - lib/doh/app
40
- - lib/doh/app/add_lib_to_load_path.rb
41
- - lib/doh/app/find_home_from_main_source.rb
42
40
  - lib/doh/app/home.rb
41
+ - lib/doh/app/init.rb
43
42
  - lib/doh/app/options.rb
44
43
  - lib/doh/app.rb
45
- - lib/doh/app_init.rb
44
+ - lib/doh/app_util.rb
46
45
  - lib/doh/core
47
46
  - lib/doh/core/bigdecimal.rb
48
47
  - lib/doh/core/date.rb
@@ -1,3 +0,0 @@
1
- require 'doh/app/home'
2
-
3
- $LOAD_PATH.push(File.join(DohApp::home, 'lib'))
@@ -1,3 +0,0 @@
1
- require 'doh/app/home'
2
-
3
- DohApp::find_home(File.dirname($PROGRAM_NAME))
data/lib/doh/app_init.rb DELETED
@@ -1,2 +0,0 @@
1
- require 'doh/app/add_lib_to_load_path'
2
- require 'doh/app/options'