epitools 0.5.72 → 0.5.73
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/epitools/path.rb +3 -12
- data/spec/core_ext_spec.rb +2 -1
- data/spec/path_spec.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec37ccba9b3b090251f5a096ed57ef7ee4c4e769
|
4
|
+
data.tar.gz: 9abd4684561e30e28bb23094fd2606e9ef1d8a24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80a9d929bd6fda00c1fa766af8cee4ebbbfc92dc0fba752c772976ed412c3a5fa1707f64944ebdb5bb2ff1ccb2f7977a9c00b5ddaaddc7de272ad796f6f3c1a4
|
7
|
+
data.tar.gz: c2d51d16d96359830af2ea2532708ed6362dff0b60610a709641e66d6718dcfadfafb6f28ba06ce7b4f7dde23bc6ad67fb8b741e04eb0e91cfc24cb3a160dcbe
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.73
|
data/lib/epitools/path.rb
CHANGED
@@ -291,18 +291,9 @@ class Path
|
|
291
291
|
end
|
292
292
|
|
293
293
|
def relative_to(anchor)
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
first_mismatch = dirs.zip(anchor.dirs).index { |a,b| a != b }
|
299
|
-
|
300
|
-
num_dots = anchor.dirs.size - first_mismatch
|
301
|
-
|
302
|
-
result = dup
|
303
|
-
result.dirs = ([".."] * num_dots) + dirs[first_mismatch..-1]
|
304
|
-
|
305
|
-
result
|
294
|
+
anchor = anchor.to_s
|
295
|
+
anchor += "/" unless anchor[/\/$/]
|
296
|
+
to_s.gsub(/^#{Regexp.escape(anchor)}/, '')
|
306
297
|
end
|
307
298
|
|
308
299
|
# The current directory (with a trailing /)
|
data/spec/core_ext_spec.rb
CHANGED
@@ -254,7 +254,8 @@ describe String do
|
|
254
254
|
"What's Up" => "What's Up",
|
255
255
|
"they're awesome" => "They're Awesome",
|
256
256
|
"king of pain" => "King of Pain",
|
257
|
-
"a-b-c 1-2-3" => "A-B-C 1-2-3"
|
257
|
+
"a-b-c 1-2-3" => "A-B-C 1-2-3",
|
258
|
+
"i'm the best" => "I'm the Best"
|
258
259
|
}.each {|orig, titled| orig.titlecase.should == titled }
|
259
260
|
|
260
261
|
s = "asdf asdf"
|
data/spec/path_spec.rb
CHANGED
@@ -32,7 +32,8 @@ describe Path do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
it "'relative_to's" do
|
35
|
-
Path["/etc"].relative_to(Path["/tmp"]).should == "../etc/"
|
35
|
+
# Path["/etc"].relative_to(Path["/tmp"]).should == "../etc/"
|
36
|
+
Path["/etc/passwd"].relative_to("/etc").should == "passwd"
|
36
37
|
end
|
37
38
|
|
38
39
|
it "should glob with relative paths" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epitools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.73
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- epitron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|