metka 2.3.0 → 2.3.4

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: 63abcec9261f272c219d1a6cfcad32dd7d0c7898191d7914c74c3f0a892015c6
4
- data.tar.gz: fcf4bfed70ff8f3933543ace8902125dd3b2a34e0bcde143f15e829a83eccd60
3
+ metadata.gz: 518540070ea615095e92751f4f41ab3acb37f1ffc2afff2fc9bf111953afd8fc
4
+ data.tar.gz: affb55639df832a3eaf06b10466bff83dde4e4dee353bc9b1d3e67f4339c3e17
5
5
  SHA512:
6
- metadata.gz: 4b6571d0d1efae326e4aef32c0184ba71323deb737358c1271889b2ef88d05addd5b109c4d82aac22111e22231ab75172b56addf39d9c93a395cecffaf542b3d
7
- data.tar.gz: 9c711b3639ce53cc8d953bbd8cf5634ee184d821734ff19162c50f24a07d8825506f4223c0b2c1397f5142e7578e0eea55d50b88c0eb4d55e6d8a8aa2c001bea
6
+ metadata.gz: 6bf346782f251890b071ce994030f1698208502294a36494944bf911de5e7bee9c5e1e80cfb40ad7f890894d7908292fef87268e21feefb7fd26ae023a7d6523
7
+ data.tar.gz: c2960765c3522b26c0926aef4be272bcc23b09733af363907d4fb2bf3f2b860029fc90dd8b7fdbfd25307131e75c849c994bc458d8f1d1c567ed91e8a7f33acb
@@ -1,4 +1,4 @@
1
- name: Rubocop
1
+ name: Lint Code
2
2
 
3
3
  on:
4
4
  push:
File without changes
@@ -1,10 +1,12 @@
1
- name: Build
1
+ name: Specs
2
2
 
3
3
  on:
4
4
  push:
5
5
  branches:
6
6
  - master
7
7
  pull_request:
8
+ schedule:
9
+ - cron: "0 3 * * 1" # Every monday at 3 AM
8
10
 
9
11
  jobs:
10
12
  rspec:
@@ -27,7 +29,7 @@ jobs:
27
29
  include:
28
30
  - ruby: "3.0"
29
31
  postgres: "13"
30
- gemfile: "gemfiles/railsmaster.gemfile"
32
+ gemfile: "gemfiles/railsmain.gemfile"
31
33
  fx: "false"
32
34
  - ruby: "2.6"
33
35
  postgres: "12"
data/Gemfile.lock CHANGED
@@ -1,145 +1,159 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metka (2.2.1)
4
+ metka (2.3.3)
5
5
  dry-configurable (>= 0.8)
6
6
  rails (>= 5.2)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (6.1.0)
12
- actionpack (= 6.1.0)
13
- activesupport (= 6.1.0)
11
+ actioncable (6.1.4.1)
12
+ actionpack (= 6.1.4.1)
13
+ activesupport (= 6.1.4.1)
14
14
  nio4r (~> 2.0)
15
15
  websocket-driver (>= 0.6.1)
16
- actionmailbox (6.1.0)
17
- actionpack (= 6.1.0)
18
- activejob (= 6.1.0)
19
- activerecord (= 6.1.0)
20
- activestorage (= 6.1.0)
21
- activesupport (= 6.1.0)
16
+ actionmailbox (6.1.4.1)
17
+ actionpack (= 6.1.4.1)
18
+ activejob (= 6.1.4.1)
19
+ activerecord (= 6.1.4.1)
20
+ activestorage (= 6.1.4.1)
21
+ activesupport (= 6.1.4.1)
22
22
  mail (>= 2.7.1)
23
- actionmailer (6.1.0)
24
- actionpack (= 6.1.0)
25
- actionview (= 6.1.0)
26
- activejob (= 6.1.0)
27
- activesupport (= 6.1.0)
23
+ actionmailer (6.1.4.1)
24
+ actionpack (= 6.1.4.1)
25
+ actionview (= 6.1.4.1)
26
+ activejob (= 6.1.4.1)
27
+ activesupport (= 6.1.4.1)
28
28
  mail (~> 2.5, >= 2.5.4)
29
29
  rails-dom-testing (~> 2.0)
30
- actionpack (6.1.0)
31
- actionview (= 6.1.0)
32
- activesupport (= 6.1.0)
30
+ actionpack (6.1.4.1)
31
+ actionview (= 6.1.4.1)
32
+ activesupport (= 6.1.4.1)
33
33
  rack (~> 2.0, >= 2.0.9)
34
34
  rack-test (>= 0.6.3)
35
35
  rails-dom-testing (~> 2.0)
36
36
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
37
- actiontext (6.1.0)
38
- actionpack (= 6.1.0)
39
- activerecord (= 6.1.0)
40
- activestorage (= 6.1.0)
41
- activesupport (= 6.1.0)
37
+ actiontext (6.1.4.1)
38
+ actionpack (= 6.1.4.1)
39
+ activerecord (= 6.1.4.1)
40
+ activestorage (= 6.1.4.1)
41
+ activesupport (= 6.1.4.1)
42
42
  nokogiri (>= 1.8.5)
43
- actionview (6.1.0)
44
- activesupport (= 6.1.0)
43
+ actionview (6.1.4.1)
44
+ activesupport (= 6.1.4.1)
45
45
  builder (~> 3.1)
46
46
  erubi (~> 1.4)
47
47
  rails-dom-testing (~> 2.0)
48
48
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
49
- activejob (6.1.0)
50
- activesupport (= 6.1.0)
49
+ activejob (6.1.4.1)
50
+ activesupport (= 6.1.4.1)
51
51
  globalid (>= 0.3.6)
52
- activemodel (6.1.0)
53
- activesupport (= 6.1.0)
54
- activerecord (6.1.0)
55
- activemodel (= 6.1.0)
56
- activesupport (= 6.1.0)
57
- activestorage (6.1.0)
58
- actionpack (= 6.1.0)
59
- activejob (= 6.1.0)
60
- activerecord (= 6.1.0)
61
- activesupport (= 6.1.0)
62
- marcel (~> 0.3.1)
63
- mimemagic (~> 0.3.2)
64
- activesupport (6.1.0)
52
+ activemodel (6.1.4.1)
53
+ activesupport (= 6.1.4.1)
54
+ activerecord (6.1.4.1)
55
+ activemodel (= 6.1.4.1)
56
+ activesupport (= 6.1.4.1)
57
+ activestorage (6.1.4.1)
58
+ actionpack (= 6.1.4.1)
59
+ activejob (= 6.1.4.1)
60
+ activerecord (= 6.1.4.1)
61
+ activesupport (= 6.1.4.1)
62
+ marcel (~> 1.0.0)
63
+ mini_mime (>= 1.1.0)
64
+ activesupport (6.1.4.1)
65
65
  concurrent-ruby (~> 1.0, >= 1.0.2)
66
66
  i18n (>= 1.6, < 2)
67
67
  minitest (>= 5.1)
68
68
  tzinfo (~> 2.0)
69
69
  zeitwerk (~> 2.3)
70
- ammeter (1.1.4)
70
+ ammeter (1.1.5)
71
71
  activesupport (>= 3.0)
72
72
  railties (>= 3.0)
73
73
  rspec-rails (>= 2.2)
74
+ ast (2.4.2)
74
75
  builder (3.2.4)
75
76
  coderay (1.1.3)
76
- concurrent-ruby (1.1.7)
77
+ concurrent-ruby (1.1.9)
77
78
  crass (1.0.6)
78
- database_cleaner (1.8.5)
79
+ database_cleaner (2.0.1)
80
+ database_cleaner-active_record (~> 2.0.0)
81
+ database_cleaner-active_record (2.0.0)
82
+ activerecord (>= 5.a)
83
+ database_cleaner-core (~> 2.0.0)
84
+ database_cleaner-core (2.0.1)
79
85
  diff-lcs (1.4.4)
80
- dry-configurable (0.12.0)
86
+ dry-configurable (0.13.0)
81
87
  concurrent-ruby (~> 1.0)
82
- dry-core (~> 0.5, >= 0.5.0)
83
- dry-core (0.5.0)
88
+ dry-core (~> 0.6)
89
+ dry-core (0.7.1)
84
90
  concurrent-ruby (~> 1.0)
85
91
  erubi (1.10.0)
86
- faker (2.15.1)
92
+ faker (2.17.0)
87
93
  i18n (>= 1.6, < 2)
88
- globalid (0.4.2)
89
- activesupport (>= 4.2.0)
90
- i18n (1.8.5)
94
+ globalid (1.0.0)
95
+ activesupport (>= 5.0)
96
+ i18n (1.8.10)
91
97
  concurrent-ruby (~> 1.0)
92
- loofah (2.8.0)
98
+ jetrockets-standard (1.2.0)
99
+ rubocop-rails
100
+ rubocop-rspec
101
+ standard (~> 1.1.1)
102
+ loofah (2.12.0)
93
103
  crass (~> 1.0.2)
