unread 0.8.3 → 0.9.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: 48716668ad0d7a2e9cd493656fb8c10f71903ff9
4
- data.tar.gz: 2fcd8322339fa2e05381e1dc90889f0460a4c094
3
+ metadata.gz: c07c4e81aedbb9145c7ce1ca8da208037dba8866
4
+ data.tar.gz: 8b970b45fb9c988c09938fe62e4b17afaf9a6a30
5
5
  SHA512:
6
- metadata.gz: 4c5bb97e17fc71c5516b8099be065c4c68bdc578aa2286e95a2ff10627d43771f395b7f96e65be1e7c3f1d94db1d25e81942ff3de4ed9d43e54a517703427a4d
7
- data.tar.gz: 73c4a144f14a95b4aa043b3ce3fda6704d8de7016e2a77127e5f07148ed8df76309898a6054e39aa69cb37d26d0fda06a5f0ded3478ff229e447a4ae802235ac
6
+ metadata.gz: 4b77bad5fa155eea207bb5787368674883b3d4d148bb23dc63e69fd29c1ada9bb470b4fba0d922a3319e34940d96067cd1e80757ad430184bc557f2670658446
7
+ data.tar.gz: 7bb4ac0a6820ef38c680805e72c218f440c689efa5439abeb0d33a7b0181bd3842093a7f12a7944c2f418a0a441cf6ac4c2f85b8dc19e7dd3d55eb0e7bdec1d9
@@ -1,10 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
3
  - 2.0.0
5
- - 2.1.8
6
- - 2.2.4
7
- - 2.3.0
4
+ - 2.1.10
5
+ - 2.2.6
6
+ - 2.3.3
7
+ - 2.4.0
8
8
  gemfile:
9
9
  - gemfiles/rails_5_0.gemfile
10
10
  - gemfiles/rails_4_2.gemfile
@@ -15,18 +15,26 @@ gemfile:
15
15
  - gemfiles/rails_3_0.gemfile
16
16
  matrix:
17
17
  exclude:
18
- - rvm: 1.9.3
19
- gemfile: gemfiles/rails_5_0.gemfile
20
18
  - rvm: 2.0.0
21
19
  gemfile: gemfiles/rails_5_0.gemfile
22
- - rvm: 2.1.8
20
+ - rvm: 2.1.10
23
21
  gemfile: gemfiles/rails_5_0.gemfile
24
- - rvm: 2.3.0
22
+ - rvm: 2.3.3
23
+ gemfile: gemfiles/rails_3_0.gemfile
24
+ - rvm: 2.3.3
25
+ gemfile: gemfiles/rails_3_1.gemfile
26
+ - rvm: 2.3.3
27
+ gemfile: gemfiles/rails_3_2.gemfile
28
+ - rvm: 2.4.0
25
29
  gemfile: gemfiles/rails_3_0.gemfile
26
- - rvm: 2.3.0
30
+ - rvm: 2.4.0
27
31
  gemfile: gemfiles/rails_3_1.gemfile
28
- - rvm: 2.3.0
32
+ - rvm: 2.4.0
29
33
  gemfile: gemfiles/rails_3_2.gemfile
34
+ - rvm: 2.4.0
35
+ gemfile: gemfiles/rails_4_0.gemfile
36
+ - rvm: 2.4.0
37
+ gemfile: gemfiles/rails_4_1.gemfile
30
38
  before_install: gem update bundler
31
39
  sudo: false
32
40
  env:
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2010-2016 Georg Ledermann
3
+ Copyright (c) 2010-2017 Georg Ledermann
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -19,7 +19,7 @@ Ruby gem to manage read/unread status of ActiveRecord objects - and it's fast.
19
19
 
20
20
  ## Requirements
21
21
 
22
- * Ruby 1.9.3 or newer
22
+ * Ruby 2.0.0 or newer
23
23
  * Rails 3.0 or newer (including Rails 4.x and Rails 5.0)
24
24
  * MySQL, PostgreSQL or SQLite
25
25
  * Needs a timestamp field in your models (like created_at or updated_at) with a database index on it
@@ -189,4 +189,4 @@ AND messages.created_at > '2010-10-20 08:50:00'
189
189
  Hint: You should add a database index on `messages.created_at`.
190
190
 
191
191
 
192
- Copyright (c) 2010-2016 [Georg Ledermann](http://www.georg-ledermann.de) and [contributors](https://github.com/ledermann/unread/graphs/contributors), released under the MIT license
192
+ Copyright (c) 2010-2017 [Georg Ledermann](http://www.georg-ledermann.de) and [contributors](https://github.com/ledermann/unread/graphs/contributors), released under the MIT license
@@ -58,11 +58,7 @@ module Unread
58
58
  end
59
59
 
60
60
  def readable_parent
61
- current_klass = self
62
- while(ReadMark.readable_classes.include?(current_klass.superclass)) do
63
- current_klass = current_klass.superclass
64
- end
65
- current_klass
61
+ self.ancestors.find { |ancestor| ReadMark.readable_classes.include?(ancestor) }
66
62
  end
67
63
 
68
64
  def cleanup_read_marks!
@@ -1,3 +1,3 @@
1
1
  module Unread
2
- VERSION = '0.8.3'
2
+ VERSION = '0.9.0'
3
3
  end
@@ -0,0 +1,2 @@
1
+ class MultiLevelStiReadable < Email
2
+ end
@@ -19,6 +19,7 @@ require 'app/models/customer'
19
19
  require 'app/models/sti_reader'
20
20
  require 'app/models/document'
21
21
  require 'app/models/email'
22
+ require 'app/models/multi_level_sti_readable'
22
23
 
23
24
  # Requires supporting ruby files with custom matchers and macros, etc,
24
25
  # in spec/support/ and its subdirectories.
@@ -8,7 +8,7 @@ describe Unread::GarbageCollector do
8
8
  wait
9
9
  @email1 = Email.create!
10
10
  wait
11
- @email2 = Email.create!
11
+ @email2 = MultiLevelStiReadable.create!
12
12
  end
13
13
 
14
14
  describe :run! do
@@ -8,7 +8,7 @@ describe Unread::Readable do
8
8
  wait
9
9
  @email1 = Email.create!
10
10
  wait
11
- @email2 = Email.create!
11
+ @email2 = MultiLevelStiReadable.create!
12
12
  end
13
13
 
14
14
  describe :unread_by do
@@ -8,7 +8,7 @@ describe Unread::Reader do
8
8
  wait
9
9
  @email1 = Email.create!
10
10
  wait
11
- @email2 = Email.create!
11
+ @email2 = MultiLevelStiReadable.create!
12
12
  end
13
13
 
14
14
  describe :have_not_read do
@@ -178,4 +178,4 @@ describe Unread::Reader do
178
178
  expect(readers[0].have_read?(@email2)).to be_falsey
179
179
  end
180
180
  end
181
- end
181
+ end
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.homepage = "https://github.com/ledermann/unread"
12
12
  s.summary = %q{Manages read/unread status of ActiveRecord objects}
13
13
  s.description = %q{This gem creates a scope for unread objects and adds methods to mark objects as read }
14
- s.required_ruby_version = '>= 1.9.3'
14
+ s.required_ruby_version = '>= 2.0.0'
15
15
 
16
16
  s.rubyforge_project = "unread"
17
17
 
@@ -28,7 +28,8 @@ Gem::Specification.new do |s|
28
28
  s.add_development_dependency 'mysql2'
29
29
  s.add_development_dependency 'pg'
30
30
  s.add_development_dependency 'rspec'
31
- s.add_development_dependency 'simplecov', RUBY_VERSION < '2' ? '~> 0.11.2' : '>= 0.11.2'
31
+ s.add_development_dependency 'simplecov'
32
+ s.add_development_dependency 'term-ansicolor'
32
33
  s.add_development_dependency 'coveralls'
33
34
  s.add_development_dependency 'appraisal'
34
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unread
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Georg Ledermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-18 00:00:00.000000000 Z
11
+ date: 2017-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -114,14 +114,28 @@ dependencies:
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 0.11.2
117
+ version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 0.11.2
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: term-ansicolor
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: coveralls
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -192,6 +206,7 @@ files:
192
206
  - spec/app/models/different_reader.rb
193
207
  - spec/app/models/document.rb
194
208
  - spec/app/models/email.rb
209
+ - spec/app/models/multi_level_sti_readable.rb
195
210
  - spec/app/models/reader.rb
196
211
  - spec/app/models/sti_reader.rb
197
212
  - spec/database.yml
@@ -219,7 +234,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
219
234
  requirements:
220
235
  - - ">="
221
236
  - !ruby/object:Gem::Version
222
- version: 1.9.3
237
+ version: 2.0.0
223
238
  required_rubygems_version: !ruby/object:Gem::Requirement
224
239
  requirements:
225
240
  - - ">="
@@ -227,7 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
242
  version: '0'
228
243
  requirements: []
229
244
  rubyforge_project: unread
230
- rubygems_version: 2.6.8
245
+ rubygems_version: 2.6.11
231
246
  signing_key:
232
247
  specification_version: 4
233
248
  summary: Manages read/unread status of ActiveRecord objects
@@ -236,6 +251,7 @@ test_files:
236
251
  - spec/app/models/different_reader.rb
237
252
  - spec/app/models/document.rb
238
253
  - spec/app/models/email.rb
254
+ - spec/app/models/multi_level_sti_readable.rb
239
255
  - spec/app/models/reader.rb
240
256
  - spec/app/models/sti_reader.rb
241
257
  - spec/database.yml