spark-component 1.0.0 → 1.0.1
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 +4 -4
- data/.github/workflows/ruby.yml +20 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +3 -3
- data/lib/spark/component/attr.rb +12 -0
- data/lib/spark/component/tag_attr.rb +2 -0
- data/lib/spark/component/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 707be6971c26fd122f03a9da00e0396b2b6cb5eaac221ce27a94a884e865b2db
|
4
|
+
data.tar.gz: 375416e9a317b550911aaabf4509cb6eb8e827aa8b39bad7987808cb452c0829
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
spark-component (1.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.
|
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.
|
102
|
+
rack (2.0.8)
|
103
103
|
rack-test (1.1.0)
|
104
104
|
rack (>= 1.0, < 3)
|
105
105
|
rails (6.0.1)
|
data/lib/spark/component/attr.rb
CHANGED
@@ -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?("_")
|
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.
|
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:
|
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
|