infraruby-base 3.7.1 → 4.0.0
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.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +0 -5
- data/infraruby-base.gemspec +2 -2
- data/lib/infraruby-base.rb +27 -27
- data/ruby/{Object.rb → BasicObject.rb} +2 -2
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b17bccbc46136d1ccde31ced2be412c16cce9f1
|
4
|
+
data.tar.gz: c8b3f5552c943e1a1549520ee9b2499f9dfea3bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16dbb668516ecb00360049d6f7265aed1d3a5ab689970542f9732f25802f95166694f3212a064f1fa0404893d2f9abdaad1e374f8564a3f721c59edf9bfecfaa
|
7
|
+
data.tar.gz: f7d5c155395412fe1973206b2467aefd1d256aeefd6479024d05c65bc83b3f010c7b7dc57e166f6bbc5b5d81612aaa317d5f0dd0293d51aa57d8518839e9f13a
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
data/infraruby-base.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.platform = "ruby"
|
3
3
|
s.name = "infraruby-base"
|
4
|
-
s.version = "
|
4
|
+
s.version = "4.0.0"
|
5
5
|
s.licenses = ["MIT"]
|
6
6
|
s.author = "InfraRuby Vision"
|
7
7
|
s.email = "rubygems@infraruby.com"
|
@@ -9,6 +9,6 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.summary = "InfraRuby base for Ruby interpreters"
|
10
10
|
s.description = "InfraRuby base for Ruby interpreters"
|
11
11
|
s.files = Dir["**/*"]
|
12
|
-
s.add_development_dependency "infraruby-task", "~>
|
12
|
+
s.add_development_dependency "infraruby-task", "~> 4.0"
|
13
13
|
s.add_development_dependency "rspec", "~> 3.0"
|
14
14
|
end
|
data/lib/infraruby-base.rb
CHANGED
@@ -1,10 +1,3 @@
|
|
1
|
-
module Kernel
|
2
|
-
def __dir__
|
3
|
-
filename = caller[0][/^(.*):/, 1]
|
4
|
-
return File.expand_path(File.dirname(filename))
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
1
|
module InfraRuby
|
9
2
|
class << self
|
10
3
|
def if(c)
|
@@ -14,16 +7,26 @@ module InfraRuby
|
|
14
7
|
end
|
15
8
|
|
16
9
|
class << self
|
10
|
+
def with_clean_env(&block)
|
11
|
+
if defined?(Bundler)
|
12
|
+
Bundler.with_clean_env(&block)
|
13
|
+
else
|
14
|
+
block.call
|
15
|
+
end
|
16
|
+
return
|
17
|
+
end
|
18
|
+
|
17
19
|
def system!(command, *args)
|
18
|
-
|
19
|
-
|
20
|
-
|
20
|
+
with_clean_env do
|
21
|
+
success = Kernel.system(command, *args)
|
22
|
+
if success.nil?
|
23
|
+
raise RuntimeError, "command not found: #{command}"
|
24
|
+
end
|
25
|
+
return success
|
21
26
|
end
|
22
|
-
|
27
|
+
raise RuntimeError
|
23
28
|
end
|
24
|
-
end
|
25
29
|
|
26
|
-
class << self
|
27
30
|
def load_gemspec
|
28
31
|
files = Dir["*.gemspec"]
|
29
32
|
case files.size
|
@@ -43,15 +46,6 @@ module InfraRuby
|
|
43
46
|
end
|
44
47
|
return spec.name
|
45
48
|
end
|
46
|
-
|
47
|
-
def with_clean_env(&block)
|
48
|
-
if defined?(Bundler)
|
49
|
-
Bundler.with_clean_env(&block)
|
50
|
-
else
|
51
|
-
block.call
|
52
|
-
end
|
53
|
-
return
|
54
|
-
end
|
55
49
|
end
|
56
50
|
|
57
51
|
class << self
|
@@ -60,11 +54,14 @@ module InfraRuby
|
|
60
54
|
begin
|
61
55
|
data = File.read(path)
|
62
56
|
rescue Errno::ENOENT
|
63
|
-
yield "**/*.rb"
|
57
|
+
yield "**/*.{ir,rb}"
|
64
58
|
return
|
65
59
|
end
|
66
60
|
data.each_line do |line|
|
67
|
-
|
61
|
+
name = line.strip
|
62
|
+
unless name.empty?
|
63
|
+
yield name
|
64
|
+
end
|
68
65
|
end
|
69
66
|
return
|
70
67
|
end
|
@@ -79,11 +76,15 @@ module InfraRuby
|
|
79
76
|
end
|
80
77
|
|
81
78
|
def each_library_path(dir)
|
79
|
+
visited = {}
|
82
80
|
each_library_glob(dir) do |glob|
|
83
81
|
paths = Dir.glob(glob)
|
84
82
|
paths.sort!
|
85
83
|
paths.each do |path|
|
86
|
-
|
84
|
+
unless visited.key?(path)
|
85
|
+
visited[path] = path
|
86
|
+
yield path
|
87
|
+
end
|
87
88
|
end
|
88
89
|
end
|
89
90
|
return
|
@@ -94,12 +95,11 @@ module InfraRuby
|
|
94
95
|
each_library_path(dir) do |path|
|
95
96
|
paths.push(path)
|
96
97
|
end
|
97
|
-
paths.uniq!
|
98
98
|
return paths
|
99
99
|
end
|
100
100
|
|
101
101
|
def load_library(dir)
|
102
|
-
|
102
|
+
each_library_path(dir) do |path|
|
103
103
|
load(path) if File.exists?(path)
|
104
104
|
end
|
105
105
|
return
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infraruby-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- InfraRuby Vision
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: infraruby-task
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -48,8 +48,8 @@ files:
|
|
48
48
|
- README.md
|
49
49
|
- infraruby-base.gemspec
|
50
50
|
- lib/infraruby-base.rb
|
51
|
+
- ruby/BasicObject.rb
|
51
52
|
- ruby/Class.rb
|
52
|
-
- ruby/Object.rb
|
53
53
|
homepage: http://infraruby.com/
|
54
54
|
licenses:
|
55
55
|
- MIT
|
@@ -75,3 +75,4 @@ signing_key:
|
|
75
75
|
specification_version: 4
|
76
76
|
summary: InfraRuby base for Ruby interpreters
|
77
77
|
test_files: []
|
78
|
+
has_rdoc:
|