metka 2.3.4 → 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 -17
- metadata +43 -104
- data/.github/workflows/specs.yml +0 -86
- data/.rspec +0 -2
- data/Gemfile.lock +0 -239
- 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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5621512784509f88e9861c6565536ca325d32d9915630427f912bb39b1a9ea15
|
|
4
|
+
data.tar.gz: fc3b37fee78a29229c580bd784137806c6059f8edfffbbbff826ae239fa91ca3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 411ded3fec01b9b111bdd95ce8a9c4b22d077b9e816160571c132883b7e07837a237abcc20993cac38cfb3cd2fd952634f2eed3cc823aeaefce4240288973cbc
|
|
7
|
+
data.tar.gz: 713866c547b15c6f11833acf593c56172508211c0c5732ea3ef6818e92ef5dd3c112c01ba449bd9d0d6b8d20930b406b172857f663067db3f418833a0a7d27dc
|
|
@@ -6,16 +6,19 @@ on:
|
|
|
6
6
|
- master
|
|
7
7
|
pull_request:
|
|
8
8
|
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
9
12
|
jobs:
|
|
10
13
|
rubocop:
|
|
11
14
|
runs-on: ubuntu-latest
|
|
15
|
+
env:
|
|
16
|
+
BUNDLE_GEMFILE: gemfiles/rubocop.gemfile
|
|
12
17
|
steps:
|
|
13
|
-
- uses: actions/checkout@
|
|
18
|
+
- uses: actions/checkout@v5
|
|
14
19
|
- uses: ruby/setup-ruby@v1
|
|
15
20
|
with:
|
|
16
|
-
ruby-version:
|
|
21
|
+
ruby-version: "3.4"
|
|
22
|
+
bundler-cache: true
|
|
17
23
|
- name: RuboCop
|
|
18
|
-
run:
|
|
19
|
-
gem install bundler
|
|
20
|
-
bundle install --gemfile gemfiles/rubocop.gemfile --jobs 4 --retry 3
|
|
21
|
-
bundle exec --gemfile gemfiles/rubocop.gemfile rubocop
|
|
24
|
+
run: bundle exec rubocop
|
|
@@ -12,45 +12,44 @@ on:
|
|
|
12
12
|
- "*.md"
|
|
13
13
|
- "**/*.md"
|
|
14
14
|
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
15
18
|
jobs:
|
|
16
19
|
markdownlint:
|
|
17
20
|
runs-on: ubuntu-latest
|
|
18
21
|
steps:
|
|
19
|
-
- uses: actions/checkout@
|
|
22
|
+
- uses: actions/checkout@v5
|
|
20
23
|
- uses: ruby/setup-ruby@v1
|
|
21
24
|
with:
|
|
22
|
-
ruby-version:
|
|
25
|
+
ruby-version: "3.4"
|
|
23
26
|
- name: Run Markdown linter
|
|
24
27
|
run: |
|
|
25
28
|
gem install mdl
|
|
26
29
|
mdl README.md .github/*.md
|
|
27
30
|
rubocop:
|
|
28
31
|
runs-on: ubuntu-latest
|
|
32
|
+
env:
|
|
33
|
+
BUNDLE_GEMFILE: gemfiles/rubocop.gemfile
|
|
29
34
|
steps:
|
|
30
|
-
- uses: actions/checkout@
|
|
35
|
+
- uses: actions/checkout@v5
|
|
31
36
|
- uses: ruby/setup-ruby@v1
|
|
32
37
|
with:
|
|
33
|
-
ruby-version:
|
|
38
|
+
ruby-version: "3.4"
|
|
39
|
+
bundler-cache: true
|
|
34
40
|
- name: Lint Markdown files with RuboCop
|
|
35
|
-
run:
|
|
36
|
-
gem install bundler
|
|
37
|
-
bundle install --gemfile gemfiles/rubocop.gemfile --jobs 4 --retry 3
|
|
38
|
-
bundle exec --gemfile gemfiles/rubocop.gemfile rubocop -c .rubocop-md.yml
|
|
41
|
+
run: bundle exec rubocop -c .rubocop-md.yml
|
|
39
42
|
forspell:
|
|
40
43
|
runs-on: ubuntu-latest
|
|
41
44
|
steps:
|
|
42
|
-
- uses: actions/checkout@
|
|
45
|
+
- uses: actions/checkout@v5
|
|
43
46
|
- name: Install Hunspell
|
|
44
47
|
run: |
|
|
45
|
-
sudo apt-get
|
|
48
|
+
sudo apt-get update
|
|
49
|
+
sudo apt-get -yqq install hunspell
|
|
46
50
|
- uses: ruby/setup-ruby@v1
|
|
47
51
|
with:
|
|
48
|
-
ruby-version:
|
|
49
|
-
- name: Cache installed gems
|
|
50
|
-
uses: actions/cache@v1
|
|
51
|
-
with:
|
|
52
|
-
path: /home/runner/.rubies/ruby-2.7.0/lib/ruby/gems/2.7.0
|
|
53
|
-
key: gems-cache-${{ runner.os }}
|
|
52
|
+
ruby-version: "3.4"
|
|
54
53
|
- name: Install Forspell
|
|
55
54
|
run: gem install forspell
|
|
56
55
|
- name: Run Forspell
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
push:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
environment: rubygems
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
id-token: write
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v5
|
|
19
|
+
- uses: ruby/setup-ruby@v1
|
|
20
|
+
with:
|
|
21
|
+
ruby-version: "3.4"
|
|
22
|
+
bundler-cache: true
|
|
23
|
+
- uses: rubygems/release-gem@v1
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
name: Tests
|
|
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
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
minitest:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
name: Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }} / PostgreSQL ${{ matrix.postgres }}
|
|
18
|
+
continue-on-error: ${{ matrix.allow-failure || false }}
|
|
19
|
+
env:
|
|
20
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
21
|
+
BUNDLE_JOBS: 4
|
|
22
|
+
BUNDLE_RETRY: 3
|
|
23
|
+
CI: true
|
|
24
|
+
RAILS_ENV: test
|
|
25
|
+
DATABASE_URL: postgres://postgres:postgres@localhost:5432
|
|
26
|
+
strategy:
|
|
27
|
+
fail-fast: false
|
|
28
|
+
matrix:
|
|
29
|
+
include:
|
|
30
|
+
- ruby: "3.4"
|
|
31
|
+
postgres: "18"
|
|
32
|
+
gemfile: "gemfiles/rails81.gemfile"
|
|
33
|
+
- ruby: "3.4"
|
|
34
|
+
postgres: "17"
|
|
35
|
+
gemfile: "gemfiles/rails80.gemfile"
|
|
36
|
+
- ruby: "3.3"
|
|
37
|
+
postgres: "17"
|
|
38
|
+
gemfile: "gemfiles/rails72.gemfile"
|
|
39
|
+
- ruby: "3.2"
|
|
40
|
+
postgres: "16"
|
|
41
|
+
gemfile: "gemfiles/rails71.gemfile"
|
|
42
|
+
- ruby: "3.4"
|
|
43
|
+
postgres: "18"
|
|
44
|
+
gemfile: "gemfiles/railsmain.gemfile"
|
|
45
|
+
allow-failure: true
|
|
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@v5
|
|
59
|
+
- uses: ruby/setup-ruby@v1
|
|
60
|
+
with:
|
|
61
|
+
ruby-version: ${{ matrix.ruby }}
|
|
62
|
+
bundler-cache: true
|
|
63
|
+
- name: Prepare test database
|
|
64
|
+
run: |
|
|
65
|
+
bundle exec rake dummy:db:create
|
|
66
|
+
bundle exec rake dummy:db:migrate:reset
|
|
67
|
+
- name: Run Minitest
|
|
68
|
+
run: bundle exec rake test
|
|
69
|
+
|
|
70
|
+
minitest-sqlite:
|
|
71
|
+
runs-on: ubuntu-latest
|
|
72
|
+
name: Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }} / SQLite
|
|
73
|
+
env:
|
|
74
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
75
|
+
BUNDLE_JOBS: 4
|
|
76
|
+
BUNDLE_RETRY: 3
|
|
77
|
+
CI: true
|
|
78
|
+
RAILS_ENV: test
|
|
79
|
+
DB: sqlite
|
|
80
|
+
strategy:
|
|
81
|
+
fail-fast: false
|
|
82
|
+
matrix:
|
|
83
|
+
include:
|
|
84
|
+
- ruby: "3.4"
|
|
85
|
+
gemfile: "gemfiles/rails81.gemfile"
|
|
86
|
+
- ruby: "3.2"
|
|
87
|
+
gemfile: "gemfiles/rails71.gemfile"
|
|
88
|
+
steps:
|
|
89
|
+
- uses: actions/checkout@v5
|
|
90
|
+
- uses: ruby/setup-ruby@v1
|
|
91
|
+
with:
|
|
92
|
+
ruby-version: ${{ matrix.ruby }}
|
|
93
|
+
bundler-cache: true
|
|
94
|
+
- name: Prepare test database
|
|
95
|
+
run: bundle exec rake dummy:db:migrate
|
|
96
|
+
- name: Run Minitest
|
|
97
|
+
run: bundle exec rake test
|
data/.gitignore
CHANGED
|
@@ -5,14 +5,23 @@
|
|
|
5
5
|
/coverage/
|
|
6
6
|
/doc/
|
|
7
7
|
/pkg/
|
|
8
|
-
/
|
|
8
|
+
/test/reports/
|
|
9
9
|
/tmp/
|
|
10
|
-
/
|
|
10
|
+
/test/tmp/
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
.rspec_status
|
|
14
|
-
spec/debug.log
|
|
12
|
+
test/debug.log
|
|
15
13
|
*.gem
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
test/dummy/log/test.log
|
|
16
|
+
test/dummy/log/development.log
|
|
17
|
+
|
|
18
|
+
# Gemfile.lock is not committed for gems: the supported dependency range is
|
|
19
|
+
# expressed in metka.gemspec and exercised by the gemfiles/ matrix.
|
|
20
|
+
Gemfile.lock
|
|
21
|
+
gemfiles/*.lock
|
|
22
|
+
|
|
23
|
+
# Generated by running the dummy app's migrations
|
|
24
|
+
test/dummy/db/schema.rb
|
|
25
|
+
test/dummy/db/*.sqlite3
|
|
26
|
+
benchmark/*.sqlite3
|
|
27
|
+
test/dummy/tmp/
|
data/.rubocop.yml
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
inherit_gem:
|
|
2
|
-
|
|
2
|
+
rubocop-rails-omakase: rubocop.yml
|
|
3
|
+
|
|
4
|
+
inherit_mode:
|
|
5
|
+
merge:
|
|
6
|
+
- Exclude
|
|
3
7
|
|
|
4
8
|
AllCops:
|
|
5
9
|
Exclude:
|
|
@@ -9,19 +13,7 @@ AllCops:
|
|
|
9
13
|
- 'Gemfile'
|
|
10
14
|
- 'vendor/**/*'
|
|
11
15
|
- 'gemfiles/**/*'
|
|
16
|
+
# Generated by running the dummy app's migrations
|
|
17
|
+
- 'test/dummy/db/schema.rb'
|
|
12
18
|
DisplayCopNames: true
|
|
13
|
-
TargetRubyVersion: 2
|
|
14
|
-
|
|
15
|
-
Style/TrailingCommaInArrayLiteral:
|
|
16
|
-
EnforcedStyleForMultiline: no_comma
|
|
17
|
-
|
|
18
|
-
Style/TrailingCommaInHashLiteral:
|
|
19
|
-
EnforcedStyleForMultiline: no_comma
|
|
20
|
-
|
|
21
|
-
Layout/ParameterAlignment:
|
|
22
|
-
EnforcedStyle: with_first_parameter
|
|
23
|
-
|
|
24
|
-
# See https://github.com/rubocop-hq/rubocop/issues/4222
|
|
25
|
-
Lint/AmbiguousBlockAssociation:
|
|
26
|
-
Exclude:
|
|
27
|
-
- 'spec/**/*'
|
|
19
|
+
TargetRubyVersion: 3.2
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3.4.8
|
data/Gemfile
CHANGED