dm_ruby_extensions 1.0.5 → 1.0.6

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: 025c40a8257c7d727270ce28062928a0838e5331
4
- data.tar.gz: 3c1671a3fb9034464af17d7f9c0bc2d59fa2100e
3
+ metadata.gz: f72e11f58e106fd495b75ef27df70e180a49a0e0
4
+ data.tar.gz: c5b429ee99f6c14c2519b311d6f6122adf009c04
5
5
  SHA512:
6
- metadata.gz: 5b0718b79d90271870a09f06b88b8f01608d84479c5b08036f957ecb9e86e73f187f602ef9734c13bd3ab0018280b190b9fb1a3de5341a730e6b5fb8b0f5a477
7
- data.tar.gz: b04e951314d1ca30aa0684a1fc81bf4c3ca64d1d659bc480cb22477217c009be3f80a7890a050445af044fb6b336645b0c7d63365a6da57885380b57314340b2
6
+ metadata.gz: bcedfcd588d98bb65f021d3ce51c8ff4ff2fd3cf0c6e5fa10f0c2838de93eb62453edc665fe49137c6dfcf335906a8b381b45521906e9a9817be2aa8b1990c72
7
+ data.tar.gz: 86955966a9e1b429a5165d309dbd5f9268efd8be4cd13c40bd71382266c83b665888886bde060cc222280c51c8a5e67e3616d7ff672dc1ee7eb4579485c269b6
@@ -53,7 +53,7 @@ class String #:nodoc:
53
53
  if self.blank? || self.absolute_url?
54
54
  return self
55
55
  else
56
- return path + self
56
+ return path.end_with?('/') ? "#{path}#{self}" : "#{path}/#{self}"
57
57
  end
58
58
  end
59
59
 
@@ -1,3 +1,3 @@
1
1
  module DmRubyExtensions
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
@@ -1,3 +1,6 @@
1
+ require 'active_support'
2
+ require 'active_support/core_ext'
3
+
1
4
  require "dm_ruby_extensions/version"
2
5
  require "dm_ruby_extensions/extend_array"
3
6
  require "dm_ruby_extensions/extend_date"
@@ -9,7 +12,5 @@ require "dm_ruby_extensions/extend_time"
9
12
  require "dm_ruby_extensions/extend_fixnum"
10
13
  require "dm_ruby_extensions/extend_numeric"
11
14
 
12
- require 'active_support/core_ext/string'
13
-
14
15
  module DmRubyExtensions
15
16
  end
@@ -44,9 +44,10 @@ describe String do
44
44
 
45
45
  describe 'expand_url' do
46
46
  specify { expect('/home/foobar.doc'.expand_url).to eq '/home/foobar.doc' }
47
- specify { expect('foobar.doc'.expand_url).to eq 'foobar.doc' }
48
- specify { expect('foobar.doc'.expand_url('/home/')).to eq '/home/foobar.doc' }
49
47
  specify { expect('/foobar.doc'.expand_url('/home/')).to eq '/foobar.doc' }
48
+ specify { expect('foobar.doc'.expand_url).to eq '/foobar.doc' }
49
+ specify { expect('foobar.doc'.expand_url('/home/')).to eq '/home/foobar.doc' }
50
+ specify { expect('foobar.doc'.expand_url('/home')).to eq '/home/foobar.doc' }
50
51
  end
51
52
 
52
53
  describe 'absolute_url?' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm_ruby_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Walker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-06 00:00:00.000000000 Z
11
+ date: 2017-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport