scout-essentials 1.9.0 → 1.9.1
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/VERSION +1 -1
- data/lib/scout/misc/filesystem.rb +2 -2
- data/scout-essentials.gemspec +2 -2
- data/test/scout/misc/test_filesystem.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2728649ba93b46d44375db31a80bb0a5fc90530c774d139fdc4b575e1726cfd0
|
|
4
|
+
data.tar.gz: b20c423919740d63453a369cf479bc117111f448d2a313fdb92e14612002345a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 074c51d5af5679e2163af1ce4e7ec60173496887fec9b5c661b2f26c6dd2ac7c097a349670fdf9680023ebeeb124420c4eca157c16250196c5ccc09e7912477c
|
|
7
|
+
data.tar.gz: 236840fd82b35cf17ff7ff49dd4a94ed6d85fe117b8371cec06a7a8ba76a6c5863d604fce6d00363249697146d956a50a276602f4a536f5886fc7c4172159a0b
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.9.
|
|
1
|
+
1.9.1
|
|
@@ -14,10 +14,10 @@ module Misc
|
|
|
14
14
|
path = File.expand_path(path) unless path.slice(0,1) == "/"
|
|
15
15
|
basedir = File.expand_path(basedir) unless basedir.slice(0,1) == "/"
|
|
16
16
|
|
|
17
|
-
basedir += "/" unless basedir.slice(-
|
|
17
|
+
basedir += "/" unless basedir.slice(-1,1) == "/"
|
|
18
18
|
|
|
19
19
|
if path.start_with?(basedir)
|
|
20
|
-
return path.slice(basedir.length,
|
|
20
|
+
return path.slice(basedir.length, path.length)
|
|
21
21
|
else
|
|
22
22
|
return nil
|
|
23
23
|
end
|
data/scout-essentials.gemspec
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
|
-
# stub: scout-essentials 1.9.
|
|
5
|
+
# stub: scout-essentials 1.9.1 ruby lib
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
8
|
s.name = "scout-essentials".freeze
|
|
9
|
-
s.version = "1.9.
|
|
9
|
+
s.version = "1.9.1".freeze
|
|
10
10
|
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
|
12
12
|
s.require_paths = ["lib".freeze]
|
|
@@ -54,5 +54,15 @@ class TestFilesystem < Test::Unit::TestCase
|
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
|
+
|
|
58
|
+
def test_path_relative_to
|
|
59
|
+
path = '/some/path/dir1/foo'
|
|
60
|
+
dir = '/some/path/'
|
|
61
|
+
|
|
62
|
+
assert_equal 'dir1/foo', Misc.path_relative_to(dir, path)
|
|
63
|
+
|
|
64
|
+
path = '/some/path/dir1/dir2/dir3/dir4/foo/'
|
|
65
|
+
assert_equal 'dir1/dir2/dir3/dir4/foo/', Misc.path_relative_to(dir, path)
|
|
66
|
+
end
|
|
57
67
|
end
|
|
58
68
|
|