94
104
  nokogiri (>= 1.5.9)
95
105
  mail (2.7.1)
96
106
  mini_mime (>= 0.1.1)
97
- marcel (0.3.3)
98
- mimemagic (~> 0.3.2)
107
+ marcel (1.0.2)
99
108
  method_source (1.0.0)
100
- mimemagic (0.3.5)
101
- mini_mime (1.0.2)
102
- mini_portile2 (2.5.0)
103
- minitest (5.14.2)
104
- nio4r (2.5.4)
105
- nokogiri (1.11.1)
106
- mini_portile2 (~> 2.5.0)
109
+ mini_mime (1.1.2)
110
+ mini_portile2 (2.6.1)
111
+ minitest (5.14.4)
112
+ nio4r (2.5.8)
113
+ nokogiri (1.12.5)
114
+ mini_portile2 (~> 2.6.1)
107
115
  racc (~> 1.4)
116
+ parallel (1.21.0)
117
+ parser (3.1.0.0)
118
+ ast (~> 2.4.1)
108
119
  pg (1.2.3)
109
- pry (0.13.1)
120
+ pry (0.14.0)
110
121
  coderay (~> 1.1)
111
122
  method_source (~> 1.0)
112
123
  racc (1.5.2)
113
124
  rack (2.2.3)
114
125
  rack-test (1.1.0)
115
126
  rack (>= 1.0, < 3)
116
- rails (6.1.0)
117
- actioncable (= 6.1.0)
118
- actionmailbox (= 6.1.0)
119
- actionmailer (= 6.1.0)
120
- actionpack (= 6.1.0)
121
- actiontext (= 6.1.0)
122
- actionview (= 6.1.0)
123
- activejob (= 6.1.0)
124
- activemodel (= 6.1.0)
125
- activerecord (= 6.1.0)
126
- activestorage (= 6.1.0)
127
- activesupport (= 6.1.0)
127
+ rails (6.1.4.1)
128
+ actioncable (= 6.1.4.1)
129
+ actionmailbox (= 6.1.4.1)
130
+ actionmailer (= 6.1.4.1)
131
+ actionpack (= 6.1.4.1)
132
+ actiontext (= 6.1.4.1)
133
+ actionview (= 6.1.4.1)
134
+ activejob (= 6.1.4.1)
135
+ activemodel (= 6.1.4.1)
136
+ activerecord (= 6.1.4.1)
137
+ activestorage (= 6.1.4.1)
138
+ activesupport (= 6.1.4.1)
128
139
  bundler (>= 1.15.0)
129
- railties (= 6.1.0)
140
+ railties (= 6.1.4.1)
130
141
  sprockets-rails (>= 2.0.0)
131
142
  rails-dom-testing (2.0.3)
132
143
  activesupport (>= 4.2.0)
133
144
  nokogiri (>= 1.6)
134
- rails-html-sanitizer (1.3.0)
145
+ rails-html-sanitizer (1.4.2)
135
146
  loofah (~> 2.3)
136
- railties (6.1.0)
137
- actionpack (= 6.1.0)
138
- activesupport (= 6.1.0)
147
+ railties (6.1.4.1)
148
+ actionpack (= 6.1.4.1)
149
+ activesupport (= 6.1.4.1)
139
150
  method_source
140
- rake (>= 0.8.7)
151
+ rake (>= 0.13)
141
152
  thor (~> 1.0)
142
- rake (13.0.3)
153
+ rainbow (3.0.0)
154
+ rake (13.0.6)
155
+ regexp_parser (2.2.0)
156
+ rexml (3.2.5)
143
157
  rspec (3.10.0)
144
158
  rspec-core (~> 3.10.0)
145
159
  rspec-expectations (~> 3.10.0)
@@ -149,30 +163,56 @@ GEM
149
163
  rspec-expectations (3.10.1)
150
164
  diff-lcs (>= 1.2.0, < 2.0)
151
165
  rspec-support (~> 3.10.0)
152
- rspec-mocks (3.10.0)
166
+ rspec-mocks (3.10.2)
153
167
  diff-lcs (>= 1.2.0, < 2.0)
154
168
  rspec-support (~> 3.10.0)
155
- rspec-rails (4.0.2)
156
- actionpack (>= 4.2)
157
- activesupport (>= 4.2)
158
- railties (>= 4.2)
169
+ rspec-rails (5.0.1)
170
+ actionpack (>= 5.2)
171
+ activesupport (>= 5.2)
172
+ railties (>= 5.2)
159
173
  rspec-core (~> 3.10)
