counter_culture 2.8.0 → 3.2.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: dd2787a78c042c84c8585261e4fb2f2975fd5688833de084e6936cb605fd85d6
4
- data.tar.gz: dc42bb90b178eca596a17ceb0455ea8cd499d615f66f585a357ed3d6584987fa
3
+ metadata.gz: 95534ee62aca302b549c2dcac07fc297169c388686330d44fd7113e4ef2b20bc
4
+ data.tar.gz: b19462c370aca6769529a3f1485f6bf5cbaba9b51b4df8edc3f7f4fcd01dac40
5
5
  SHA512:
6
- metadata.gz: b015b805b60250331318aa8e0c66b8f313e1b6e9f7da3d8dbee966463b2b7c15adc6be042f572fa0a6fe0df0baf323219eb1aaf2bd2c4df8d4519c929d089bdc
7
- data.tar.gz: 00b1cd20630a952f7dd435da9fff6ef9700f3c9dd2e8330a180bb0c4768aede7ca718e7dfbf0a61df5c9c6cd169c43551c6970a8cf70d186a9b4ae940df4e300
6
+ metadata.gz: d6f3b86aff4915f42227de7303a1b8dfef7e6be9de77574b0887c44022393a8d4135329c1a538ba7e0fb0595cd27c021905a401303727169b90ac4ec3d891120
7
+ data.tar.gz: 7453a54d51964e9ee157ee6a9a7d6a4977c0f21b4e6261859558b83b92c29a03e4619428d88b18988f08c27db8f2afce0fecf32edb1156c3550b76aa8ba4388a
@@ -0,0 +1,66 @@
1
+ version: 2.1
2
+
3
+ orbs:
4
+ ruby: circleci/ruby@1.4
5
+
6
+ jobs:
7
+ test:
8
+ parameters:
9
+ ruby-version:
10
+ type: string
11
+ rails-version:
12
+ type: string
13
+ database:
14
+ type: string
15
+ docker:
16
+ - image: cimg/ruby:<< parameters.ruby-version >>
17
+ - image: cimg/postgres:14.1
18
+ - image: cimg/mysql:8.0
19
+ steps:
20
+ - checkout
21
+ - run:
22
+ name: bundle update
23
+ command: BUNDLE_GEMFILE=gemfiles/rails_<< parameters.rails-version >>.gemfile bundle update
24
+ - run:
25
+ name: install dockerize
26
+ command: wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
27
+ environment:
28
+ DOCKERIZE_VERSION: v0.3.0
29
+ - run:
30
+ name: Wait for Postgres
31
+ command: dockerize -wait tcp://localhost:5432 -timeout 1m
32
+ - run:
33
+ name: Wait for MySQL
34
+ command: dockerize -wait tcp://localhost:3306 -timeout 1m
35
+ - run:
36
+ name: rspec
37
+ command: DB=<< parameters.database >> rspec spec
38
+
39
+ workflows:
40
+ test:
41
+ jobs:
42
+ - test:
43
+ matrix:
44
+ parameters:
45
+ ruby-version: ["2.6", "2.7", "3.0"]
46
+ rails-version: ["5.2", "6.0", "6.1", "7.0"]
47
+ database: ["postgresql", "sqlite3", "mysql2"]
48
+ exclude:
49
+ - ruby-version: "3.0"
50
+ rails-version: "5.2"
51
+ database: "postgresql"
52
+ - ruby-version: "3.0"
53
+ rails-version: "5.2"
54
+ database: "sqlite3"
55
+ - ruby-version: "3.0"
56
+ rails-version: "5.2"
57
+ database: "mysql2"
58
+ - ruby-version: "2.6"
59
+ rails-version: "7.0"
60
+ database: "postgresql"
61
+ - ruby-version: "2.6"
62
+ rails-version: "7.0"
63
+ database: "sqlite3"
64
+ - ruby-version: "2.6"
65
+ rails-version: "7.0"
66
+ database: "mysql2"
data/Appraisals CHANGED
@@ -1,34 +1,10 @@
1
1
  %w[
2
- 4.2
3
- 5.0
4
- 5.1
5
2
  5.2
6
3
  6.0
7
4
  6.1
5
+ 7.0
8
6
  ].each do |rails_version|
