acts-as-messageable 0.4.11 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +1 -0
  3. data/.rubocop.yml +19 -0
  4. data/.rubocop_todo.yml +33 -0
  5. data/.travis.yml +40 -4
  6. data/Appraisals +24 -11
  7. data/Dockerfile +13 -0
  8. data/Gemfile +11 -4
  9. data/Gemfile.lock +94 -63
  10. data/README.md +30 -12
  11. data/Rakefile +4 -0
  12. data/VERSION +1 -1
  13. data/acts-as-messageable.gemspec +62 -49
  14. data/docker-compose.yml +73 -0
  15. data/gemfiles/rails_3.2.gemfile +17 -10
  16. data/gemfiles/rails_4.2.gemfile +24 -0
  17. data/gemfiles/rails_5.2.gemfile +17 -10
  18. data/gemfiles/rails_6.0.gemfile +17 -10
  19. data/gemfiles/rails_master.gemfile +23 -0
  20. data/lib/acts-as-messageable.rb +2 -17
  21. data/lib/acts_as_messageable.rb +23 -0
  22. data/lib/{acts-as-messageable → acts_as_messageable}/message.rb +25 -8
  23. data/lib/{acts-as-messageable → acts_as_messageable}/model.rb +27 -30
  24. data/lib/{acts-as-messageable → acts_as_messageable}/rails3.rb +7 -5
  25. data/lib/{acts-as-messageable → acts_as_messageable}/rails4.rb +8 -4
  26. data/lib/acts_as_messageable/rails6.rb +31 -0
  27. data/lib/acts_as_messageable/railtie.rb +11 -0
  28. data/lib/{acts-as-messageable → acts_as_messageable}/relation.rb +4 -2
  29. data/lib/{acts-as-messageable → acts_as_messageable}/scopes.rb +16 -12
  30. data/lib/generators/{acts-as-messageable → acts_as_messageable}/migration/migration_generator.rb +16 -2
  31. data/lib/generators/{acts-as-messageable → acts_as_messageable}/migration/templates/migration.rb +3 -3
  32. data/lib/generators/acts_as_messageable/migration/templates/migration_indexes.rb +11 -0
  33. data/lib/generators/acts_as_messageable/migration/templates/migration_opened_as_datetime.rb +15 -0
  34. data/lib/generators/{acts-as-messageable → acts_as_messageable}/migration/templates/migration_permanent.rb +1 -1
  35. data/spec/{acts-as-messageable_spec.rb → acts_as_messageable_spec.rb} +77 -5
  36. data/spec/{custom-class_spec.rb → custom_class_spec.rb} +14 -5
  37. data/spec/{custom-required_spec.rb → custom_required_spec.rb} +3 -1
  38. data/spec/{group-messages_spec.rb → group_messages_spec.rb} +4 -2
  39. data/spec/migrations_spec.rb +75 -0
  40. data/spec/spec_helper.rb +30 -37
  41. data/spec/support/admin.rb +2 -0
  42. data/spec/support/custom_message.rb +5 -0
  43. data/spec/support/custom_message_uuid.rb +5 -0
  44. data/spec/support/custom_search_user.rb +5 -0
  45. data/spec/support/men.rb +6 -0
  46. data/spec/support/send_message.rb +2 -0
  47. data/spec/support/table_schema.rb +35 -0
  48. data/spec/support/user.rb +2 -3
  49. data/spec/support/uuid_user.rb +6 -0
  50. metadata +113 -31
  51. data/gemfiles/rails_3.2.gemfile.lock +0 -153
  52. data/gemfiles/rails_4.2.11.gemfile +0 -16
  53. data/gemfiles/rails_4.2.11.gemfile.lock +0 -157
  54. data/gemfiles/rails_5.2.gemfile.lock +0 -155
  55. data/gemfiles/rails_6.0.gemfile.lock +0 -155
  56. data/lib/acts-as-messageable/railtie.rb +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d39bb2cad41112507fe75f034c4eb8f959e91e5183cc6418ab30c2f6064f0431
4
- data.tar.gz: eeea6d6202f01f845737538938ebfaa1ae7f1874685a1490aa4d3540f838cabf
3
+ metadata.gz: 96fae57b67967259c71b193f80296cd147ce3e0464ce680d77499945cf491ef0
4
+ data.tar.gz: aff0c1d8b83cc57de586e86b088dbff56da6c3363b82354580f5356b76a08d29
5
5
  SHA512:
6
- metadata.gz: 843a163ea94ab5efe825bbbb91838d805e058efcaa23a7ff2e3880b35e500fd3e9d9fc9f04426cd030b71eff1d7914412226ec6f3af9811b7ba13d40a0fb08d8
7
- data.tar.gz: 870d81738c5d3804c23641a6188a0baa9d4f1c2615a9fca31f8f4859e7b1297d6ab661c846272115211f0f42bd4f44ac51089cee212899063b38151e8c33f76a
6
+ metadata.gz: 8d5cf68cc310b76b8db7be5b10106bc49794b9668e798588aa817471bedcbeb40d38efd35eafc27bb0b9b5cef007be6f9d9587dab72787e55d7a5ac65723ec5a
7
+ data.tar.gz: b36a95ae9f4ce8b89cd055786a6ebb09cd875ce18b891c58bf9346796ff98c32b21523277d3a1eff32c39630c38a0b02c02c879c07e3a4e7caa529ca88e25be4
@@ -0,0 +1 @@
1
+ .git
@@ -0,0 +1,19 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ TargetRubyVersion: 2.7
5
+ Exclude:
6
+ - 'lib/generators/acts_as_messageable/migration/templates/*'
7
+ - 'vendor/**/*'
8
+ - 'gemfiles/vendor/**/*'
9
+ NewCops: enable
10
+
11
+ Layout/LineLength:
12
+ Max: 120
13
+
14
+ Metrics/BlockLength:
15
+ ExcludedMethods: ['describe', 'context']
16
+
17
+ Naming/FileName:
18
+ Exclude:
19
+ - 'lib/acts-as-messageable.rb'
@@ -0,0 +1,33 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2020-05-03 14:16:43 +0200 using RuboCop version 0.82.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 2
10
+ # Configuration parameters: IgnoredMethods.
11
+ Metrics/AbcSize:
12
+ Max: 44
13
+
14
+ # Offense count: 4
15
+ # Configuration parameters: CountComments, ExcludedMethods.
16
+ Metrics/MethodLength:
17
+ Max: 28
18
+
19
+ # Offense count: 13
20
+ Style/Documentation:
21
+ Exclude:
22
+ - 'spec/**/*'
23
+ - 'test/**/*'
24
+ - 'lib/acts_as_messageable.rb'
25
+ - 'lib/acts_as_messageable/message.rb'
26
+ - 'lib/acts_as_messageable/model.rb'
27
+ - 'lib/acts_as_messageable/rails3.rb'
28
+ - 'lib/acts_as_messageable/rails4.rb'
29
+ - 'lib/acts_as_messageable/rails6.rb'
30
+ - 'lib/acts_as_messageable/railtie.rb'
31
+ - 'lib/acts_as_messageable/relation.rb'
32
+ - 'lib/acts_as_messageable/scopes.rb'
33
+ - 'lib/generators/acts_as_messageable/migration/migration_generator.rb'
@@ -1,3 +1,7 @@
1
+ stages:
2
+ - "Static analysis"
3
+ - "Test"
4
+ - "Documentation"
1
5
  matrix:
2
6
  allow_failures:
3
7
  - rvm: ruby-head
@@ -5,15 +9,47 @@ matrix:
5
9
  - rvm: 2.3.8
6
10
  gemfile: gemfiles/rails_3.2.gemfile
7
11
  - rvm: 2.3.8
8
- gemfile: gemfiles/rails_4.2.11.gemfile
9
- - rvm: 2.6.3
12
+ gemfile: gemfiles/rails_4.2.gemfile
13
+ - rvm: 2.7
10
14
  gemfile: gemfiles/rails_5.2.gemfile
11
- - rvm: 2.6.3
15
+ - rvm: 2.7
12
16
  gemfile: gemfiles/rails_6.0.gemfile
13
- - rvm: ruby-head
17
+ - rvm: 2.7
14
18
  gemfile: gemfiles/rails_5.2.gemfile
19
+ - rvm: 2.7
20
+ env: RUN_GENERATORS=true
21
+ gemfile: gemfiles/rails_6.0.gemfile
22
+ - rvm: 2.7
23
+ name: "PostgreSQL"
24
+ services:
25
+ - postgresql
26
+ before_script:
27
+ - psql -c 'create database ci_test;' -U postgres
28
+ env:
29
+ - DATABASE_ADAPTER=postgresql
30
+ - DATABASE_NAME=ci_test
31
+ - rvm: 2.7
32
+ gemfile: gemfiles/rails_master.gemfile
15
33
  - rvm: ruby-head
34
+ gemfile: gemfiles/rails_master.gemfile
35
+ - rvm: 2.7
36
+ stage: "Static analysis"
16
37
  gemfile: gemfiles/rails_6.0.gemfile
38
+ name: "Rubocop"
39
+ script: rake rubocop
40
+ - rvm: 2.7
41
+ stage: "Documentation"
42
+ name: "Documentation"
43
+ before_deploy: 'bundle exec yard doc --private'
44
+ deploy:
45
+ provider: pages
46
+ skip_cleanup: true
47
+ github_token: $GITHUB_TOKEN
48
+ local_dir: doc
49
+ on:
50
+ branch: master
17
51
  before_install:
18
52
  - gem update --system
19
53
  - gem install bundler
54
+ cache: bundler
55
+
data/Appraisals CHANGED
@@ -1,17 +1,20 @@
1
- appraise "rails-3.2" do
2
- gem "activerecord", "~> 3.2.22"
3
- gem "activesupport", "~> 3.2.22"
4
- gem "railties", "~> 3.2.22"
1
+ # frozen_string_literal: true
2
+
3
+ appraise 'rails-3.2' do
4
+ gem 'activerecord', '~> 3.2.22'
5
+ gem 'activesupport', '~> 3.2.22'
6
+ gem 'railties', '~> 3.2.22'
5
7
 
6
8
  group :development do
7
9
  gem 'sqlite3', '~> 1.3.6'
8
10
  end
9
11
  end
10
12
 
11
- appraise "rails-4.2.11" do
12
- gem "activerecord", "~> 4.2.11"
13
- gem "activesupport", "~> 4.2.11"
14
- gem "railties", "~> 4.2.11"
13
+ appraise 'rails-4.2' do
14
+ gem 'activerecord', '~> 4.2'
15
+ gem 'activesupport', '~> 4.2'
16
+ gem 'railties', '~> 4.2'
17
+ gem 'rdoc', '6.2.0'
15
18
 
16
19
  group :development do
17
20
  gem 'sqlite3', '~> 1.3.6'
@@ -29,11 +32,21 @@ appraise 'rails-5.2' do
29
32
  end
30
33
 
31
34
  appraise 'rails-6.0' do
32
- gem 'activerecord', '~> 6.0.0.rc1'
33
- gem 'activesupport', '~> 6.0.0.rc1'
34
- gem 'railties', '~> 6.0.0.rc1'
35
+ gem 'activerecord', '~> 6'
36
+ gem 'activesupport', '~> 6'
37
+ gem 'railties', '~> 6'
35
38
 
36
39
  group :development do
37
40
  gem 'sqlite3', '~> 1.4.0'
38
41
  end
39
42
  end
43
+
44
+ appraise 'rails-master' do
45
+ gem 'activerecord', git: 'https://github.com/rails/rails.git'
46
+ gem 'activesupport', git: 'https://github.com/rails/rails.git'
47
+ gem 'railties', git: 'https://github.com/rails/rails.git'
48
+
49
+ group :development do
50
+ gem 'sqlite3'
51
+ end
52
+ end
@@ -0,0 +1,13 @@
1
+ ARG RUBY_VERSION
2
+ FROM ruby:${RUBY_VERSION}
3
+
4
+ WORKDIR /home/app
5
+
6
+ COPY Gemfile Gemfile.lock gemfiles ./
7
+
8
+ ARG GEMFILE
9
+ ENV BUNDLE_GEMFILE=${GEMFILE}
10
+ RUN gem install bundler && bundle install
11
+
12
+ CMD ["bundle", "exec", "rake"]
13
+
data/Gemfile CHANGED
@@ -1,14 +1,21 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'http://rubygems.org'
2
4
 
3
- gem 'activerecord', '>= 3.0.0'
4
- gem 'activesupport', '>= 3.0.0'
5
- gem 'ancestry', '>= 1.3.0'
6
- gem 'railties', '>= 3.0.0'
5
+ gem 'activerecord'
6
+ gem 'activesupport'
7
+ gem 'ancestry'
8
+ gem 'railties'
7
9
 
8
10
  group :development do
9
11
  gem 'appraisal'
10
12
  gem 'coveralls', require: false
11
13
  gem 'jeweler'
14
+ gem 'pg'
15
+ gem 'pry'
12
16
  gem 'rspec'
17
+ gem 'rubocop', require: false
13
18
  gem 'sqlite3'
19
+ gem 'timecop'
20
+ gem 'yard'
14
21
  end
@@ -1,55 +1,57 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- actionpack (5.2.3)
5
- actionview (= 5.2.3)
6
- activesupport (= 5.2.3)
7
- rack (~> 2.0)
4
+ actionpack (6.0.3)
5
+ actionview (= 6.0.3)
6
+ activesupport (= 6.0.3)
7
+ rack (~> 2.0, >= 2.0.8)
8
8
  rack-test (>= 0.6.3)
9
9
  rails-dom-testing (~> 2.0)
10
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
11
- actionview (5.2.3)
12
- activesupport (= 5.2.3)
10
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
11
+ actionview (6.0.3)
12
+ activesupport (= 6.0.3)
13
13
  builder (~> 3.1)
14
14
  erubi (~> 1.4)
15
15
  rails-dom-testing (~> 2.0)
16
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
17
- activemodel (5.2.3)
18
- activesupport (= 5.2.3)
19
- activerecord (5.2.3)
20
- activemodel (= 5.2.3)
21
- activesupport (= 5.2.3)
22
- arel (>= 9.0)
23
- activesupport (5.2.3)
16
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
17
+ activemodel (6.0.3)
18
+ activesupport (= 6.0.3)
19
+ activerecord (6.0.3)
20
+ activemodel (= 6.0.3)
21
+ activesupport (= 6.0.3)
22
+ activesupport (6.0.3)
24
23
  concurrent-ruby (~> 1.0, >= 1.0.2)
25
24
  i18n (>= 0.7, < 2)
26
25
  minitest (~> 5.1)
27
26
  tzinfo (~> 1.1)
27
+ zeitwerk (~> 2.2, >= 2.2.2)
28
28
  addressable (2.4.0)
29
- ancestry (3.0.6)
29
+ ancestry (3.0.7)
30
30
  activerecord (>= 3.2.0)
31
31
  appraisal (2.2.0)
32
32
  bundler
33
33
  rake
34
34
  thor (>= 0.14.0)
35
- arel (9.0.0)
36
- builder (3.2.3)
37
- concurrent-ruby (1.1.5)
35
+ ast (2.4.0)
36
+ builder (3.2.4)
37
+ coderay (1.1.2)
38
+ concurrent-ruby (1.1.6)
38
39
  coveralls (0.8.23)
39
40
  json (>= 1.8, < 3)
40
41
  simplecov (~> 0.16.1)
41
42
  term-ansicolor (~> 1.3)
42
43
  thor (>= 0.19.4, < 2.0)
43
44
  tins (~> 1.6)
44
- crass (1.0.4)
45
+ crass (1.0.6)
45
46
  descendants_tracker (0.0.4)
46
47
  thread_safe (~> 0.3, >= 0.3.1)
47
48
  diff-lcs (1.3)
48
- docile (1.3.1)
49
- erubi (1.8.0)
49
+ docile (1.3.2)
50
+ erubi (1.9.0)
50
51
  faraday (0.9.2)
51
52
  multipart-post (>= 1.2, < 3)
52
- git (1.5.0)
53
+ git (1.7.0)
54
+ rchardet (~> 1.8)
53
55
  github_api (0.16.0)
54
56
  addressable (~> 2.4.0)
55
57
  descendants_tracker (~> 0.0.4)
@@ -57,9 +59,9 @@ GEM
57
59
  hashie (>= 3.4)
58
60
  mime-types (>= 1.16, < 3.0)
59
61
  oauth2 (~> 1.0)
60
- hashie (3.6.0)
61
- highline (2.0.2)
62
- i18n (1.6.0)
62
+ hashie (4.1.0)
63
+ highline (2.0.3)
64
+ i18n (1.8.2)
63
65
  concurrent-ruby (~> 1.0)
64
66
  jeweler (2.3.9)
65
67
  builder
@@ -72,84 +74,113 @@ GEM
72
74
  rake
73
75
  rdoc
74
76
  semver2
75
- json (2.2.0)
77
+ json (2.3.0)
76
78
  jwt (2.2.1)
77
- loofah (2.2.3)
79
+ loofah (2.5.0)
78
80
  crass (~> 1.0.2)
79
81
  nokogiri (>= 1.5.9)
80
- method_source (0.9.2)
82
+ method_source (1.0.0)
81
83
  mime-types (2.99.3)
82
84
  mini_portile2 (2.4.0)
83
- minitest (5.11.3)
84
- multi_json (1.13.1)
85
+ minitest (5.14.0)
86
+ multi_json (1.14.1)
85
87
  multi_xml (0.6.0)
86
88
  multipart-post (2.1.1)
87
- nokogiri (1.10.3)
89
+ nokogiri (1.10.9)
88
90
  mini_portile2 (~> 2.4.0)
89
- oauth2 (1.4.1)
90
- faraday (>= 0.8, < 0.16.0)
91
+ oauth2 (1.4.4)
92
+ faraday (>= 0.8, < 2.0)
91
93
  jwt (>= 1.0, < 3.0)
92
94
  multi_json (~> 1.3)
93
95
  multi_xml (~> 0.5)
94
96
  rack (>= 1.2, < 3)
97
+ parallel (1.19.1)
98
+ parser (2.7.1.2)
99
+ ast (~> 2.4.0)
100
+ pg (1.2.3)
101
+ pry (0.13.1)
102
+ coderay (~> 1.1)
103
+ method_source (~> 1.0)
95
104
  psych (3.1.0)
96
- rack (2.0.7)
105
+ rack (2.2.2)
97
106
  rack-test (1.1.0)
98
107
  rack (>= 1.0, < 3)
99
108
  rails-dom-testing (2.0.3)
100
109
  activesupport (>= 4.2.0)
101
110
  nokogiri (>= 1.6)
102
- rails-html-sanitizer (1.0.4)
103
- loofah (~> 2.2, >= 2.2.2)
104
- railties (5.2.3)
105
- actionpack (= 5.2.3)
106
- activesupport (= 5.2.3)
111
+ rails-html-sanitizer (1.3.0)
112
+ loofah (~> 2.3)
113
+ railties (6.0.3)
114
+ actionpack (= 6.0.3)
115
+ activesupport (= 6.0.3)
107
116
  method_source
108
117
  rake (>= 0.8.7)
109
- thor (>= 0.19.0, < 2.0)
110
- rake (12.3.2)
111
- rdoc (6.1.1)
112
- rspec (3.8.0)
113
- rspec-core (~> 3.8.0)
114
- rspec-expectations (~> 3.8.0)
115
- rspec-mocks (~> 3.8.0)
116
- rspec-core (3.8.0)
117
- rspec-support (~> 3.8.0)
118
- rspec-expectations (3.8.3)
118
+ thor (>= 0.20.3, < 2.0)
119
+ rainbow (3.0.0)
120
+ rake (13.0.1)
121
+ rchardet (1.8.0)
122
+ rdoc (6.2.1)
123
+ rexml (3.2.4)
124
+ rspec (3.9.0)
125
+ rspec-core (~> 3.9.0)
126
+ rspec-expectations (~> 3.9.0)
127
+ rspec-mocks (~> 3.9.0)
128
+ rspec-core (3.9.2)
129
+ rspec-support (~> 3.9.3)
130
+ rspec-expectations (3.9.2)
119
131
  diff-lcs (>= 1.2.0, < 2.0)
120
- rspec-support (~> 3.8.0)
121
- rspec-mocks (3.8.0)
132
+ rspec-support (~> 3.9.0)
133
+ rspec-mocks (3.9.1)
122
134
  diff-lcs (>= 1.2.0, < 2.0)
123
- rspec-support (~> 3.8.0)
124
- rspec-support (3.8.0)
135
+ rspec-support (~> 3.9.0)
136
+ rspec-support (3.9.3)
137
+ rubocop (0.83.0)
138
+ parallel (~> 1.10)
139
+ parser (>= 2.7.0.1)
140
+ rainbow (>= 2.2.2, < 4.0)
141
+ rexml
142
+ ruby-progressbar (~> 1.7)
143
+ unicode-display_width (>= 1.4.0, < 2.0)
144
+ ruby-progressbar (1.10.1)
125
145
  semver2 (3.4.2)
126
146
  simplecov (0.16.1)
127
147
  docile (~> 1.1)
128
148
  json (>= 1.8, < 3)
129
149
  simplecov-html (~> 0.10.0)
130
150
  simplecov-html (0.10.2)
131
- sqlite3 (1.4.1)
151
+ sqlite3 (1.4.2)
152
+ sync (0.5.0)
132
153
  term-ansicolor (1.7.1)
133
154
  tins (~> 1.0)
134
- thor (0.20.3)
155
+ thor (1.0.1)
135
156
  thread_safe (0.3.6)
136
- tins (1.20.3)
137
- tzinfo (1.2.5)
157
+ timecop (0.9.1)
158
+ tins (1.24.1)
159
+ sync
160
+ tzinfo (1.2.7)
138
161
  thread_safe (~> 0.1)
162
+ unicode-display_width (1.7.0)
163
+ yard (0.9.25)
164
+ zeitwerk (2.3.0)
139
165
 
140
166
  PLATFORMS
141
167
  ruby
142
168
 
143
169
  DEPENDENCIES
144
- activerecord (>= 3.0.0)
145
- activesupport (>= 3.0.0)
146
- ancestry (>= 1.3.0)
170
+ activerecord
171
+ activesupport
172
+ ancestry
147
173
  appraisal
148
174
  coveralls
149
175
  jeweler
150
- railties (>= 3.0.0)
176
+ pg
177
+ pry
178
+ railties
151
179
  rspec
180
+ rubocop
152
181
  sqlite3
182
+ timecop
183
+ yard
153
184
 
154
185
  BUNDLED WITH
155
- 2.0.1
186
+ 2.1.4