listable_collections 4.0.0.1 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +5 -5
- data/Rakefile +1 -3
- data/lib/listable_collections/builder.rb +1 -1
- data/lib/listable_collections/version.rb +1 -1
- metadata +17 -111
- data/test/association_test.rb +0 -28
- data/test/attribute_test.rb +0 -24
- data/test/dummy/Rakefile +0 -5
- data/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/dummy/app/assets/stylesheets/application.css +0 -15
- data/test/dummy/app/controllers/application_controller.rb +0 -5
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/models/product.rb +0 -15
- data/test/dummy/app/models/shop.rb +0 -13
- data/test/dummy/app/views/layouts/application.html.erb +0 -12
- data/test/dummy/bin/bundle +0 -4
- data/test/dummy/bin/rails +0 -5
- data/test/dummy/bin/rake +0 -5
- data/test/dummy/bin/setup +0 -30
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -25
- data/test/dummy/config/boot.rb +0 -5
- data/test/dummy/config/database.yml +0 -10
- data/test/dummy/config/database.yml.travis +0 -3
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -41
- data/test/dummy/config/environments/production.rb +0 -79
- data/test/dummy/config/environments/test.rb +0 -42
- data/test/dummy/config/initializers/assets.rb +0 -11
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/dummy/config/initializers/mime_types.rb +0 -4
- data/test/dummy/config/initializers/session_store.rb +0 -3
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -23
- data/test/dummy/config/routes.rb +0 -56
- data/test/dummy/config/secrets.yml +0 -22
- data/test/dummy/db/migrate/20160916011427_create_shops.rb +0 -9
- data/test/dummy/db/migrate/20160916011451_create_products.rb +0 -11
- data/test/dummy/db/schema.rb +0 -33
- data/test/dummy/log/development.log +0 -76
- data/test/dummy/log/test.log +0 -124
- data/test/dummy/public/404.html +0 -61
- data/test/dummy/public/422.html +0 -61
- data/test/dummy/public/500.html +0 -60
- data/test/dummy/public/favicon.ico +0 -0
- data/test/test_helper.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d47c9d32ec17aa0389a54c9e415ec1a380792809
|
4
|
+
data.tar.gz: 3966124268625ebfa2be2455f44415b6ba0070d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba45f4d4bd8a4e131314e2204184e20c459b63ed2738df2e38008efc0d82bf889d292d7005290e6b9a220440f0caaffce4b3d5cc31a74661a4748683483c95bc
|
7
|
+
data.tar.gz: 55858a79e778ea6def559e5d720afec00b745559d31cd9fd266b96e0f4663fee09a34ca4c9c4887c655745e4866f581a3f21a4c697a124a32b28a4e23c82530c
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/listable_collections.svg)](http://badge.fury.io/rb/listable_collections)
|
2
|
-
[![Code Climate](https://codeclimate.com/github/
|
3
|
-
[![Build Status](https://travis-ci.org/
|
4
|
-
[![Dependency Status](https://gemnasium.com/
|
2
|
+
[![Code Climate](https://codeclimate.com/github/museways/listable_collections/badges/gpa.svg)](https://codeclimate.com/github/museways/listable_collections)
|
3
|
+
[![Build Status](https://travis-ci.org/museways/listable_collections.svg)](https://travis-ci.org/museways/listable_collections)
|
4
|
+
[![Dependency Status](https://gemnasium.com/museways/listable_collections.svg)](https://gemnasium.com/museways/listable_collections)
|
5
5
|
|
6
6
|
# Listable collections
|
7
7
|
|
@@ -104,11 +104,11 @@ end
|
|
104
104
|
|
105
105
|
Any issue, pull request, comment of any kind is more than welcome!
|
106
106
|
|
107
|
-
I will mainly ensure compatibility to
|
107
|
+
I will mainly ensure compatibility to Rails, AWS, PostgreSQL, Redis, Elasticsearch and FreeBSD.
|
108
108
|
|
109
109
|
## Credits
|
110
110
|
|
111
|
-
This gem is maintained and funded by [
|
111
|
+
This gem is maintained and funded by [museways](https://github.com/museways).
|
112
112
|
|
113
113
|
## License
|
114
114
|
|
data/Rakefile
CHANGED
@@ -4,16 +4,14 @@ rescue LoadError
|
|
4
4
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
5
|
end
|
6
6
|
|
7
|
-
|
7
|
+
require 'bundler/gem_tasks'
|
8
8
|
|
9
9
|
require 'rake/testtask'
|
10
10
|
|
11
11
|
Rake::TestTask.new(:test) do |t|
|
12
|
-
t.libs << 'lib'
|
13
12
|
t.libs << 'test'
|
14
13
|
t.pattern = 'test/**/*_test.rb'
|
15
14
|
t.verbose = false
|
16
|
-
t.warning = false
|
17
15
|
end
|
18
16
|
|
19
17
|
task default: :test
|
@@ -14,7 +14,7 @@ module ListableCollections
|
|
14
14
|
name = "#{singular}_list"
|
15
15
|
variable = "@#{name}"
|
16
16
|
was = "#{name}_was"
|
17
|
-
model.
|
17
|
+
model.attribute name
|
18
18
|
define_list_writer name, variable, attribute, options
|
19
19
|
define_list_reader name, variable, attribute, options
|
20
20
|
define_added_to_list plural, name, was
|
metadata
CHANGED
@@ -1,66 +1,60 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: listable_collections
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mmontossi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 4.2.0
|
20
|
-
- - "<"
|
17
|
+
- - "~>"
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
19
|
+
version: '5.1'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 4.2.0
|
30
|
-
- - "<"
|
24
|
+
- - "~>"
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
26
|
+
version: '5.1'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
28
|
+
name: pg
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
31
|
- - "~>"
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
33
|
+
version: '0.21'
|
40
34
|
type: :development
|
41
35
|
prerelease: false
|
42
36
|
version_requirements: !ruby/object:Gem::Requirement
|
43
37
|
requirements:
|
44
38
|
- - "~>"
|
45
39
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
40
|
+
version: '0.21'
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
42
|
+
name: mocha
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
50
44
|
requirements:
|
51
45
|
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
47
|
+
version: '1.2'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
51
|
requirements:
|
58
52
|
- - "~>"
|
59
53
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
54
|
+
version: '1.2'
|
61
55
|
description: Makes collections accessible from a string list in rails.
|
62
56
|
email:
|
63
|
-
-
|
57
|
+
- hi@museways.com
|
64
58
|
executables: []
|
65
59
|
extensions: []
|
66
60
|
extra_rdoc_files: []
|
@@ -73,51 +67,7 @@ files:
|
|
73
67
|
- lib/listable_collections/extensions/active_record/base.rb
|
74
68
|
- lib/listable_collections/railtie.rb
|
75
69
|
- lib/listable_collections/version.rb
|
76
|
-
|
77
|
-
- test/attribute_test.rb
|
78
|
-
- test/dummy/Rakefile
|
79
|
-
- test/dummy/app/assets/javascripts/application.js
|
80
|
-
- test/dummy/app/assets/stylesheets/application.css
|
81
|
-
- test/dummy/app/controllers/application_controller.rb
|
82
|
-
- test/dummy/app/helpers/application_helper.rb
|
83
|
-
- test/dummy/app/models/product.rb
|
84
|
-
- test/dummy/app/models/shop.rb
|
85
|
-
- test/dummy/app/views/layouts/application.html.erb
|
86
|
-
- test/dummy/bin/bundle
|
87
|
-
- test/dummy/bin/rails
|
88
|
-
- test/dummy/bin/rake
|
89
|
-
- test/dummy/bin/setup
|
90
|
-
- test/dummy/config.ru
|
91
|
-
- test/dummy/config/application.rb
|
92
|
-
- test/dummy/config/boot.rb
|
93
|
-
- test/dummy/config/database.yml
|
94
|
-
- test/dummy/config/database.yml.travis
|
95
|
-
- test/dummy/config/environment.rb
|
96
|
-
- test/dummy/config/environments/development.rb
|
97
|
-
- test/dummy/config/environments/production.rb
|
98
|
-
- test/dummy/config/environments/test.rb
|
99
|
-
- test/dummy/config/initializers/assets.rb
|
100
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
101
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
102
|
-
- test/dummy/config/initializers/filter_parameter_logging.rb
|
103
|
-
- test/dummy/config/initializers/inflections.rb
|
104
|
-
- test/dummy/config/initializers/mime_types.rb
|
105
|
-
- test/dummy/config/initializers/session_store.rb
|
106
|
-
- test/dummy/config/initializers/wrap_parameters.rb
|
107
|
-
- test/dummy/config/locales/en.yml
|
108
|
-
- test/dummy/config/routes.rb
|
109
|
-
- test/dummy/config/secrets.yml
|
110
|
-
- test/dummy/db/migrate/20160916011427_create_shops.rb
|
111
|
-
- test/dummy/db/migrate/20160916011451_create_products.rb
|
112
|
-
- test/dummy/db/schema.rb
|
113
|
-
- test/dummy/log/development.log
|
114
|
-
- test/dummy/log/test.log
|
115
|
-
- test/dummy/public/404.html
|
116
|
-
- test/dummy/public/422.html
|
117
|
-
- test/dummy/public/500.html
|
118
|
-
- test/dummy/public/favicon.ico
|
119
|
-
- test/test_helper.rb
|
120
|
-
homepage: https://github.com/mmontossi/listable_collections
|
70
|
+
homepage: https://github.com/museways/listable_collections
|
121
71
|
licenses:
|
122
72
|
- MIT
|
123
73
|
metadata: {}
|
@@ -129,7 +79,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
79
|
requirements:
|
130
80
|
- - ">="
|
131
81
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
82
|
+
version: '0'
|
133
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
84
|
requirements:
|
135
85
|
- - ">="
|
@@ -137,52 +87,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
87
|
version: '0'
|
138
88
|
requirements: []
|
139
89
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.
|
90
|
+
rubygems_version: 2.6.13
|
141
91
|
signing_key:
|
142
92
|
specification_version: 4
|
143
93
|
summary: Listable collections for rails.
|
144
|
-
test_files:
|
145
|
-
- test/association_test.rb
|
146
|
-
- test/attribute_test.rb
|
147
|
-
- test/dummy/app/assets/javascripts/application.js
|
148
|
-
- test/dummy/app/assets/stylesheets/application.css
|
149
|
-
- test/dummy/app/controllers/application_controller.rb
|
150
|
-
- test/dummy/app/helpers/application_helper.rb
|
151
|
-
- test/dummy/app/models/product.rb
|
152
|
-
- test/dummy/app/models/shop.rb
|
153
|
-
- test/dummy/app/views/layouts/application.html.erb
|
154
|
-
- test/dummy/bin/bundle
|
155
|
-
- test/dummy/bin/rails
|
156
|
-
- test/dummy/bin/rake
|
157
|
-
- test/dummy/bin/setup
|
158
|
-
- test/dummy/config/application.rb
|
159
|
-
- test/dummy/config/boot.rb
|
160
|
-
- test/dummy/config/database.yml
|
161
|
-
- test/dummy/config/database.yml.travis
|
162
|
-
- test/dummy/config/environment.rb
|
163
|
-
- test/dummy/config/environments/development.rb
|
164
|
-
- test/dummy/config/environments/production.rb
|
165
|
-
- test/dummy/config/environments/test.rb
|
166
|
-
- test/dummy/config/initializers/assets.rb
|
167
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
168
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
169
|
-
- test/dummy/config/initializers/filter_parameter_logging.rb
|
170
|
-
- test/dummy/config/initializers/inflections.rb
|
171
|
-
- test/dummy/config/initializers/mime_types.rb
|
172
|
-
- test/dummy/config/initializers/session_store.rb
|
173
|
-
- test/dummy/config/initializers/wrap_parameters.rb
|
174
|
-
- test/dummy/config/locales/en.yml
|
175
|
-
- test/dummy/config/routes.rb
|
176
|
-
- test/dummy/config/secrets.yml
|
177
|
-
- test/dummy/config.ru
|
178
|
-
- test/dummy/db/migrate/20160916011427_create_shops.rb
|
179
|
-
- test/dummy/db/migrate/20160916011451_create_products.rb
|
180
|
-
- test/dummy/db/schema.rb
|
181
|
-
- test/dummy/log/development.log
|
182
|
-
- test/dummy/log/test.log
|
183
|
-
- test/dummy/public/404.html
|
184
|
-
- test/dummy/public/422.html
|
185
|
-
- test/dummy/public/500.html
|
186
|
-
- test/dummy/public/favicon.ico
|
187
|
-
- test/dummy/Rakefile
|
188
|
-
- test/test_helper.rb
|
94
|
+
test_files: []
|
data/test/association_test.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class AssociationTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
test 'methods' do
|
6
|
-
shop = Shop.create
|
7
|
-
%w(iPhone iPad).each do |name|
|
8
|
-
shop.products.create name: name
|
9
|
-
end
|
10
|
-
assert_equal 'iPhone,iPad', shop.product_list
|
11
|
-
|
12
|
-
imac = Product.new(name: 'iMac')
|
13
|
-
shop.expects(:product_added).never
|
14
|
-
shop.expects(:product_removed).never
|
15
|
-
shop.products << imac
|
16
|
-
assert_equal 'iPhone,iPad,iMac', shop.product_list
|
17
|
-
assert_equal [], shop.added_products_to_list
|
18
|
-
assert_equal [], shop.removed_products_from_list
|
19
|
-
|
20
|
-
shop.expects(:product_added).once.with('MacBook')
|
21
|
-
shop.expects(:product_removed).once.with('iPad')
|
22
|
-
shop.product_list = 'iMac,iPhone,MacBook'
|
23
|
-
assert_equal 'iPhone,iMac,MacBook', shop.product_list
|
24
|
-
assert_equal ['MacBook'], shop.added_products_to_list
|
25
|
-
assert_equal ['iPad'], shop.removed_products_from_list
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
data/test/attribute_test.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class AttributeTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
test 'methods' do
|
6
|
-
product = Product.new
|
7
|
-
assert_equal '', product.size_list
|
8
|
-
|
9
|
-
product.expects(:size_added).never
|
10
|
-
product.expects(:size_removed).never
|
11
|
-
product.sizes << '64GB'
|
12
|
-
assert_equal '64GB', product.size_list
|
13
|
-
assert_equal [], product.added_sizes_to_list
|
14
|
-
assert_equal [], product.removed_sizes_from_list
|
15
|
-
|
16
|
-
product.expects(:size_added).once.with('32GB')
|
17
|
-
product.expects(:size_removed).once.with('64GB')
|
18
|
-
product.size_list = '32GB'
|
19
|
-
assert_equal '32GB', product.size_list
|
20
|
-
assert_equal ['32GB'], product.added_sizes_to_list
|
21
|
-
assert_equal ['64GB'], product.removed_sizes_from_list
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
data/test/dummy/Rakefile
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require_tree .
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
-
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
-
* file per style scope.
|
12
|
-
*
|
13
|
-
*= require_tree .
|
14
|
-
*= require_self
|
15
|
-
*/
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Dummy</title>
|
5
|
-
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
6
|
-
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
7
|
-
<%= csrf_meta_tags %>
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
<%= yield %>
|
11
|
-
</body>
|
12
|
-
</html>
|
data/test/dummy/bin/bundle
DELETED
data/test/dummy/bin/rails
DELETED