eac_ruby_utils 0.86.0 → 0.87.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eac_ruby_utils/patches/object/to_uri.rb +15 -0
- data/lib/eac_ruby_utils/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d4ecfbc2e97f7fb3f09539826cfeb26eca26eac7e12fd7ea396dbf1c26cdc88
|
4
|
+
data.tar.gz: dfb7c05df973182295f4ad73c118e1825d80130e7a446a5a395ecd3d9c361e35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dc1d1cf517eee4582a0359aa3868fea24b4305ee365dcf2c8509db75180c021a428256f8ea32d21ce88ce29a43a5a016ed0dcec39143d84ec9b359802dc6d83
|
7
|
+
data.tar.gz: a7caf88e6692f6ff0ba15d0c231ca86bac511ef10eb539afaa3f4aac0556d50d19328822dac22ca8f5be69b4ef83cebfd06658ecaa9790f154ddc64ac6f0a1b9
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/core_ext/object/blank'
|
4
|
+
require 'addressable/uri'
|
5
|
+
|
6
|
+
class Object
|
7
|
+
# Convert +self+ to String and then to Addressable::URI. Return nil if +self+ is +blank?+.
|
8
|
+
#
|
9
|
+
# @return [Addressable::URI]
|
10
|
+
def to_uri
|
11
|
+
return self if is_a?(::Addressable::URI)
|
12
|
+
|
13
|
+
to_s.blank? ? nil : ::Addressable::URI.parse(to_s)
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_ruby_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.87.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -203,6 +203,7 @@ files:
|
|
203
203
|
- lib/eac_ruby_utils/patches/object/if_present.rb
|
204
204
|
- lib/eac_ruby_utils/patches/object/if_respond.rb
|
205
205
|
- lib/eac_ruby_utils/patches/object/to_pathname.rb
|
206
|
+
- lib/eac_ruby_utils/patches/object/to_uri.rb
|
206
207
|
- lib/eac_ruby_utils/patches/pathname.rb
|
207
208
|
- lib/eac_ruby_utils/patches/pathname/basename_sub.rb
|
208
209
|
- lib/eac_ruby_utils/patches/pathname/if_exist.rb
|