metka 3.0.0 → 3.0.1
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/lib/generators/metka/sql_identifier.rb +25 -0
- data/lib/generators/metka/strategies/index/index_generator.rb +7 -0
- data/lib/generators/metka/strategies/table/table_generator.rb +8 -0
- data/lib/metka/model.rb +11 -2
- data/lib/metka/version.rb +1 -1
- metadata +8 -66
- data/.github/ISSUE_TEMPLATE.md +0 -15
- data/.github/workflows/lint_code.yml +0 -24
- data/.github/workflows/lint_docs.yml +0 -56
- data/.github/workflows/release.yml +0 -23
- data/.github/workflows/tests.yml +0 -97
- data/.gitignore +0 -27
- data/.mdlrc +0 -1
- data/.rubocop-md.yml +0 -20
- data/.rubocop.yml +0 -19
- data/.ruby-version +0 -1
- data/Gemfile +0 -12
- data/Rakefile +0 -18
- data/assets/metka-icon.svg +0 -23
- data/assets/metka-logo.svg +0 -28
- data/benchmark/Gemfile +0 -17
- data/benchmark/README.md +0 -170
- data/benchmark/benchmark.rb +0 -718
- data/benchmark/results.sqlite.txt +0 -131
- data/benchmark/results.txt +0 -150
- data/bin/console +0 -14
- data/bin/setup +0 -15
- data/docs/superpowers/plans/2026-08-18-cloud-table-naming.md +0 -316
- data/docs/superpowers/specs/2026-08-18-cloud-table-naming-design.md +0 -105
- data/forspell.dict +0 -9
- data/gemfiles/rails71.gemfile +0 -6
- data/gemfiles/rails72.gemfile +0 -6
- data/gemfiles/rails80.gemfile +0 -6
- data/gemfiles/rails81.gemfile +0 -6
- data/gemfiles/railsmain.gemfile +0 -5
- data/gemfiles/rubocop.gemfile +0 -4
- data/metka.gemspec +0 -46
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d03117dddd97b8d5e4dadecbeac504796f15e931d5fac68cc294f2ffa940e6ec
|
|
4
|
+
data.tar.gz: 726433d8f58ebd159599b5617e9951004291b9e63f9f98e6a72a53459544d517
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 85dd6c3fa306dde5034e0a20ac966b689a07a6e5649ae1f9b607e1e28a62bf15f0207f9350ee79f824803c33eaa42754798ba048f4721988aef98dfd4b0af97a
|
|
7
|
+
data.tar.gz: d717a3389a9c0846454486e52b2383126b6a08e0654f9dafa112fa0bd8e130a444613a5fe344f05aaec6b5613d143eaecf56a2c776a8005a9b9112295e0dff2e
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metka
|
|
4
|
+
module Generators
|
|
5
|
+
# Generator options land verbatim in the migration's SQL, so they are
|
|
6
|
+
# constrained to plain identifiers: a hostile-looking name fails closed
|
|
7
|
+
# instead of producing broken or surprising DDL.
|
|
8
|
+
module SqlIdentifier
|
|
9
|
+
IDENTIFIER = /\A[a-zA-Z_][a-zA-Z0-9_]*\z/
|
|
10
|
+
|
|
11
|
+
private
|
|
12
|
+
|
|
13
|
+
def validate_sql_identifiers!(names_by_option)
|
|
14
|
+
names_by_option.each do |option, names|
|
|
15
|
+
names.each do |name|
|
|
16
|
+
next if IDENTIFIER.match?(name)
|
|
17
|
+
|
|
18
|
+
raise Thor::Error, "#{option} #{name.inspect} must be a plain SQL identifier: " \
|
|
19
|
+
"letters, digits and underscores, not starting with a digit"
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
require "rails/generators"
|
|
4
4
|
require "rails/generators/active_record"
|
|
5
|
+
require_relative "../../sql_identifier"
|
|
5
6
|
|
|
6
7
|
module Metka
|
|
7
8
|
module Generators
|
|
8
9
|
module Strategies
|
|
9
10
|
class IndexGenerator < ::Rails::Generators::Base # :nodoc:
|
|
10
11
|
include Rails::Generators::Migration
|
|
12
|
+
include Metka::Generators::SqlIdentifier
|
|
11
13
|
|
|
12
14
|
DEFAULT_SOURCE_COLUMNS = [ "tags" ].freeze
|
|
13
15
|
|
|
@@ -36,6 +38,11 @@ module Metka
|
|
|
36
38
|
desc: "List of the tagged columns names"
|
|
37
39
|
|
|
38
40
|
def generate_migration
|
|
41
|
+
validate_sql_identifiers!(
|
|
42
|
+
"--source-table-name" => [ source_table_name ],
|
|
43
|
+
"--source-columns" => source_columns
|
|
44
|
+
)
|
|
45
|
+
|
|
39
46
|
unless sqlite?
|
|
40
47
|
say_status :skipped,
|
|
41
48
|
"the index strategy targets SQLite; PostgreSQL GIN indexes already serve tag queries",
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
require "rails/generators"
|
|
4
4
|
require "rails/generators/active_record"
|
|
5
|
+
require_relative "../../sql_identifier"
|
|
5
6
|
|
|
6
7
|
module Metka
|
|
7
8
|
module Generators
|
|
8
9
|
module Strategies
|
|
9
10
|
class TableGenerator < ::Rails::Generators::Base # :nodoc:
|
|
10
11
|
include Rails::Generators::Migration
|
|
12
|
+
include Metka::Generators::SqlIdentifier
|
|
11
13
|
|
|
12
14
|
DEFAULT_SOURCE_COLUMNS = [ "tags" ].freeze
|
|
13
15
|
|
|
@@ -32,6 +34,12 @@ module Metka
|
|
|
32
34
|
desc: "Custom name for the resulting table"
|
|
33
35
|
|
|
34
36
|
def generate_migration
|
|
37
|
+
validate_sql_identifiers!(
|
|
38
|
+
"--source-table-name" => [ source_table_name ],
|
|
39
|
+
"--source-columns" => source_columns,
|
|
40
|
+
"--table-name" => Array(options[:table_name])
|
|
41
|
+
)
|
|
42
|
+
|
|
35
43
|
migration_template migration_template_file, "db/migrate/#{migration_name}.rb"
|
|
36
44
|
end
|
|
37
45
|
|
data/lib/metka/model.rb
CHANGED
|
@@ -52,7 +52,7 @@ module Metka
|
|
|
52
52
|
def define_tagged_with_scope(base)
|
|
53
53
|
return if base.respond_to?(:tagged_with)
|
|
54
54
|
|
|
55
|
-
columns = @columns
|
|
55
|
+
columns = @columns.map(&:to_s)
|
|
56
56
|
parser = tag_parser
|
|
57
57
|
allowed = TAGGED_WITH_OPTIONS
|
|
58
58
|
|
|
@@ -66,10 +66,19 @@ module Metka
|
|
|
66
66
|
raise ArgumentError, "Unknown tagged_with options #{unknown.inspect}, expected #{allowed.inspect}"
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
+
# :on lands in raw SQL as identifiers, so it is checked against the
|
|
70
|
+
# declared columns rather than interpolated on trust — same contract
|
|
71
|
+
# as metka_cloud.
|
|
72
|
+
on = Array(options[:on] || columns).map(&:to_s)
|
|
73
|
+
unknown_columns = on - columns
|
|
74
|
+
if unknown_columns.any?
|
|
75
|
+
raise ArgumentError, "Unknown tag columns #{unknown_columns.inspect}, expected #{columns.inspect}"
|
|
76
|
+
end
|
|
77
|
+
|
|
69
78
|
tag_list = parser.call(tags)
|
|
70
79
|
next self if tag_list.empty?
|
|
71
80
|
|
|
72
|
-
where(::Metka::QueryBuilder.instance.call(self,
|
|
81
|
+
where(::Metka::QueryBuilder.instance.call(self, on, tag_list, {
|
|
73
82
|
any: options.fetch(:any, false),
|
|
74
83
|
exclude: options[:exclude],
|
|
75
84
|
join_operator: options[:join_operator] || ::Metka::OR
|
data/lib/metka/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metka
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.
|
|
4
|
+
version: 3.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
- Igor
|
|
8
|
-
|
|
9
|
-
bindir: exe
|
|
7
|
+
- Igor Aleksandrov
|
|
8
|
+
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
@@ -24,34 +23,6 @@ dependencies:
|
|
|
24
23
|
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
25
|
version: '7.1'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: pry
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - ">="
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: 0.12.2
|
|
34
|
-
type: :development
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - ">="
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: 0.12.2
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: bundler
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - ">="
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '1.3'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - ">="
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '1.3'
|
|
55
26
|
- !ruby/object:Gem::Dependency
|
|
56
27
|
name: minitest
|
|
57
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -122,47 +93,18 @@ dependencies:
|
|
|
122
93
|
- - ">="
|
|
123
94
|
- !ruby/object:Gem::Version
|
|
124
95
|
version: '1.1'
|
|
125
|
-
description: Rails tagging system
|
|
96
|
+
description: Rails tagging system that stores tags in a PostgreSQL array column or
|
|
97
|
+
an SQLite JSON column — no join tables, no extra models, no N+1 queries.
|
|
126
98
|
email:
|
|
127
99
|
- igor.alexandrov@gmail.com
|
|
128
|
-
- andrey.morozov@jetrockets.ru
|
|
129
100
|
executables: []
|
|
130
101
|
extensions: []
|
|
131
102
|
extra_rdoc_files: []
|
|
132
103
|
files:
|
|
133
|
-
- ".github/ISSUE_TEMPLATE.md"
|
|
134
|
-
- ".github/workflows/lint_code.yml"
|
|
135
|
-
- ".github/workflows/lint_docs.yml"
|
|
136
|
-
- ".github/workflows/release.yml"
|
|
137
|
-
- ".github/workflows/tests.yml"
|
|
138
|
-
- ".gitignore"
|
|
139
|
-
- ".mdlrc"
|
|
140
|
-
- ".rubocop-md.yml"
|
|
141
|
-
- ".rubocop.yml"
|
|
142
|
-
- ".ruby-version"
|
|
143
104
|
- CODE_OF_CONDUCT.md
|
|
144
|
-
- Gemfile
|
|
145
105
|
- LICENSE.txt
|
|
146
106
|
- README.md
|
|
147
|
-
-
|
|
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
|
|
155
|
-
- bin/console
|
|
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
|
|
159
|
-
- forspell.dict
|
|
160
|
-
- gemfiles/rails71.gemfile
|
|
161
|
-
- gemfiles/rails72.gemfile
|
|
162
|
-
- gemfiles/rails80.gemfile
|
|
163
|
-
- gemfiles/rails81.gemfile
|
|
164
|
-
- gemfiles/railsmain.gemfile
|
|
165
|
-
- gemfiles/rubocop.gemfile
|
|
107
|
+
- lib/generators/metka/sql_identifier.rb
|
|
166
108
|
- lib/generators/metka/strategies/index/index_generator.rb
|
|
167
109
|
- lib/generators/metka/strategies/index/templates/migration.rb.erb
|
|
168
110
|
- lib/generators/metka/strategies/table/table_generator.rb
|
|
@@ -175,7 +117,6 @@ files:
|
|
|
175
117
|
- lib/metka/tag_list.rb
|
|
176
118
|
- lib/metka/tags_query.rb
|
|
177
119
|
- lib/metka/version.rb
|
|
178
|
-
- metka.gemspec
|
|
179
120
|
homepage: https://github.com/metka-ruby/metka
|
|
180
121
|
licenses:
|
|
181
122
|
- MIT
|
|
@@ -183,6 +124,7 @@ metadata:
|
|
|
183
124
|
homepage_uri: https://github.com/metka-ruby/metka
|
|
184
125
|
source_code_uri: https://github.com/metka-ruby/metka
|
|
185
126
|
bug_tracker_uri: https://github.com/metka-ruby/metka/issues
|
|
127
|
+
changelog_uri: https://github.com/metka-ruby/metka/releases
|
|
186
128
|
rubygems_mfa_required: 'true'
|
|
187
129
|
rdoc_options: []
|
|
188
130
|
require_paths:
|
|
@@ -200,5 +142,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
200
142
|
requirements: []
|
|
201
143
|
rubygems_version: 3.6.9
|
|
202
144
|
specification_version: 4
|
|
203
|
-
summary: Rails tagging system based on PostgreSQL arrays
|
|
145
|
+
summary: Rails tagging system based on PostgreSQL arrays and SQLite JSON columns
|
|
204
146
|
test_files: []
|
data/.github/ISSUE_TEMPLATE.md
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
name: Lint Code
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
pull_request:
|
|
8
|
-
|
|
9
|
-
permissions:
|
|
10
|
-
contents: read
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
rubocop:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
env:
|
|
16
|
-
BUNDLE_GEMFILE: gemfiles/rubocop.gemfile
|
|
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
|
-
- name: RuboCop
|
|
24
|
-
run: bundle exec rubocop
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
name: Lint Docs
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
paths:
|
|
8
|
-
- "*.md"
|
|
9
|
-
- "**/*.md"
|
|
10
|
-
pull_request:
|
|
11
|
-
paths:
|
|
12
|
-
- "*.md"
|
|
13
|
-
- "**/*.md"
|
|
14
|
-
|
|
15
|
-
permissions:
|
|
16
|
-
contents: read
|
|
17
|
-
|
|
18
|
-
jobs:
|
|
19
|
-
markdownlint:
|
|
20
|
-
runs-on: ubuntu-latest
|
|
21
|
-
steps:
|
|
22
|
-
- uses: actions/checkout@v5
|
|
23
|
-
- uses: ruby/setup-ruby@v1
|
|
24
|
-
with:
|
|
25
|
-
ruby-version: "3.4"
|
|
26
|
-
- name: Run Markdown linter
|
|
27
|
-
run: |
|
|
28
|
-
gem install mdl
|
|
29
|
-
mdl README.md .github/*.md
|
|
30
|
-
rubocop:
|
|
31
|
-
runs-on: ubuntu-latest
|
|
32
|
-
env:
|
|
33
|
-
BUNDLE_GEMFILE: gemfiles/rubocop.gemfile
|
|
34
|
-
steps:
|
|
35
|
-
- uses: actions/checkout@v5
|
|
36
|
-
- uses: ruby/setup-ruby@v1
|
|
37
|
-
with:
|
|
38
|
-
ruby-version: "3.4"
|
|
39
|
-
bundler-cache: true
|
|
40
|
-
- name: Lint Markdown files with RuboCop
|
|
41
|
-
run: bundle exec rubocop -c .rubocop-md.yml
|
|
42
|
-
forspell:
|
|
43
|
-
runs-on: ubuntu-latest
|
|
44
|
-
steps:
|
|
45
|
-
- uses: actions/checkout@v5
|
|
46
|
-
- name: Install Hunspell
|
|
47
|
-
run: |
|
|
48
|
-
sudo apt-get update
|
|
49
|
-
sudo apt-get -yqq install hunspell
|
|
50
|
-
- uses: ruby/setup-ruby@v1
|
|
51
|
-
with:
|
|
52
|
-
ruby-version: "3.4"
|
|
53
|
-
- name: Install Forspell
|
|
54
|
-
run: gem install forspell
|
|
55
|
-
- name: Run Forspell
|
|
56
|
-
run: forspell *.md .github/*.md
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
data/.github/workflows/tests.yml
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/.idea/
|
|
2
|
-
/.bundle/
|
|
3
|
-
/.yardoc
|
|
4
|
-
/_yardoc/
|
|
5
|
-
/coverage/
|
|
6
|
-
/doc/
|
|
7
|
-
/pkg/
|
|
8
|
-
/test/reports/
|
|
9
|
-
/tmp/
|
|
10
|
-
/test/tmp/
|
|
11
|
-
|
|
12
|
-
test/debug.log
|
|
13
|
-
*.gem
|
|
14
|
-
|
|
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/.mdlrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
rules "~MD013", "~MD026", "~MD029", "~MD034", "~MD041"
|
data/.rubocop-md.yml
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
inherit_from: ".rubocop.yml"
|
|
2
|
-
|
|
3
|
-
require:
|
|
4
|
-
- rubocop-md
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
AllCops:
|
|
8
|
-
Include:
|
|
9
|
-
- '**/*.md'
|
|
10
|
-
|
|
11
|
-
Lint/Void:
|
|
12
|
-
Exclude:
|
|
13
|
-
- '**/*.md'
|
|
14
|
-
|
|
15
|
-
Lint/DuplicateMethods:
|
|
16
|
-
Exclude:
|
|
17
|
-
- '**/*.md'
|
|
18
|
-
|
|
19
|
-
Layout/SpaceInsideHashLiteralBraces:
|
|
20
|
-
EnforcedStyle: space
|
data/.rubocop.yml
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
inherit_gem:
|
|
2
|
-
rubocop-rails-omakase: rubocop.yml
|
|
3
|
-
|
|
4
|
-
inherit_mode:
|
|
5
|
-
merge:
|
|
6
|
-
- Exclude
|
|
7
|
-
|
|
8
|
-
AllCops:
|
|
9
|
-
Exclude:
|
|
10
|
-
- 'bin/*'
|
|
11
|
-
- 'tmp/**/*'
|
|
12
|
-
- 'docs/**/*'
|
|
13
|
-
- 'Gemfile'
|
|
14
|
-
- 'vendor/**/*'
|
|
15
|
-
- 'gemfiles/**/*'
|
|
16
|
-
# Generated by running the dummy app's migrations
|
|
17
|
-
- 'test/dummy/db/schema.rb'
|
|
18
|
-
DisplayCopNames: true
|
|
19
|
-
TargetRubyVersion: 3.2
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.4.8
|
data/Gemfile
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
source "https://rubygems.org"
|
|
2
|
-
|
|
3
|
-
# Specify your gem's dependencies in metka.gemspec
|
|
4
|
-
gemspec
|
|
5
|
-
|
|
6
|
-
local_gemfile = "#{File.dirname(__FILE__)}/Gemfile.local"
|
|
7
|
-
|
|
8
|
-
if File.exist?(local_gemfile)
|
|
9
|
-
eval(File.read(local_gemfile)) # rubocop:disable Lint/Eval
|
|
10
|
-
else
|
|
11
|
-
gem 'activerecord', '>= 7.1'
|
|
12
|
-
end
|
data/Rakefile
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'bundler/gem_tasks'
|
|
4
|
-
require 'rake/testtask'
|
|
5
|
-
|
|
6
|
-
Rake::TestTask.new(:test) do |t|
|
|
7
|
-
t.libs << 'test'
|
|
8
|
-
t.pattern = 'test/**/*_test.rb'
|
|
9
|
-
t.warning = false
|
|
10
|
-
t.verbose = false
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
namespace :dummy do
|
|
14
|
-
require_relative 'test/dummy/config/application'
|
|
15
|
-
Dummy::Application.load_tasks
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
task default: :test
|
data/assets/metka-icon.svg
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96">
|
|
2
|
-
<style>
|
|
3
|
-
.ink { fill: none; stroke: #24292f; }
|
|
4
|
-
@media (prefers-color-scheme: dark) {
|
|
5
|
-
.ink { stroke: #e6edf3; }
|
|
6
|
-
}
|
|
7
|
-
</style>
|
|
8
|
-
<!-- array brackets -->
|
|
9
|
-
<path class="ink" d="M32 16 H18 V80 H32" stroke-width="8" stroke-linecap="round" stroke-linejoin="round"/>
|
|
10
|
-
<path class="ink" d="M64 16 H78 V80 H64" stroke-width="8" stroke-linecap="round" stroke-linejoin="round"/>
|
|
11
|
-
<!-- back tag -->
|
|
12
|
-
<g transform="translate(48 48) scale(0.88) translate(-48 -48)">
|
|
13
|
-
<g transform="translate(27 30) rotate(-18)">
|
|
14
|
-
<path fill="#fb7185" fill-rule="evenodd" d="M12 0 H34 Q40 0 40 6 V20 Q40 26 34 26 H12 L2 15.6 Q0 13 2 10.4 Z
|
|
15
|
-
M12 13 m-3.2 0 a3.2 3.2 0 1 0 6.4 0 a3.2 3.2 0 1 0 -6.4 0"/>
|
|
16
|
-
</g>
|
|
17
|
-
<!-- front tag -->
|
|
18
|
-
<g transform="translate(23 48) rotate(-18)">
|
|
19
|
-
<path fill="#e11d48" fill-rule="evenodd" d="M12 0 H34 Q40 0 40 6 V20 Q40 26 34 26 H12 L2 15.6 Q0 13 2 10.4 Z
|
|
20
|
-
M12 13 m-3.2 0 a3.2 3.2 0 1 0 6.4 0 a3.2 3.2 0 1 0 -6.4 0"/>
|
|
21
|
-
</g>
|
|
22
|
-
</g>
|
|
23
|
-
</svg>
|
data/assets/metka-logo.svg
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 336 96" width="336" height="96">
|
|
2
|
-
<style>
|
|
3
|
-
.ink { fill: none; stroke: #24292f; }
|
|
4
|
-
.word { fill: #24292f; }
|
|
5
|
-
@media (prefers-color-scheme: dark) {
|
|
6
|
-
.ink { stroke: #e6edf3; }
|
|
7
|
-
.word { fill: #e6edf3; }
|
|
8
|
-
}
|
|
9
|
-
</style>
|
|
10
|
-
<!-- array brackets -->
|
|
11
|
-
<path class="ink" d="M32 16 H18 V80 H32" stroke-width="8" stroke-linecap="round" stroke-linejoin="round"/>
|
|
12
|
-
<path class="ink" d="M64 16 H78 V80 H64" stroke-width="8" stroke-linecap="round" stroke-linejoin="round"/>
|
|
13
|
-
<!-- back tag -->
|
|
14
|
-
<g transform="translate(48 48) scale(0.88) translate(-48 -48)">
|
|
15
|
-
<g transform="translate(27 30) rotate(-18)">
|
|
16
|
-
<path fill="#fb7185" fill-rule="evenodd" d="M12 0 H34 Q40 0 40 6 V20 Q40 26 34 26 H12 L2 15.6 Q0 13 2 10.4 Z
|
|
17
|
-
M12 13 m-3.2 0 a3.2 3.2 0 1 0 6.4 0 a3.2 3.2 0 1 0 -6.4 0"/>
|
|
18
|
-
</g>
|
|
19
|
-
<!-- front tag -->
|
|
20
|
-
<g transform="translate(23 48) rotate(-18)">
|
|
21
|
-
<path fill="#e11d48" fill-rule="evenodd" d="M12 0 H34 Q40 0 40 6 V20 Q40 26 34 26 H12 L2 15.6 Q0 13 2 10.4 Z
|
|
22
|
-
M12 13 m-3.2 0 a3.2 3.2 0 1 0 6.4 0 a3.2 3.2 0 1 0 -6.4 0"/>
|
|
23
|
-
</g>
|
|
24
|
-
</g>
|
|
25
|
-
<!-- wordmark -->
|
|
26
|
-
<text class="word" x="104" y="63" font-family="'Inter','SF Pro Display','Segoe UI','Helvetica Neue',Arial,sans-serif"
|
|
27
|
-
font-size="46" font-weight="700" letter-spacing="-1">Metka</text>
|
|
28
|
-
</svg>
|
data/benchmark/Gemfile
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
source 'https://rubygems.org'
|
|
4
|
-
|
|
5
|
-
gem 'rails', '~> 8.0'
|
|
6
|
-
gem 'pg'
|
|
7
|
-
gem 'sqlite3'
|
|
8
|
-
|
|
9
|
-
gem 'metka', path: '..'
|
|
10
|
-
|
|
11
|
-
gem 'acts-as-taggable-on'
|
|
12
|
-
gem 'acts-as-taggable-array-on'
|
|
13
|
-
gem 'gutentag'
|
|
14
|
-
gem 'tag_columns'
|
|
15
|
-
|
|
16
|
-
gem 'benchmark'
|
|
17
|
-
gem 'benchmark-ips'
|