classnames-rails-view 1.1.1 → 2.0.0

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: f7b68268254790e28a671f42b1e53698404e6116101d6ff745dd25c12675fe09
4
- data.tar.gz: ff3f340df7174a36772d8abcea984b296803da59d632d2cf88713cd5835d1a4c
3
+ metadata.gz: 967a111319da073632bf349111353f6074e9ceb79e6f4d04c337c902ef147bc3
4
+ data.tar.gz: 8a2b9de3353e96b76ef19bd0e26b70fedda72cb01755629349d92198e4be7aaf
5
5
  SHA512:
6
- metadata.gz: dfdf1f88525e72f69455c2e507dfc4dcfd4db18a82b384d24344c0e775be292581893594273d4957da22ce6cf6c72632f8a0d6c3f05315799438f61e54cd6e13
7
- data.tar.gz: a49c0fe626d5ac42789bd4ee3000b8facc28cab34035c4d028b33e418dd2d3405d293d2e83d0da3f5092195569659db4b26f1ecc105715e1e3508998eb2b0fe5
6
+ metadata.gz: cbce757f98992d4255bfd4fc2db79ef5ff224a713d4ab6a243c1d540b7a7310835690270200dac9f42479078bc6381348910a947de708c985d1f6f3666c31cc0
7
+ data.tar.gz: fac01677b331fcfe91347cd1a0a317ed968b45036b8afba6f5186a2bd2f3f24c89274f2d697ceb825be3126ef51376c95374f674f47ceb3f0b45b0c0b88aee87
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require 'bundler/setup'
3
5
  rescue LoadError
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Classnames
2
4
  module Rails
3
5
  module View
@@ -19,4 +21,4 @@ module Classnames
19
21
  end
20
22
  end
21
23
 
22
- ActionView::Base.send :include, Classnames::Rails::View::Helper
24
+ ActionView::Base.include Classnames::Rails::View::Helper
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Classnames
2
4
  module Rails
3
5
  module View
@@ -10,9 +12,7 @@ module Classnames
10
12
 
11
13
  def detect_elem(elem)
12
14
  if elem.is_a?(Hash)
13
- elem.inject '' do |out, (key, value)|
14
- value ? out << key.to_s << ' ' : out
15
- end.strip
15
+ elem.filter {|_k, v| v }.map {|k, _v| k }.join(' ')
16
16
  elsif elem.is_a?(Array)
17
17
  inject_values elem
18
18
  elsif elem == false
@@ -23,10 +23,7 @@ module Classnames
23
23
  end
24
24
 
25
25
  def inject_values(values)
26
- values.inject '' do |out, value|
27
- detected = detect_elem(value)
28
- detected == '' ? out : out << detect_elem(value) << ' '
29
- end.strip
26
+ values.map {|value| detect_elem(value) }.reject(&:empty?).join(' ')
30
27
  end
31
28
  end
32
29
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Classnames
2
4
  module Rails
3
5
  module View
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Classnames
2
4
  module Rails
3
5
  module View
4
- VERSION = '1.1.1'.freeze
6
+ VERSION = '2.0.0'
5
7
  end
6
8
  end
7
9
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Classnames
2
4
  module Rails
3
5
  module View
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'classnames/rails/view'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # desc "Explaining what the task does"
2
4
  # task :classnames_rails_view do
3
5
  # # Task goes here
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: classnames-rails-view
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masamoto Miyata
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-30 00:00:00.000000000 Z
11
+ date: 2021-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '5.0'
20
20
  - - "<="
21
21
  - !ruby/object:Gem::Version
22
- version: '6.1'
22
+ version: 6.1.4.4
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '5.0'
30
30
  - - "<="
31
31
  - !ruby/object:Gem::Version
32
- version: '6.1'
32
+ version: 6.1.4.4
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: pry-byebug
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -100,6 +100,20 @@ dependencies:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: rspec
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - '='
108
+ - !ruby/object:Gem::Version
109
+ version: '3.10'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - '='
115
+ - !ruby/object:Gem::Version
116
+ version: '3.10'
103
117
  - !ruby/object:Gem::Dependency
104
118
  name: rspec-rails
105
119
  requirement: !ruby/object:Gem::Requirement
@@ -114,6 +128,34 @@ dependencies:
114
128
  - - ">="
115
129
  - !ruby/object:Gem::Version
116
130
  version: '0'
131
+ - !ruby/object:Gem::Dependency
132
+ name: rubocop
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - '='
136
+ - !ruby/object:Gem::Version
137
+ version: 0.75.0
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - '='
143
+ - !ruby/object:Gem::Version
144
+ version: 0.75.0
145
+ - !ruby/object:Gem::Dependency
146
+ name: rubocop-rails
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
117
159
  - !ruby/object:Gem::Dependency
118
160
  name: sqlite3
119
161
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +192,7 @@ homepage: https://github.com/gomo/classnames-rails-view
150
192
  licenses:
151
193
  - MIT
152
194
  metadata: {}
153
- post_install_message:
195
+ post_install_message:
154
196
  rdoc_options: []
155
197
  require_paths:
156
198
  - lib
@@ -158,15 +200,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
158
200
  requirements:
159
201
  - - ">="
160
202
  - !ruby/object:Gem::Version
161
- version: '0'
203
+ version: 2.6.0
162
204
  required_rubygems_version: !ruby/object:Gem::Requirement
163
205
  requirements:
164
206
  - - ">="
165
207
  - !ruby/object:Gem::Version
166
208
  version: '0'
167
209
  requirements: []
168
- rubygems_version: 3.0.6
169
- signing_key:
210
+ rubygems_version: 3.2.32
211
+ signing_key:
170
212
  specification_version: 4
171
213
  summary: The helper method to dynamically generate class attribute of HTML tag.
172
214
  test_files: []