apple_core 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/apple_core/action_view/helpers/web_client_url.rb +21 -9
- data/lib/apple_core/railtie.rb +1 -1
- data/lib/apple_core/refinements/query_string.rb +1 -1
- data/lib/apple_core/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +5 -5
- metadata.gz.sig +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f869f1185e23950b6ae33ba96812fe7ac8ae866c6062b754802c00436329dc22
|
4
|
+
data.tar.gz: 82c0b3b4274c031d719f0c3a601e97b428be1ff11fb21a81353ec001de749fc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bef1067195220d80dfd89caf6911fdd5ed4c54636fd49317d3f3affd751996b0f8eb40994914605a3dd170d5568d73b8f767ee5f93a931ad2b346f7d36e58549
|
7
|
+
data.tar.gz: 154665543960907f869c49d1046a22ceda02b22d553cbb04f1e7d133fbe164f95487fbd5ee536759c9f19b463882d1363fe8957f1b190adecfad058b7950af10
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -4,22 +4,32 @@ require 'uri'
|
|
4
4
|
require 'apple_core/refinements/query_string'
|
5
5
|
|
6
6
|
module AppleCore
|
7
|
+
module ActionView
|
7
8
|
module Helpers
|
8
9
|
module WebClientUrl
|
9
10
|
using ::AppleCore::Refinements::QueryString
|
10
11
|
|
12
|
+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
11
13
|
def web_client_url(**options)
|
12
|
-
route_name
|
13
|
-
|
14
|
-
|
14
|
+
route_name = options.delete(:name)
|
15
|
+
|
16
|
+
if defined?(::Chamber)
|
17
|
+
default_options = Chamber.env.web_client.slice('host', 'port', 'protocol')
|
18
|
+
original_path = Chamber.env.web_client.urls[route_name]
|
19
|
+
else
|
20
|
+
default_options = {}
|
21
|
+
original_path = options.delete(:path)
|
22
|
+
end
|
15
23
|
|
16
|
-
options.dup.
|
24
|
+
path = options.dup.inject(original_path) do |memo, (key, value)|
|
17
25
|
key_pattern = %r{/:#{key}(?=(/|\z))}
|
18
26
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
27
|
+
if memo.match?(key_pattern)
|
28
|
+
options.delete(key)
|
29
|
+
memo.gsub(key_pattern, "/#{value}")
|
30
|
+
else
|
31
|
+
memo
|
32
|
+
end
|
23
33
|
end
|
24
34
|
|
25
35
|
options = default_options.merge(options)
|
@@ -30,7 +40,7 @@ module WebClientUrl
|
|
30
40
|
options.delete('host'),
|
31
41
|
options.delete('port') || 443,
|
32
42
|
nil,
|
33
|
-
|
43
|
+
path,
|
34
44
|
nil,
|
35
45
|
options.to_query,
|
36
46
|
anchor,
|
@@ -38,6 +48,8 @@ module WebClientUrl
|
|
38
48
|
|
39
49
|
URI::HTTPS.new(*arguments).to_s
|
40
50
|
end
|
51
|
+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
52
|
+
end
|
41
53
|
end
|
42
54
|
end
|
43
55
|
end
|
data/lib/apple_core/railtie.rb
CHANGED
@@ -5,7 +5,7 @@ require 'apple_core/action_view/helpers/web_client_url'
|
|
5
5
|
module AppleCore
|
6
6
|
class Railtie < Rails::Railtie
|
7
7
|
initializer 'web_client_url.helper' do |_app|
|
8
|
-
ActionView::Base.public_send(:include, AppleCore::Helpers::WebClientUrl)
|
8
|
+
::ActionView::Base.public_send(:include, AppleCore::ActionView::Helpers::WebClientUrl)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
data/lib/apple_core/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apple_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thegranddesign
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
Y2GAoHKstmfIVhc4XHOPpmTd2o/C29O9oaRgjrkfQEhF/KvJ/PhoV5hvokzsCyI5
|
32
32
|
iUeXPfvrGD/itYIBCgk+fnzyQQ4QtE5hTQaWQ3o2
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2018-07-
|
34
|
+
date: 2018-07-12 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: activemodel
|
@@ -88,19 +88,19 @@ dependencies:
|
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '3.7'
|
90
90
|
- !ruby/object:Gem::Dependency
|
91
|
-
name:
|
91
|
+
name: rspeckled
|
92
92
|
requirement: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.0.53
|
97
97
|
type: :development
|
98
98
|
prerelease: false
|
99
99
|
version_requirements: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 0.0.53
|
104
104
|
description: To the CORE!
|
105
105
|
email:
|
106
106
|
- rubygems@livinghighontheblog.com
|
metadata.gz.sig
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
+
|
2
|
+
��jòz]D�|T�ʕ��^z�!�3��4w��*�����;G�h����VK�]F�Īf���,y�m���A��_Uc����[��n�|K�6=L�}<c����m̃��y�ҿߥ�:|=�/f>���(����(�S��~��'����6���ڇ��^�d�I��h<��ח�݆s��Pv�S^�-�G���
|
3
|
+
��z�x�q�/���3gDS�pZ�4�T���*��m��z���<Q���G��
|