tp_common 0.4.3.pre1 → 0.4.3.pre2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 025ffd9b6a300dba51d4e8edbae4a778d300835fa674ec52bcbca3a819d072c9
4
- data.tar.gz: 651838404deaf1632f71078813c04b5e0f4486946471be743b9dfdf277669009
3
+ metadata.gz: 65d4bd6ac845522f0e2e8535de63543f6b96405ca6cf039eaf186dfae390322d
4
+ data.tar.gz: e6e0df92af5db1cdab297d72d2d7dd6709020db43c37c1a25ae809504f496602
5
5
  SHA512:
6
- metadata.gz: d0c929022ae62ef0e961548e79572e64fe1e9a6c01161b14b262e6316e1919b9f24653bb18cf4a10f2461f74ea1ad9550270833306909216afcf6c76ee170039
7
- data.tar.gz: 752c51e003424ab2ca708bd617fd39c1d57987e19d71733e63046e54e5dc3a3cb3b3b56401da7e68602f3cc2d9369534310bd895ed7bfbf81779c18d5d19263c
6
+ metadata.gz: 46e93abb7eaad65f3fc99436ced2b264bf2e6e3073a0fdd9398f610eec8967dd2f311a44387639694b70a9a01f1f9f9154b3850fc4853c226e2cb80d10383a5b
7
+ data.tar.gz: e4480c23da83713b298b99091ad37e2d6169829d005a459c4c34783d598bb01c2d02215311a03cd25a8645e5c7b76574351ab33ad983f6519c99135da79dde1d
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.5.3
data/Appraisals CHANGED
@@ -10,6 +10,6 @@ end
10
10
 
11
11
  # This tests for compatible with latest rails, no matter what version.
12
12
  appraise "rails-latest" do
13
- gem 'rails', '= 5.2.1'
13
+ gem 'rails', '= 5.2.2.1'
14
14
  gem 'rspec-rails'
15
15
  end
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- tp_common (0.4.3.pre1)
5
- activesupport (>= 4.2.0, <= 5.2.1)
4
+ tp_common (0.4.3.pre2)
5
+ activesupport (>= 4.2.0, < 6.0)
6
6
  aws-sdk-s3 (~> 1.19)
7
7
  fog-aws (~> 2.0)
8
8
  mime-types (~> 3.2)
@@ -45,30 +45,35 @@ GEM
45
45
  minitest (~> 5.1)
46
46
  thread_safe (~> 0.3, >= 0.3.4)
47
47
  tzinfo (~> 1.1)
48
+ addressable (2.6.0)
49
+ public_suffix (>= 2.0.2, < 4.0)
48
50
  appraisal (2.2.0)
49
51
  bundler
50
52
  rake
51
53
  thor (>= 0.14.0)
52
54
  arel (6.0.4)
53
- aws-eventstream (1.0.1)
54
- aws-partitions (1.140.0)
55
- aws-sdk-core (3.46.2)
56
- aws-eventstream (~> 1.0)
55
+ aws-eventstream (1.0.2)
56
+ aws-partitions (1.144.0)
57
+ aws-sdk-core (3.48.0)
58
+ aws-eventstream (~> 1.0, >= 1.0.2)
57
59
  aws-partitions (~> 1.0)
58
- aws-sigv4 (~> 1.0)
60
+ aws-sigv4 (~> 1.1)
59
61
  jmespath (~> 1.0)
60
- aws-sdk-kms (1.13.0)
61
- aws-sdk-core (~> 3, >= 3.39.0)
62
- aws-sigv4 (~> 1.0)
63
- aws-sdk-s3 (1.30.1)
64
- aws-sdk-core (~> 3, >= 3.39.0)
62
+ aws-sdk-kms (1.15.0)
63
+ aws-sdk-core (~> 3, >= 3.48.0)
64
+ aws-sigv4 (~> 1.1)
65
+ aws-sdk-s3 (1.33.0)
66
+ aws-sdk-core (~> 3, >= 3.48.0)
65
67
  aws-sdk-kms (~> 1)
66
68
  aws-sigv4 (~> 1.0)
67
- aws-sigv4 (1.0.3)
69
+ aws-sigv4 (1.1.0)
70
+ aws-eventstream (~> 1.0, >= 1.0.2)
68
71
  builder (3.2.3)
69
72
  byebug (9.1.0)
70
73
  coderay (1.1.2)
71
74
  concurrent-ruby (1.0.5)
75
+ crack (0.4.3)
76
+ safe_yaml (~> 1.0.0)
72
77
  crass (1.0.3)
73
78
  diff-lcs (1.3)
74
79
  erubis (2.7.0)
@@ -91,6 +96,7 @@ GEM
91
96
  formatador (0.2.5)
92
97
  globalid (0.4.1)
93
98
  activesupport (>= 4.2.0)
99
+ hashdiff (0.3.8)
94
100
  i18n (0.9.1)
95
101
  concurrent-ruby (~> 1.0)
96
102
  ipaddress (0.8.3)
@@ -116,6 +122,7 @@ GEM
116
122
  pry-byebug (3.5.1)
117
123
  byebug (~> 9.1)
118
124
  pry (~> 0.10)
125
+ public_suffix (3.0.3)
119
126
  rack (1.6.8)
120
127
  rack-test (0.6.3)
121
128
  rack (>= 1.0)
@@ -165,6 +172,7 @@ GEM
165
172
  rspec-mocks (~> 3.7.0)
166
173
  rspec-support (~> 3.7.0)
167
174
  rspec-support (3.7.0)
175
+ safe_yaml (1.0.5)
168
176
  sprockets (3.7.1)
169
177
  concurrent-ruby (~> 1.0)
170
178
  rack (> 1, < 3)
@@ -177,6 +185,10 @@ GEM
177
185
  timecop (0.9.1)
178
186
  tzinfo (1.2.4)
179
187
  thread_safe (~> 0.1)
188
+ webmock (3.5.1)
189
+ addressable (>= 2.3.6)
190
+ crack (>= 0.3.2)
191
+ hashdiff
180
192
 
181
193
  PLATFORMS
182
194
  ruby
@@ -191,6 +203,7 @@ DEPENDENCIES
191
203
  rspec-rails
192
204
  timecop (~> 0.9)
193
205
  tp_common!
206
+ webmock
194
207
 
195
208
  BUNDLED WITH
196
- 1.16.2
209
+ 1.16.6
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- tp_common (0.4.3.pre1)
5
- activesupport (>= 4.2.0, <= 5.2.1)
4
+ tp_common (0.4.3.pre2)
5
+ activesupport (>= 4.2.0, < 6.0)
6
6
  aws-sdk-s3 (~> 1.19)
7
7
  fog-aws (~> 2.0)
8
8
  mime-types (~> 3.2)
@@ -48,30 +48,35 @@ GEM
48
48
  i18n (~> 0.7)
49
49
  minitest (~> 5.1)
50
50
  tzinfo (~> 1.1)
51
+ addressable (2.6.0)
52
+ public_suffix (>= 2.0.2, < 4.0)
51
53
  appraisal (2.2.0)
52
54
  bundler
53
55
  rake
54
56
  thor (>= 0.14.0)
55
57
  arel (7.1.4)
56
- aws-eventstream (1.0.1)
57
- aws-partitions (1.140.0)
58
- aws-sdk-core (3.46.2)
59
- aws-eventstream (~> 1.0)
58
+ aws-eventstream (1.0.2)
59
+ aws-partitions (1.144.0)
60
+ aws-sdk-core (3.48.0)
61
+ aws-eventstream (~> 1.0, >= 1.0.2)
60
62
  aws-partitions (~> 1.0)
61
- aws-sigv4 (~> 1.0)
63
+ aws-sigv4 (~> 1.1)
62
64
  jmespath (~> 1.0)
63
- aws-sdk-kms (1.13.0)
64
- aws-sdk-core (~> 3, >= 3.39.0)
65
- aws-sigv4 (~> 1.0)
66
- aws-sdk-s3 (1.30.1)
67
- aws-sdk-core (~> 3, >= 3.39.0)
65
+ aws-sdk-kms (1.15.0)
66
+ aws-sdk-core (~> 3, >= 3.48.0)
67
+ aws-sigv4 (~> 1.1)
68
+ aws-sdk-s3 (1.33.0)
69
+ aws-sdk-core (~> 3, >= 3.48.0)
68
70
  aws-sdk-kms (~> 1)
69
71
  aws-sigv4 (~> 1.0)
70
- aws-sigv4 (1.0.3)
72
+ aws-sigv4 (1.1.0)
73
+ aws-eventstream (~> 1.0, >= 1.0.2)
71
74
  builder (3.2.3)
72
75
  byebug (9.1.0)
73
76
  coderay (1.1.2)
74
77
  concurrent-ruby (1.0.5)
78
+ crack (0.4.3)
79
+ safe_yaml (~> 1.0.0)
75
80
  crass (1.0.3)
76
81
  diff-lcs (1.3)
77
82
  erubis (2.7.0)
@@ -94,6 +99,7 @@ GEM
94
99
  formatador (0.2.5)
95
100
  globalid (0.4.1)
96
101
  activesupport (>= 4.2.0)
102
+ hashdiff (0.3.8)
97
103
  i18n (0.9.1)
98
104
  concurrent-ruby (~> 1.0)
99
105
  ipaddress (0.8.3)
@@ -120,6 +126,7 @@ GEM
120
126
  pry-byebug (3.5.1)
121
127
  byebug (~> 9.1)
122
128
  pry (~> 0.10)
129
+ public_suffix (3.0.3)
123
130
  rack (2.0.3)
124
131
  rack-test (0.6.3)
125
132
  rack (>= 1.0)
@@ -168,6 +175,7 @@ GEM
168
175
  rspec-mocks (~> 3.7.0)
169
176
  rspec-support (~> 3.7.0)
170
177
  rspec-support (3.7.0)
178
+ safe_yaml (1.0.5)
171
179
  sprockets (3.7.1)
172
180
  concurrent-ruby (~> 1.0)
173
181
  rack (> 1, < 3)
@@ -180,6 +188,10 @@ GEM
180
188
  timecop (0.9.1)
181
189
  tzinfo (1.2.4)
182
190
  thread_safe (~> 0.1)
191
+ webmock (3.5.1)
192
+ addressable (>= 2.3.6)
193
+ crack (>= 0.3.2)
194
+ hashdiff
183
195
  websocket-driver (0.6.5)
184
196
  websocket-extensions (>= 0.1.0)
185
197
  websocket-extensions (0.1.3)
@@ -197,6 +209,7 @@ DEPENDENCIES
197
209
  rspec-rails
198
210
  timecop (~> 0.9)
199
211
  tp_common!
212
+ webmock
200
213
 
201
214
  BUNDLED WITH
202
- 1.16.2
215
+ 1.16.6
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "= 5.2.1"
5
+ gem "rails", "= 5.2.2.1"
6
6
  gem "rspec-rails"
7
7
 
8
8
  gemspec path: "../"
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- tp_common (0.4.3.pre1)
5
- activesupport (>= 4.2.0, <= 5.2.1)
4
+ tp_common (0.4.3.pre2)
5
+ activesupport (>= 4.2.0, < 6.0)
6
6
  aws-sdk-s3 (~> 1.19)
7
7
  fog-aws (~> 2.0)
8
8
  mime-types (~> 3.2)
@@ -11,74 +11,79 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- actioncable (5.2.1)
15
- actionpack (= 5.2.1)
14
+ actioncable (5.2.2.1)
15
+ actionpack (= 5.2.2.1)
16
16
  nio4r (~> 2.0)
17
17
  websocket-driver (>= 0.6.1)
18
- actionmailer (5.2.1)
19
- actionpack (= 5.2.1)
20
- actionview (= 5.2.1)
21
- activejob (= 5.2.1)
18
+ actionmailer (5.2.2.1)
19
+ actionpack (= 5.2.2.1)
20
+ actionview (= 5.2.2.1)
21
+ activejob (= 5.2.2.1)
22
22
  mail (~> 2.5, >= 2.5.4)
23
23
  rails-dom-testing (~> 2.0)
24
- actionpack (5.2.1)
25
- actionview (= 5.2.1)
26
- activesupport (= 5.2.1)
24
+ actionpack (5.2.2.1)
25
+ actionview (= 5.2.2.1)
26
+ activesupport (= 5.2.2.1)
27
27
  rack (~> 2.0)
