spark-component 1.0.0 → 1.0.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: e238b4f6fdf5790b5c1af6508280abe06b9287c67fd868f7bfcbf40a35526b5c
4
- data.tar.gz: d9be6f0ce11e582469675237ffd69e7a6110ca7ede62d18d5c80a9b252e90a95
3
+ metadata.gz: 707be6971c26fd122f03a9da00e0396b2b6cb5eaac221ce27a94a884e865b2db
4
+ data.tar.gz: 375416e9a317b550911aaabf4509cb6eb8e827aa8b39bad7987808cb452c0829
5
5
  SHA512:
6
- metadata.gz: 3564bec7086d861f8419b6184b8ec1ad01c1b9ba3ddba2e723f808692db50949d3e9850961ae5027f57ada0b4edfc741d2d21445312e7a59a418972f99457d39
7
- data.tar.gz: 8d03274b9b754a0a4c28c8a1f2e18fdbffe7780096853833cd47de23a495fdf6657f1adbd5dad8f84370ab8045b2912cf4e3eff2fde93acc2a33f7f317455417
6
+ metadata.gz: 870ddc6e2e84950a12f59525294f00f8968f9e75ce52631fc9a029d4a51cd7f80cd911e69372c060a13c08dfae13567634d6f12469da5e62755c7d2dfb5f16c3
7
+ data.tar.gz: 483b152823ed0f681257b826451747c4aa2e26497e350bb30231ea6fd593a7f9ff5971093ed6a7b2c6807590f31e37a9bfbb9033721dd242f4d90f66cc474f95
@@ -0,0 +1,20 @@
1
+ name: Ruby
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@v1
12
+ - name: Set up Ruby 2.6
13
+ uses: actions/setup-ruby@v1
14
+ with:
15
+ ruby-version: 2.6.x
16
+ - name: Build and test with Rake
17
+ run: |
18
+ gem install bundler
19
+ bundle install --jobs 4 --retry 3
20
+ bundle exec rake
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v1.0.1 - 2020-01-08
2
+
3
+ - Fix: added `deep_compact` to Attr and TagAttr to ensure that `nil` or `empty?` objects are ignored.
4
+
1
5
  # v1.0.0 - 2019-12-18
2
6
 
3
7
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spark-component (1.0.0)
4
+ spark-component (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -42,7 +42,7 @@ GEM
42
42
  erubi (~> 1.4)
43
43
  rails-dom-testing (~> 2.0)
44
44
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
45
- actionview-component (1.5.3)
45
+ actionview-component (1.6.1)
46
46
  activejob (6.0.1)
47
47
  activesupport (= 6.0.1)
48
48
  globalid (>= 0.3.6)
@@ -99,7 +99,7 @@ GEM
99
99
  pry-byebug (3.7.0)
100
100
  byebug (~> 11.0)
101
101
  pry (~> 0.10)
102
- rack (2.0.7)
102
+ rack (2.0.8)
103
103
  rack-test (1.1.0)
104
104
  rack (>= 1.0, < 3)
105
105
  rails (6.0.1)
@@ -11,6 +11,7 @@ module Spark
11
11
  def add(hash)
12
12
  return self if hash.nil? || hash.keys.empty?
13
13
 
14
+ deep_compact!(hash)
14
15
  dasherize_keys(hash)
15
16
  merge!(hash)
16
17
  self
@@ -32,6 +33,17 @@ module Spark
32
33
 
33
34
  private
34
35
 
36
+ def deep_compact!(hash)
37
+ hash.replace(deep_compact(hash))
38
+ end
39
+
40
+ def deep_compact(hash)
41
+ hash.select do |key, val|
42
+ val = deep_compact(val) if val.is_a?(Hash)
43
+ !(val.nil? || val.respond_to?(:empty?) && val.empty?)
44
+ end
45
+ end
46
+
35
47
  def dasherize_keys(hash)
36
48
  hash.merge!(hash.keys.each_with_object({}) do |key, obj|
37
49
  obj[key.to_s.gsub(/[\W_]+/, "-")] = hash.delete(key) if key.to_s.include?("_")
@@ -9,6 +9,8 @@ module Spark
9
9
  def add(hash)
10
10
  return self if hash.nil? || hash.keys.empty?
11
11
 
12
+ deep_compact!(hash)
13
+
12
14
  # Extract keys for special properties
13
15
  extracted = {
14
16
  aria: hash.delete(:aria),
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Spark
4
4
  module Component
5
- VERSION = "1.0.0"
5
+ VERSION = "1.0.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spark-component
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-18 00:00:00.000000000 Z
11
+ date: 2020-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview-component
@@ -115,6 +115,7 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
+ - ".github/workflows/ruby.yml"
118
119
  - ".gitignore"
119
120
  - ".rubocop.yml"
120
121
  - CHANGELOG.md