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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 526dfca4b8e68e08295052cb58f86b37b346857f0eb80ada50406b2683921de6
4
- data.tar.gz: b2babc599d88a5e429fbcc1aad07e3f7d62483c3a73c1b56492a5847f7238319
3
+ metadata.gz: 2728649ba93b46d44375db31a80bb0a5fc90530c774d139fdc4b575e1726cfd0
4
+ data.tar.gz: b20c423919740d63453a369cf479bc117111f448d2a313fdb92e14612002345a
5
5
  SHA512:
6
- metadata.gz: 5041b9210824ce7add63097c50f67745af42c212197c33816ddef4a11e187e09c75d3e342b4d9e56d4a5e6132717cc5cef078518540e74494d98f7deb819c28b
7
- data.tar.gz: 695290651c1db53bf9bfcd93f1567126f4eaba1c494d46b0cc6c4bbb221c4fcdd924a5c29d0ca25d8173b2b67fdbac46cfc344d59e9d28f58f8d30f19b71ea16
6
+ metadata.gz: 074c51d5af5679e2163af1ce4e7ec60173496887fec9b5c661b2f26c6dd2ac7c097a349670fdf9680023ebeeb124420c4eca157c16250196c5ccc09e7912477c
7
+ data.tar.gz: 236840fd82b35cf17ff7ff49dd4a94ed6d85fe117b8371cec06a7a8ba76a6c5863d604fce6d00363249697146d956a50a276602f4a536f5886fc7c4172159a0b
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.9.0
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(-2,-1) == "/"
17
+ basedir += "/" unless basedir.slice(-1,1) == "/"
18
18
 
19
19
  if path.start_with?(basedir)
20
- return path.slice(basedir.length, basedir.length)
20
+ return path.slice(basedir.length, path.length)
21
21
  else
22
22
  return nil
23
23
  end
@@ -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.0 ruby lib
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.0".freeze
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout-essentials
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez