dohroot 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dohroot.rb +0 -1
- metadata +4 -9
- data/lib/dohroot/pkg.rb +0 -38
- data/test/add_lib.rb +0 -2
- data/test/pkg.dt.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37d97ed8032b60f32d57f3abbd56d4e75671aa6a
|
4
|
+
data.tar.gz: 993f2afd449bea1cb1a3a924014f682bcbd580a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afebde8f75a30b9350271b26d56b31eab27fad77c541831b7edbd39fb2235787a1931c64c998a37bada8494e97edea562dda9e33cb04a976c4d4e5527e6a267e
|
7
|
+
data.tar.gz: 5cf800607a5f8adba462714f8f2184b2d94d594ca011ed25b913c81b1021642271bc552022ab8e6777c50ad040f5c5276f0a21914124fbb168f40217d4ac555d
|
data/lib/dohroot.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dohroot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Makani Mason
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-01-02 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Implements the notion of dohroot that enables most other doh stuff.
|
15
15
|
email:
|
@@ -24,9 +24,6 @@ files:
|
|
24
24
|
- lib/dohroot/findup.rb
|
25
25
|
- lib/dohroot/main.rb
|
26
26
|
- lib/dohroot/options.rb
|
27
|
-
- lib/dohroot/pkg.rb
|
28
|
-
- test/add_lib.rb
|
29
|
-
- test/pkg.dt.rb
|
30
27
|
homepage: https://github.com/atpsoft/dohroot
|
31
28
|
licenses:
|
32
29
|
- MIT
|
@@ -47,10 +44,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
47
44
|
version: '0'
|
48
45
|
requirements: []
|
49
46
|
rubyforge_project:
|
50
|
-
rubygems_version: 2.6.
|
47
|
+
rubygems_version: 2.6.13
|
51
48
|
signing_key:
|
52
49
|
specification_version: 4
|
53
50
|
summary: tiniest root of doh stuff
|
54
|
-
test_files:
|
55
|
-
- test/add_lib.rb
|
56
|
-
- test/pkg.dt.rb
|
51
|
+
test_files: []
|
data/lib/dohroot/pkg.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'dohroot/main'
|
2
|
-
|
3
|
-
module Doh
|
4
|
-
extend self
|
5
|
-
|
6
|
-
def use_pkg(init_file, *name_list)
|
7
|
-
if name_list.empty?
|
8
|
-
Dir.glob(File.join(Doh.root, 'pkg/*/')).each do |rootdir|
|
9
|
-
name_list << File.basename(rootdir)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
@pkg_used ||= []
|
14
|
-
retval = false
|
15
|
-
name_list.each do |name|
|
16
|
-
next if @pkg_used.include?(name)
|
17
|
-
retval = true
|
18
|
-
@pkg_used << name
|
19
|
-
use_one_pkg(init_file, name)
|
20
|
-
end
|
21
|
-
retval
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
def use_one_pkg(init_file, name)
|
27
|
-
libdir = File.join(Doh.root, "pkg/#{name}/lib")
|
28
|
-
unless $LOAD_PATH.include?(libdir)
|
29
|
-
$LOAD_PATH << libdir
|
30
|
-
end
|
31
|
-
|
32
|
-
init_path = File.join(Doh.root, "pkg/#{name}/#{init_file}.rb")
|
33
|
-
if File.exist?(init_path)
|
34
|
-
require init_path
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
data/test/add_lib.rb
DELETED
data/test/pkg.dt.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require_relative 'add_lib'
|
2
|
-
require 'dohroot/pkg'
|
3
|
-
require 'minitest/autorun'
|
4
|
-
|
5
|
-
module Doh
|
6
|
-
|
7
|
-
class Test_pkg < MiniTest::Unit::TestCase
|
8
|
-
def test_use_more_than_once
|
9
|
-
Doh.root = File.join(__dir__, 'fake_pkg_root')
|
10
|
-
assert(Doh.use_pkg(:none, 'some'))
|
11
|
-
assert(!Doh.use_pkg(:none, 'some'))
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|