28
28
  rack-test (>= 0.6.3)
29
29
  rails-dom-testing (~> 2.0)
30
30
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
31
- actionview (5.2.1)
32
- activesupport (= 5.2.1)
31
+ actionview (5.2.2.1)
32
+ activesupport (= 5.2.2.1)
33
33
  builder (~> 3.1)
34
34
  erubi (~> 1.4)
35
35
  rails-dom-testing (~> 2.0)
36
36
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
37
- activejob (5.2.1)
38
- activesupport (= 5.2.1)
37
+ activejob (5.2.2.1)
38
+ activesupport (= 5.2.2.1)
39
39
  globalid (>= 0.3.6)
40
- activemodel (5.2.1)
41
- activesupport (= 5.2.1)
42
- activerecord (5.2.1)
43
- activemodel (= 5.2.1)
44
- activesupport (= 5.2.1)
40
+ activemodel (5.2.2.1)
41
+ activesupport (= 5.2.2.1)
42
+ activerecord (5.2.2.1)
43
+ activemodel (= 5.2.2.1)
44
+ activesupport (= 5.2.2.1)
45
45
  arel (>= 9.0)
46
- activestorage (5.2.1)
47
- actionpack (= 5.2.1)
48
- activerecord (= 5.2.1)
46
+ activestorage (5.2.2.1)
47
+ actionpack (= 5.2.2.1)
48
+ activerecord (= 5.2.2.1)
49
49
  marcel (~> 0.3.1)
50
- activesupport (5.2.1)
50
+ activesupport (5.2.2.1)
51
51
  concurrent-ruby (~> 1.0, >= 1.0.2)
52
52
  i18n (>= 0.7, < 2)
53
53
  minitest (~> 5.1)
54
54
  tzinfo (~> 1.1)
55
+ addressable (2.6.0)
56
+ public_suffix (>= 2.0.2, < 4.0)
55
57
  appraisal (2.2.0)
56
58
  bundler
57
59
  rake
58
60
  thor (>= 0.14.0)
59
61
  arel (9.0.0)
60
- aws-eventstream (1.0.1)
61
- aws-partitions (1.140.0)
62
- aws-sdk-core (3.46.2)
63
- aws-eventstream (~> 1.0)
62
+ aws-eventstream (1.0.2)
63
+ aws-partitions (1.144.0)
64
+ aws-sdk-core (3.48.0)
65
+ aws-eventstream (~> 1.0, >= 1.0.2)
64
66
  aws-partitions (~> 1.0)
65
- aws-sigv4 (~> 1.0)
67
+ aws-sigv4 (~> 1.1)
66
68
  jmespath (~> 1.0)
67
- aws-sdk-kms (1.13.0)
68
- aws-sdk-core (~> 3, >= 3.39.0)
69
- aws-sigv4 (~> 1.0)
70
- aws-sdk-s3 (1.30.1)
71
- aws-sdk-core (~> 3, >= 3.39.0)
69
+ aws-sdk-kms (1.15.0)
70
+ aws-sdk-core (~> 3, >= 3.48.0)
71
+ aws-sigv4 (~> 1.1)
72
+ aws-sdk-s3 (1.33.0)
73
+ aws-sdk-core (~> 3, >= 3.48.0)
72
74
  aws-sdk-kms (~> 1)
73
75
  aws-sigv4 (~> 1.0)
74
- aws-sigv4 (1.0.3)
76
+ aws-sigv4 (1.1.0)
77
+ aws-eventstream (~> 1.0, >= 1.0.2)
75
78
  builder (3.2.3)
76
- byebug (10.0.2)
79
+ byebug (11.0.1)
77
80
  coderay (1.1.2)
78
- concurrent-ruby (1.1.3)
81
+ concurrent-ruby (1.1.5)
82
+ crack (0.4.3)
83
+ safe_yaml (~> 1.0.0)
79
84
  crass (1.0.4)
80
85
  diff-lcs (1.3)
81
- erubi (1.7.1)
86
+ erubi (1.8.0)
82
87
  excon (0.62.0)
83
88
  fog-aws (2.0.1)
84
89
  fog-core (~> 1.38)
@@ -96,9 +101,10 @@ GEM
96
101
  fog-core
97
102
  nokogiri (>= 1.5.11, < 2.0.0)
98
103
  formatador (0.2.5)
99
- globalid (0.4.1)
104
+ globalid (0.4.2)
100
105
  activesupport (>= 4.2.0)
101
- i18n (1.1.1)
106
+ hashdiff (0.3.8)
107
+ i18n (1.6.0)
102
108
  concurrent-ruby (~> 1.0)
103
109
  ipaddress (0.8.3)
104
110
  jmespath (1.4.0)
@@ -113,44 +119,45 @@ GEM
113
119
  mime-types (3.2.2)
114
120
  mime-types-data (~> 3.2015)
115
121
  mime-types-data (3.2018.0812)
116
- mimemagic (0.3.2)
122
+ mimemagic (0.3.3)
117
123
  mini_mime (1.0.1)
118
- mini_portile2 (2.3.0)
124
+ mini_portile2 (2.4.0)
119
125
  minitest (5.11.3)
120
126
  multi_json (1.13.1)
121
127
  nio4r (2.3.1)
122
- nokogiri (1.8.5)
123
- mini_portile2 (~> 2.3.0)
128
+ nokogiri (1.10.1)
129
+ mini_portile2 (~> 2.4.0)
124
130
  pry (0.12.2)
125
131
  coderay (~> 1.1.0)
126
132
  method_source (~> 0.9.0)
127
- pry-byebug (3.6.0)
128
- byebug (~> 10.0)
133
+ pry-byebug (3.7.0)
134
+ byebug (~> 11.0)
129
135
  pry (~> 0.10)
136
+ public_suffix (3.0.3)
130
137
  rack (2.0.6)
131
138
  rack-test (1.1.0)
132
139
  rack (>= 1.0, < 3)
133
- rails (5.2.1)
134
- actioncable (= 5.2.1)
135
- actionmailer (= 5.2.1)
136
- actionpack (= 5.2.1)
137
- actionview (= 5.2.1)
138
- activejob (= 5.2.1)
139
- activemodel (= 5.2.1)
140
- activerecord (= 5.2.1)
141
- activestorage (= 5.2.1)
142
- activesupport (= 5.2.1)
140
+ rails (5.2.2.1)
141
+ actioncable (= 5.2.2.1)
142
+ actionmailer (= 5.2.2.1)
143
+ actionpack (= 5.2.2.1)
144
+ actionview (= 5.2.2.1)
145
+ activejob (= 5.2.2.1)
146
+ activemodel (= 5.2.2.1)
147
+ activerecord (= 5.2.2.1)
148
+ activestorage (= 5.2.2.1)
149
+ activesupport (= 5.2.2.1)
143
150
  bundler (>= 1.3.0)
144
- railties (= 5.2.1)
151
+ railties (= 5.2.2.1)
145
152
  sprockets-rails (>= 2.0.0)
146
153
  rails-dom-testing (2.0.3)
147
154
  activesupport (>= 4.2.0)
148
155
  nokogiri (>= 1.6)
149
156
  rails-html-sanitizer (1.0.4)
150
157
  loofah (~> 2.2, >= 2.2.2)
151
- railties (5.2.1)
152
- actionpack (= 5.2.1)
153
- activesupport (= 5.2.1)
158
+ railties (5.2.2.1)
159
+ actionpack (= 5.2.2.1)
160
+ activesupport (= 5.2.2.1)
154
161
  method_source
155
162
  rake (>= 0.8.7)
156
163
  thor (>= 0.19.0, < 2.0)
@@ -167,7 +174,7 @@ GEM
167
174
  rspec-mocks (3.8.0)
168
175
  diff-lcs (>= 1.2.0, < 2.0)
169
176
  rspec-support (~> 3.8.0)
170
- rspec-rails (3.8.1)
177
+ rspec-rails (3.8.2)
171
178
  actionpack (>= 3.0)
172
179
  activesupport (>= 3.0)
173
180
  railties (>= 3.0)
@@ -176,6 +183,7 @@ GEM
176
183
  rspec-mocks (~> 3.8.0)
177
184
  rspec-support (~> 3.8.0)
178
185
  rspec-support (3.8.0)
186
+ safe_yaml (1.0.5)
179
187
  sprockets (3.7.2)
180
188
  concurrent-ruby (~> 1.0)
181
189
  rack (> 1, < 3)
@@ -188,6 +196,10 @@ GEM
188
196
  timecop (0.9.1)
189
197
  tzinfo (1.2.5)
190
198
  thread_safe (~> 0.1)
199
+ webmock (3.5.1)
200
+ addressable (>= 2.3.6)
201
+ crack (>= 0.3.2)
202
+ hashdiff
191
203
  websocket-driver (0.7.0)
192
204
  websocket-extensions (>= 0.1.0)
193
205
  websocket-extensions (0.1.3)
@@ -199,12 +211,13 @@ DEPENDENCIES
199
211
  appraisal (~> 2.2, >= 2.2.0)
200
212
  bundler (~> 1.15)
201
213
  pry-byebug (~> 3)
202
- rails (= 5.2.1)
214
+ rails (= 5.2.2.1)
203
215
  rake (~> 10.0)
204
216
  rspec (~> 3.0)
205
217
  rspec-rails
206
218
  timecop (~> 0.9)
207
219
  tp_common!
220
+ webmock
208
221
 
209
222
  BUNDLED WITH
210
- 1.16.2
223
+ 1.16.6
@@ -4,15 +4,12 @@ module TpCommon
4
4
  module AssetLoaders
5
5
  module PackagePathProviders
6
6
  class Development < Production
7
- DEVELOPMENT_CDN = 'http://localhost:3001'
8
-
9
7
  def asset_url(package_name, version, asset)
10
- @development ||= head("#{DEVELOPMENT_CDN}/_ping")
11
- if @development
12
- return "#{cdn(package_name, version)}/#{asset}"
8
+ if !head("#{@dev_cdn}/#{package_name}/_ping")
9
+ return super(package_name, version, asset)
13
10
  end
14
11
 
15
- super(package_name, version, asset)
12
+ "#{@dev_cdn}/#{package_name}/#{asset}"
16
13
  end
17
14
 
18
15
  private
@@ -2,12 +2,23 @@ module TpCommon
2
2
  module AssetLoaders
3
3
  module PackagePathProviders
4
4
  class Production
5
- def initialize(default_cdn)
5
+ def initialize(default_cdn, _dev_cdn = nil)
6
6
  @default_cdn = default_cdn
7
+ @dev_cdn = _dev_cdn
8
+
9
+ @cache = Hash.new do |current_hash, key|
10
+ current_hash[key] = key.to_s.split('.').insert(-2, 'min').join('.')
11
+ end
7
12
  end
8
13
 
9
14
  def asset_url(package_name, version, asset)
10
- "#{cdn(package_name, version)}/#{asset.to_s.split('.').insert(-2, 'min').join('.')}"
15
+ @cache[key(package_name, version, asset)]
16
+ end
17
+
18
+ private
19
+
20
+ def key(package_name, version, asset)
21
+ "#{@default_cdn}/spa/#{package_name}/#{version}/#{asset}".to_sym
11
22
  end
12
23
  end
13
24
  end
@@ -18,6 +18,8 @@ module TpCommon
18
18
  # ```
19
19
  # TpCommon::AssetLoaders::RemoteAssetsLoader.configure do |config|
20
20
  # config.cdn = 'https://other.hotter.cdn'
21
+ # # And for development mode, add more
22
+ # config.dev_cdn = 'http://app.lvh.me:3001'
21
23
  # end
22
24
  # # Load a package. This is required.
23
25
  # TpCommon::AssetLoaders::RemoteAssetsLoader.load(:'any-spa', 'v1.0.0')
@@ -29,7 +31,7 @@ module TpCommon
29
31
  # ```
30
32
  class RemoteAssetsLoader
31
33
  DEFAULT_CDN = 'https://cdn.tinypulse.com/spa'
32
- LoaderConfiguration = Struct.new(:cdn, :package_path_provider)
34
+ LoaderConfiguration = Struct.new(:cdn, :dev_cdn, :package_path_provider)
33
35
 
34
36
  class << self
35
37
  # Configure RemoteAssetsLoader, for now, only :cdn is supported
@@ -41,7 +43,7 @@ module TpCommon
41
43
  def configure
42
44
  yield(config)
43
45
 
44
- config.package_path_provider = TpCommon::AssetLoaders::ProviderClass.new(config.cdn)
46
+ config.package_path_provider = TpCommon::AssetLoaders::ProviderClass.new(config.cdn, config.dev_cdn)
45
47
  end
46
48
 
47
49
  # Load a package (SPA) with specific version to use.
@@ -99,8 +101,6 @@ module TpCommon
99
101
  def initialize(package_name, version)
100
102
  @package_name = package_name
101
103
  @version = version
102
-
103
- @cached_assets = Hash.new { |hash, key| hash[key] = RemoteAssetsLoader.asset_url(@package_name, @version, key.to_s) }
104
104
  end
105
105
 
106
106
  def [](asset_name)
@@ -108,7 +108,7 @@ module TpCommon
108
108
  # NOTE: [AV] It's secure to check this asset url exists by Net::HTTP then try more than 1 cdn.
109
109
  # but DONT DO IT. Using unavailable spa version/cdn is a SERIOUS problem need to solve, not auto-recovery
110
110
  # beside, this url will be called every page hit, so any milisecond are counted.
111
- @cached_assets[asset_name]
111
+ RemoteAssetsLoader.asset_url(@package_name, @version, asset_name)
112
112
  end
113
113
  end
114
114
  end
@@ -1,3 +1,3 @@
1
1
  module TpCommon
2
- VERSION = "0.4.3.pre1"
2
+ VERSION = "0.4.3.pre2"
3
3
  end
data/tp_common.gemspec CHANGED
@@ -34,9 +34,10 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency "pry-byebug", '~> 3'
35
35
  spec.add_development_dependency "timecop", '~> 0.9'
36
36
  spec.add_development_dependency "appraisal", '~> 2.2', '>= 2.2.0'
37
+ spec.add_development_dependency "webmock"
37
38
 
38
39
  spec.add_runtime_dependency "tzinfo", '~> 1.2', '>= 1.2.0'
39
- spec.add_runtime_dependency "activesupport", '<= 5.2.1', '>= 4.2.0'
40
+ spec.add_runtime_dependency "activesupport", '< 6.0', '>= 4.2.0'
40
41
  spec.add_runtime_dependency 'fog-aws', '~> 2.0'
41
42
  # fog-aws need a mime-type tool
42
43
  spec.add_runtime_dependency 'mime-types', '~> 3.2'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tp_common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3.pre1
4
+ version: 0.4.3.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TINYpulse Devops
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-22 00:00:00.000000000 Z
11
+ date: 2019-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -100,6 +100,20 @@ dependencies:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
102
  version: '2.2'
103
+ - !ruby/object:Gem::Dependency
104
+ name: webmock
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
103
117
  - !ruby/object:Gem::Dependency
104
118
  name: tzinfo
105
119
  requirement: !ruby/object:Gem::Requirement
@@ -127,9 +141,9 @@ dependencies:
127
141
  - - ">="
128
142
  - !ruby/object:Gem::Version
129
143
  version: 4.2.0
130
- - - "<="
144
+ - - "<"
131
145
  - !ruby/object:Gem::Version
132
- version: 5.2.1
146
+ version: '6.0'
133
147
  type: :runtime
134
148
  prerelease: false
135
149
  version_requirements: !ruby/object:Gem::Requirement
@@ -137,9 +151,9 @@ dependencies:
137
151
  - - ">="
138
152
  - !ruby/object:Gem::Version
139
153
  version: 4.2.0
140
- - - "<="
154
+ - - "<"
141
155
  - !ruby/object:Gem::Version
142
- version: 5.2.1
156
+ version: '6.0'
143
157
  - !ruby/object:Gem::Dependency
144
158
  name: fog-aws
145
159
  requirement: !ruby/object:Gem::Requirement
@@ -255,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
269
  - !ruby/object:Gem::Version
256
270
  version: 1.3.1
257
271
  requirements: []
258
- rubygems_version: 3.0.2
272
+ rubygems_version: 3.0.3
259
273
  signing_key:
260
274
  specification_version: 4
261
275
  summary: Common libraries used for TINYpulse apps