dohroot 0.1.2 → 0.1.3

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/dohroot.rb +25 -1
  3. metadata +8 -10
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 964f666fa8de25553813222bdc141d1640761b18
4
+ data.tar.gz: 34bcfe1fd33fe9b5b81649eadc6a2be620e28791
5
+ SHA512:
6
+ metadata.gz: 7aeda966cb08bd6f6224c062d19ebc0a5c61ccb169acb911c24c8e050afc9462800a1d32c986f0543b21e9e4a21b50d19444e45af2c32f7475ba8e793d11f131
7
+ data.tar.gz: d860cc510d803f265032925feefb1a3c62d4e3fbeac203bce84e06288ef5ff64914a133decb9ded262eb36e7dc992c1243ea749a8ce8b10bc0b63ee037f0b91e
data/lib/dohroot.rb CHANGED
@@ -13,7 +13,7 @@ end
13
13
  def root=(directory)
14
14
  @root = directory
15
15
  libdir = File.join(@root, 'lib')
16
- $LOAD_PATH.push(libdir) if libdir
16
+ $LOAD_PATH.push(libdir) if libdir && !$LOAD_PATH.include?(libdir)
17
17
  end
18
18
 
19
19
  def find_root(start_directory, filename = 'dohroot', max_tries = 20)
@@ -43,4 +43,28 @@ def find_root_from_pwd
43
43
  Doh.find_root(Dir.pwd)
44
44
  end
45
45
 
46
+ def use_pkg(init_file, *name_list)
47
+ if name_list.empty?
48
+ Dir.glob(File.join(Doh.root, 'pkg/*/')).each do |rootdir|
49
+ name_list << File.basename(rootdir)
50
+ end
51
+ end
52
+
53
+ name_list.each do |name|
54
+ use_one_pkg(init_file, name)
55
+ end
56
+ end
57
+
58
+ def use_one_pkg(init_file, name)
59
+ libdir = File.join(Doh.root, "pkg/#{name}/lib")
60
+ unless $LOAD_PATH.include?(libdir)
61
+ $LOAD_PATH << libdir
62
+ end
63
+
64
+ init_path = File.join(Doh.root, "pkg/#{name}/#{init_file}.rb")
65
+ if File.exist?(init_path)
66
+ require init_path
67
+ end
68
+ end
69
+
46
70
  end # module Doh
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dohroot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
5
- prerelease:
4
+ version: 0.1.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Makani Mason
@@ -10,7 +9,7 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-05-22 00:00:00.000000000 Z
12
+ date: 2013-10-18 00:00:00.000000000 Z
14
13
  dependencies: []
15
14
  description: Implements the notion of dohroot that enables most other doh stuff.
16
15
  email:
@@ -20,33 +19,32 @@ extensions: []
20
19
  extra_rdoc_files:
21
20
  - MIT-LICENSE
22
21
  files:
22
+ - lib/dohroot.rb
23
23
  - lib/dohroot/findup.rb
24
24
  - lib/dohroot/options.rb
25
- - lib/dohroot.rb
26
25
  - MIT-LICENSE
27
26
  homepage: https://github.com/atpsoft/dohroot
28
27
  licenses:
29
28
  - MIT
29
+ metadata: {}
30
30
  post_install_message:
31
31
  rdoc_options: []
32
32
  require_paths:
33
33
  - lib
34
34
  required_ruby_version: !ruby/object:Gem::Requirement
35
- none: false
36
35
  requirements:
37
- - - ! '>='
36
+ - - '>='
38
37
  - !ruby/object:Gem::Version
39
38
  version: 1.9.3
40
39
  required_rubygems_version: !ruby/object:Gem::Requirement
41
- none: false
42
40
  requirements:
43
- - - ! '>='
41
+ - - '>='
44
42
  - !ruby/object:Gem::Version
45
43
  version: '0'
46
44
  requirements: []
47
45
  rubyforge_project:
48
- rubygems_version: 1.8.25
46
+ rubygems_version: 2.0.6
49
47
  signing_key:
50
- specification_version: 3
48
+ specification_version: 4
51
49
  summary: tiniest root of doh stuff
52
50
  test_files: []