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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +5 -5
  4. data/Rakefile +1 -3
  5. data/lib/listable_collections/builder.rb +1 -1
  6. data/lib/listable_collections/version.rb +1 -1
  7. metadata +17 -111
  8. data/test/association_test.rb +0 -28
  9. data/test/attribute_test.rb +0 -24
  10. data/test/dummy/Rakefile +0 -5
  11. data/test/dummy/app/assets/javascripts/application.js +0 -13
  12. data/test/dummy/app/assets/stylesheets/application.css +0 -15
  13. data/test/dummy/app/controllers/application_controller.rb +0 -5
  14. data/test/dummy/app/helpers/application_helper.rb +0 -2
  15. data/test/dummy/app/models/product.rb +0 -15
  16. data/test/dummy/app/models/shop.rb +0 -13
  17. data/test/dummy/app/views/layouts/application.html.erb +0 -12
  18. data/test/dummy/bin/bundle +0 -4
  19. data/test/dummy/bin/rails +0 -5
  20. data/test/dummy/bin/rake +0 -5
  21. data/test/dummy/bin/setup +0 -30
  22. data/test/dummy/config.ru +0 -4
  23. data/test/dummy/config/application.rb +0 -25
  24. data/test/dummy/config/boot.rb +0 -5
  25. data/test/dummy/config/database.yml +0 -10
  26. data/test/dummy/config/database.yml.travis +0 -3
  27. data/test/dummy/config/environment.rb +0 -5
  28. data/test/dummy/config/environments/development.rb +0 -41
  29. data/test/dummy/config/environments/production.rb +0 -79
  30. data/test/dummy/config/environments/test.rb +0 -42
  31. data/test/dummy/config/initializers/assets.rb +0 -11
  32. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  33. data/test/dummy/config/initializers/cookies_serializer.rb +0 -3
  34. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  35. data/test/dummy/config/initializers/inflections.rb +0 -16
  36. data/test/dummy/config/initializers/mime_types.rb +0 -4
  37. data/test/dummy/config/initializers/session_store.rb +0 -3
  38. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  39. data/test/dummy/config/locales/en.yml +0 -23
  40. data/test/dummy/config/routes.rb +0 -56
  41. data/test/dummy/config/secrets.yml +0 -22
  42. data/test/dummy/db/migrate/20160916011427_create_shops.rb +0 -9
  43. data/test/dummy/db/migrate/20160916011451_create_products.rb +0 -11
  44. data/test/dummy/db/schema.rb +0 -33
  45. data/test/dummy/log/development.log +0 -76
  46. data/test/dummy/log/test.log +0 -124
  47. data/test/dummy/public/404.html +0 -61
  48. data/test/dummy/public/422.html +0 -61
  49. data/test/dummy/public/500.html +0 -60
  50. data/test/dummy/public/favicon.ico +0 -0
  51. data/test/test_helper.rb +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 254f443d254032f05cc8bba08c521a82d2180165
4
- data.tar.gz: 2ae78c4b3a02a460b200840020f6dd34b5a68a7a
3
+ metadata.gz: d47c9d32ec17aa0389a54c9e415ec1a380792809
4
+ data.tar.gz: 3966124268625ebfa2be2455f44415b6ba0070d6
5
5
  SHA512:
6
- metadata.gz: 8eefb5e9bf7504190f564aead44481e9a59f63b312f429c1fff18cdf8e26cba5f122e8a48ede9a4009531b8c9fe22eb56beab156967c09da5a292437b9b4dc49
7
- data.tar.gz: 0b42fce70bb530ce461838c689dcf410487dffc56ad425c78aee9820526641d5bb1fa082fb852af977becff9f79b5421bbaa093cd4522a37f27429a0e04b8af4
6
+ metadata.gz: ba45f4d4bd8a4e131314e2204184e20c459b63ed2738df2e38008efc0d82bf889d292d7005290e6b9a220440f0caaffce4b3d5cc31a74661a4748683483c95bc
7
+ data.tar.gz: 55858a79e778ea6def559e5d720afec00b745559d31cd9fd266b96e0f4663fee09a34ca4c9c4887c655745e4866f581a3f21a4c697a124a32b28a4e23c82530c
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2016 Mathías Montossi
1
+ Copyright 2017 Museways
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
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/mmontossi/listable_collections/badges/gpa.svg)](https://codeclimate.com/github/mmontossi/listable_collections)
3
- [![Build Status](https://travis-ci.org/mmontossi/listable_collections.svg)](https://travis-ci.org/mmontossi/listable_collections)
4
- [![Dependency Status](https://gemnasium.com/mmontossi/listable_collections.svg)](https://gemnasium.com/mmontossi/listable_collections)
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 PostgreSQL, AWS, Redis, Elasticsearch, FreeBSD and Memcached
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 [mmontossi](https://github.com/mmontossi).
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
- Bundler::GemHelper.install_tasks
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.define_attribute_method name
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
@@ -1,5 +1,5 @@
1
1
  module ListableCollections
2
2
 
3
- VERSION = '4.0.0.1'
3
+ VERSION = '5.1.0'
4
4
 
5
5
  end
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.0.0.1
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: 2016-12-14 00:00:00.000000000 Z
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: 4.3.0
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: 4.3.0
26
+ version: '5.1'
33
27
  - !ruby/object:Gem::Dependency
34
- name: mocha
28
+ name: pg
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: '1.1'
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: '1.1'
40
+ version: '0.21'
47
41
  - !ruby/object:Gem::Dependency
48
- name: pg
42
+ name: mocha
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '0.18'
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: '0.18'
54
+ version: '1.2'
61
55
  description: Makes collections accessible from a string list in rails.
62
56
  email:
63
- - mmontossi@gmail.com
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
- - test/association_test.rb
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: 2.1.0
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.5.1
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: []
@@ -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
@@ -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,5 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require File.expand_path('../config/application', __FILE__)
5
- Rails.application.load_tasks
@@ -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,5 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- # Prevent CSRF attacks by raising an exception.
3
- # For APIs, you may want to use :null_session instead.
4
- protect_from_forgery with: :exception
5
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,15 +0,0 @@
1
- class Product < ActiveRecord::Base
2
-
3
- belongs_to :shop
4
-
5
- list :sizes, after_add: :size_added, after_remove: :size_removed
6
-
7
- serialize :sizes, Array
8
-
9
- def size_added(size)
10
- end
11
-
12
- def size_removed(size)
13
- end
14
-
15
- end
@@ -1,13 +0,0 @@
1
- class Shop < ActiveRecord::Base
2
-
3
- has_many :products
4
-
5
- list :products, attribute: :name, after_add: :product_added, after_remove: :product_removed
6
-
7
- def product_added(product)
8
- end
9
-
10
- def product_removed(product)
11
- end
12
-
13
- end
@@ -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>
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
4
- load Gem.bin_path('bundler', 'bundle')
data/test/dummy/bin/rails DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- APP_PATH = File.expand_path('../../config/application', __FILE__)
4
- require_relative '../config/boot'
5
- require 'rails/commands'
data/test/dummy/bin/rake DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require_relative '../config/boot'
4
- require 'rake'
5
- Rake.application.run