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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b031ca8051ff8d6e391f4e9b4015bc9f80517202e6a597766f70c9a0756ade70
4
- data.tar.gz: 63dcd8c0c2a70233b70729bcc07c37044cafad4573fbd0fe0e3bb395ec88ff94
3
+ metadata.gz: f869f1185e23950b6ae33ba96812fe7ac8ae866c6062b754802c00436329dc22
4
+ data.tar.gz: 82c0b3b4274c031d719f0c3a601e97b428be1ff11fb21a81353ec001de749fc6
5
5
  SHA512:
6
- metadata.gz: 0f17c0ea2da214f24cbd48679415ff1d498a1e9e4d0f2964a365671f2a861119ed6ab149b332cae34cb628dd36b3645cfbc3cc9012b79aef8c55694261ab238b
7
- data.tar.gz: f636bcd1eb98ece8ff046d8ceaeb7d03104b1faa63b3a3eec9f73770ed93ece0d56c0b762770d548234d1891fe3622333f6d91d8bd373770a6f2bb458713a6da
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 = options.delete(:name)
13
- default_options = Chamber.env.web_client.slice('host', 'port', 'protocol')
14
- route_path = Chamber.env.web_client.urls[route_name]
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.each do |key, value|
24
+ path = options.dup.inject(original_path) do |memo, (key, value)|
17
25
  key_pattern = %r{/:#{key}(?=(/|\z))}
18
26
 
19
- next unless route_path.match?(key_pattern)
20
-
21
- route_path.gsub!(key_pattern, "/#{value}")
22
- options.delete(key)
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
- route_path,
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
@@ -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
@@ -39,7 +39,7 @@ refine ::Hash do
39
39
  .join('&')
40
40
  end
41
41
 
42
- alias_method :to_param, :to_query
42
+ alias_method :to_query, :to_param
43
43
  end
44
44
  end
45
45
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppleCore
4
- VERSION = '1.4.0'
4
+ VERSION = '1.4.1'
5
5
  end
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.0
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-10 00:00:00.000000000 Z
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: rspectacular
91
+ name: rspeckled
92
92
  requirement: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.6'
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: '0.6'
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
- g����+d.I���,�d��Y��/� l�R�siF�>>x{�#s��w ���r��4Ԝ��S
2
- R�>r/�
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��