160
174
  rspec-expectations (~> 3.10)
161
175
  rspec-mocks (~> 3.10)
162
176
  rspec-support (~> 3.10)
163
- rspec-support (3.10.1)
177
+ rspec-support (3.10.2)
178
+ rubocop (1.18.4)
179
+ parallel (~> 1.10)
180
+ parser (>= 3.0.0.0)
181
+ rainbow (>= 2.2.2, < 4.0)
182
+ regexp_parser (>= 1.8, < 3.0)
183
+ rexml
184
+ rubocop-ast (>= 1.8.0, < 2.0)
185
+ ruby-progressbar (~> 1.7)
186
+ unicode-display_width (>= 1.4.0, < 3.0)
187
+ rubocop-ast (1.15.1)
188
+ parser (>= 3.0.1.1)
189
+ rubocop-performance (1.11.4)
190
+ rubocop (>= 1.7.0, < 2.0)
191
+ rubocop-ast (>= 0.4.0)
192
+ rubocop-rails (2.13.0)
193
+ activesupport (>= 4.2.0)
194
+ rack (>= 1.1)
195
+ rubocop (>= 1.7.0, < 2.0)
196
+ rubocop-rspec (2.4.0)
197
+ rubocop (~> 1.0)
198
+ rubocop-ast (>= 1.1.0)
199
+ ruby-progressbar (1.11.0)
164
200
  sprockets (4.0.2)
165
201
  concurrent-ruby (~> 1.0)
166
202
  rack (> 1, < 3)
167
- sprockets-rails (3.2.2)
168
- actionpack (>= 4.0)
169
- activesupport (>= 4.0)
203
+ sprockets-rails (3.4.2)
204
+ actionpack (>= 5.2)
205
+ activesupport (>= 5.2)
170
206
  sprockets (>= 3.0.0)
171
- thor (1.0.1)
172
- timecop (0.9.2)
207
+ standard (1.1.7)
208
+ rubocop (= 1.18.4)
209
+ rubocop-performance (= 1.11.4)
210
+ thor (1.1.0)
211
+ timecop (0.9.4)
173
212
  tzinfo (2.0.4)
174
213
  concurrent-ruby (~> 1.0)
175
- websocket-driver (0.7.3)
214
+ unicode-display_width (2.1.0)
215
+ websocket-driver (0.7.5)
176
216
  websocket-extensions (>= 0.1.0)
177
217
  websocket-extensions (0.1.5)
178
218
  zeitwerk (2.4.2)
@@ -186,6 +226,7 @@ DEPENDENCIES
186
226
  bundler (>= 1.3)
187
227
  database_cleaner (>= 1.7)
188
228
  faker (>= 2.8)
229
+ jetrockets-standard (>= 1.1)
189
230
  metka!
190
231
  pg (>= 1.1)