9
- gem_rails_version = Gem::Version.new(rails_version)
10
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.5.0') &&
11
- gem_rails_version >= Gem::Version.new('6.0.0.beta')
12
-
13
- # Rails 6 requires Ruby >= 2.5
14
- next
15
- end
16
7
  appraise "rails-#{rails_version}" do
17
8
  gem 'rails', "~> #{rails_version}.0"
18
-
19
- if gem_rails_version < Gem::Version.new('5.0')
20
- gem 'pg', '~> 0.15'
21
- else
22
- gem 'pg'
23
- end
24
- gem 'mysql2'
25
- if gem_rails_version < Gem::Version.new('5.2')
26
- gem 'sqlite3', '~> 1.3.0'
27
- else
28
- gem 'sqlite3'
29
- end
30
- if gem_rails_version < Gem::Version.new('5.0')
31
- gem 'bigdecimal', '~> 1.3.5'
32
- end
33
9
  end
34
10
  end
data/CHANGELOG.md CHANGED
@@ -1,3 +1,36 @@
1
+ ## 3.2.0 (January 24, 2022)
2
+
3
+ Improvements:
4
+ - Allow specifiying `polymorphic_classes` to avoid a potentially expensive
5
+ `DISTINCT` query when calling `counter_culture_fix_counts` (#336)
6
+
7
+ Bugfixes:
8
+ - Fix primary key name for enumerable relations (#337)
9
+
10
+ ## 3.1.0 (November 29, 2021)
11
+
12
+ Improvements:
13
+ - Allow specifiying a `Proc` to `column_names` to avoid loading a scope on
14
+ startup (#335)
15
+
16
+ ## 3.0.0 (October 26, 2021)
17
+
18
+ Breaking changes:
19
+ - Dropped support for Ruby < 2.6
20
+ - Dropped support for Rails < 5.2
21
+
22
+ Note that there are no specific breaking changes that would cause older
23
+ versions of Ruby or Rails to stop working, we have simply stopped testing
24
+ against them.
25
+
26
+ Improvements:
27
+ - Support PostgreSql's `money` type for use with a delta column (#333)
28
+
29
+ ## 2.9.0 (August 27, 2021)
30
+
31
+ Improvements:
32
+ - Allow `execute_after_commit` to be a `Proc` for dynamic control (#326)
33
+
1
34
  ## 2.8.0 (March 16, 2021)
2
35
 
3
36
  Improvements:
data/Gemfile CHANGED
@@ -4,6 +4,3 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify the gem's dependencies in counter_culture.gemspec
6
6
  gemspec
7
-
8
- # Ensure we have the default DB adapter for testing
9
- gem 'sqlite3'
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # counter_culture [![Build Status](https://travis-ci.com/magnusvk/counter_culture.svg)](https://travis-ci.com/magnusvk/counter_culture)
1
+ # counter_culture [![Build Status](https://circleci.com/gh/magnusvk/counter_culture/tree/master.svg?style=svg)](https://circleci.com/gh/magnusvk/counter_culture/tree/master)
2
2
 
3
3
  Turbo-charged counter caches for your Rails app. Huge improvements over the Rails standard counter caches:
4
4
 
@@ -7,7 +7,7 @@ Turbo-charged counter caches for your Rails app. Huge improvements over the Rail
7
7
  * Supports dynamic column names, making it possible to split up the counter cache for different types of objects
8
8
  * Can keep a running count, or a running total
9
9
 
10
- Tested against Ruby 2.5.8, 2.6.6, 2.7.2 and 3.0.0, and against the latest patch releases of Rails 4.2, 5.0, 5.1, 5.2, 6.0 and 6.1.
10
+ Tested against Ruby 2.6, 2.7 and 3.0, and against the latest patch releases of Rails 5.2, 6.0, 6.1 and 7.0.
11
11
 
12
12
  Please note that -- unlike Rails' built-in counter-caches -- counter_culture does not currently change the behavior of the `.size` method on ActiveRecord associations. If you want to avoid a database query and read the cached value, please use the attribute name containing the counter cache directly.
13
13
  ```
@@ -259,6 +259,18 @@ Another option is to simply defer the update of counter caches to outside of the
259
259
  ```ruby
260
260
  counter_culture :category, execute_after_commit: true
261
261
  ```
262
+ [NOTE] You need to manually specify the `after_commit_action` as dependency in the Gemfile to use this feature
263
+ ```ruby
264
+ ...
265
+ gem "after_commit_action"
266
+ ...
267
+ ```
268
+
269
+ You can also pass a `Proc` for dynamic control. This is useful for temporarily moving the counter cache update inside of the transaction:
270
+
271
+ ```ruby
272
+ counter_culture :category, execute_after_commit: proc { !Thread.current[:update_counter_cache_in_transaction] }
273
+ ```
262
274
 
263
275
  ### Manually populating counter cache values
264
276
 
@@ -364,7 +376,10 @@ class Product < ActiveRecord::Base
364
376
  end
365
377
  ```
366
378
 
367
- You can specify a scope instead of a where condition string for `column_names`:
379
+ You can specify a scope instead of a where condition string for `column_names`. We recommend
380
+ providing a Proc that returns a hash instead of directly providing a hash: If you were to directly
381
+ provide a scope this would load your schema cache on startup which will break things like
382
+ `rake db:migrate`.
368
383
 
369
384
  ```ruby
370
385
  class Product < ActiveRecord::Base
@@ -374,10 +389,10 @@ class Product < ActiveRecord::Base
374
389
 
375
390
  counter_culture :category,
376
391
  column_name: proc {|model| "#{model.product_type}_count" },
377
- column_names: {
392
+ column_names: -> { {
378
393
  Product.awesomes => :awesome_count,
379
394
  Product.suckys => :sucky_count
380
- }
395
+ } }
381
396
  end
382
397
  ```
383
398
 
@@ -444,6 +459,17 @@ end
444
459
 
445
460
  counter_culture now supports polymorphic associations of one level only.
446
461
 
462
+ To discover which models need to be updated via `counter_culture_fix_counts`,
463
+ counter_culture performs a `DISTINCT` query on the polymorphic relationship.
464
+ This query can be expensive so we therefore offer the option
465
+ (`polymorphic_classes`) to specify the models' counts that should be corrected:
466
+
467
+ ```ruby
468
+ Image.counter_culture_fix_counts(polymorphic_classes: Product)
469
+ # or
470
+ Image.counter_culture_fix_counts(polymorphic_classes: [Product, Employee])
471
+ ```
472
+
447
473
  ## Contributing to counter_culture
448
474
 
449
475
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
@@ -38,9 +38,12 @@ Gem::Specification.new do |spec|
38
38
  spec.add_development_dependency 'after_commit_action'
39
39
  spec.add_development_dependency 'rails', '>= 4.2'
40
40
  spec.add_development_dependency 'rake', '>= 10.0'
41
- spec.add_development_dependency 'rdoc', '~> 5.0.0'
41
+ spec.add_development_dependency 'rdoc', ">= 6.3.1"
42
42
  spec.add_development_dependency 'rspec', '~> 3.0'
43
43
  spec.add_development_dependency 'rspec-extra-formatters'
44
44
  spec.add_development_dependency 'simplecov', '~> 0.16.1'
45
45
  spec.add_development_dependency 'timecop'
46
+ spec.add_development_dependency 'sqlite3'
47
+ spec.add_development_dependency 'mysql2'
48
+ spec.add_development_dependency 'pg'
46
49
  end
@@ -2,9 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sqlite3"
6
5
  gem "rails", "~> 5.2.0"
7
- gem "pg"
8
- gem "mysql2"
9
6
 
10
7
  gemspec path: "../"
@@ -2,9 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sqlite3"
6
5
  gem "rails", "~> 6.0.0"
7
- gem "pg"
8
- gem "mysql2"
9
6
 
10
7
  gemspec path: "../"
@@ -2,9 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sqlite3"
6
5
  gem "rails", "~> 6.1.0"
7
- gem "pg"
8
- gem "mysql2"
9
6
 
10
7
  gemspec path: "../"
@@ -2,9 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sqlite3", "~> 1.3.0"
6
- gem "rails", "~> 5.0.0"
7
- gem "pg"
8
- gem "mysql2"
5
+ gem "rails", "~> 7.0.0"
9
6
 
10
7
  gemspec path: "../"
@@ -69,10 +69,16 @@ module CounterCulture
69
69
  "#{model.connection.quote_column_name(change_counter_column)}"
70
70
  end
71
71
 
72
+ column_type = klass.type_for_attribute(change_counter_column).type
73
+
72
74
  # we don't use Rails' update_counters because we support changing the timestamp
73
75
  updates = []
74
76
  # this updates the actual counter
75
- updates << "#{quoted_column} = COALESCE(#{quoted_column}, 0) #{operator} #{delta_magnitude}"
77
+ if column_type == :money
78
+ updates << "#{quoted_column} = COALESCE(CAST(#{quoted_column} as NUMERIC), 0) #{operator} #{delta_magnitude}"
79
+ else
80
+ updates << "#{quoted_column} = COALESCE(#{quoted_column}, 0) #{operator} #{delta_magnitude}"
81
+ end
76
82
  # and here we update the timestamp, if so desired
77
83
  if touch
78
84
  current_time = obj.send(:current_time_from_proper_timezone)
@@ -157,8 +163,9 @@ module CounterCulture
157
163
  # pass true to get the past value, false or nothing to get the
158
164
  # current value
159
165
  def foreign_key_value(obj, relation, was = false)
166
+ original_relation = relation
160
167
  relation = relation.is_a?(Enumerable) ? relation.dup : [relation]
161
- first_relation = relation.first
168
+
162
169
  if was
163
170
  first = relation.shift
164
171
  foreign_key_value = attribute_was(obj, relation_foreign_key(first))
@@ -174,7 +181,8 @@ module CounterCulture
174
181
  while !value.nil? && relation.size > 0
175
182
  value = value.send(relation.shift)
176
183
  end
177
- return value.try(relation_primary_key(first_relation, source: obj, was: was).try(:to_sym))
184
+
185
+ return value.try(relation_primary_key(original_relation, source: obj, was: was).try(:to_sym))
178
186
  end
179
187
 
180
188
  # gets the reflect object on the given relation
@@ -311,7 +319,9 @@ module CounterCulture
311
319
  end
312
320
 
313
321
  def execute_now_or_after_commit(obj, &block)
314
- if @execute_after_commit
322
+ execute_after_commit = @execute_after_commit.is_a?(Proc) ? @execute_after_commit.call : @execute_after_commit
323
+
324
+ if execute_after_commit
315
325
  obj.execute_after_commit(&block)
316
326
  else
317
327
  block.call
@@ -45,8 +45,19 @@ module CounterCulture
45
45
  @after_commit_counter_cache = []
46
46
  end
47
47
 
48
- if options[:column_names] && !options[:column_names].is_a?(Hash)
49
- raise ":column_names must be a Hash of conditions and column names"
48
+ column_names_valid = (
49
+ !options[:column_names] ||
50
+ options[:column_names].is_a?(Hash) ||
51
+ (
52
+ options[:column_names].is_a?(Proc) &&
53
+ options[:column_names].call.is_a?(Hash)
54
+ )
55
+ )
56
+ unless column_names_valid
57
+ raise ArgumentError.new(
58
+ ":column_names must be a Hash of conditions and column names, " \
59
+ "or a Proc that when called returns such a Hash"
60
+ )
50
61
  end
51
62
 
52
63
  # add the counter to our collection
@@ -60,7 +71,8 @@ module CounterCulture
60
71
  # options:
61
72
  # { :exclude => list of relations to skip when fixing counts,
62
73
  # :only => only these relations will have their counts fixed,
63
- # :column_name => only this column will have its count fixed }
74
+ # :column_name => only this column will have its count fixed
75
+ # :polymorphic_classes => specify the class(es) to update in polymorphic associations }
64
76
  # returns: a list of fixed record as an array of hashes of the form:
65
77
  # { :entity => which model the count was fixed on,
66
78
  # :id => the id of the model that had the incorrect count,
@@ -80,7 +92,7 @@ module CounterCulture
80
92
  next if options[:exclude] && options[:exclude].include?(counter.relation)
81
93
  next if options[:only] && !options[:only].include?(counter.relation)
82
94
 
83
- reconciler_options = %i(batch_size column_name finish skip_unsupported start touch verbose where)
95
+ reconciler_options = %i(batch_size column_name finish skip_unsupported start touch verbose where polymorphic_classes)
84
96
 
85
97
  reconciler = CounterCulture::Reconciler.new(counter, options.slice(*reconciler_options))
86
98
  reconciler.reconcile!
@@ -28,7 +28,7 @@ module CounterCulture
28
28
  raise "Fixing counter caches is not supported when :delta_magnitude is a Proc; you may skip this relation with :skip_unsupported => true" if delta_magnitude.is_a?(Proc)
29
29
  end
30
30
 
31
- associated_model_classes.each do |associated_model_class|
31
+ Array(associated_model_classes).each do |associated_model_class|
32
32
  Reconciliation.new(counter, changes, options, associated_model_class).perform
33
33
  end
34
34
 
@@ -39,7 +39,7 @@ module CounterCulture
39
39
 
40
40
  def associated_model_classes
41
41
  if polymorphic?
42
- polymorphic_associated_model_classes
42
+ options[:polymorphic_classes].presence || polymorphic_associated_model_classes
43
43
  else
44
44
  [associated_model_class]
45
45
  end
@@ -74,7 +74,15 @@ module CounterCulture
74
74
 
75
75
  scope = relation_class
76
76
 
77
- counter_column_names = column_names || {nil => counter_cache_name}
77
+ counter_column_names =
78
+ case column_names
79
+ when Proc
80
+ column_names.call
81
+ when Hash
82
+ column_names
83
+ else
84
+ { nil => counter_cache_name }
85
+ end
78
86
 
79
87
  if options[:column_name]
80
88
  counter_column_names = counter_column_names.select{ |_, v| options[:column_name].to_s == v }
@@ -187,7 +195,12 @@ module CounterCulture
187
195
  # if a delta column is provided use SUM, otherwise use COUNT
188
196
  return @count_select if @count_select
189
197
  if delta_column
190
- @count_select = "SUM(COALESCE(#{self_table_name}.#{delta_column},0))"
198
+ # cast the column as NUMERIC if it is a PG money type
199
+ if model.type_for_attribute(delta_column).type == :money
200
+ @count_select = "SUM(COALESCE(CAST(#{self_table_name}.#{delta_column} as NUMERIC),0))"
201
+ else
202
+ @count_select = "SUM(COALESCE(#{self_table_name}.#{delta_column}, 0))"
203
+ end
191
204
  else
192
205
  @count_select = "COUNT(#{self_table_name}.#{model.primary_key})*#{delta_magnitude}"
193
206
  end
@@ -1,3 +1,3 @@
1
1
  module CounterCulture
2
- VERSION = '2.8.0'.freeze
2
+ VERSION = '3.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: counter_culture
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus von Koeller
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-17 00:00:00.000000000 Z
11
+ date: 2022-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -182,16 +182,16 @@ dependencies:
182
182
  name: rdoc
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - "~>"
185
+ - - ">="
186
186
  - !ruby/object:Gem::Version
187
- version: 5.0.0
187
+ version: 6.3.1
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - "~>"
192
+ - - ">="
193
193
  - !ruby/object:Gem::Version
194
- version: 5.0.0
194
+ version: 6.3.1
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: rspec
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -248,6 +248,48 @@ dependencies:
248
248
  - - ">="
249
249
  - !ruby/object:Gem::Version
250
250
  version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: sqlite3
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
265
+ - !ruby/object:Gem::Dependency
266
+ name: mysql2
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - ">="
270
+ - !ruby/object:Gem::Version
271
+ version: '0'
272
+ type: :development
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - ">="
277
+ - !ruby/object:Gem::Version
278
+ version: '0'
279
+ - !ruby/object:Gem::Dependency
280
+ name: pg
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - ">="
284
+ - !ruby/object:Gem::Version
285
+ version: '0'
286
+ type: :development
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - ">="
291
+ - !ruby/object:Gem::Version
292
+ version: '0'
251
293
  description: counter_culture provides turbo-charged counter caches that are kept up-to-date
252
294
  not just on create and destroy, that support multiple levels of indirection through
253
295
  relationships, allow dynamic column names and that avoid deadlocks by updating in
@@ -260,10 +302,10 @@ extra_rdoc_files:
260
302
  - LICENSE.txt
261
303
  - README.md
262
304
  files:
305
+ - ".circleci/config.yml"
263
306
  - ".document"
264
307
  - ".gitignore"
265
308
  - ".rspec"
266
- - ".travis.yml"
267
309
  - Appraisals
268
310
  - CHANGELOG.md
269
311
  - Gemfile
@@ -272,12 +314,10 @@ files:
272
314
  - Rakefile
273
315
  - circle.yml
274
316
  - counter_culture.gemspec
275
- - gemfiles/rails_4.2.gemfile
276
- - gemfiles/rails_5.0.gemfile
277
- - gemfiles/rails_5.1.gemfile
278
317
  - gemfiles/rails_5.2.gemfile
279
318
  - gemfiles/rails_6.0.gemfile
280
319
  - gemfiles/rails_6.1.gemfile
320
+ - gemfiles/rails_7.0.gemfile
281
321
  - lib/counter_culture.rb
282
322
  - lib/counter_culture/counter.rb
283
323
  - lib/counter_culture/extensions.rb
@@ -285,7 +325,6 @@ files:
285
325
  - lib/counter_culture/version.rb
286
326
  - lib/generators/counter_culture_generator.rb
287
327
  - lib/generators/templates/counter_culture_migration.rb.erb
288
- - run_tests_locally.sh
289
328
  homepage: https://github.com/magnusvk/counter_culture
290
329
  licenses:
291
330
  - MIT
data/.travis.yml DELETED
@@ -1,43 +0,0 @@
1
- language: ruby
2
- cache:
3
- directories:
4
- - ~/.rvm/gems
5
- services:
6
- - postgresql
7
- - mysql
8
- addons:
9
- postgresql: "9.6"
10
- rvm:
11
- - "2.5.8"
12
- - "2.6.6"
13
- - "2.7.2"
14
- - "3.0.0"
15
- gemfile:
16
- - gemfiles/rails_4.2.gemfile
17
- - gemfiles/rails_5.0.gemfile
18
- - gemfiles/rails_5.1.gemfile
19
- - gemfiles/rails_5.2.gemfile
20
- - gemfiles/rails_6.0.gemfile
21
- - gemfiles/rails_6.1.gemfile
22
- matrix:
23
- exclude:
24
- - rvm: "3.0.0"
25
- gemfile: gemfiles/rails_4.2.gemfile
26
- - rvm: "3.0.0"
27
- gemfile: gemfiles/rails_5.0.gemfile
28
- - rvm: "3.0.0"
29
- gemfile: gemfiles/rails_5.1.gemfile
30
- - rvm: "3.0.0"
31
- gemfile: gemfiles/rails_5.2.gemfile
32
- env:
33
- - DB=postgresql
34
- - DB=sqlite3
35
- - DB=mysql2
36
- before_install:
37
- - if [ "$BUNDLE_GEMFILE" = "$PWD/gemfiles/rails_4.2.gemfile" ]; then gem install bundler -v '1.17.3'; else gem install bundler -v '> 2'; fi
38
- install:
39
- - if [ "$BUNDLE_GEMFILE" = "$PWD/gemfiles/rails_4.2.gemfile" ]; then bundle _1.17.3_ update; else bundle update; fi
40
- before_script:
41
- - psql -c 'create database counter_culture_test;' -U postgres
42
- - mysql -e 'CREATE DATABASE counter_culture_test;'
43
- script: TRAVIS=true bundle exec rake spec
@@ -1,11 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sqlite3", "~> 1.3.0"
6
- gem "rails", "~> 4.2.0"
7
- gem "pg", "~> 0.15"
8
- gem "mysql2"
9
- gem "bigdecimal", "~> 1.3.5"
10
-
11
- gemspec path: "../"
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sqlite3", "~> 1.3.0"
6
- gem "rails", "~> 5.1.0"
7
- gem "pg"
8
- gem "mysql2"
9
-
10
- gemspec path: "../"
data/run_tests_locally.sh DELETED
@@ -1,20 +0,0 @@
1
- #! /bin/bash
2
-
3
- set -e
4
- source /usr/local/share/chruby/chruby.sh
5
-
6
- for RUBY_VERSION in 2.5.8 2.6.6 2.7.2 3.0.0; do
7
- chruby $RUBY_VERSION
8
- ruby --version
9
-
10
- gem install bundler -v '1.17.3'
11
-
12
- (bundle _1.17.3_ check > /dev/null || bundle _1.17.3_ install)
13
- gem install appraisal
14
- bundle exec appraisal install
15
-
16
- for DB in mysql2 postgresql sqlite3; do
17
- echo "RUBY $RUBY_VERSION; DB $DB"
18
- DB=$DB bundle exec appraisal rspec spec/counter_culture_spec.rb
19
- done
20
- done