metka 2.3.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/lint_code.yml +9 -6
- data/.github/workflows/lint_docs.yml +15 -16
- data/.github/workflows/release.yml +23 -0
- data/.github/workflows/tests.yml +97 -0
- data/.gitignore +16 -7
- data/.rubocop.yml +8 -16
- data/.ruby-version +1 -1
- data/Gemfile +1 -1
- data/README.md +273 -236
- data/Rakefile +9 -4
- data/assets/metka-icon.svg +23 -0
- data/assets/metka-logo.svg +28 -0
- data/benchmark/Gemfile +17 -0
- data/benchmark/README.md +170 -0
- data/benchmark/benchmark.rb +718 -0
- data/benchmark/results.sqlite.txt +131 -0
- data/benchmark/results.txt +150 -0
- data/bin/setup +7 -0
- data/docs/superpowers/plans/2026-08-18-cloud-table-naming.md +316 -0
- data/docs/superpowers/specs/2026-08-18-cloud-table-naming-design.md +105 -0
- data/forspell.dict +3 -1
- data/gemfiles/rails71.gemfile +6 -0
- data/gemfiles/rails72.gemfile +6 -0
- data/gemfiles/rails80.gemfile +6 -0
- data/gemfiles/rails81.gemfile +6 -0
- data/gemfiles/rubocop.gemfile +2 -2
- data/lib/generators/metka/strategies/index/index_generator.rb +77 -0
- data/lib/generators/metka/strategies/index/templates/migration.rb.erb +89 -0
- data/lib/generators/metka/strategies/table/table_generator.rb +83 -0
- data/lib/generators/metka/strategies/table/templates/migration.rb.erb +128 -0
- data/lib/generators/metka/strategies/table/templates/migration.sqlite.rb.erb +93 -0
- data/lib/metka/generic_parser.rb +28 -14
- data/lib/metka/model.rb +121 -51
- data/lib/metka/query_builder.rb +45 -49
- data/lib/metka/tag_list.rb +16 -8
- data/lib/metka/tags_query.rb +93 -0
- data/lib/metka/version.rb +1 -1
- data/lib/metka.rb +24 -10
- data/metka.gemspec +21 -16
- metadata +45 -92
- data/.github/workflows/specs.yml +0 -86
- data/.rspec +0 -2
- data/Gemfile.lock +0 -201
- data/gemfiles/rails52.gemfile +0 -6
- data/gemfiles/rails6.gemfile +0 -6
- data/gemfiles/rails61.gemfile +0 -6
- data/lib/generators/metka/strategies/materialized_view/materialized_view_generator.rb +0 -73
- data/lib/generators/metka/strategies/materialized_view/templates/migration.rb.erb +0 -54
- data/lib/generators/metka/strategies/view/templates/migration.rb.erb +0 -26
- data/lib/generators/metka/strategies/view/view_generator.rb +0 -70
- data/lib/metka/query_builder/all_tags_query.rb +0 -11
- data/lib/metka/query_builder/any_tags_query.rb +0 -11
- data/lib/metka/query_builder/base_query.rb +0 -48
metadata
CHANGED
|
@@ -1,58 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metka
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Igor Alexandrov
|
|
8
8
|
- Andrey Morozov
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: exe
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
|
-
- !ruby/object:Gem::Dependency
|
|
15
|
-
name: dry-configurable
|
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
|
17
|
-
requirements:
|
|
18
|
-
- - ">="
|
|
19
|
-
- !ruby/object:Gem::Version
|
|
20
|
-
version: '0.8'
|
|
21
|
-
type: :runtime
|
|
22
|
-
prerelease: false
|
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
24
|
-
requirements:
|
|
25
|
-
- - ">="
|
|
26
|
-
- !ruby/object:Gem::Version
|
|
27
|
-
version: '0.8'
|
|
28
13
|
- !ruby/object:Gem::Dependency
|
|
29
14
|
name: rails
|
|
30
15
|
requirement: !ruby/object:Gem::Requirement
|
|
31
16
|
requirements:
|
|
32
17
|
- - ">="
|
|
33
18
|
- !ruby/object:Gem::Version
|
|
34
|
-
version: '
|
|
19
|
+
version: '7.1'
|
|
35
20
|
type: :runtime
|
|
36
21
|
prerelease: false
|
|
37
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
38
23
|
requirements:
|
|
39
24
|
- - ">="
|
|
40
25
|
- !ruby/object:Gem::Version
|
|
41
|
-
version: '
|
|
42
|
-
- !ruby/object:Gem::Dependency
|
|
43
|
-
name: ammeter
|
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
|
45
|
-
requirements:
|
|
46
|
-
- - ">="
|
|
47
|
-
- !ruby/object:Gem::Version
|
|
48
|
-
version: '1.1'
|
|
49
|
-
type: :development
|
|
50
|
-
prerelease: false
|
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
52
|
-
requirements:
|
|
53
|
-
- - ">="
|
|
54
|
-
- !ruby/object:Gem::Version
|
|
55
|
-
version: '1.1'
|
|
26
|
+
version: '7.1'
|
|
56
27
|
- !ruby/object:Gem::Dependency
|
|
57
28
|
name: pry
|
|
58
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -82,19 +53,19 @@ dependencies:
|
|
|
82
53
|
- !ruby/object:Gem::Version
|
|
83
54
|
version: '1.3'
|
|
84
55
|
- !ruby/object:Gem::Dependency
|
|
85
|
-
name:
|
|
56
|
+
name: minitest
|
|
86
57
|
requirement: !ruby/object:Gem::Requirement
|
|
87
58
|
requirements:
|
|
88
59
|
- - ">="
|
|
89
60
|
- !ruby/object:Gem::Version
|
|
90
|
-
version: '
|
|
61
|
+
version: '5.15'
|
|
91
62
|
type: :development
|
|
92
63
|
prerelease: false
|
|
93
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
94
65
|
requirements:
|
|
95
66
|
- - ">="
|
|
96
67
|
- !ruby/object:Gem::Version
|
|
97
|
-
version: '
|
|
68
|
+
version: '5.15'
|
|
98
69
|
- !ruby/object:Gem::Dependency
|
|
99
70
|
name: pg
|
|
100
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -110,75 +81,47 @@ dependencies:
|
|
|
110
81
|
- !ruby/object:Gem::Version
|
|
111
82
|
version: '1.1'
|
|
112
83
|
- !ruby/object:Gem::Dependency
|
|
113
|
-
name:
|
|
114
|
-
requirement: !ruby/object:Gem::Requirement
|
|
115
|
-
requirements:
|
|
116
|
-
- - ">="
|
|
117
|
-
- !ruby/object:Gem::Version
|
|
118
|
-
version: 0.8.7
|
|
119
|
-
type: :development
|
|
120
|
-
prerelease: false
|
|
121
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
122
|
-
requirements:
|
|
123
|
-
- - ">="
|
|
124
|
-
- !ruby/object:Gem::Version
|
|
125
|
-
version: 0.8.7
|
|
126
|
-
- !ruby/object:Gem::Dependency
|
|
127
|
-
name: rspec
|
|
84
|
+
name: sqlite3
|
|
128
85
|
requirement: !ruby/object:Gem::Requirement
|
|
129
86
|
requirements:
|
|
130
87
|
- - ">="
|
|
131
88
|
- !ruby/object:Gem::Version
|
|
132
|
-
version: '
|
|
89
|
+
version: '2.1'
|
|
133
90
|
type: :development
|
|
134
91
|
prerelease: false
|
|
135
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
136
93
|
requirements:
|
|
137
94
|
- - ">="
|
|
138
95
|
- !ruby/object:Gem::Version
|
|
139
|
-
version: '
|
|
96
|
+
version: '2.1'
|
|
140
97
|
- !ruby/object:Gem::Dependency
|
|
141
|
-
name:
|
|
142
|
-
requirement: !ruby/object:Gem::Requirement
|
|
143
|
-
requirements:
|
|
144
|
-
- - ">="
|
|
145
|
-
- !ruby/object:Gem::Version
|
|
146
|
-
version: '3.9'
|
|
147
|
-
type: :development
|
|
148
|
-
prerelease: false
|
|
149
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
150
|
-
requirements:
|
|
151
|
-
- - ">="
|
|
152
|
-
- !ruby/object:Gem::Version
|
|
153
|
-
version: '3.9'
|
|
154
|
-
- !ruby/object:Gem::Dependency
|
|
155
|
-
name: timecop
|
|
98
|
+
name: rake
|
|
156
99
|
requirement: !ruby/object:Gem::Requirement
|
|
157
100
|
requirements:
|
|
158
101
|
- - ">="
|
|
159
102
|
- !ruby/object:Gem::Version
|
|
160
|
-
version:
|
|
103
|
+
version: 0.8.7
|
|
161
104
|
type: :development
|
|
162
105
|
prerelease: false
|
|
163
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
164
107
|
requirements:
|
|
165
108
|
- - ">="
|
|
166
109
|
- !ruby/object:Gem::Version
|
|
167
|
-
version:
|
|
110
|
+
version: 0.8.7
|
|
168
111
|
- !ruby/object:Gem::Dependency
|
|
169
|
-
name:
|
|
112
|
+
name: rubocop-rails-omakase
|
|
170
113
|
requirement: !ruby/object:Gem::Requirement
|
|
171
114
|
requirements:
|
|
172
115
|
- - ">="
|
|
173
116
|
- !ruby/object:Gem::Version
|
|
174
|
-
version: '1.
|
|
117
|
+
version: '1.1'
|
|
175
118
|
type: :development
|
|
176
119
|
prerelease: false
|
|
177
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
178
121
|
requirements:
|
|
179
122
|
- - ">="
|
|
180
123
|
- !ruby/object:Gem::Version
|
|
181
|
-
version: '1.
|
|
124
|
+
version: '1.1'
|
|
182
125
|
description: Rails tagging system based on PostgreSQL arrays
|
|
183
126
|
email:
|
|
184
127
|
- igor.alexandrov@gmail.com
|
|
@@ -190,46 +133,57 @@ files:
|
|
|
190
133
|
- ".github/ISSUE_TEMPLATE.md"
|
|
191
134
|
- ".github/workflows/lint_code.yml"
|
|
192
135
|
- ".github/workflows/lint_docs.yml"
|
|
193
|
-
- ".github/workflows/
|
|
136
|
+
- ".github/workflows/release.yml"
|
|
137
|
+
- ".github/workflows/tests.yml"
|
|
194
138
|
- ".gitignore"
|
|
195
139
|
- ".mdlrc"
|
|
196
|
-
- ".rspec"
|
|
197
140
|
- ".rubocop-md.yml"
|
|
198
141
|
- ".rubocop.yml"
|
|
199
142
|
- ".ruby-version"
|
|
200
143
|
- CODE_OF_CONDUCT.md
|
|
201
144
|
- Gemfile
|
|
202
|
-
- Gemfile.lock
|
|
203
145
|
- LICENSE.txt
|
|
204
146
|
- README.md
|
|
205
147
|
- Rakefile
|
|
148
|
+
- assets/metka-icon.svg
|
|
149
|
+
- assets/metka-logo.svg
|
|
150
|
+
- benchmark/Gemfile
|
|
151
|
+
- benchmark/README.md
|
|
152
|
+
- benchmark/benchmark.rb
|
|
153
|
+
- benchmark/results.sqlite.txt
|
|
154
|
+
- benchmark/results.txt
|
|
206
155
|
- bin/console
|
|
207
156
|
- bin/setup
|
|
157
|
+
- docs/superpowers/plans/2026-08-18-cloud-table-naming.md
|
|
158
|
+
- docs/superpowers/specs/2026-08-18-cloud-table-naming-design.md
|
|
208
159
|
- forspell.dict
|
|
209
|
-
- gemfiles/
|
|
210
|
-
- gemfiles/
|
|
211
|
-
- gemfiles/
|
|
160
|
+
- gemfiles/rails71.gemfile
|
|
161
|
+
- gemfiles/rails72.gemfile
|
|
162
|
+
- gemfiles/rails80.gemfile
|
|
163
|
+
- gemfiles/rails81.gemfile
|
|
212
164
|
- gemfiles/railsmain.gemfile
|
|
213
165
|
- gemfiles/rubocop.gemfile
|
|
214
|
-
- lib/generators/metka/strategies/
|
|
215
|
-
- lib/generators/metka/strategies/
|
|
216
|
-
- lib/generators/metka/strategies/
|
|
217
|
-
- lib/generators/metka/strategies/
|
|
166
|
+
- lib/generators/metka/strategies/index/index_generator.rb
|
|
167
|
+
- lib/generators/metka/strategies/index/templates/migration.rb.erb
|
|
168
|
+
- lib/generators/metka/strategies/table/table_generator.rb
|
|
169
|
+
- lib/generators/metka/strategies/table/templates/migration.rb.erb
|
|
170
|
+
- lib/generators/metka/strategies/table/templates/migration.sqlite.rb.erb
|
|
218
171
|
- lib/metka.rb
|
|
219
172
|
- lib/metka/generic_parser.rb
|
|
220
173
|
- lib/metka/model.rb
|
|
221
174
|
- lib/metka/query_builder.rb
|
|
222
|
-
- lib/metka/query_builder/all_tags_query.rb
|
|
223
|
-
- lib/metka/query_builder/any_tags_query.rb
|
|
224
|
-
- lib/metka/query_builder/base_query.rb
|
|
225
175
|
- lib/metka/tag_list.rb
|
|
176
|
+
- lib/metka/tags_query.rb
|
|
226
177
|
- lib/metka/version.rb
|
|
227
178
|
- metka.gemspec
|
|
228
|
-
homepage: https://github.com/
|
|
179
|
+
homepage: https://github.com/metka-ruby/metka
|
|
229
180
|
licenses:
|
|
230
181
|
- MIT
|
|
231
|
-
metadata:
|
|
232
|
-
|
|
182
|
+
metadata:
|
|
183
|
+
homepage_uri: https://github.com/metka-ruby/metka
|
|
184
|
+
source_code_uri: https://github.com/metka-ruby/metka
|
|
185
|
+
bug_tracker_uri: https://github.com/metka-ruby/metka/issues
|
|
186
|
+
rubygems_mfa_required: 'true'
|
|
233
187
|
rdoc_options: []
|
|
234
188
|
require_paths:
|
|
235
189
|
- lib
|
|
@@ -237,15 +191,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
237
191
|
requirements:
|
|
238
192
|
- - ">="
|
|
239
193
|
- !ruby/object:Gem::Version
|
|
240
|
-
version: '2
|
|
194
|
+
version: '3.2'
|
|
241
195
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
242
196
|
requirements:
|
|
243
197
|
- - ">="
|
|
244
198
|
- !ruby/object:Gem::Version
|
|
245
199
|
version: '0'
|
|
246
200
|
requirements: []
|
|
247
|
-
rubygems_version: 3.
|
|
248
|
-
signing_key:
|
|
201
|
+
rubygems_version: 3.6.9
|
|
249
202
|
specification_version: 4
|
|
250
203
|
summary: Rails tagging system based on PostgreSQL arrays
|
|
251
204
|
test_files: []
|
data/.github/workflows/specs.yml
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
name: Specs
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
pull_request:
|
|
8
|
-
schedule:
|
|
9
|
-
- cron: "0 3 * * 1" # Every monday at 3 AM
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
rspec:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
env:
|
|
15
|
-
BUNDLE_JOBS: 4
|
|
16
|
-
BUNDLE_RETRY: 3
|
|
17
|
-
CI: true
|
|
18
|
-
RAILS_ENV: test
|
|
19
|
-
DATABASE_URL: postgres://postgres:postgres@localhost:5432
|
|
20
|
-
strategy:
|
|
21
|
-
fail-fast: false
|
|
22
|
-
matrix:
|
|
23
|
-
ruby: ["2.7"]
|
|
24
|
-
postgres: ["12"]
|
|
25
|
-
gemfile: [
|
|
26
|
-
"gemfiles/rails61.gemfile"
|
|
27
|
-
]
|
|
28
|
-
fx: ["false"]
|
|
29
|
-
include:
|
|
30
|
-
- ruby: "3.0"
|
|
31
|
-
postgres: "13"
|
|
32
|
-
gemfile: "gemfiles/railsmain.gemfile"
|
|
33
|
-
fx: "false"
|
|
34
|
-
- ruby: "2.6"
|
|
35
|
-
postgres: "12"
|
|
36
|
-
gemfile: "gemfiles/rails61.gemfile"
|
|
37
|
-
fx: "false"
|
|
38
|
-
- ruby: "2.6"
|
|
39
|
-
postgres: "12"
|
|
40
|
-
gemfile: "gemfiles/rails6.gemfile"
|
|
41
|
-
fx: "false"
|
|
42
|
-
- ruby: "2.5"
|
|
43
|
-
postgres: "11"
|
|
44
|
-
gemfile: "gemfiles/rails52.gemfile"
|
|
45
|
-
fx: "false"
|
|
46
|
-
services:
|
|
47
|
-
postgres:
|
|
48
|
-
image: postgres:${{ matrix.postgres }}
|
|
49
|
-
ports: ["5432:5432"]
|
|
50
|
-
env:
|
|
51
|
-
POSTGRES_PASSWORD: postgres
|
|
52
|
-
options: >-
|
|
53
|
-
--health-cmd pg_isready
|
|
54
|
-
--health-interval 10s
|
|
55
|
-
--health-timeout 5s
|
|
56
|
-
--health-retries 5
|
|
57
|
-
steps:
|
|
58
|
-
- uses: actions/checkout@v2
|
|
59
|
-
- uses: actions/cache@v1
|
|
60
|
-
with:
|
|
61
|
-
path: /home/runner/bundle
|
|
62
|
-
key: bundle-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ hashFiles(matrix.gemfile) }}-${{ hashFiles('**/*.gemspec') }}
|
|
63
|
-
restore-keys: |
|
|
64
|
-
bundle-${{ matrix.ruby }}-${{ matrix.gemfile }}-
|
|
65
|
-
- name: Install system deps
|
|
66
|
-
run: |
|
|
67
|
-
sudo apt-get update
|
|
68
|
-
sudo apt-get -yqq install libpq-dev
|
|
69
|
-
- uses: ruby/setup-ruby@v1
|
|
70
|
-
with:
|
|
71
|
-
ruby-version: ${{ matrix.ruby }}
|
|
72
|
-
- name: Bundle install
|
|
73
|
-
run: |
|
|
74
|
-
bundle config path /home/runner/bundle
|
|
75
|
-
bundle config --global gemfile ${{ matrix.gemfile }}
|
|
76
|
-
bundle install
|
|
77
|
-
bundle update
|
|
78
|
-
- name: Prepare test database
|
|
79
|
-
run: |
|
|
80
|
-
bundle exec rake dummy:db:create
|
|
81
|
-
bundle exec rake dummy:db:migrate:reset
|
|
82
|
-
- name: Run RSpec
|
|
83
|
-
env:
|
|
84
|
-
USE_FX: ${{ matrix.fx }}
|
|
85
|
-
run: |
|
|
86
|
-
bundle exec rspec -f d --force-color
|
data/.rspec
DELETED
data/Gemfile.lock
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
metka (2.3.2)
|
|
5
|
-
dry-configurable (>= 0.8)
|
|
6
|
-
rails (>= 5.2)
|
|
7
|
-
|
|
8
|
-
GEM
|
|
9
|
-
remote: https://rubygems.org/
|
|
10
|
-
specs:
|
|
11
|
-
actioncable (6.1.4.1)
|
|
12
|
-
actionpack (= 6.1.4.1)
|
|
13
|
-
activesupport (= 6.1.4.1)
|
|
14
|
-
nio4r (~> 2.0)
|
|
15
|
-
websocket-driver (>= 0.6.1)
|
|
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
|
-
mail (>= 2.7.1)
|
|
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
|
-
mail (~> 2.5, >= 2.5.4)
|
|
29
|
-
rails-dom-testing (~> 2.0)
|
|
30
|
-
actionpack (6.1.4.1)
|
|
31
|
-
actionview (= 6.1.4.1)
|
|
32
|
-
activesupport (= 6.1.4.1)
|
|
33
|
-
rack (~> 2.0, >= 2.0.9)
|
|
34
|
-
rack-test (>= 0.6.3)
|
|
35
|
-
rails-dom-testing (~> 2.0)
|
|
36
|
-
rails-html-sanitizer (~> 1.0, >= 1.2.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
|
-
nokogiri (>= 1.8.5)
|
|
43
|
-
actionview (6.1.4.1)
|
|
44
|
-
activesupport (= 6.1.4.1)
|
|
45
|
-
builder (~> 3.1)
|
|
46
|
-
erubi (~> 1.4)
|
|
47
|
-
rails-dom-testing (~> 2.0)
|
|
48
|
-
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
|
49
|
-
activejob (6.1.4.1)
|
|
50
|
-
activesupport (= 6.1.4.1)
|
|
51
|
-
globalid (>= 0.3.6)
|
|
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
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
66
|
-
i18n (>= 1.6, < 2)
|
|
67
|
-
minitest (>= 5.1)
|
|
68
|
-
tzinfo (~> 2.0)
|
|
69
|
-
zeitwerk (~> 2.3)
|
|
70
|
-
ammeter (1.1.5)
|
|
71
|
-
activesupport (>= 3.0)
|
|
72
|
-
railties (>= 3.0)
|
|
73
|
-
rspec-rails (>= 2.2)
|
|
74
|
-
builder (3.2.4)
|
|
75
|
-
coderay (1.1.3)
|
|
76
|
-
concurrent-ruby (1.1.9)
|
|
77
|
-
crass (1.0.6)
|
|
78
|
-
database_cleaner (2.0.1)
|
|
79
|
-
database_cleaner-active_record (~> 2.0.0)
|
|
80
|
-
database_cleaner-active_record (2.0.0)
|
|
81
|
-
activerecord (>= 5.a)
|
|
82
|
-
database_cleaner-core (~> 2.0.0)
|
|
83
|
-
database_cleaner-core (2.0.1)
|
|
84
|
-
diff-lcs (1.4.4)
|
|
85
|
-
dry-configurable (0.13.0)
|
|
86
|
-
concurrent-ruby (~> 1.0)
|
|
87
|
-
dry-core (~> 0.6)
|
|
88
|
-
dry-core (0.7.1)
|
|
89
|
-
concurrent-ruby (~> 1.0)
|
|
90
|
-
erubi (1.10.0)
|
|
91
|
-
faker (2.17.0)
|
|
92
|
-
i18n (>= 1.6, < 2)
|
|
93
|
-
globalid (0.5.2)
|
|
94
|
-
activesupport (>= 5.0)
|
|
95
|
-
i18n (1.8.10)
|
|
96
|
-
concurrent-ruby (~> 1.0)
|
|
97
|
-
loofah (2.12.0)
|
|
98
|
-
crass (~> 1.0.2)
|
|
99
|
-
nokogiri (>= 1.5.9)
|
|
100
|
-
mail (2.7.1)
|
|
101
|
-
mini_mime (>= 0.1.1)
|
|
102
|
-
marcel (1.0.2)
|
|
103
|
-
method_source (1.0.0)
|
|
104
|
-
mini_mime (1.1.1)
|
|
105
|
-
mini_portile2 (2.6.1)
|
|
106
|
-
minitest (5.14.4)
|
|
107
|
-
nio4r (2.5.8)
|
|
108
|
-
nokogiri (1.12.5)
|
|
109
|
-
mini_portile2 (~> 2.6.1)
|
|
110
|
-
racc (~> 1.4)
|
|
111
|
-
pg (1.2.3)
|
|
112
|
-
pry (0.14.0)
|
|
113
|
-
coderay (~> 1.1)
|
|
114
|
-
method_source (~> 1.0)
|
|
115
|
-
racc (1.5.2)
|
|
116
|
-
rack (2.2.3)
|
|
117
|
-
rack-test (1.1.0)
|
|
118
|
-
rack (>= 1.0, < 3)
|
|
119
|
-
rails (6.1.4.1)
|
|
120
|
-
actioncable (= 6.1.4.1)
|
|
121
|
-
actionmailbox (= 6.1.4.1)
|
|
122
|
-
actionmailer (= 6.1.4.1)
|
|
123
|
-
actionpack (= 6.1.4.1)
|
|
124
|
-
actiontext (= 6.1.4.1)
|
|
125
|
-
actionview (= 6.1.4.1)
|
|
126
|
-
activejob (= 6.1.4.1)
|
|
127
|
-
activemodel (= 6.1.4.1)
|
|
128
|
-
activerecord (= 6.1.4.1)
|
|
129
|
-
activestorage (= 6.1.4.1)
|
|
130
|
-
activesupport (= 6.1.4.1)
|
|
131
|
-
bundler (>= 1.15.0)
|
|
132
|
-
railties (= 6.1.4.1)
|
|
133
|
-
sprockets-rails (>= 2.0.0)
|
|
134
|
-
rails-dom-testing (2.0.3)
|
|
135
|
-
activesupport (>= 4.2.0)
|
|
136
|
-
nokogiri (>= 1.6)
|
|
137
|
-
rails-html-sanitizer (1.4.2)
|
|
138
|
-
loofah (~> 2.3)
|
|
139
|
-
railties (6.1.4.1)
|
|
140
|
-
actionpack (= 6.1.4.1)
|
|
141
|
-
activesupport (= 6.1.4.1)
|
|
142
|
-
method_source
|
|
143
|
-
rake (>= 0.13)
|
|
144
|
-
thor (~> 1.0)
|
|
145
|
-
rake (13.0.6)
|
|
146
|
-
rspec (3.10.0)
|
|
147
|
-
rspec-core (~> 3.10.0)
|
|
148
|
-
rspec-expectations (~> 3.10.0)
|
|
149
|
-
rspec-mocks (~> 3.10.0)
|
|
150
|
-
rspec-core (3.10.1)
|
|
151
|
-
rspec-support (~> 3.10.0)
|
|
152
|
-
rspec-expectations (3.10.1)
|
|
153
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
154
|
-
rspec-support (~> 3.10.0)
|
|
155
|
-
rspec-mocks (3.10.2)
|
|
156
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
157
|
-
rspec-support (~> 3.10.0)
|
|
158
|
-
rspec-rails (5.0.1)
|
|
159
|
-
actionpack (>= 5.2)
|
|
160
|
-
activesupport (>= 5.2)
|
|
161
|
-
railties (>= 5.2)
|
|
162
|
-
rspec-core (~> 3.10)
|
|
163
|
-
rspec-expectations (~> 3.10)
|
|
164
|
-
rspec-mocks (~> 3.10)
|
|
165
|
-
rspec-support (~> 3.10)
|
|
166
|
-
rspec-support (3.10.2)
|
|
167
|
-
sprockets (4.0.2)
|
|
168
|
-
concurrent-ruby (~> 1.0)
|
|
169
|
-
rack (> 1, < 3)
|
|
170
|
-
sprockets-rails (3.2.2)
|
|
171
|
-
actionpack (>= 4.0)
|
|
172
|
-
activesupport (>= 4.0)
|
|
173
|
-
sprockets (>= 3.0.0)
|
|
174
|
-
thor (1.1.0)
|
|
175
|
-
timecop (0.9.4)
|
|
176
|
-
tzinfo (2.0.4)
|
|
177
|
-
concurrent-ruby (~> 1.0)
|
|
178
|
-
websocket-driver (0.7.5)
|
|
179
|
-
websocket-extensions (>= 0.1.0)
|
|
180
|
-
websocket-extensions (0.1.5)
|
|
181
|
-
zeitwerk (2.4.2)
|
|
182
|
-
|
|
183
|
-
PLATFORMS
|
|
184
|
-
ruby
|
|
185
|
-
|
|
186
|
-
DEPENDENCIES
|
|
187
|
-
activerecord (>= 5.2.4, < 6.2)
|
|
188
|
-
ammeter (>= 1.1)
|
|
189
|
-
bundler (>= 1.3)
|
|
190
|
-
database_cleaner (>= 1.7)
|
|
191
|
-
faker (>= 2.8)
|
|
192
|
-
metka!
|
|
193
|
-
pg (>= 1.1)
|
|
194
|
-
pry (>= 0.12.2)
|
|
195
|
-
rake (>= 0.8.7)
|
|
196
|
-
rspec (>= 3.9)
|
|
197
|
-
rspec-rails (>= 3.9)
|
|
198
|
-
timecop (>= 0.9)
|
|
199
|
-
|
|
200
|
-
BUNDLED WITH
|
|
201
|
-
2.1.4
|
data/gemfiles/rails52.gemfile
DELETED
data/gemfiles/rails6.gemfile
DELETED
data/gemfiles/rails61.gemfile
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'rails/generators'
|
|
4
|
-
require 'rails/generators/active_record'
|
|
5
|
-
|
|
6
|
-
module Metka
|
|
7
|
-
module Generators
|
|
8
|
-
module Strategies
|
|
9
|
-
class MaterializedViewGenerator < ::Rails::Generators::Base # :nodoc:
|
|
10
|
-
include Rails::Generators::Migration
|
|
11
|
-
|
|
12
|
-
DEFAULT_SOURCE_COLUMNS = ['tags'].freeze
|
|
13
|
-
|
|
14
|
-
desc <<~LONGDESC
|
|
15
|
-
Generates migration to implement view strategy for Metka
|
|
16
|
-
|
|
17
|
-
> $ rails g metka:strategies:materialized_view \
|
|
18
|
-
--source-table-name=NAME_OF_TABLE_WITH_TAGS \
|
|
19
|
-
--source-columns=NAME_OF_TAGGED_COLUMN_1 NAME_OF_TAGGED_COLUMN_2 \
|
|
20
|
-
--view-name=NAME_OF_VIEW
|
|
21
|
-
LONGDESC
|
|
22
|
-
|
|
23
|
-
source_root File.expand_path('templates', __dir__)
|
|
24
|
-
|
|
25
|
-
class_option :source_table_name, type: :string, required: true,
|
|
26
|
-
desc: 'Name of the table that has a column with tags'
|
|
27
|
-
|
|
28
|
-
class_option :source_columns, type: :array, default: DEFAULT_SOURCE_COLUMNS,
|
|
29
|
-
desc: 'List of the tagged columns names'
|
|
30
|
-
|
|
31
|
-
class_option :view_name, type: :string,
|
|
32
|
-
desc: 'Custom name for the resulting view'
|
|
33
|
-
|
|
34
|
-
def generate_migration
|
|
35
|
-
migration_template 'migration.rb.erb', "db/migrate/#{migration_name}.rb"
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
no_tasks do
|
|
39
|
-
def source_table_name
|
|
40
|
-
options[:source_table_name]
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def source_columns
|
|
44
|
-
options[:source_columns]
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def source_columns_names
|
|
48
|
-
source_columns.join('_and_')
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def view_name
|
|
52
|
-
return options[:view_name] if options[:view_name]
|
|
53
|
-
|
|
54
|
-
columns_sequence = source_columns == DEFAULT_SOURCE_COLUMNS ? nil : "_with_#{source_columns_names}"
|
|
55
|
-
"tagged#{columns_sequence}_#{source_table_name}"
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def migration_name
|
|
59
|
-
"create_#{view_name}_materialized_view"
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def migration_class_name
|
|
63
|
-
migration_name.classify
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def self.next_migration_number(dir)
|
|
68
|
-
::ActiveRecord::Generators::Base.next_migration_number(dir)
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
end
|