vanity 4.0.2 → 4.0.4

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.
@@ -7,100 +7,132 @@ GIT
7
7
  PATH
8
8
  remote: ..
9
9
  specs:
10
- vanity (4.0.2)
10
+ vanity (4.0.4)
11
11
  i18n
12
12
 
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
- RedCloth (4.2.9)
17
- RedCloth (4.2.9-java)
18
- actioncable (5.2.0)
19
- actionpack (= 5.2.0)
16
+ RedCloth (4.3.2)
17
+ actioncable (6.1.6.1)
18
+ actionpack (= 6.1.6.1)
19
+ activesupport (= 6.1.6.1)
20
20
  nio4r (~> 2.0)
21
21
  websocket-driver (>= 0.6.1)
22
- actionmailer (5.2.0)
23
- actionpack (= 5.2.0)
24
- actionview (= 5.2.0)
25
- activejob (= 5.2.0)
22
+ actionmailbox (6.1.6.1)
23
+ actionpack (= 6.1.6.1)
24
+ activejob (= 6.1.6.1)
25
+ activerecord (= 6.1.6.1)
26
+ activestorage (= 6.1.6.1)
27
+ activesupport (= 6.1.6.1)
28
+ mail (>= 2.7.1)
29
+ actionmailer (6.1.6.1)
30
+ actionpack (= 6.1.6.1)
31
+ actionview (= 6.1.6.1)
32
+ activejob (= 6.1.6.1)
33
+ activesupport (= 6.1.6.1)
26
34
  mail (~> 2.5, >= 2.5.4)
27
35
  rails-dom-testing (~> 2.0)
28
- actionpack (5.2.0)
29
- actionview (= 5.2.0)
30
- activesupport (= 5.2.0)
31
- rack (~> 2.0)
36
+ actionpack (6.1.6.1)
37
+ actionview (= 6.1.6.1)
38
+ activesupport (= 6.1.6.1)
39
+ rack (~> 2.0, >= 2.0.9)
32
40
  rack-test (>= 0.6.3)
33
41
  rails-dom-testing (~> 2.0)
34
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
35
- actionview (5.2.0)
36
- activesupport (= 5.2.0)
42
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
43
+ actiontext (6.1.6.1)
44
+ actionpack (= 6.1.6.1)
45
+ activerecord (= 6.1.6.1)
46
+ activestorage (= 6.1.6.1)
47
+ activesupport (= 6.1.6.1)
48
+ nokogiri (>= 1.8.5)
49
+ actionview (6.1.6.1)
50
+ activesupport (= 6.1.6.1)
37
51
  builder (~> 3.1)
38
52
  erubi (~> 1.4)
39
53
  rails-dom-testing (~> 2.0)
40
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
41
- activejob (5.2.0)
42
- activesupport (= 5.2.0)
54
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
55
+ activejob (6.1.6.1)
56
+ activesupport (= 6.1.6.1)
43
57
  globalid (>= 0.3.6)
44
- activemodel (5.2.0)
45
- activesupport (= 5.2.0)
46
- activerecord (5.2.0)
47
- activemodel (= 5.2.0)
48
- activesupport (= 5.2.0)
49
- arel (>= 9.0)
50
- activerecord-jdbc-adapter (52.8-java)
51
- activerecord (~> 5.2.0)
52
- activestorage (5.2.0)
53
- actionpack (= 5.2.0)
54
- activerecord (= 5.2.0)
55
- marcel (~> 0.3.1)
56
- activesupport (5.2.0)
58
+ activemodel (6.1.6.1)
59
+ activesupport (= 6.1.6.1)
60
+ activerecord (6.1.6.1)
61
+ activemodel (= 6.1.6.1)
62
+ activesupport (= 6.1.6.1)
63
+ activestorage (6.1.6.1)
64
+ actionpack (= 6.1.6.1)
65
+ activejob (= 6.1.6.1)
66
+ activerecord (= 6.1.6.1)
67
+ activesupport (= 6.1.6.1)
68
+ marcel (~> 1.0)
69
+ mini_mime (>= 1.1.0)
70
+ activesupport (6.1.6.1)
57
71
  concurrent-ruby (~> 1.0, >= 1.0.2)
58
- i18n (>= 0.7, < 2)
59
- minitest (~> 5.1)
60
- tzinfo (~> 1.1)
61
- addressable (2.5.2)
62
- public_suffix (>= 2.0.2, < 4.0)
63
- appraisal (2.0.2)
72
+ i18n (>= 1.6, < 2)
73
+ minitest (>= 5.1)
74
+ tzinfo (~> 2.0)
75
+ zeitwerk (~> 2.3)
76
+ addressable (2.8.0)
77
+ public_suffix (>= 2.0.2, < 5.0)
78
+ appraisal (2.4.1)
64
79
  bundler
65
80
  rake
66
81
  thor (>= 0.14.0)
67
- arel (9.0.0)
68
82
  ast (2.4.2)
69
83
  blankslate (2.1.2.4)
70
- bson (4.3.0)
71
- bson (4.3.0-java)
72
- builder (3.2.3)
73
- classifier-reborn (2.2.0)
84
+ bson (4.15.0)
85
+ builder (3.2.4)
86
+ classifier-reborn (2.3.0)
74
87
  fast-stemmer (~> 1.0)
75
- coderay (1.1.2)
88
+ matrix (~> 0.4)
89
+ coderay (1.1.3)
76
90
  coffee-script (2.4.1)
77
91
  coffee-script-source
78
92
  execjs
79
- coffee-script-source (1.11.1)
93
+ coffee-script-source (1.12.2)
80
94
  colorator (0.1)
81
- concurrent-ruby (1.0.5)
82
- concurrent-ruby (1.0.5-java)
83
- crack (0.4.3)
84
- safe_yaml (~> 1.0.0)
85
- crass (1.0.4)
86
- erubi (1.7.1)
87
- execjs (2.7.0)
88
- fakefs (0.18.0)
89
- faraday (0.15.2)
90
- multipart-post (>= 1.2, < 3)
95
+ concurrent-ruby (1.1.10)
96
+ crack (0.4.5)
97
+ rexml
98
+ crass (1.0.6)
99
+ erubi (1.10.0)
100
+ execjs (2.8.1)
101
+ fakefs (1.8.0)
102
+ faraday (1.10.0)
103
+ faraday-em_http (~> 1.0)
104
+ faraday-em_synchrony (~> 1.0)
105
+ faraday-excon (~> 1.1)
106
+ faraday-httpclient (~> 1.0)
107
+ faraday-multipart (~> 1.0)
108
+ faraday-net_http (~> 1.0)
109
+ faraday-net_http_persistent (~> 1.0)
110
+ faraday-patron (~> 1.0)
111
+ faraday-rack (~> 1.0)
112
+ faraday-retry (~> 1.0)
113
+ ruby2_keywords (>= 0.0.4)
114
+ faraday-em_http (1.0.0)
115
+ faraday-em_synchrony (1.0.0)
116
+ faraday-excon (1.1.0)
117
+ faraday-httpclient (1.0.1)
118
+ faraday-multipart (1.0.4)
119
+ multipart-post (~> 2)
120
+ faraday-net_http (1.0.1)
121
+ faraday-net_http_persistent (1.2.0)
122
+ faraday-patron (1.0.0)
123
+ faraday-rack (1.0.0)
124
+ faraday-retry (1.0.3)
91
125
  fast-stemmer (1.0.2)
92
126
  ffi (1.15.5)
93
- ffi (1.15.5-java)
94
127
  garb (0.9.1)
95
128
  activesupport (>= 2.2.0)
96
129
  crack (>= 0.1.6)
97
- globalid (0.4.1)
98
- activesupport (>= 4.2.0)
99
- hashdiff (0.3.7)
100
- i18n (1.0.1)
130
+ globalid (1.0.0)
131
+ activesupport (>= 5.0)
132
+ hashdiff (1.0.1)
133
+ i18n (1.11.0)
101
134
  concurrent-ruby (~> 1.0)
102
135
  integration (0.1.0)
103
- jdbc-sqlite3 (3.28.0)
104
136
  jekyll (2.5.3)
