merit 2.4.0 → 3.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
  SHA1:
3
- metadata.gz: c1d70d0ff56841cebd7bfb79bf17a152ba0a8156
4
- data.tar.gz: c602f5a16bbe014cd78ba2fc5d5eeec1ee9ac362
3
+ metadata.gz: 1c2cb7b1562ee27518561243969673e6bc9796f4
4
+ data.tar.gz: ac96051e01a3ad6223ebc0a84ffa7d0f7845dc67
5
5
  SHA512:
6
- metadata.gz: 5a8a44e81bddc1a740ebfb860eabefa2314f136c19851f5011113b1e25e4f539bb86affa4c9d447c6768f77b5c0a6b107258563a7bc41bd0b16ec86b24bd7a72
7
- data.tar.gz: 4e8523ab4e5c04583184da68b1aa5ff9937f053ad39c3756d10526bf9fde5f1e93c54d2d209c65b3f8c811e8d1bc21c15a475faa688eef5021ab363ee97bfe3c
6
+ metadata.gz: 74b144eb96c51f83aacb529ac9d87962e9fed9e48f6af0da365b00df773597c28f79a66f8ab3048df3c9042a62e46371442661123b4321f0a9d333fa8f97ed67
7
+ data.tar.gz: 1022b3357c719d183dfa1b2b068943fecefa009263aeed1905d051310c29e644333c087cadbd5eec433d0542a11abf5174121c38f003d6b657e937895345ca44
data/Gemfile CHANGED
@@ -2,23 +2,8 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- version = ENV['RAILS_VERSION'] || '4.2'
6
- rails = case version
7
- when 'master'
8
- { github: 'rails/rails' }
9
- when '4.0-protected-attributes'
10
- gem 'protected_attributes'
11
- "~> 4.0.0"
12
- when /4\.0|4\.1/
13
- "~> #{version}.0"
14
- when /4\.2/
15
- "~> #{version}.0.rc3"
16
- when '3.2'
17
- gem 'strong_parameters'
18
- "~> #{version}.0"
19
- end
20
-
21
- gem 'rails', rails
5
+ version = ENV['RAILS_VERSION'] || '5.0.3'
6
+ gem 'rails', version
22
7
 
23
8
  case ENV['ORM']
24
9
  when 'active_record'
@@ -36,7 +21,7 @@ platforms :rbx do
36
21
  gem 'rubysl', '~> 2.0'
37
22
  gem 'psych'
38
23
  gem 'racc'
39
- gem 'minitest'
24
+ gem 'minitest', '~> 5.10', '!= 5.10.2'
40
25
  gem 'rubinius-developer_tools'
41
26
  end
42
27
 
data/NEWS.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  User-visible changes worth mentioning.
4
4
 
5
+ ## 3.0.0
6
+
7
+ - [#276] Drops Rails <5 version support. Drops deprecated `action_filter` call.
8
+ - Fix deprecation warnings
9
+
5
10
  ## 2.4.0
6
11
 
7
12
  - [#260] Works with Rails 5
data/README.md CHANGED
@@ -4,7 +4,7 @@ Merit adds reputation behavior to Rails apps in the form of Badges, Points,
4
4
  and Rankings.
5
5
 
6
6
  [![Build Status](https://travis-ci.org/merit-gem/merit.svg?branch=master)](http://travis-ci.org/merit-gem/merit)
7
- [![Coverage Status](https://img.shields.io/coveralls/tute/merit.svg)](https://coveralls.io/r/tute/merit?branch=master)
7
+ [![Coverage Status](https://coveralls.io/repos/github/merit-gem/merit/badge.svg?branch=master)](https://coveralls.io/github/merit-gem/merit?branch=master)
8
8
  [![Code Climate](https://codeclimate.com/github/tute/merit/badges/gpa.svg)](https://codeclimate.com/github/tute/merit)
9
9
 
10
10
  # Table of Contents
@@ -9,7 +9,7 @@ class CreateMeritActions < ActiveRecord::Migration
9
9
  t.integer :target_id
10
10
  t.text :target_data
11
11
  t.boolean :processed, default: false
12
- t.timestamps
12
+ t.timestamps null: false
13
13
  end
14
14
  end
15
15
  end
@@ -1,7 +1,7 @@
1
1
  class CreateSashes < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :sashes do |t|
4
- t.timestamps
4
+ t.timestamps null: false
5
5
  end
6
6
  end
7
7
  end
@@ -4,18 +4,19 @@ module Merit
4
4
  # 'controller_path#action_name'
5
5
  module ControllerExtensions
6
6
  def self.included(base)
7
- base.after_filter do |controller|
8
- if rules_defined?
9
- log_merit_action
10
- Merit::Action.check_unprocessed if Merit.checks_on_each_request
11
- end
12
- end
7
+ base.after_action :log_and_process
13
8
  end
14
9
 
15
10
  private
16
11
 
17
- def log_merit_action
18
- Merit::Action.create(merit_action_hash)
12
+ def log_and_process
13
+ if rules_defined?
14
+ Merit::Action.create(merit_action_hash)
15
+
16
+ if Merit.checks_on_each_request
17
+ Merit::Action.check_unprocessed
18
+ end
19
+ end
19
20
  end
20
21
 
21
22
  def merit_action_hash
@@ -6,14 +6,14 @@ Gem::Specification.new do |s|
6
6
  s.files = `git ls-files`.split("\n").reject{|f| f =~ /^\./ }
7
7
  s.test_files = `git ls-files -- test/*`.split("\n")
8
8
  s.license = 'MIT'
9
- s.version = '2.4.0'
9
+ s.version = '3.0.0'
10
10
  s.authors = ["Tute Costa"]
11
11
  s.email = 'tutecosta@gmail.com'
12
12
 
13
- s.required_ruby_version = '>= 1.9.2'
13
+ s.required_ruby_version = '>= 2.2.2'
14
14
 
15
- s.add_dependency 'ambry', '~> 1.0.0'
16
- s.add_development_dependency 'rails', '>= 3.2.0'
15
+ s.add_dependency 'ambry', '~> 1.0.0'
16
+ s.add_development_dependency 'rails', '>= 5.0.0'
17
17
  s.add_development_dependency 'capybara'
18
18
  s.add_development_dependency 'simplecov'
19
19
  s.add_development_dependency 'rubocop'
@@ -32,5 +32,5 @@ Dummy::Application.configure do
32
32
  # Print deprecation notices to the stderr
33
33
  config.active_support.deprecation = :stderr
34
34
 
35
- config.eager_load = ENV['RAILS_VERSION'] == '4.0' || ENV['RAILS_VERSION'] == '4.0-protected-attributes'
35
+ config.eager_load = false
36
36
  end
@@ -1,8 +1,8 @@
1
- class CreateUsers < ActiveRecord::Migration
1
+ class CreateUsers < ActiveRecord::Migration[5.0]
2
2
  def self.up
3
3
  create_table :users do |t|
4
4
  t.string :name
5
- t.timestamps
5
+ t.timestamps null: false
6
6
  end
7
7
  end
8
8
 
@@ -1,4 +1,4 @@
1
- class CreateComments < ActiveRecord::Migration
1
+ class CreateComments < ActiveRecord::Migration[5.0]
2
2
  def self.up
3
3
  create_table :comments do |t|
4
4
  t.string :name
@@ -6,7 +6,7 @@ class CreateComments < ActiveRecord::Migration
6
6
  t.integer :user_id
7
7
  t.integer :votes, :default => 0
8
8
 
9
- t.timestamps
9
+ t.timestamps null: false
10
10
  end
11
11
  end
12
12
 
@@ -1,4 +1,4 @@
1
- class AddFieldsToUsers < ActiveRecord::Migration
1
+ class AddFieldsToUsers < ActiveRecord::Migration[5.0]
2
2
  def self.up
3
3
  add_column :users, :sash_id, :integer
4
4
  add_column :users, :level, :integer, :default => 0
@@ -1,4 +1,4 @@
1
- class AddFieldsToComments < ActiveRecord::Migration
1
+ class AddFieldsToComments < ActiveRecord::Migration[5.0]
2
2
  def self.up
3
3
  add_column :comments, :sash_id, :integer
4
4
  add_column :comments, :level, :integer, :default => 0
@@ -1,4 +1,4 @@
1
- class CreateMeritActions < ActiveRecord::Migration
1
+ class CreateMeritActions < ActiveRecord::Migration[5.0]
2
2
  def self.up
3
3
  create_table :merit_actions do |t|
4
4
  t.integer :user_id # source
@@ -8,7 +8,7 @@ class CreateMeritActions < ActiveRecord::Migration
8
8
  t.string :target_model
9
9
  t.integer :target_id
10
10
  t.boolean :processed, :default => false
11
- t.timestamps
11
+ t.timestamps null: false
12
12
  end
13
13
  end
14
14
 
@@ -1,4 +1,4 @@
1
- class CreateMeritActivityLogs < ActiveRecord::Migration
1
+ class CreateMeritActivityLogs < ActiveRecord::Migration[5.0]
2
2
  def self.up
3
3
  create_table :merit_activity_logs do |t|
4
4
  t.integer :action_id
@@ -1,7 +1,7 @@
1
- class CreateSashes < ActiveRecord::Migration
1
+ class CreateSashes < ActiveRecord::Migration[5.0]
2
2
  def self.up
3
3
  create_table :sashes do |t|
4
- t.timestamps
4
+ t.timestamps null: false
5
5
  end
6
6
  end
7
7
 
@@ -1,4 +1,4 @@
1
- class CreateBadgesSashes < ActiveRecord::Migration
1
+ class CreateBadgesSashes < ActiveRecord::Migration[5.0]
2
2
  def self.up
3
3
  create_table :badges_sashes do |t|
4
4
  t.integer :badge_id, :sash_id
@@ -1,4 +1,4 @@
1
- class CreateScoresAndPoints < ActiveRecord::Migration
1
+ class CreateScoresAndPoints < ActiveRecord::Migration[5.0]
2
2
  def self.up
3
3
  create_table :merit_scores do |t|
4
4
  t.references :sash
@@ -1,4 +1,4 @@
1
- class CreateAddresses < ActiveRecord::Migration
1
+ class CreateAddresses < ActiveRecord::Migration[5.0]
2
2
  def up
3
3
  create_table :addresses do |t|
4
4
  t.references :user
@@ -1,4 +1,4 @@
1
- class AddTargetDataToMeritActions < ActiveRecord::Migration
1
+ class AddTargetDataToMeritActions < ActiveRecord::Migration[5.0]
2
2
  def change
3
3
  add_column :merit_actions, :target_data, :text
4
4
  end
@@ -1,4 +1,4 @@
1
- class CreatePlayers < ActiveRecord::Migration
1
+ class CreatePlayers < ActiveRecord::Migration[5.0]
2
2
  def change
3
3
  create_table :players do |t|
4
4
  t.integer :sash_id
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tute Costa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-22 00:00:00.000000000 Z
11
+ date: 2017-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ambry
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 3.2.0
33
+ version: 5.0.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 3.2.0
40
+ version: 5.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: capybara
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -273,7 +273,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
273
273
  requirements:
274
274
  - - ">="
275
275
  - !ruby/object:Gem::Version
276
- version: 1.9.2
276
+ version: 2.2.2
277
277
  required_rubygems_version: !ruby/object:Gem::Requirement
278
278
  requirements:
279
279
  - - ">="
@@ -281,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
281
  version: '0'
282
282
  requirements: []
283
283
  rubyforge_project:
284
- rubygems_version: 2.5.1
284
+ rubygems_version: 2.6.11
285
285
  signing_key:
286
286
  specification_version: 4
287
287
  summary: Reputation engine for Rails apps