191
232
  pry (>= 0.12.2)
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/metka.svg)](https://badge.fury.io/rb/metka)
2
- [![Build Status](https://github.com/jetrockets/metka/workflows/Build/badge.svg?branch=master)](https://github.com/jetrockets/metka/actions)
2
+ [![Build Status](https://github.com/jetrockets/metka/workflows/Specs/badge.svg?branch=master)](https://github.com/jetrockets/metka/actions)
3
3
  [![Open Source Helpers](https://www.codetriage.com/jetrockets/metka/badges/users.svg)](https://www.codetriage.com/jetrockets/metka)
4
4
 
5
5
  # Metka
@@ -353,6 +353,35 @@ TBD
353
353
  2. [ActsAsTaggableArrayOn](https://github.com/tmiyamon/acts-as-taggable-array-on)
354
354
  3. [TagColumns](https://github.com/hopsoft/tag_columns)
355
355
 
356
+ ## Migration from ActsAsTaggable
357
+
358
+ To migrate your data from `ActsAsTaggable` can be done with the following migration.
359
+
360
+ ```ruby
361
+ class AddTagsToYourTable < ActiveRecord::Migration[6.0]
362
+ def change
363
+ add_column :your_table, :tags, :string, array: true
364
+ add_index :your_table, :tags, using: 'gin'
365
+
366
+ execute <<~SQL
367
+ UPDATE your_table
368
+ SET tags = tags.names
369
+ FROM (
370
+ SELECT taggings.taggable_id AS your_table_id,
371
+ array_agg(tags.name) as names
372
+ FROM tags
373
+ INNER JOIN taggings
374
+ ON tags.id = taggings.tag_id
375
+ WHERE
376
+ taggings.taggable_type = 'YouTableType'
377
+ GROUP BY taggings.taggable_id
378
+ ) as tags
379
+ WHERE your_table.id = tags.your_table_id
380
+ SQL
381
+ end
382
+ end
383
+ ```
384
+
356
385
  ## Benchmark Comparison
357
386
 
358
387
  There are some results of benchmarking a performance of write, read and find operations for different gems, that provide solution for tagging. Keep in mind, that those results can't be used as a proof, that some solution is better than the others, since each of the benchmarked gems has their unique features. You could run the benchmarks yourself or check, what exact operations has been used for benchmarking, with [MetkaBench application](https://github.com/jetrockets/metka_bench).
@@ -1,5 +1,5 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'rails', github: 'rails/rails'
3
+ gem 'rails', github: 'rails/rails', branch: 'main'
4
4
 
5
5
  gemspec path: '..'
data/lib/metka/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Metka
4
- VERSION = '2.3.0'
4
+ VERSION = '2.3.4'
5
5
  end
data/lib/metka.rb CHANGED
@@ -15,6 +15,6 @@ module Metka
15
15
 
16
16
  extend Dry::Configurable
17
17
 
18
- setting :parser, Metka::GenericParser
19
- setting :delimiter, ',', reader: true
18
+ setting :parser, default: Metka::GenericParser
19
+ setting :delimiter, default: ',', reader: true
20
20
  end
data/metka.gemspec CHANGED
@@ -37,5 +37,6 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency 'rspec-rails', '>= 3.9'
38
38
  spec.add_development_dependency 'timecop', '>= 0.9'
39
39
  spec.add_development_dependency 'database_cleaner', '>= 1.7'
40
+ spec.add_development_dependency 'jetrockets-standard', '>= 1.1'
40
41
  spec.required_ruby_version = '>= 2.5'
41
42
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metka
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Alexandrov
8
8
  - Andrey Morozov
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-02-05 00:00:00.000000000 Z
12
+ date: 2022-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dry-configurable
@@ -179,6 +179,20 @@ dependencies:
179
179
  - - ">="
180
180
  - !ruby/object:Gem::Version
181
181
  version: '1.7'
182
+ - !ruby/object:Gem::Dependency
183
+ name: jetrockets-standard
184
+ requirement: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - ">="
187
+ - !ruby/object:Gem::Version
188
+ version: '1.1'
189
+ type: :development
190
+ prerelease: false
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - ">="
194
+ - !ruby/object:Gem::Version
195
+ version: '1.1'
182
196
  description: Rails tagging system based on PostgreSQL arrays
183
197
  email:
184
198
  - igor.alexandrov@gmail.com
@@ -188,9 +202,9 @@ extensions: []
188
202
  extra_rdoc_files: []
189
203
  files:
190
204
  - ".github/ISSUE_TEMPLATE.md"
191
- - ".github/workflows/docs.yml"
192
- - ".github/workflows/rspec.yml"
193
- - ".github/workflows/rubocop.yml"
205
+ - ".github/workflows/lint_code.yml"
206
+ - ".github/workflows/lint_docs.yml"
207
+ - ".github/workflows/specs.yml"
194
208
  - ".gitignore"
195
209
  - ".mdlrc"
196
210
  - ".rspec"
@@ -209,7 +223,7 @@ files:
209
223
  - gemfiles/rails52.gemfile
210
224
  - gemfiles/rails6.gemfile
211
225
  - gemfiles/rails61.gemfile
212
- - gemfiles/railsmaster.gemfile
226
+ - gemfiles/railsmain.gemfile
213
227
  - gemfiles/rubocop.gemfile
214
228
  - lib/generators/metka/strategies/materialized_view/materialized_view_generator.rb
215
229
  - lib/generators/metka/strategies/materialized_view/templates/migration.rb.erb
@@ -229,7 +243,7 @@ homepage: https://github.com/jetrockets/metka
229
243
  licenses:
230
244
  - MIT
231
245
  metadata: {}
232
- post_install_message:
246
+ post_install_message:
233
247
  rdoc_options: []
234
248
  require_paths:
235
249
  - lib
@@ -245,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
245
259
  version: '0'
246
260
  requirements: []
247
261
  rubygems_version: 3.1.4
248
- signing_key:
262
+ signing_key:
249
263
  specification_version: 4
250
264
  summary: Rails tagging system based on PostgreSQL arrays
251
265
  test_files: []