105
137
  classifier-reborn (~> 2.0)
106
138
  colorator (~> 0.1)
@@ -116,9 +148,9 @@ GEM
116
148
  redcarpet (~> 3.1)
117
149
  safe_yaml (~> 1.0)
118
150
  toml (~> 0.1.0)
119
- jekyll-coffeescript (1.1.1)
151
+ jekyll-coffeescript (1.2.2)
120
152
  coffee-script (~> 2.2)
121
- coffee-script-source (~> 1.11.1)
153
+ coffee-script-source (~> 1.12)
122
154
  jekyll-gist (1.5.0)
123
155
  octokit (~> 4.2)
124
156
  jekyll-paginate (1.1.0)
@@ -128,97 +160,88 @@ GEM
128
160
  listen (~> 3.0)
129
161
  kramdown (1.17.0)
130
162
  liquid (2.6.3)
131
- listen (3.1.5)
132
- rb-fsevent (~> 0.9, >= 0.9.4)
133
- rb-inotify (~> 0.9, >= 0.9.7)
134
- ruby_dep (~> 1.2)
135
- loofah (2.2.2)
163
+ listen (3.7.1)
164
+ rb-fsevent (~> 0.10, >= 0.10.3)
165
+ rb-inotify (~> 0.9, >= 0.9.10)
166
+ loofah (2.18.0)
136
167
  crass (~> 1.0.2)
137
168
  nokogiri (>= 1.5.9)
138
- mail (2.7.0)
169
+ mail (2.7.1)
139
170
  mini_mime (>= 0.1.1)
140
- marcel (0.3.3)
141
- mimemagic (~> 0.3.2)
171
+ marcel (1.0.2)
172
+ matrix (0.4.2)
142
173
  mercenary (0.3.6)
143
- method_source (0.9.0)
144
- mimemagic (0.3.10)
145
- nokogiri (~> 1)
146
- rake
147
- mini_mime (1.0.0)
174
+ method_source (1.0.0)
175
+ mini_mime (1.1.2)
148
176
  mini_portile2 (2.6.1)
149
- minitest (5.11.3)
150
- mocha (1.13.0)
151
- mongo (2.6.1)
152
- bson (>= 4.3.0, < 5.0.0)
153
- multipart-post (2.0.0)
154
- nio4r (2.3.1)
155
- nio4r (2.3.1-java)
177
+ minitest (5.15.0)
178
+ mocha (1.14.0)
179
+ mongo (2.17.1)
180
+ bson (>= 4.8.2, < 5.0.0)
181
+ multipart-post (2.2.3)
182
+ nio4r (2.5.8)
156
183
  nokogiri (1.12.5)
157
184
  mini_portile2 (~> 2.6.1)
158
185
  racc (~> 1.4)
159
- nokogiri (1.12.5-java)
160
- racc (~> 1.4)
161
- octokit (4.9.0)
162
- sawyer (~> 0.8.0, >= 0.5.3)
163
- parallel (1.21.0)
164
- parser (3.1.1.0)
186
+ octokit (4.25.1)
187
+ faraday (>= 1, < 3)
188
+ sawyer (~> 0.9)
189
+ parallel (1.22.1)
190
+ parser (3.1.2.0)
165
191
  ast (~> 2.4.1)
166
192
  parslet (1.5.0)
167
193
  blankslate (~> 2.0)
168
- passenger (6.0.12)
194
+ passenger (6.0.14)
169
195
  rack
170
196
  rake (>= 0.8.1)
171
- posix-spawn (0.3.13)
172
- pry (0.11.3)
173
- coderay (~> 1.1.0)
174
- method_source (~> 0.9.0)
175
- pry (0.11.3-java)
176
- coderay (~> 1.1.0)
177
- method_source (~> 0.9.0)
178
- spoon (~> 0.0)
179
- public_suffix (3.0.2)
197
+ posix-spawn (0.3.15)
198
+ pry (0.14.1)
199
+ coderay (~> 1.1)
200
+ method_source (~> 1.0)
201
+ public_suffix (4.0.7)
180
202
  pygments.rb (0.6.3)
