lite-component 1.0.4 → 1.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41534fd17e7cfda5187c537d255e41ae6451624b666cefd61579bca3e8cf59c3
4
- data.tar.gz: fd52bbac5931e9021468519f62a1a9801f7f01742c4731ff4843dcbbedcd4483
3
+ metadata.gz: bcb7ba2c5e21389a70483a3160c9bf136890ca5399ac7ea390cfb717feeb38ab
4
+ data.tar.gz: e490fec6f741b127a95745e77005a8e06896afc8336ae7eb8836e9f26d973399
5
5
  SHA512:
6
- metadata.gz: 8933b889df91e694a02a37752753a2a5cc32d3adb29723178ca8eadf69c9508e03b2d05b92f1edfac859b26d006cff4074853fb66f4634320c94fe29f96dab71
7
- data.tar.gz: 7a945851fbb2aa0f7aa1576d962853374bfab0b6c35e0bc7a6ecef553da901c334c4603c2fd82858b4e3af2418b11128a6c4a0f7b1b17e83cc634302588bb156
6
+ metadata.gz: bd1e7a555cfe7699de2ccce76007ba22c25a25648e11f9a1af5b310a29b0821f0af61bf607ad09a2bb8d731392e7ef21e8b6952d75d397b91a7f06e3922ca2f0
7
+ data.tar.gz: 6e6807cb9cf96ffdb30c5c91af67aee23619d65eacf7f81106f93d77b63a04517742d67fbce2a94215b0be61c5afdc446ef5100e22a9d24fc8bc0b713a2b77d4
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.0.5] - 2019-12-21
10
+ ### Added
11
+ - Added support for `to_a` and `to_hash` for size check
12
+
9
13
  ## [1.0.4] - 2019-12-20
10
14
  ### Changed
11
15
  - Fixed generator template name
data/Gemfile.lock CHANGED
@@ -1,29 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-component (1.0.4)
5
- rails (>= 5.1.0)
4
+ lite-component (1.0.5)
5
+ actionview
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (6.0.2.1)
11
- actionpack (= 6.0.2.1)
12
- nio4r (~> 2.0)
13
- websocket-driver (>= 0.6.1)
14
- actionmailbox (6.0.2.1)
15
- actionpack (= 6.0.2.1)
16
- activejob (= 6.0.2.1)
17
- activerecord (= 6.0.2.1)
18
- activestorage (= 6.0.2.1)
19
- activesupport (= 6.0.2.1)
20
- mail (>= 2.7.1)
21
- actionmailer (6.0.2.1)
22
- actionpack (= 6.0.2.1)
23
- actionview (= 6.0.2.1)
24
- activejob (= 6.0.2.1)
25
- mail (~> 2.5, >= 2.5.4)
26
- rails-dom-testing (~> 2.0)
27
10
  actionpack (6.0.2.1)
28
11
  actionview (= 6.0.2.1)
29
12
  activesupport (= 6.0.2.1)
@@ -31,31 +14,12 @@ GEM
31
14
  rack-test (>= 0.6.3)
32
15
  rails-dom-testing (~> 2.0)
33
16
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
34
- actiontext (6.0.2.1)
35
- actionpack (= 6.0.2.1)
36
- activerecord (= 6.0.2.1)
37
- activestorage (= 6.0.2.1)
38
- activesupport (= 6.0.2.1)
39
- nokogiri (>= 1.8.5)
40
17
  actionview (6.0.2.1)
41
18
  activesupport (= 6.0.2.1)
42
19
  builder (~> 3.1)
43
20
  erubi (~> 1.4)
44
21
  rails-dom-testing (~> 2.0)
45
22
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
46
- activejob (6.0.2.1)
47
- activesupport (= 6.0.2.1)
48
- globalid (>= 0.3.6)
49
- activemodel (6.0.2.1)
50
- activesupport (= 6.0.2.1)
51
- activerecord (6.0.2.1)
52
- activemodel (= 6.0.2.1)
53
- activesupport (= 6.0.2.1)
54
- activestorage (6.0.2.1)
55
- actionpack (= 6.0.2.1)
56
- activejob (= 6.0.2.1)
57
- activerecord (= 6.0.2.1)
58
- marcel (~> 0.3.1)
59
23
  activesupport (6.0.2.1)
60
24
  concurrent-ruby (~> 1.0, >= 1.0.2)
61
25
  i18n (>= 0.7, < 2)
@@ -75,24 +39,15 @@ GEM
75
39
  generator_spec (0.9.4)
76
40
  activesupport (>= 3.0.0)
77
41
  railties (>= 3.0.0)
