sane 0.20.0 → 0.20.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/sane/require_relative.rb +3 -1
- data/spec/go2.rb +1 -0
- data/spec/spec.sane.rb +11 -7
- data/spec/subdir/go.rb +1 -0
- metadata +5 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.20.
|
1
|
+
0.20.1
|
@@ -4,7 +4,9 @@ module Kernel
|
|
4
4
|
module_function
|
5
5
|
def require_relative(relative_feature)
|
6
6
|
c = caller.first
|
7
|
-
|
7
|
+
# could be spec.sane.rb:127
|
8
|
+
# or e:/abc.rb:127
|
9
|
+
e = c.rindex(/:\d+/)
|
8
10
|
file = $`
|
9
11
|
if /\A\((.*)\)/ =~ file # eval, etc.
|
10
12
|
raise LoadError, "require_relative is called in #{$1}"
|
data/spec/go2.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require_relative 'go2.rb'
|
data/spec/spec.sane.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require File.dirname(File.expand_path __FILE__) + '/../lib/sane'
|
2
|
-
|
3
1
|
require 'rubygems' if RUBY_VERSION < '1.9'
|
2
|
+
require File.dirname(File.expand_path( __FILE__)) + '/../lib/sane'
|
3
|
+
|
4
4
|
require 'spec/autorun'
|
5
5
|
|
6
6
|
describe Sane do
|
@@ -68,7 +68,7 @@ describe Sane do
|
|
68
68
|
# end
|
69
69
|
|
70
70
|
it "should have verbose looking float#inspect" do
|
71
|
-
assert( (1.1 - 0.9).inspect.include?
|
71
|
+
assert( (1.1 - 0.9).inspect.include?('0.2000000')) # 0.20000000000000006661 or something close to it
|
72
72
|
end
|
73
73
|
|
74
74
|
it "should return false if you call File.executable? non_existent_file" do
|
@@ -89,14 +89,14 @@ describe Sane do
|
|
89
89
|
end
|
90
90
|
|
91
91
|
it "should allow for contain? and include?" do
|
92
|
-
assert "a".include? "a"
|
93
|
-
assert "a".contain? "a"
|
92
|
+
assert "a".include?( "a")
|
93
|
+
assert "a".contain?( "a")
|
94
94
|
assert !("a".contain? "b")
|
95
95
|
end
|
96
96
|
|
97
97
|
it "should have include and contain for arrays" do
|
98
|
-
assert ['a'].include? "a"
|
99
|
-
assert ['a'].contain? "a"
|
98
|
+
assert ['a'].include?( "a" )
|
99
|
+
assert ['a'].contain?( "a" )
|
100
100
|
end
|
101
101
|
|
102
102
|
it "should have blank? and empty? for arrays and strings" do
|
@@ -127,5 +127,9 @@ describe Sane do
|
|
127
127
|
require_relative 'go.rb'
|
128
128
|
FileUtils.rm 'go.rb'
|
129
129
|
end
|
130
|
+
|
131
|
+
it "should be able to require from a subdir" do
|
132
|
+
require_relative 'subdir/go.rb'
|
133
|
+
end
|
130
134
|
|
131
135
|
end
|
data/spec/subdir/go.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require_relative '../go2.rb'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sane
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roger Pack
|
@@ -68,7 +68,9 @@ files:
|
|
68
68
|
- lib/sane/require_relative.rb
|
69
69
|
- lib/sane/sane_random.rb
|
70
70
|
- lib/sane/string_blank.rb
|
71
|
+
- spec/go2.rb
|
71
72
|
- spec/spec.sane.rb
|
73
|
+
- spec/subdir/go.rb
|
72
74
|
- todo
|
73
75
|
- TODO
|
74
76
|
has_rdoc: true
|
@@ -100,4 +102,6 @@ signing_key:
|
|
100
102
|
specification_version: 3
|
101
103
|
summary: Helpers for ruby core to make it easier to work with--things that are missing from core but should arguably be there
|
102
104
|
test_files:
|
105
|
+
- spec/go2.rb
|
103
106
|
- spec/spec.sane.rb
|
107
|
+
- spec/subdir/go.rb
|