181
203
  posix-spawn (~> 0.3.6)
182
204
  yajl-ruby (~> 1.2.0)
183
205
  racc (1.6.0)
184
- racc (1.6.0-java)
185
- rack (2.2.3)
186
- rack-test (1.1.0)
187
- rack (>= 1.0, < 3)
188
- rails (5.2.0)
189
- actioncable (= 5.2.0)
190
- actionmailer (= 5.2.0)
191
- actionpack (= 5.2.0)
192
- actionview (= 5.2.0)
193
- activejob (= 5.2.0)
194
- activemodel (= 5.2.0)
195
- activerecord (= 5.2.0)
196
- activestorage (= 5.2.0)
197
- activesupport (= 5.2.0)
198
- bundler (>= 1.3.0)
199
- railties (= 5.2.0)
206
+ rack (2.2.4)
207
+ rack-test (2.0.2)
208
+ rack (>= 1.3)
209
+ rails (6.1.6.1)
210
+ actioncable (= 6.1.6.1)
211
+ actionmailbox (= 6.1.6.1)
212
+ actionmailer (= 6.1.6.1)
213
+ actionpack (= 6.1.6.1)
214
+ actiontext (= 6.1.6.1)
215
+ actionview (= 6.1.6.1)
216
+ activejob (= 6.1.6.1)
217
+ activemodel (= 6.1.6.1)
218
+ activerecord (= 6.1.6.1)
219
+ activestorage (= 6.1.6.1)
220
+ activesupport (= 6.1.6.1)
221
+ bundler (>= 1.15.0)
222
+ railties (= 6.1.6.1)
200
223
  sprockets-rails (>= 2.0.0)
201
224
  rails-dom-testing (2.0.3)
202
225
  activesupport (>= 4.2.0)
203
226
  nokogiri (>= 1.6)
204
- rails-html-sanitizer (1.0.4)
205
- loofah (~> 2.2, >= 2.2.2)
206
- railties (5.2.0)
207
- actionpack (= 5.2.0)
208
- activesupport (= 5.2.0)
227
+ rails-html-sanitizer (1.4.3)
228
+ loofah (~> 2.3)
229
+ railties (6.1.6.1)
230
+ actionpack (= 6.1.6.1)
231
+ activesupport (= 6.1.6.1)
209
232
  method_source
210
- rake (>= 0.8.7)
211
- thor (>= 0.18.1, < 2.0)
233
+ rake (>= 12.2)
234
+ thor (~> 1.0)
212
235
  rainbow (3.1.1)
213
236
  rake (13.0.6)
214
- rb-fsevent (0.10.3)
215
- rb-inotify (0.9.10)
216
- ffi (>= 0.5.0, < 2)
217
- redcarpet (3.4.0)
218
- redis (4.6.0)
237
+ rb-fsevent (0.11.1)
238
+ rb-inotify (0.10.1)
239
+ ffi (~> 1.0)
240
+ redcarpet (3.5.1)
241
+ redis (4.7.1)
219
242
  redis-namespace (1.8.2)
220
243
  redis (>= 3.0.4)
221
- regexp_parser (2.2.1)
244
+ regexp_parser (2.5.0)
222
245
  rexml (3.2.5)
223
246
  rubocop (1.25.1)
224
247
  parallel (~> 1.10)
@@ -231,56 +254,52 @@ GEM
231
254
  unicode-display_width (>= 1.4.0, < 3.0)
232
255
  rubocop-ast (1.15.2)
233
256
  parser (>= 3.0.1.1)
234
- rubocop-performance (1.13.2)
257
+ rubocop-performance (1.13.3)
235
258
  rubocop (>= 1.7.0, < 2.0)
236
259
  rubocop-ast (>= 0.4.0)
237
- rubocop-rspec (2.8.0)
260
+ rubocop-rspec (2.10.0)
238
261
  rubocop (~> 1.19)
239
262
  ruby-progressbar (1.11.0)
240
- ruby_dep (1.5.0)
263
+ ruby2_keywords (0.0.5)
241
264
  rubystats (0.3.0)
242
- safe_yaml (1.0.4)
243
- sass (3.5.7)
265
+ safe_yaml (1.0.5)
266
+ sass (3.7.4)
244
267
  sass-listen (~> 4.0.0)
245
268
  sass-listen (4.0.0)
246
269
  rb-fsevent (~> 0.9, >= 0.9.4)
247
270
  rb-inotify (~> 0.9, >= 0.9.7)
248
- sawyer (0.8.1)
249
- addressable (>= 2.3.5, < 2.6)
250
- faraday (~> 0.8, < 1.0)
251
- spoon (0.0.6)
252
- ffi
253
- sprockets (3.7.2)
271
+ sawyer (0.9.2)
272
+ addressable (>= 2.3.5)
273
+ faraday (>= 0.17.3, < 3)
274
+ sprockets (4.1.1)
254
275
  concurrent-ruby (~> 1.0)
255
276
  rack (> 1, < 3)
256
- sprockets-rails (3.2.1)
257
- actionpack (>= 4.0)
258
- activesupport (>= 4.0)
277
+ sprockets-rails (3.4.2)
278
+ actionpack (>= 5.2)
279
+ activesupport (>= 5.2)
259
280
  sprockets (>= 3.0.0)
260
- sqlite3 (1.3.10)
261
- thor (0.20.0)
262
- thread_safe (0.3.6)
263
- thread_safe (0.3.6-java)
264
- timecop (0.9.1)
281
+ sqlite3 (1.4.4)
282
+ thor (1.2.1)
283
+ timecop (0.9.5)
265
284
  toml (0.1.2)
266
285
  parslet (~> 1.5.0)
267
- tzinfo (1.2.5)
268
- thread_safe (~> 0.1)
269
- unicode-display_width (2.1.0)
270
- webmock (3.4.2)
271
- addressable (>= 2.3.6)
286
+ tzinfo (2.0.4)
287
+ concurrent-ruby (~> 1.0)
288
+ unicode-display_width (2.2.0)
289
+ webmock (3.14.0)
290
+ addressable (>= 2.8.0)
272
291
  crack (>= 0.3.2)
273
- hashdiff
274
- websocket-driver (0.7.0)
275
- websocket-extensions (>= 0.1.0)
276
- websocket-driver (0.7.0-java)
292
+ hashdiff (>= 0.4.0, < 2.0.0)
293
+ webrick (1.7.0)
294
+ websocket-driver (0.7.5)
277
295
  websocket-extensions (>= 0.1.0)
278
- websocket-extensions (0.1.3)
296
+ websocket-extensions (0.1.5)
279
297
  yajl-ruby (1.2.3)
280
- yard (0.9.15)
298
+ yard (0.9.28)
299
+ webrick (~> 1.7.0)
300
+ zeitwerk (2.6.0)
281
301
 
282
302
  PLATFORMS
283
- java
284
303
  ruby
285
304
 
286
305
  DEPENDENCIES
@@ -300,19 +319,20 @@ DEPENDENCIES
300
319
  passenger
301
320
  pry
302
321
  rack
303
- rails (~> 5.2.0)
322
+ rails (~> 6.1.0)
304
323
  rake
305
324
  redis (>= 3.2.1)
306
325
  redis-namespace (>= 1.1.0)
307
- rubocop
326
+ rubocop (~> 1.25.1)
327
+ rubocop-ast (~> 1.15.2)
308
328
  rubocop-performance
309
329
  rubocop-rspec
310
330
  rubystats (>= 0.2.5)
311
- sqlite3 (~> 1.3.10)
331
+ sqlite3 (~> 1.4.0)
312
332
  timecop
313
333
  vanity!
314
334
  webmock
315
335
  yard
316
336
 
317
337
  BUNDLED WITH
318
- 1.17.3
338
+ 2.3.26
@@ -213,7 +213,7 @@ module Vanity
213
213
  file_path = File.join(config_path, file_name)
214
214
 
215
215
  if File.exist?(file_path) # rubocop:todo Style/GuardClause
216
- config = YAML.safe_load(ERB.new(File.read(file_path)).result, [], [], true)
216
+ config = SafeYAML.load(ERB.new(File.read(file_path)).result)
217
217
  config ||= {}
218
218
  params_for_environment = config[environment.to_s]
219
219
 
@@ -249,8 +249,9 @@ module Vanity
249
249
  def vanity_js
250
250
  return if Vanity.context.vanity_active_experiments.nil? || Vanity.context.vanity_active_experiments.empty?
251
251
 
252
+ template = File.read(Vanity.template("_vanity.js.erb"))
252
253
  javascript_tag do
253
- render file: Vanity.template("_vanity.js.erb"), formats: [:js]
254
+ ERB.new(template).result(binding)
254
255
  end
255
256
  end
256
257
 
@@ -0,0 +1,21 @@
1
+ require "yaml"
2
+
3
+ module Vanity
4
+ module SafeYAML
5
+ begin
6
+ YAML.safe_load("---", permitted_classes: [])
7
+ rescue ArgumentError
8
+ SUPPORTS_PERMITTED_CLASSES = false
9
+ else
10
+ SUPPORTS_PERMITTED_CLASSES = true
11
+ end
12
+
13
+ def self.load(payload)
14
+ if SUPPORTS_PERMITTED_CLASSES
15
+ YAML.safe_load(payload, permitted_classes: [], permitted_symbols: [], aliases: true)
16
+ else
17
+ YAML.safe_load(payload, [], [], true)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -1,5 +1,5 @@
1
1
  module Vanity
2
- VERSION = "4.0.2"
2
+ VERSION = "4.0.4"
3
3
 
4
4
  module Version
5
5
  version = VERSION.to_s.split(".").map { |i| i.to_i }
data/lib/vanity.rb CHANGED
@@ -17,6 +17,7 @@ module Vanity
17
17
  end
18
18
 
19
19
  require "vanity/version"
20
+ require "vanity/safe_yaml"
20
21
  # Metrics
21
22
  require "vanity/metric/base"
22
23
  require "vanity/metric/active_record"
@@ -203,7 +203,7 @@ if ENV["DB"] == "active_record"
203
203
  once = true
204
204
  end
205
205
  Sky.create!
206
- Sky.last.update_attributes height: 4
206
+ Sky.last.update height: 4
207
207
  end
208
208
 
209
209
  it "with after_save" do
@@ -226,7 +226,7 @@ if ENV["DB"] == "active_record"
226
226
  end
227
227
  Sky.create!
228
228
  (1..5).each do |height|
229
- Sky.last.update_attributes! height: height
229
+ Sky.last.update! height: height
230
230
  end
231
231
  assert_equal 2, times
232
232
  end
@@ -279,7 +279,7 @@ if ENV["DB"] == "active_record"
279
279
  (1..5).each do |height|
280
280
  Sky.create! height: height
281
281
  end
282
- Sky.first.update_attributes! height: 4
282
+ Sky.first.update! height: 4
283
283
  assert_equal 3, Vanity::Metric.data(metric(:sky_is_limit)).last.last
284
284
  end
285
285
 
data/test/test_helper.rb CHANGED
@@ -263,7 +263,11 @@ if ENV["DB"] == "active_record"
263
263
 
264
264
  migrate_path = File.expand_path('dummy/db/migrate', __dir__)
265
265
  if defined?(ActiveRecord::MigrationContext)
266
- ActiveRecord::MigrationContext.new(migrate_path).migrate
266
+ if ActiveRecord.version.release >= Gem::Version.new('6.0')
267
+ ActiveRecord::MigrationContext.new(migrate_path, ActiveRecord::SchemaMigration).migrate
268
+ else
269
+ ActiveRecord::MigrationContext.new(migrate_path).migrate
270
+ end
267
271
  else
268
272
  ActiveRecord::Migrator.migrate(migrate_path)
269
273
  end
data/vanity.gemspec CHANGED
@@ -13,7 +13,6 @@ Gem::Specification.new do |spec|
13
13
  spec.post_install_message = "To get started run vanity --help"
14
14
 
15
15
  spec.files = `git ls-files`.split("\n")
16
- spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
16
  spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
18
17
  spec.require_paths = ["lib"]
19
18