78
- globalid (0.4.2)
79
- activesupport (>= 4.2.0)
80
42
  i18n (1.7.0)
81
43
  concurrent-ruby (~> 1.0)
82
44
  jaro_winkler (1.5.4)
83
45
  loofah (2.4.0)
84
46
  crass (~> 1.0.2)
85
47
  nokogiri (>= 1.5.9)
86
- mail (2.7.1)
87
- mini_mime (>= 0.1.1)
88
- marcel (0.3.3)
89
- mimemagic (~> 0.3.2)
90
48
  method_source (0.9.2)
91
- mimemagic (0.3.3)
92
- mini_mime (1.0.2)
93
49
  mini_portile2 (2.4.0)
94
50
  minitest (5.13.0)
95
- nio4r (2.5.2)
96
51
  nokogiri (1.10.7)
97
52
  mini_portile2 (~> 2.4.0)
98
53
  parallel (1.19.1)
@@ -101,21 +56,6 @@ GEM
101
56
  rack (2.0.8)
102
57
  rack-test (1.1.0)
103
58
  rack (>= 1.0, < 3)
104
- rails (6.0.2.1)
105
- actioncable (= 6.0.2.1)
106
- actionmailbox (= 6.0.2.1)
107
- actionmailer (= 6.0.2.1)
108
- actionpack (= 6.0.2.1)
109
- actiontext (= 6.0.2.1)
110
- actionview (= 6.0.2.1)
111
- activejob (= 6.0.2.1)
112
- activemodel (= 6.0.2.1)
113
- activerecord (= 6.0.2.1)
114
- activestorage (= 6.0.2.1)
115
- activesupport (= 6.0.2.1)
116
- bundler (>= 1.3.0)
117
- railties (= 6.0.2.1)
118
- sprockets-rails (>= 2.0.0)
119
59
  rails-dom-testing (2.0.3)
120
60
  activesupport (>= 4.2.0)
121
61
  nokogiri (>= 1.6)
@@ -157,21 +97,11 @@ GEM
157
97
  ruby_parser (3.14.1)
158
98
  sexp_processor (~> 4.9)
159
99
  sexp_processor (4.13.0)
160
- sprockets (4.0.0)
161
- concurrent-ruby (~> 1.0)
162
- rack (> 1, < 3)
163
- sprockets-rails (3.2.1)
164
- actionpack (>= 4.0)
165
- activesupport (>= 4.0)
166
- sprockets (>= 3.0.0)
167
100
  thor (1.0.1)
168
101
  thread_safe (0.3.6)
169
102
  tzinfo (1.2.5)
170
103
  thread_safe (~> 0.1)
171
104
  unicode-display_width (1.6.0)
172
- websocket-driver (0.7.1)
173
- websocket-extensions (>= 0.1.0)
174
- websocket-extensions (0.1.4)
175
105
  zeitwerk (2.2.2)
176
106
 
177
107
  PLATFORMS
@@ -50,7 +50,7 @@ module Lite
50
50
 
51
51
  def render
52
52
  collection = options.delete(:collection)
53
- return render_content if collection.nil? || !collection.respond_to?(:to_a)
53
+ return render_content if collection.nil? || !collection.respond_to?(:each)
54
54
 
55
55
  Lite::Component::Collection.render(
56
56
  collection,
@@ -28,7 +28,15 @@ module Lite
28
28
  private
29
29
 
30
30
  def collection_size
31
- @collection_size ||= collection.size
31
+ @collection_size ||= begin
32
+ if collection.respond_to?(:size)
33
+ collection.size
34
+ elsif collection.respond_to?(:to_a)
35
+ collection.to_a.size
36
+ elsif collection.respond_to?(:to_hash)
37
+ collection.to_hash.size
38
+ end
39
+ end
32
40
  end
33
41
 
34
42
  # rubocop:disable Metrics/AbcSize
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Component
5
5
 
6
- VERSION ||= '1.0.4'
6
+ VERSION ||= '1.0.5'
7
7
 
8
8
  end
9
9
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'action_view'
4
+
3
5
  %w[version engine iteration collection locals base].each do |filename|
4
6
  require "lite/component/#{filename}"
5
7
  end
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
38
38
  spec.require_paths = %w[lib]
39
39
 
40
- spec.add_runtime_dependency 'rails', '>= 5.1.0'
40
+ spec.add_runtime_dependency 'actionview'
41
41
 
42
42
  spec.add_development_dependency 'bundler'
43
43
  spec.add_development_dependency 'fasterer'
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lite-component
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-20 00:00:00.000000000 Z
11
+ date: 2019-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: actionview
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.1.0
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 5.1.0
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement