rom-yesql 0.5.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.action_hero.yml +20 -0
- data/.devtools/templates/README.md.erb +29 -0
- data/.devtools/templates/changelog.erb +43 -0
- data/.devtools/templates/release.erb +36 -0
- data/.github/FUNDING.yml +1 -0
- data/.github/ISSUE_TEMPLATE/bug-report.md +26 -0
- data/.github/ISSUE_TEMPLATE/config.yml +5 -0
- data/.github/SUPPORT.md +3 -0
- data/.github/workflows/ci.yml +61 -0
- data/.github/workflows/docsite.yml +63 -0
- data/.github/workflows/rubocop.yml +46 -0
- data/.github/workflows/sync_configs.yml +53 -0
- data/.rspec +2 -0
- data/.rubocop.yml +210 -37
- data/CHANGELOG.md +41 -12
- data/CODEOWNERS +1 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/CONTRIBUTING.md +29 -0
- data/Gemfile +9 -7
- data/Gemfile.devtools +20 -0
- data/Guardfile +7 -5
- data/LICENSE +20 -0
- data/README.md +13 -26
- data/Rakefile +5 -3
- data/changelog.yml +38 -0
- data/lib/rom/yesql/dataset.rb +2 -0
- data/lib/rom/yesql/gateway.rb +21 -18
- data/lib/rom/yesql/relation/class_interface.rb +5 -4
- data/lib/rom/yesql/relation.rb +10 -13
- data/lib/rom/yesql/version.rb +3 -1
- data/lib/rom/yesql.rb +4 -2
- data/lib/rom-yesql.rb +4 -2
- data/project.yml +2 -0
- data/rakelib/rubocop.rake +5 -3
- data/rom-yesql.gemspec +9 -8
- data/spec/integration/adapter_spec.rb +26 -24
- data/spec/shared/database_setup.rb +5 -3
- data/spec/shared/repository_setup.rb +8 -6
- data/spec/shared/users_and_tasks.rb +9 -7
- data/spec/spec_helper.rb +13 -19
- data/spec/support/coverage.rb +15 -0
- data/spec/support/rspec_options.rb +16 -0
- data/spec/support/warnings.rb +10 -0
- data/spec/unit/rom/yesql/repository_spec.rb +12 -10
- metadata +37 -53
- data/.rubocop_todo.yml +0 -21
- data/.travis.yml +0 -30
- data/LICENSE.txt +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 332faa00fcb371dbfa8f7970458a83d923db7aa7af198898ec5512907900b3de
|
4
|
+
data.tar.gz: f2b3658976d44cb28ed12dc5da4f22fa4b3fd1fa912a8b6da157df97962e69f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d285e7991c0753235e1e69024aa1069839687ad53c247004f9ecf4ed449a2ca082cad34e49fcdc4c58568e38a7822c859a2b22346f6f9dc7ea7ccdfd2dfc4835
|
7
|
+
data.tar.gz: 2d5b9f1b2d01ad06a142d96f1d07bba75cf690dc896ca46c8eea604788d62a76856915de090783fca6b3eb074fc369dfa34fd7fb96cd5809c9546644476de812
|
data/.action_hero.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# This is a config synced from rom-rb/template-gem repo
|
2
|
+
|
3
|
+
sources:
|
4
|
+
- repo: rom-rb/template-gem
|
5
|
+
sync:
|
6
|
+
- ".action_hero.yml.erb"
|
7
|
+
- ".devtools/templates/*.sync:${{dir}}/${{name}}"
|
8
|
+
- ".github/**/*.*"
|
9
|
+
- "spec/support/*"
|
10
|
+
- "CODE_OF_CONDUCT.md"
|
11
|
+
- "CONTRIBUTING.md"
|
12
|
+
- "CODEOWNERS"
|
13
|
+
- "LICENSE.erb"
|
14
|
+
- "README.erb"
|
15
|
+
- "Gemfile.devtools"
|
16
|
+
- ".rspec"
|
17
|
+
- ".rubocop.yml"
|
18
|
+
- repo: action-hero/workflows
|
19
|
+
sync:
|
20
|
+
- ".github/workflows/*.yml"
|
@@ -0,0 +1,29 @@
|
|
1
|
+
[gem]: https://rubygems.org/gems/<%= name %>
|
2
|
+
[actions]: https://github.com/rom-rb/<%= name %>/actions
|
3
|
+
[codacy]: https://www.codacy.com/gh/rom-rb/<%= name %>
|
4
|
+
[chat]: https://rom-rb.zulipchat.com
|
5
|
+
[inchpages]: http://inch-ci.org/github/rom-rb/<%= name %>
|
6
|
+
|
7
|
+
# <%= name %> [![Join the chat at https://rom-rb.zulipchat.com](https://img.shields.io/badge/rom--rb-join%20chat-%23346b7a.svg)][chat]
|
8
|
+
|
9
|
+
[![Gem Version](https://badge.fury.io/rb/<%= name %>.svg)][gem]
|
10
|
+
[![CI Status](https://github.com/rom-rb/<%= name %>/workflows/ci/badge.svg)][actions]
|
11
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/<%= codacy_id %>)][codacy]
|
12
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/<%= codacy_id %>)][codacy]
|
13
|
+
[![Inline docs](http://inch-ci.org/github/rom-rb/<%= name %>.svg?branch=master)][inchpages]
|
14
|
+
|
15
|
+
## Links
|
16
|
+
|
17
|
+
* [API documentation](http://rubydoc.info/gems/<%= name %>)
|
18
|
+
* User documentation - not written yet, but you [can write it](https://github.com/rom-rb/rom-yesql/issues/16)! 😄
|
19
|
+
|
20
|
+
## Supported Ruby versions
|
21
|
+
|
22
|
+
This library officially supports the following Ruby versions:
|
23
|
+
|
24
|
+
* MRI >= `2.4`
|
25
|
+
* jruby >= `9.2`
|
26
|
+
|
27
|
+
## License
|
28
|
+
|
29
|
+
See `LICENSE` file.
|
@@ -0,0 +1,43 @@
|
|
1
|
+
|
2
|
+
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
3
|
+
|
4
|
+
<% releases.each_with_index do |r, idx| %>
|
5
|
+
## <%= r.version %> <%= r.date %>
|
6
|
+
|
7
|
+
<% if r.summary %>
|
8
|
+
<%= r.summary %>
|
9
|
+
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<% if r.added? %>
|
13
|
+
### Added
|
14
|
+
|
15
|
+
<% r.added.each do |log| %>
|
16
|
+
- <%= log %>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<% end %>
|
20
|
+
<% if r.fixed? %>
|
21
|
+
### Fixed
|
22
|
+
|
23
|
+
<% r.fixed.each do |log| %>
|
24
|
+
- <%= log %>
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
<% end %>
|
28
|
+
<% if r.changed? %>
|
29
|
+
### Changed
|
30
|
+
|
31
|
+
<% r.changed.each do |log| %>
|
32
|
+
- <%= log %>
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
35
|
+
<% curr_ver = r.date ? "v#{r.version}" : 'master' %>
|
36
|
+
<% prev_rel = releases[idx + 1] %>
|
37
|
+
<% if prev_rel %>
|
38
|
+
<% ver_range = "v#{prev_rel.version}...#{curr_ver}" %>
|
39
|
+
|
40
|
+
[Compare <%=ver_range%>](https://github.com/rom-rb/<%= project.name %>/compare/<%=ver_range%>)
|
41
|
+
<% end %>
|
42
|
+
|
43
|
+
<% end %>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
|
2
|
+
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
3
|
+
|
4
|
+
<% if latest_release.summary %>
|
5
|
+
<%= latest_release.summary %>
|
6
|
+
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<% if latest_release.added? %>
|
10
|
+
### Added
|
11
|
+
|
12
|
+
<% latest_release.added.each do |log| %>
|
13
|
+
- <%= log %>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<% end %>
|
17
|
+
<% if latest_release.fixed? %>
|
18
|
+
### Fixed
|
19
|
+
|
20
|
+
<% latest_release.fixed.each do |log| %>
|
21
|
+
- <%= log %>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<% end %>
|
25
|
+
<% if latest_release.changed? %>
|
26
|
+
### Changed
|
27
|
+
|
28
|
+
<% latest_release.changed.each do |log| %>
|
29
|
+
- <%= log %>
|
30
|
+
<% end %>
|
31
|
+
<% end %>
|
32
|
+
<% if previous_release %>
|
33
|
+
<% ver_range = "v#{previous_release.version}...v#{latest_release.version}" %>
|
34
|
+
|
35
|
+
[Compare <%=ver_range%>](https://github.com/rom-rb/<%= project.name %>/compare/<%=ver_range%>)
|
36
|
+
<% end %>
|
data/.github/FUNDING.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
github: hanami
|
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
name: "\U0001F41B Bug report"
|
3
|
+
about: See CONTRIBUTING.md for more information
|
4
|
+
title: ''
|
5
|
+
labels: bug, help wanted
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
## Describe the bug
|
11
|
+
|
12
|
+
A clear and concise description of what the bug is.
|
13
|
+
|
14
|
+
## To Reproduce
|
15
|
+
|
16
|
+
Provide detailed steps to reproduce, **an executable script would be best**.
|
17
|
+
|
18
|
+
## Expected behavior
|
19
|
+
|
20
|
+
A clear and concise description of what you expected to happen.
|
21
|
+
|
22
|
+
## My environment
|
23
|
+
|
24
|
+
- Affects my production application: **YES/NO**
|
25
|
+
- Ruby version: ...
|
26
|
+
- OS: ...
|
data/.github/SUPPORT.md
ADDED
@@ -0,0 +1,3 @@
|
|
1
|
+
## Support
|
2
|
+
|
3
|
+
If you need help with any of the rom-rb libraries, feel free to ask questions on our [discussion forum](https://discourse.rom-rb.org/). This is the best place to seek help. Make sure to search for a potential solution in past threads before posting your question. Thanks! :heart:
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# This file is synced from rom-rb/template-gem repo
|
2
|
+
name: ci
|
3
|
+
|
4
|
+
on:
|
5
|
+
push:
|
6
|
+
paths:
|
7
|
+
- ".github/workflows/ci.yml"
|
8
|
+
- "lib/**"
|
9
|
+
- "*.gemspec"
|
10
|
+
- "spec/**"
|
11
|
+
- "Rakefile"
|
12
|
+
- "Gemfile"
|
13
|
+
- "Gemfile.devtools"
|
14
|
+
- ".rubocop.yml"
|
15
|
+
- "project.yml"
|
16
|
+
pull_request:
|
17
|
+
branches:
|
18
|
+
- main
|
19
|
+
create:
|
20
|
+
|
21
|
+
jobs:
|
22
|
+
tests:
|
23
|
+
runs-on: ubuntu-latest
|
24
|
+
name: Tests
|
25
|
+
strategy:
|
26
|
+
fail-fast: false
|
27
|
+
matrix:
|
28
|
+
ruby:
|
29
|
+
- "3.1"
|
30
|
+
- "3.2"
|
31
|
+
- "3.3"
|
32
|
+
- "3.4"
|
33
|
+
include:
|
34
|
+
- ruby: "3.4"
|
35
|
+
coverage: "true"
|
36
|
+
env:
|
37
|
+
COVERAGE: ${{matrix.coverage}}
|
38
|
+
COVERAGE_TOKEN: ${{secrets.CODACY_PROJECT_TOKEN}}
|
39
|
+
steps:
|
40
|
+
- name: Checkout
|
41
|
+
uses: actions/checkout@v1
|
42
|
+
- name: Install package dependencies
|
43
|
+
run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
|
44
|
+
- name: Set up Ruby
|
45
|
+
uses: ruby/setup-ruby@v1
|
46
|
+
with:
|
47
|
+
ruby-version: ${{matrix.ruby}}
|
48
|
+
- name: Install latest bundler
|
49
|
+
run: |
|
50
|
+
gem install bundler --no-document
|
51
|
+
bundle config set without 'tools benchmarks docs'
|
52
|
+
- name: Bundle install
|
53
|
+
run: bundle install --jobs 4 --retry 3
|
54
|
+
- name: Run all tests
|
55
|
+
run: bundle exec rake
|
56
|
+
- name: Run codacy-coverage-reporter
|
57
|
+
uses: codacy/codacy-coverage-reporter-action@master
|
58
|
+
if: env.COVERAGE == 'true' && env.COVERAGE_TOKEN != ''
|
59
|
+
with:
|
60
|
+
project-token: ${{secrets.CODACY_PROJECT_TOKEN}}
|
61
|
+
coverage-reports: coverage/coverage.xml
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# This file is synced from rom-rb/template-gem repo
|
2
|
+
|
3
|
+
name: docsite
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
paths:
|
8
|
+
- docsite/**
|
9
|
+
- .github/workflows/docsite.yml
|
10
|
+
branches:
|
11
|
+
- main
|
12
|
+
- release-**
|
13
|
+
tags:
|
14
|
+
|
15
|
+
jobs:
|
16
|
+
update-docs:
|
17
|
+
runs-on: ubuntu-latest
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
with:
|
21
|
+
fetch-depth: 0
|
22
|
+
- run: |
|
23
|
+
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
|
24
|
+
- name: Set up Ruby
|
25
|
+
uses: actions/setup-ruby@v1
|
26
|
+
with:
|
27
|
+
ruby-version: "2.6.x"
|
28
|
+
- name: Set up git user
|
29
|
+
run: |
|
30
|
+
git config --local user.email "rom-bot@rom-rb.org"
|
31
|
+
git config --local user.name "rom-bot"
|
32
|
+
- name: Install dependencies
|
33
|
+
run: gem install ossy --no-document
|
34
|
+
- name: Update release branches
|
35
|
+
run: |
|
36
|
+
branches=`git log --format=%B -n 1 $GITHUB_SHA | grep "docsite:release-" || echo "nothing"`
|
37
|
+
|
38
|
+
if [[ ! $branches -eq "nothing" ]]; then
|
39
|
+
for b in $branches
|
40
|
+
do
|
41
|
+
name=`echo $b | ruby -e 'puts gets[/:(.+)/, 1].gsub(/\s+/, "")'`
|
42
|
+
|
43
|
+
echo "merging $GITHUB_SHA to $name"
|
44
|
+
|
45
|
+
git checkout -b $name --track origin/$name
|
46
|
+
|
47
|
+
echo `git log -n 1`
|
48
|
+
|
49
|
+
git cherry-pick $GITHUB_SHA -m 1
|
50
|
+
done
|
51
|
+
|
52
|
+
git push --all "https://rom-bot:${{secrets.GH_PAT}}@github.com/$GITHUB_REPOSITORY.git"
|
53
|
+
|
54
|
+
git checkout main
|
55
|
+
else
|
56
|
+
echo "no need to update branches"
|
57
|
+
fi
|
58
|
+
- name: Trigger rom-rb.org deploy
|
59
|
+
env:
|
60
|
+
GITHUB_LOGIN: rom-bot
|
61
|
+
GITHUB_TOKEN: ${{secrets.GH_PAT}}
|
62
|
+
run: ossy github workflow rom-rb/rom-rb.org ci
|
63
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
name: "RuboCop"
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- "main"
|
6
|
+
- "master"
|
7
|
+
paths:
|
8
|
+
- "**/*.rb"
|
9
|
+
- "**/*.rake"
|
10
|
+
- "Rakefile"
|
11
|
+
- "Gemfile*"
|
12
|
+
- ".rubocop.yml"
|
13
|
+
pull_request:
|
14
|
+
branches:
|
15
|
+
- "main"
|
16
|
+
- "master"
|
17
|
+
types:
|
18
|
+
- "opened"
|
19
|
+
- "synchronize"
|
20
|
+
workflow_dispatch:
|
21
|
+
jobs:
|
22
|
+
run:
|
23
|
+
runs-on: ubuntu-latest
|
24
|
+
name: ${{ matrix.type }}
|
25
|
+
strategy:
|
26
|
+
fail-fast: false
|
27
|
+
matrix:
|
28
|
+
type: ["Style", "Layout", "Naming", "Lint", "Metrics", "Security"]
|
29
|
+
steps:
|
30
|
+
- name: Clone
|
31
|
+
uses: actions/checkout@v2
|
32
|
+
- name: Get git diff
|
33
|
+
id: get_diff
|
34
|
+
uses: technote-space/get-diff-action@v4
|
35
|
+
with:
|
36
|
+
PATTERNS: |
|
37
|
+
**/*.rb
|
38
|
+
**/*.rake
|
39
|
+
Gemfile
|
40
|
+
Rakefile
|
41
|
+
- name: Check ${{ matrix.type }}
|
42
|
+
uses: action-hero/actions/rubocop@main
|
43
|
+
if: ${{ env.GIT_DIFF != '' }}
|
44
|
+
with:
|
45
|
+
diff: ${{ env.GIT_DIFF }}
|
46
|
+
type: ${{ matrix.type }}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# This file is synced from rom-rb/template-gem repo
|
2
|
+
|
3
|
+
name: Changelog
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
paths:
|
8
|
+
- "changelog.yml"
|
9
|
+
branches:
|
10
|
+
- "main"
|
11
|
+
pull_request:
|
12
|
+
branches:
|
13
|
+
- "main"
|
14
|
+
types: [closed]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
sync:
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
if: github.event.pull_request.merged == true
|
20
|
+
name: Update
|
21
|
+
env:
|
22
|
+
GITHUB_LOGIN: rom-bot
|
23
|
+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
24
|
+
steps:
|
25
|
+
- name: Checkout ${{github.repository}}
|
26
|
+
uses: actions/checkout@v1
|
27
|
+
- name: Checkout devtools
|
28
|
+
uses: actions/checkout@v2
|
29
|
+
with:
|
30
|
+
repository: rom-rb/devtools
|
31
|
+
path: tmp/devtools
|
32
|
+
- name: Setup git user
|
33
|
+
run: |
|
34
|
+
git config --local user.email "rom-bot@rom-rb.org"
|
35
|
+
git config --local user.name "rom-bot"
|
36
|
+
- name: Set up Ruby
|
37
|
+
uses: actions/setup-ruby@v1
|
38
|
+
with:
|
39
|
+
ruby-version: "2.6"
|
40
|
+
- name: Install dependencies
|
41
|
+
run: gem install ossy --no-document
|
42
|
+
- name: Update changelog.yml from commit
|
43
|
+
run: tmp/devtools/bin/update-changelog-from-commit $GITHUB_SHA
|
44
|
+
- name: Compile CHANGELOG.md
|
45
|
+
run: tmp/devtools/bin/compile-changelog
|
46
|
+
- name: Commit
|
47
|
+
run: |
|
48
|
+
git add -A
|
49
|
+
git commit -m "Update CHANGELOG.md" || echo "nothing to commit"
|
50
|
+
- name: Push changes
|
51
|
+
run: |
|
52
|
+
git pull --rebase origin main
|
53
|
+
git push https://rom-bot:${{secrets.GH_PAT}}@github.com/${{github.repository}}.git HEAD:main
|
data/.rspec
CHANGED