infraruby-base 3.7.1 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 761c5238d43953a57269b64ce03bd32250739963
4
- data.tar.gz: 61b090c080d819e42831b5e2b499efb6be488282
3
+ metadata.gz: 2b17bccbc46136d1ccde31ced2be412c16cce9f1
4
+ data.tar.gz: c8b3f5552c943e1a1549520ee9b2499f9dfea3bd
5
5
  SHA512:
6
- metadata.gz: 660fc882cbcf9914b22b138aacf1c275f3ed684f7f45ba8bc88d57579fea2f7edb2d894f485ac9f468b654e8796edaa3cc71e3d084454e357761f818c2137d5d
7
- data.tar.gz: 3b3319590eec7e45a1966de64f906a402732e0a22cea9ba1b007e373eb436064948ff2db846d8c2e4bc94f665da4c66d2e24d8f54fda69e801412659f600f80a
6
+ metadata.gz: 16dbb668516ecb00360049d6f7265aed1d3a5ab689970542f9732f25802f95166694f3212a064f1fa0404893d2f9abdaad1e374f8564a3f721c59edf9bfecfaa
7
+ data.tar.gz: f7d5c155395412fe1973206b2467aefd1d256aeefd6479024d05c65bc83b3f010c7b7dc57e166f6bbc5b5d81612aaa317d5f0dd0293d51aa57d8518839e9f13a
@@ -1,4 +1,4 @@
1
- Copyright (C) 2011-2015 InfraRuby Vision
1
+ Copyright (C) 2011-2016 InfraRuby Vision
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a
4
4
  copy of this software and associated documentation files (the "Software"),
data/README.md CHANGED
@@ -15,9 +15,4 @@ Example
15
15
  Support
16
16
  -------
17
17
 
18
- InfraRuby Vision
19
- rubygems@infraruby.com
20
-
21
18
  http://infraruby.com/
22
- https://github.com/InfraRuby
23
- https://twitter.com/InfraRuby
@@ -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 = "3.7.1"
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", "~> 3.7"
12
+ s.add_development_dependency "infraruby-task", "~> 4.0"
13
13
  s.add_development_dependency "rspec", "~> 3.0"
14
14
  end
@@ -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
- success = Kernel.system(command, *args)
19
- if success.nil?
20
- raise RuntimeError, "command not found: #{command}"
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
- return success
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
- yield line.strip
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
- yield path
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
- library_paths(dir).each do |path|
102
+ each_library_path(dir) do |path|
103
103
  load(path) if File.exists?(path)
104
104
  end
105
105
  return
@@ -1,5 +1,5 @@
1
- class Object
2
- NIX = Object.new
1
+ class BasicObject
2
+ NIX = ::Object.new
3
3
 
4
4
  def nix
5
5
  return NIX
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: 3.7.1
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: 2015-06-13 00:00:00.000000000 Z
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: '3.7'
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: '3.7'
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: