primer_view_components 0.0.75 → 0.0.76

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: 2b24af98e07ddbdb9a58c00863f08e992757fdff5d78deead36303cb21a6117c
4
- data.tar.gz: a8b5399ad8ab074aa44dcb45e262f736fa194376e231c91829febe1aeccb8582
3
+ metadata.gz: 2635afac7c52d9fff327adc5ae000e6feccd1c5d315d3cce099f09c6863f8c08
4
+ data.tar.gz: aa0b235e2ac2d48bc37793adb799b0662357b516768774cd82db8ff7ca76bc8f
5
5
  SHA512:
6
- metadata.gz: f89e95270c13e87a36c2c5404f2b70984b732a02535207251791c1afef7f9dc675f2ba4319b0831325b38966b22719fcfa814689c21f80bff5702b5328f5a31e
7
- data.tar.gz: d18e9a3e2c665f8d6828787e4e5a8ff78ccb6b4933827229ab0b09f1c0f791aa804c69dc85d390aaa7315daaad38be7fd61cc8635eeb6fa73c631c636e489df7
6
+ metadata.gz: 7a9d2f32a73ac1790ae1903532581fa1349728efdd261061fa9a50fb9e5973618a69e9a149f0894861cb069780a0fed78aeab981e15d3811a32c54583e497962
7
+ data.tar.gz: 0d7ffafa34ea38a5b97fc3d05ec55ea4b6fc43067b986dce17c5774a9c89b120cb2bf9a1033522c855b9d7dd49e1db8be1496fdbe22ac082c2887b5fcedbb6af
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.0.76
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1182](https://github.com/primer/view_components/pull/1182) [`33fc7907`](https://github.com/primer/view_components/commit/33fc7907b0476bebd1d2c54e3e9c335b5e12da3b) Thanks [@camertron](https://github.com/camertron)! - Adjust DeprecatedArguments cop to handle boolean values
8
+
9
+ * [#1179](https://github.com/primer/view_components/pull/1179) [`aa7afef2`](https://github.com/primer/view_components/commit/aa7afef27dff6baac2d98e23d47194fbfddbe181) Thanks [@maxbeizer](https://github.com/maxbeizer)! - Add `role` to system args docs.
10
+
11
+ - [#1180](https://github.com/primer/view_components/pull/1180) [`3dfcf015`](https://github.com/primer/view_components/commit/3dfcf015af0e301e54a15986cb114ccf84dd65d9) Thanks [@joelhawksley](https://github.com/joelhawksley)! - Upgrading view_component
12
+ - Bump to latest release of [view_component 2.56.0](https://github.com/github/view_component/releases/tag/v2.56.0).
13
+ - Remove dependency on the now-changed private `@rendered_component` api.
14
+
3
15
  ## 0.0.75
4
16
 
5
17
  ### Patch Changes
@@ -5,7 +5,7 @@ module Primer
5
5
  module VERSION
6
6
  MAJOR = 0
7
7
  MINOR = 0
8
- PATCH = 75
8
+ PATCH = 76
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH].join(".")
11
11
  end
@@ -33,8 +33,14 @@ module RuboCop
33
33
  # }
34
34
  #
35
35
  DEPRECATED = {
36
- is_label_inline: nil,
37
- with_icon: nil,
36
+ is_label_inline: {
37
+ true => nil,
38
+ false => nil
39
+ },
40
+ with_icon: {
41
+ true => nil,
42
+ false => nil
43
+ },
38
44
  is_label_visible: {
39
45
  false => "visually_hide_label: true",
40
46
  true => "visually_hide_label: false"
@@ -287,13 +293,10 @@ module RuboCop
287
293
  return unless kwargs.type == :hash
288
294
 
289
295
  kwargs.pairs.each do |pair|
290
- # Skip if we're not dealing with a symbol
296
+ # Skip if we're not dealing with a symbol key
291
297
  next if pair.key.type != :sym
292
- next unless pair.value.type == :sym || pair.value.type == :str
293
-
294
- key = pair.key.value
295
- value = pair.value.value.to_sym
296
298
 
299
+ key, value = extract_kv_from(pair)
297
300
  next unless DEPRECATED.key?(key) && DEPRECATED[key].key?(value)
298
301
 
299
302
  add_offense(pair, message: INVALID_MESSAGE)
@@ -302,10 +305,28 @@ module RuboCop
302
305
 
303
306
  def autocorrect(node)
304
307
  lambda do |corrector|
305
- replacement = DEPRECATED[node.key.value][node.value.value.to_sym]
308
+ key, value = extract_kv_from(node)
309
+ replacement = DEPRECATED[key][value]
306
310
  corrector.replace(node, replacement) if replacement.present?
307
311
  end
308
312
  end
313
+
314
+ def extract_kv_from(pair)
315
+ key = pair.key.value
316
+
317
+ # rubocop:disable Lint/BooleanSymbol
318
+ value = case pair.value.type
319
+ when :sym, :str
320
+ pair.value.value.to_sym
321
+ when :false, :true
322
+ pair.value.type == :true
323
+ else
324
+ return []
325
+ end
326
+ # rubocop:enable Lint/BooleanSymbol
327
+
328
+ [key, value]
329
+ end
309
330
  end
310
331
  end
311
332
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: primer_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.75
4
+ version: 0.0.76
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-31 00:00:00.000000000 Z
11
+ date: 2022-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -366,7 +366,7 @@ dependencies:
366
366
  - - "~>"
367
367
  - !ruby/object:Gem::Version
368
368
  version: 0.9.25
369
- description:
369
+ description:
370
370
  email:
371
371
  - opensource+primer_view_components@github.com
372
372
  executables: []
@@ -580,7 +580,7 @@ licenses:
580
580
  - MIT
581
581
  metadata:
582
582
  allowed_push_host: https://rubygems.org
583
- post_install_message:
583
+ post_install_message:
584
584
  rdoc_options: []
585
585
  require_paths:
586
586
  - lib
@@ -595,8 +595,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
595
595
  - !ruby/object:Gem::Version
596
596
  version: '0'
597
597
  requirements: []
598
- rubygems_version: 3.1.6
599
- signing_key:
598
+ rubygems_version: 3.2.22
599
+ signing_key:
600
600
  specification_version: 4
601
601
  summary: ViewComponents for the Primer Design System
602
602
  test_files: []