rom-yesql 0.5.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.devtools/templates/changelog.erb +40 -0
- data/.github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md +10 -0
- data/.github/ISSUE_TEMPLATE/---bug-report.md +30 -0
- data/.github/ISSUE_TEMPLATE/---feature-request.md +18 -0
- data/.github/workflows/ci.yml +82 -0
- data/.github/workflows/docsite.yml +62 -0
- data/.github/workflows/sync_configs.yml +53 -0
- data/.rspec +2 -0
- data/.rubocop.yml +117 -39
- data/CHANGELOG.md +32 -12
- data/CODE_OF_CONDUCT.md +13 -0
- data/CONTRIBUTING.md +29 -0
- data/Gemfile +11 -7
- data/Gemfile.devtools +17 -0
- data/Guardfile +7 -5
- data/LICENSE +20 -0
- data/README.md +14 -25
- data/Rakefile +5 -3
- data/changelog.yml +33 -0
- data/lib/rom-yesql.rb +4 -2
- data/lib/rom/yesql.rb +4 -2
- data/lib/rom/yesql/dataset.rb +2 -0
- data/lib/rom/yesql/gateway.rb +8 -6
- data/lib/rom/yesql/relation.rb +5 -4
- data/lib/rom/yesql/relation/class_interface.rb +4 -3
- data/lib/rom/yesql/version.rb +3 -1
- data/project.yml +2 -0
- data/rakelib/rubocop.rake +4 -3
- data/rom-yesql.gemspec +3 -3
- 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 +14 -19
- data/spec/support/coverage.rb +15 -0
- data/spec/support/warnings.rb +10 -0
- data/spec/unit/rom/yesql/repository_spec.rb +12 -10
- metadata +29 -22
- 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: f8a6d3dab4da13310d92b59073bf13b91e284fef8f4da60751aea849debe54a5
|
4
|
+
data.tar.gz: 3482cbe0f53e94a8040b3bb9f9a91137a074d58d4d304c3192e527a026bf733b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d25f12ef1f8538d87bad637f8fa9d64188086606140085138dacc5e84bafacd4f9e4e9c32246117c610fbb46167c033838b069963e54ff2836467d2f15bfe6a
|
7
|
+
data.tar.gz: f93b2e8e2adc49aaea229225cad6f287d456697dc28b8590428d9dd72c3174bc663b277916726528948a6e3b677067cfaef72438ba7d53660ec90fdc4633e272
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<% releases.each_with_index do |r, idx| %>
|
2
|
+
## <%= r.version %> <%= r.date %>
|
3
|
+
|
4
|
+
<% if r.summary %>
|
5
|
+
<%= r.summary %>
|
6
|
+
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<% if r.added? %>
|
10
|
+
### Added
|
11
|
+
|
12
|
+
<% r.added.each do |log| %>
|
13
|
+
- <%= log %>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<% end %>
|
17
|
+
<% if r.fixed? %>
|
18
|
+
### Fixed
|
19
|
+
|
20
|
+
<% r.fixed.each do |log| %>
|
21
|
+
- <%= log %>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<% end %>
|
25
|
+
<% if r.changed? %>
|
26
|
+
### Changed
|
27
|
+
|
28
|
+
<% r.changed.each do |log| %>
|
29
|
+
- <%= log %>
|
30
|
+
<% end %>
|
31
|
+
<% end %>
|
32
|
+
<% curr_ver = r.date ? "v#{r.version}" : 'master' %>
|
33
|
+
<% prev_rel = releases[idx + 1] %>
|
34
|
+
<% if prev_rel %>
|
35
|
+
<% ver_range = "v#{prev_rel.version}...#{curr_ver}" %>
|
36
|
+
|
37
|
+
[Compare <%=ver_range%>](https://github.com/rom-rb/<%= project.name %>/compare/<%=ver_range%>)
|
38
|
+
<% end %>
|
39
|
+
|
40
|
+
<% end %>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
name: "\U0001F41B Bug report"
|
3
|
+
about: See CONTRIBUTING.md for more information
|
4
|
+
title: ''
|
5
|
+
labels: bug
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Before you submit this: WE ONLY ACCEPT BUG REPORTS AND FEATURE REQUESTS**
|
11
|
+
|
12
|
+
For more information see `CONTRIBUTING.md`.
|
13
|
+
|
14
|
+
**Describe the bug**
|
15
|
+
|
16
|
+
A clear and concise description of what the bug is.
|
17
|
+
|
18
|
+
**To Reproduce**
|
19
|
+
|
20
|
+
Provide detailed steps to reproduce, an executable script would be best.
|
21
|
+
|
22
|
+
**Expected behavior**
|
23
|
+
|
24
|
+
A clear and concise description of what you expected to happen.
|
25
|
+
|
26
|
+
**Your environment**
|
27
|
+
|
28
|
+
- Affects my production application: **YES/NO**
|
29
|
+
- Ruby version: ...
|
30
|
+
- OS: ...
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
name: "\U0001F6E0 Feature request"
|
3
|
+
about: See CONTRIBUTING.md for more information
|
4
|
+
title: ''
|
5
|
+
labels: feature
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
Summary of what the feature is supposed to do.
|
11
|
+
|
12
|
+
## Examples
|
13
|
+
|
14
|
+
Code examples showing how the feature could be used.
|
15
|
+
|
16
|
+
## Resources
|
17
|
+
|
18
|
+
Additional information, like a link to the discussion forum thread where the feature was discussed etc.
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# this file is managed by rom-rb/devtools project
|
2
|
+
|
3
|
+
name: ci
|
4
|
+
|
5
|
+
"on":
|
6
|
+
push:
|
7
|
+
paths:
|
8
|
+
- ".github/workflows/ci.yml"
|
9
|
+
- "lib/**"
|
10
|
+
- "*.gemspec"
|
11
|
+
- "spec/**"
|
12
|
+
- "Rakefile"
|
13
|
+
- "Gemfile"
|
14
|
+
- "Gemfile.devtools"
|
15
|
+
- ".rubocop.yml"
|
16
|
+
- "project.yml"
|
17
|
+
pull_request:
|
18
|
+
branches:
|
19
|
+
- master
|
20
|
+
create:
|
21
|
+
|
22
|
+
jobs:
|
23
|
+
tests:
|
24
|
+
runs-on: ubuntu-latest
|
25
|
+
strategy:
|
26
|
+
fail-fast: false
|
27
|
+
matrix:
|
28
|
+
ruby:
|
29
|
+
- "2.7.0"
|
30
|
+
- "2.6"
|
31
|
+
- "2.5"
|
32
|
+
- "2.4"
|
33
|
+
- "jruby"
|
34
|
+
include:
|
35
|
+
- ruby: "2.6"
|
36
|
+
coverage: "true"
|
37
|
+
env:
|
38
|
+
COVERAGE: ${{matrix.coverage}}
|
39
|
+
COVERAGE_TOKEN: ${{secrets.CODACY_PROJECT_TOKEN}}
|
40
|
+
steps:
|
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
|
62
|
+
release:
|
63
|
+
runs-on: ubuntu-latest
|
64
|
+
if: contains(github.ref, 'tags') && github.event_name == 'create'
|
65
|
+
needs: tests
|
66
|
+
env:
|
67
|
+
GITHUB_LOGIN: rom-bot
|
68
|
+
GITHUB_TOKEN: ${{secrets.GH_PAT}}
|
69
|
+
steps:
|
70
|
+
- uses: actions/checkout@v1
|
71
|
+
- name: Install package dependencies
|
72
|
+
run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
|
73
|
+
- name: Set up Ruby
|
74
|
+
uses: ruby/setup-ruby@v1
|
75
|
+
with:
|
76
|
+
ruby-version: 2.6
|
77
|
+
- name: Install dependencies
|
78
|
+
run: gem install ossy --no-document
|
79
|
+
- name: Trigger release workflow
|
80
|
+
run: |
|
81
|
+
tag=$(echo $GITHUB_REF | cut -d / -f 3)
|
82
|
+
ossy gh w rom-rb/devtools release --payload "{\"tag\":\"$tag\",\"tag_creator\":\"$GITHUB_ACTOR\",\"repo\":\"$GITHUB_REPOSITORY\"}"
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# this file is managed by rom-rb/devtools project
|
2
|
+
|
3
|
+
name: docsite
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
paths:
|
8
|
+
- docsite/**
|
9
|
+
- .github/workflows/docsite.yml
|
10
|
+
branches:
|
11
|
+
- master
|
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 master
|
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
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# this file is managed by rom-rb/devtools project
|
2
|
+
|
3
|
+
name: sync
|
4
|
+
|
5
|
+
on:
|
6
|
+
repository_dispatch:
|
7
|
+
push:
|
8
|
+
branches:
|
9
|
+
- "master"
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
main:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
if: (github.event_name == 'repository_dispatch' && github.event.action == 'sync_configs') || github.event_name != 'repository_dispatch'
|
15
|
+
env:
|
16
|
+
GITHUB_LOGIN: rom-bot
|
17
|
+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
18
|
+
steps:
|
19
|
+
- name: Checkout ${{github.repository}}
|
20
|
+
uses: actions/checkout@v1
|
21
|
+
- name: Checkout devtools
|
22
|
+
uses: actions/checkout@v2
|
23
|
+
with:
|
24
|
+
repository: rom-rb/devtools
|
25
|
+
path: tmp/devtools
|
26
|
+
- name: Setup git user
|
27
|
+
run: |
|
28
|
+
git config --local user.email "rom-bot@rom-rb.org"
|
29
|
+
git config --local user.name "rom-bot"
|
30
|
+
- name: Set up Ruby
|
31
|
+
uses: ruby/setup-ruby@v1
|
32
|
+
with:
|
33
|
+
ruby-version: 2.6
|
34
|
+
- name: Install dependencies
|
35
|
+
run: gem install ossy --no-document
|
36
|
+
- name: Compile file templates
|
37
|
+
run: tmp/devtools/bin/compile-templates
|
38
|
+
- name: Update workflow files from devtools
|
39
|
+
run: tmp/devtools/bin/sync-workflows
|
40
|
+
- name: Update configuration files from devtools
|
41
|
+
run: tmp/devtools/bin/sync-shared-files
|
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 "[devtools] sync" || echo "nothing to commit"
|
50
|
+
- name: Push changes
|
51
|
+
run: |
|
52
|
+
git pull --rebase origin master
|
53
|
+
git push https://rom-bot:${{secrets.GH_PAT}}@github.com/${{github.repository}}.git HEAD:master
|
data/.rspec
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,74 +1,152 @@
|
|
1
|
-
#
|
2
|
-
inherit_from: .rubocop_todo.yml
|
1
|
+
# this file is managed by rom-rb/devtools project
|
3
2
|
|
4
|
-
# Exclude temporary files
|
5
3
|
AllCops:
|
4
|
+
TargetRubyVersion: 2.4
|
6
5
|
Exclude:
|
7
|
-
-
|
6
|
+
- spec/support/coverage.rb
|
7
|
+
- spec/support/warnings.rb
|
8
|
+
- Gemfile.devtools
|
9
|
+
- "*.gemspec"
|
8
10
|
|
9
|
-
|
10
|
-
Lint/AssignmentInCondition:
|
11
|
+
Layout/SpaceAroundMethodCallOperator:
|
11
12
|
Enabled: false
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
Layout/SpaceInLambdaLiteral:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Layout/MultilineMethodCallIndentation:
|
18
|
+
Enabled: true
|
19
|
+
EnforcedStyle: indented
|
20
|
+
|
21
|
+
Layout/FirstArrayElementIndentation:
|
22
|
+
EnforcedStyle: consistent
|
23
|
+
|
24
|
+
Layout/SpaceInsideHashLiteralBraces:
|
25
|
+
Enabled: true
|
26
|
+
EnforcedStyle: no_space
|
27
|
+
EnforcedStyleForEmptyBraces: no_space
|
28
|
+
|
29
|
+
Layout/LineLength:
|
30
|
+
Max: 100
|
31
|
+
Exclude:
|
32
|
+
- "spec/**/*_spec.rb"
|
33
|
+
|
34
|
+
Lint/BooleanSymbol:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
Lint/RaiseException:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
Lint/StructNewOverride:
|
41
|
+
Enabled: false
|
42
|
+
|
43
|
+
Lint/SuppressedException:
|
15
44
|
Exclude:
|
16
|
-
-
|
45
|
+
- "spec/spec_helper.rb"
|
46
|
+
|
47
|
+
Naming/PredicateName:
|
48
|
+
Enabled: false
|
17
49
|
|
18
|
-
|
19
|
-
Metrics/LineLength:
|
50
|
+
Naming/FileName:
|
20
51
|
Exclude:
|
21
|
-
-
|
52
|
+
- "lib/*-*.rb"
|
53
|
+
|
54
|
+
Naming/MethodName:
|
55
|
+
Enabled: false
|
56
|
+
|
57
|
+
Naming/MemoizedInstanceVariableName:
|
58
|
+
Enabled: false
|
59
|
+
|
60
|
+
Metrics/MethodLength:
|
61
|
+
Enabled: false
|
62
|
+
|
63
|
+
Metrics/ClassLength:
|
64
|
+
Enabled: false
|
65
|
+
|
66
|
+
Metrics/BlockLength:
|
67
|
+
Enabled: false
|
68
|
+
|
69
|
+
Metrics/AbcSize:
|
70
|
+
Max: 25
|
71
|
+
|
72
|
+
Metrics/CyclomaticComplexity:
|
73
|
+
Enabled: true
|
74
|
+
Max: 12
|
75
|
+
|
76
|
+
Style/ExponentialNotation:
|
77
|
+
Enabled: false
|
78
|
+
|
79
|
+
Style/HashEachMethods:
|
80
|
+
Enabled: false
|
81
|
+
|
82
|
+
Style/HashTransformKeys:
|
83
|
+
Enabled: false
|
84
|
+
|
85
|
+
Style/HashTransformValues:
|
86
|
+
Enabled: false
|
22
87
|
|
23
|
-
|
24
|
-
Style/AlignParameters:
|
88
|
+
Style/AccessModifierDeclarations:
|
25
89
|
Enabled: false
|
26
90
|
|
27
|
-
|
91
|
+
Style/Alias:
|
92
|
+
Enabled: true
|
93
|
+
EnforcedStyle: prefer_alias_method
|
94
|
+
|
28
95
|
Style/AsciiComments:
|
29
96
|
Enabled: false
|
30
97
|
|
31
|
-
# Allow using braces for value-returning blocks
|
32
98
|
Style/BlockDelimiters:
|
33
99
|
Enabled: false
|
34
100
|
|
35
|
-
|
101
|
+
Style/ClassAndModuleChildren:
|
102
|
+
Exclude:
|
103
|
+
- "spec/**/*_spec.rb"
|
104
|
+
|
105
|
+
Style/ConditionalAssignment:
|
106
|
+
Enabled: false
|
107
|
+
|
108
|
+
Style/DateTime:
|
109
|
+
Enabled: false
|
110
|
+
|
36
111
|
Style/Documentation:
|
37
112
|
Enabled: false
|
38
113
|
|
39
|
-
|
40
|
-
Style/GuardClause:
|
114
|
+
Style/EachWithObject:
|
41
115
|
Enabled: false
|
42
116
|
|
43
|
-
|
44
|
-
Style/Lambda:
|
117
|
+
Style/FormatString:
|
45
118
|
Enabled: false
|
46
119
|
|
47
|
-
|
48
|
-
Style/MultilineBlockChain:
|
120
|
+
Style/GuardClause:
|
49
121
|
Enabled: false
|
50
122
|
|
51
|
-
|
52
|
-
|
53
|
-
Exclude:
|
54
|
-
- lib/rom/command_registry.rb
|
123
|
+
Style/IfUnlessModifier:
|
124
|
+
Enabled: false
|
55
125
|
|
56
|
-
|
57
|
-
|
58
|
-
EnforcedStyle: only_raise
|
126
|
+
Style/Lambda:
|
127
|
+
Enabled: false
|
59
128
|
|
60
|
-
|
61
|
-
Style/SpaceAroundOperators:
|
129
|
+
Style/LambdaCall:
|
62
130
|
Enabled: false
|
63
131
|
|
64
|
-
|
65
|
-
Style/StringLiterals:
|
132
|
+
Style/ParallelAssignment:
|
66
133
|
Enabled: false
|
67
134
|
|
68
|
-
|
69
|
-
Style/TrivialAccessors:
|
135
|
+
Style/StabbyLambdaParentheses:
|
70
136
|
Enabled: false
|
71
137
|
|
72
|
-
|
73
|
-
|
74
|
-
|
138
|
+
Style/StringLiterals:
|
139
|
+
Enabled: true
|
140
|
+
EnforcedStyle: double_quotes
|
141
|
+
ConsistentQuotesInMultiline: false
|
142
|
+
|
143
|
+
Style/StringLiteralsInInterpolation:
|
144
|
+
Enabled: true
|
145
|
+
EnforcedStyle: double_quotes
|
146
|
+
|
147
|
+
Style/SymbolArray:
|
148
|
+
Exclude:
|
149
|
+
- "spec/**/*_spec.rb"
|
150
|
+
|
151
|
+
Style/TrailingUnderscoreVariable:
|
152
|
+
Enabled: false
|