eac_ruby_utils 0.96.1 → 0.99.0
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/lib/eac_ruby_utils/listable/list.rb +9 -1
- data/lib/eac_ruby_utils/listable/value.rb +5 -0
- data/lib/eac_ruby_utils/patches/addressable/uri/query_value.rb +37 -0
- data/lib/eac_ruby_utils/patches/addressable/uri.rb +4 -0
- data/lib/eac_ruby_utils/patches/addressable.rb +4 -0
- data/lib/eac_ruby_utils/regexp_parser.rb +5 -0
- data/lib/eac_ruby_utils/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 788923b15e15ee32a9ef7b73d99a04cfbc2b6b263bb0277541714267b07ab511
|
4
|
+
data.tar.gz: 9a13bab214667dbb9e616d33bfb147ef6c7d8abb0fb9249f6f432f34be6db077
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5e8c453a6fcb2d6803f3fd1b7bd41386e9be8e53b74d3dba54892366ede77b279addb98a44030a6ac6b85f3c3781306fd8b8062fe77a4ac8619b8da8ce943f9
|
7
|
+
data.tar.gz: 77665df94b421278636db62c478a6b2c2716e42f3661799d1bbebea13f20ca4dcc9753a246fbf47a48866791adf06389173fc2006e01fb69a9b87293b86e5ea6
|
@@ -29,8 +29,16 @@ module EacRubyUtils
|
|
29
29
|
@values.values.map(&:value)
|
30
30
|
end
|
31
31
|
|
32
|
+
def values_with_blank
|
33
|
+
[blank_value.value] + values
|
34
|
+
end
|
35
|
+
|
32
36
|
def options
|
33
|
-
@values.values.map
|
37
|
+
@values.values.map(&:to_option)
|
38
|
+
end
|
39
|
+
|
40
|
+
def options_with_blank
|
41
|
+
[blank_value.to_option] + options
|
34
42
|
end
|
35
43
|
|
36
44
|
def method_missing(name, *args, &block)
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'addressable'
|
4
|
+
|
5
|
+
module Addressable
|
6
|
+
class URI
|
7
|
+
# @return [ActiveSupport:HashWithIndifferentAccess]
|
8
|
+
def hash_query_values
|
9
|
+
(query_values || {}).with_indifferent_access
|
10
|
+
end
|
11
|
+
|
12
|
+
def query_value(*args)
|
13
|
+
if args.count == 1
|
14
|
+
query_value_get(*args)
|
15
|
+
elsif args.count == 2
|
16
|
+
query_value_set(*args)
|
17
|
+
else
|
18
|
+
raise ::ArgumentError, "#{object.class}.#{__method__}: wrong number of arguments" \
|
19
|
+
" (given #{args.count}, expected 1..2)"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def query_value_get(name)
|
26
|
+
hash_query_values[name]
|
27
|
+
end
|
28
|
+
|
29
|
+
def query_value_set(name, value)
|
30
|
+
new_query_values = hash_query_values
|
31
|
+
new_query_values[name] = value
|
32
|
+
self.query_values = new_query_values
|
33
|
+
|
34
|
+
self
|
35
|
+
end
|
36
|
+
end
|
37
|
+
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.99.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-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -182,6 +182,9 @@ files:
|
|
182
182
|
- lib/eac_ruby_utils/options_consumer.rb
|
183
183
|
- lib/eac_ruby_utils/patch.rb
|
184
184
|
- lib/eac_ruby_utils/patches.rb
|
185
|
+
- lib/eac_ruby_utils/patches/addressable.rb
|
186
|
+
- lib/eac_ruby_utils/patches/addressable/uri.rb
|
187
|
+
- lib/eac_ruby_utils/patches/addressable/uri/query_value.rb
|
185
188
|
- lib/eac_ruby_utils/patches/class.rb
|
186
189
|
- lib/eac_ruby_utils/patches/class/abstract.rb
|
187
190
|
- lib/eac_ruby_utils/patches/class/common_constructor.rb
|