arel_toolkit 0.4.3 → 0.4.7

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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/coverage.yml +48 -0
  3. data/.github/workflows/test.yml +68 -0
  4. data/.gitignore +3 -1
  5. data/.rubocop.yml +2 -0
  6. data/.ruby-version +1 -1
  7. data/.tool-versions +1 -0
  8. data/Appraisals +4 -0
  9. data/CHANGELOG.md +49 -3
  10. data/Gemfile.lock +134 -84
  11. data/README.md +20 -3
  12. data/arel_toolkit.gemspec +3 -5
  13. data/bin/console +2 -1
  14. data/bin/setup +23 -2
  15. data/docker-compose.yml +11 -0
  16. data/gemfiles/active_record_6.gemfile +3 -3
  17. data/gemfiles/active_record_6.gemfile.lock +9 -7
  18. data/gemfiles/active_record_6_1.gemfile +7 -0
  19. data/gemfiles/active_record_6_1.gemfile.lock +263 -0
  20. data/gemfiles/arel_gems.gemfile.lock +9 -7
  21. data/gemfiles/default.gemfile.lock +9 -7
  22. data/lib/arel/enhance/context_enhancer/arel_table.rb +20 -0
  23. data/lib/arel/enhance/node.rb +20 -12
  24. data/lib/arel/enhance/visitor.rb +1 -1
  25. data/lib/arel/enhance.rb +2 -2
  26. data/lib/arel/extensions/conflict.rb +3 -3
  27. data/lib/arel/extensions/delete_statement.rb +19 -14
  28. data/lib/arel/extensions/infer.rb +2 -2
  29. data/lib/arel/extensions/insert_statement.rb +3 -3
  30. data/lib/arel/extensions/overlaps.rb +7 -1
  31. data/lib/arel/extensions/table.rb +7 -2
  32. data/lib/arel/extensions/transaction.rb +9 -9
  33. data/lib/arel/extensions/tree_manager.rb +0 -5
  34. data/lib/arel/extensions/update_statement.rb +8 -22
  35. data/lib/arel/sql_to_arel/pg_query_visitor/frame_options.rb +37 -5
  36. data/lib/arel/sql_to_arel/pg_query_visitor.rb +430 -521
  37. data/lib/arel/transformer/prefix_schema_name.rb +5 -3
  38. data/lib/arel/transformer.rb +0 -1
  39. data/lib/arel_toolkit/version.rb +1 -1
  40. metadata +15 -12
  41. data/.github/workflows/develop.yml +0 -90
  42. data/.github/workflows/master.yml +0 -67
  43. data/lib/arel/transformer/remove_active_record_info.rb +0 -40
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28d6dfc92b5aebf97e6a22fa4ded2583f5d2184b1f0a8afc7ea4bc1951805b6d
4
- data.tar.gz: 9c72d8926233ec968b2c864886a422848bb0fd85c7e2828e86db0b9cee21144a
3
+ metadata.gz: 8b20aac1b2e004c7d251e7e48aadbacc223df6fae248bbbfc4fba309e8135d66
4
+ data.tar.gz: dcb21b38da506edbcd72caafb15d6e5d911c86049abc5c61479d41d31930f193
5
5
  SHA512:
6
- metadata.gz: 7aaab2a35e519f4c85ce56135efa0374b8806318791913c351b797972827e0c10a5e4b9d17f6d21d8abed7508db17170a199ec4186dc16a9036a4e460a767ca0
7
- data.tar.gz: 127121759494230ea9d82b7499812f942c44026f4ff7d22dc08b45d0b5a60ce1505b11bc4c6136391005aef17ef2932565e6266c189fd521c0869dac455bdf47
6
+ metadata.gz: 572619fe51e9d76cad9a26e58c8205f132996a81f9e7a15dcd2692ef6bfb3d6553c2f6563eb2deaa8589fca7a1d710ea95647f2d5496f180b5a4152e77cffa50
7
+ data.tar.gz: 9aa9885eff763f559225a75f701205b6d6de6d5671bf4203917e7cd4cb420c0dfcdc273cf471309136b971840de458bdc8afd624995966380834280fd5b10f6d
@@ -0,0 +1,48 @@
1
+ name: Coverage
2
+ on:
3
+ workflow_run:
4
+ workflows: ["Test"]
5
+ types:
6
+ - completed
7
+
8
+ jobs:
9
+ upload_coverage:
10
+ runs-on: ubuntu-latest
11
+ if: ${{ github.event.workflow_run.conclusion == 'success' }}
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ with:
15
+ ref: ${{ github.event.workflow_run.head_sha }}
16
+ - env:
17
+ GITHUB: ${{ toJson(github) }}
18
+ run: |
19
+ env
20
+ - name: Download coverage
21
+ uses: dawidd6/action-download-artifact@v2
22
+ with:
23
+ workflow: test.yml
24
+ commit: ${{ github.event.workflow_run.head_sha }}
25
+ run_id: ${{ github.event.workflow_run.id }}
26
+ run_number: ${{ github.event.workflow_run.run_number }}
27
+ name: rspec-coverage
28
+ path: ./coverage
29
+ - name: Report to codeclimate
30
+ if: always()
31
+ shell: bash
32
+ env:
33
+ JOB_STATUS: ${{ job.status == 'Success' }}
34
+ CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
35
+ GIT_BRANCH: ${{ github.event.workflow_run.head_branch }}
36
+ GIT_COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
37
+ run: |
38
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
39
+ chmod +x ./cc-test-reporter
40
+ EXIT_CODE=$([[ "$JOB_STATUS" == true ]] && echo 0 || echo 1)
41
+ ./cc-test-reporter after-build --exit-code $EXIT_CODE
42
+
43
+ - name: Upload coverage to GitHub pages
44
+ if: ${{ github.event.workflow_run.head_branch == 'master' }}
45
+ uses: maxheld83/ghpages@v0.2.1
46
+ env:
47
+ BUILD_DIR: ./coverage
48
+ GH_PAT: ${{ secrets.GH_PAT }}
@@ -0,0 +1,68 @@
1
+ name: Test
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ pull_request:
7
+
8
+ jobs:
9
+ rspec:
10
+ name: RSpec
11
+ runs-on: ubuntu-latest
12
+ services:
13
+ postgres:
14
+ options: >-
15
+ --health-cmd pg_isready
16
+ --health-interval 10s
17
+ --health-timeout 5s
18
+ --health-retries 5
19
+ image: postgres:10.10
20
+ ports:
21
+ - 5432:5432
22
+ env:
23
+ POSTGRES_DB: arel_toolkit_test
24
+ POSTGRES_USER: postgres
25
+ steps:
26
+ - uses: actions/checkout@v2
27
+
28
+ # Based on https://github.com/paambaati/codeclimate-action/blob/0f8af43fca84b500025ca48b581bcff933244252/src/main.ts#L39-L57
29
+ - name: Set env for push event
30
+ run: |
31
+ GIT_BRANCH=$(echo "${{ github.ref }}" | sed 's/refs\/heads\///g')
32
+ echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
33
+ echo "GIT_COMMIT_SHA=${{ github.sha }}" >> $GITHUB_ENV
34
+ if: ${{ github.event_name == 'push' }}
35
+ - name: Set env for pull_request event
36
+ run: |
37
+ echo "GIT_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
38
+ echo "GIT_COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
39
+ if: ${{ github.event_name == 'pull_request' }}
40
+
41
+ # From https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#contexts
42
+ - env:
43
+ GITHUB: ${{ toJson(github) }}
44
+ run: |
45
+ env
46
+ - uses: ruby/setup-ruby@v1
47
+ with:
48
+ bundler-cache: true
49
+ - run: bundle exec appraisal install
50
+ - name: Compile extension
51
+ run: |
52
+ bundle exec rake clean
53
+ bundle exec rake compile
54
+ - name: Start coverage
55
+ run: |
56
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
57
+ chmod +x ./cc-test-reporter
58
+ ./cc-test-reporter before-build
59
+ - name: RSpec
60
+ run: |
61
+ bundle exec rspec --force-color
62
+ - name: Appraisal RSpec
63
+ run: |
64
+ bundle exec appraisal rspec --force-color
65
+ - uses: actions/upload-artifact@v2
66
+ with:
67
+ name: rspec-coverage
68
+ path: ./coverage
data/.gitignore CHANGED
@@ -21,4 +21,6 @@
21
21
  # emacs
22
22
  TAGS
23
23
  .#*
24
- stackprof.json
24
+ stackprof.json
25
+
26
+ .idea
data/.rubocop.yml CHANGED
@@ -1,5 +1,7 @@
1
1
  AllCops:
2
2
  Exclude:
3
+ - 'gemfiles/active_record_6.gemfile'
4
+ - 'gemfiles/active_record_6_1.gemfile'
3
5
  - 'gemfiles/arel_gems.gemfile'
4
6
  - 'gemfiles/default.gemfile'
5
7
 
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.3
1
+ 2.5.9
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 2.7.4
data/Appraisals CHANGED
@@ -11,3 +11,7 @@ end
11
11
  appraise 'active_record_6' do
12
12
  gem 'activerecord', '~> 6.0.0'
13
13
  end
14
+
15
+ appraise 'active_record_6_1' do
16
+ gem 'activerecord', '~> 6.1.0'
17
+ end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.4.7](https://github.com/mvgijssel/arel_toolkit/tree/v0.4.7) (2022-02-01)
4
+
5
+ [Full Changelog](https://github.com/mvgijssel/arel_toolkit/compare/v0.4.6...v0.4.7)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Bump google-protobuf from 3.17.3 to 3.19.2 [\#190](https://github.com/mvgijssel/arel_toolkit/pull/190) ([dependabot[bot]](https://github.com/apps/dependabot))
10
+ - Bump nokogiri from 1.11.7 to 1.12.5 [\#189](https://github.com/mvgijssel/arel_toolkit/pull/189) ([dependabot[bot]](https://github.com/apps/dependabot))
11
+ - Add Rails 6.1 support [\#188](https://github.com/mvgijssel/arel_toolkit/pull/188) ([Willianvdv](https://github.com/Willianvdv))
12
+
13
+ ## [v0.4.6](https://github.com/mvgijssel/arel_toolkit/tree/v0.4.6) (2021-07-29)
14
+
15
+ [Full Changelog](https://github.com/mvgijssel/arel_toolkit/compare/v0.4.5...v0.4.6)
16
+
17
+ **Implemented enhancements:**
18
+
19
+ - Use GitHub actions instead of TravisCI [\#137](https://github.com/mvgijssel/arel_toolkit/issues/137)
20
+ - Bump addressable from 2.7.0 to 2.8.0 [\#183](https://github.com/mvgijssel/arel_toolkit/pull/183) ([dependabot[bot]](https://github.com/apps/dependabot))
21
+ - Upgrade pg\_query to 2.0 [\#175](https://github.com/mvgijssel/arel_toolkit/pull/175) ([DeRRudi77](https://github.com/DeRRudi77))
22
+
23
+ **Fixed bugs:**
24
+
25
+ - Improve local development experience [\#184](https://github.com/mvgijssel/arel_toolkit/pull/184) ([mvgijssel](https://github.com/mvgijssel))
26
+
27
+ ## [v0.4.5](https://github.com/mvgijssel/arel_toolkit/tree/v0.4.5) (2021-07-08)
28
+
29
+ [Full Changelog](https://github.com/mvgijssel/arel_toolkit/compare/v0.4.4...v0.4.5)
30
+
31
+ **Implemented enhancements:**
32
+
33
+ - Refactor test setup [\#181](https://github.com/mvgijssel/arel_toolkit/issues/181)
34
+ - Bump nokogiri from 1.11.1 to 1.11.7 [\#176](https://github.com/mvgijssel/arel_toolkit/pull/176) ([dependabot[bot]](https://github.com/apps/dependabot))
35
+ - Bump activerecord from 5.2.4.3 to 6.1.3 [\#173](https://github.com/mvgijssel/arel_toolkit/pull/173) ([dependabot[bot]](https://github.com/apps/dependabot))
36
+
37
+ ## [v0.4.4](https://github.com/mvgijssel/arel_toolkit/tree/v0.4.4) (2021-02-11)
38
+
39
+ [Full Changelog](https://github.com/mvgijssel/arel_toolkit/compare/v0.4.3...v0.4.4)
40
+
41
+ **Implemented enhancements:**
42
+
43
+ - Bump nokogiri from 1.10.8 to 1.11.1 [\#171](https://github.com/mvgijssel/arel_toolkit/pull/171) ([dependabot[bot]](https://github.com/apps/dependabot))
44
+
45
+ **Fixed bugs:**
46
+
47
+ - Fix conditional update and delete statements in Rails 6 [\#170](https://github.com/mvgijssel/arel_toolkit/pull/170) ([mvgijssel](https://github.com/mvgijssel))
48
+
3
49
  ## [v0.4.3](https://github.com/mvgijssel/arel_toolkit/tree/v0.4.3) (2020-11-09)
4
50
 
5
51
  [Full Changelog](https://github.com/mvgijssel/arel_toolkit/compare/v0.4.2...v0.4.3)
@@ -35,7 +81,7 @@
35
81
  - Create a transformer that replaces a table reference with a subquery [\#141](https://github.com/mvgijssel/arel_toolkit/issues/141)
36
82
  - Same signature for all middleware helpers [\#135](https://github.com/mvgijssel/arel_toolkit/issues/135)
37
83
  - Instantiate PG::Result object instead of duck typed object [\#130](https://github.com/mvgijssel/arel_toolkit/issues/130)
38
- - Add `to\_sql` to Arel.middleware which prints the sql after middleware processing [\#127](https://github.com/mvgijssel/arel_toolkit/issues/127)
84
+ - Add `to_sql` to Arel.middleware which prints the sql after middleware processing [\#127](https://github.com/mvgijssel/arel_toolkit/issues/127)
39
85
  - Extend Middleware to include the response from the database [\#126](https://github.com/mvgijssel/arel_toolkit/issues/126)
40
86
  - Extend AddSchemaToTable to support multiple schemas and regclass typecasts [\#124](https://github.com/mvgijssel/arel_toolkit/issues/124)
41
87
  - Optional context argument for Arel middleware [\#110](https://github.com/mvgijssel/arel_toolkit/issues/110)
@@ -101,7 +147,7 @@
101
147
 
102
148
  ## [v0.2.0](https://github.com/mvgijssel/arel_toolkit/tree/v0.2.0) (2019-05-30)
103
149
 
104
- [Full Changelog](https://github.com/mvgijssel/arel_toolkit/compare/v0.1.0...v0.2.0)
150
+ [Full Changelog](https://github.com/mvgijssel/arel_toolkit/compare/6507f4849d752353a23e9c14b73e4759b370ada9...v0.2.0)
105
151
 
106
152
  **Implemented enhancements:**
107
153
 
@@ -133,4 +179,4 @@
133
179
 
134
180
 
135
181
 
136
- \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
182
+ \* *This Changelog was automatically generated by [github_changelog_generator] (https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile.lock CHANGED
@@ -1,61 +1,100 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arel_toolkit (0.4.3)
5
- activerecord
4
+ arel_toolkit (0.4.7)
5
+ activerecord (>= 5.0.0)
6
6
  pg (~> 1.1.4)
7
- pg_query (~> 1.2.0)
7
+ pg_query (~> 2.1)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activemodel (5.2.4.3)
13
- activesupport (= 5.2.4.3)
14
- activerecord (5.2.4.3)
15
- activemodel (= 5.2.4.3)
16
- activesupport (= 5.2.4.3)
17
- arel (>= 9.0)
18
- activesupport (5.2.4.3)
12
+ activemodel (6.1.4.1)
13
+ activesupport (= 6.1.4.1)
14
+ activerecord (6.1.4.1)
15
+ activemodel (= 6.1.4.1)
16
+ activesupport (= 6.1.4.1)
17
+ activesupport (6.1.4.1)
19
18
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
- i18n (>= 0.7, < 2)
21
- minitest (~> 5.1)
22
- tzinfo (~> 1.1)
23
- addressable (2.7.0)
19
+ i18n (>= 1.6, < 2)
20
+ minitest (>= 5.1)
21
+ tzinfo (~> 2.0)
22
+ zeitwerk (~> 2.3)
23
+ addressable (2.8.0)
24
24
  public_suffix (>= 2.0.2, < 5.0)
25
25
  ansi (1.5.0)
26
- appraisal (2.2.0)
26
+ appraisal (2.4.1)
27
27
  bundler
28
28
  rake
29
29
  thor (>= 0.14.0)
30
- approvals (0.0.24)
31
- nokogiri (~> 1.6)
32
- thor (~> 0.18)
33
- arel (9.0.0)
34
- ast (2.4.0)
35
- binding_of_caller (0.8.0)
30
+ approvals (0.0.25)
31
+ nokogiri (~> 1.8)
32
+ thor (~> 1.0)
33
+ ast (2.4.2)
34
+ async (1.30.1)
35
+ console (~> 1.10)
36
+ nio4r (~> 2.3)
37
+ timers (~> 4.1)
38
+ async-http (0.56.5)
39
+ async (>= 1.25)
40
+ async-io (>= 1.28)
41
+ async-pool (>= 0.2)
42
+ protocol-http (~> 0.22.0)
43
+ protocol-http1 (~> 0.14.0)
44
+ protocol-http2 (~> 0.14.0)
45
+ async-http-faraday (0.11.0)
46
+ async-http (~> 0.42)
47
+ faraday
48
+ async-io (1.32.2)
49
+ async
50
+ async-pool (0.3.8)
51
+ async (>= 1.25)
52
+ binding_of_caller (1.0.0)
36
53
  debug_inspector (>= 0.0.1)
37
- coderay (1.1.2)
38
- concurrent-ruby (1.1.6)
54
+ coderay (1.1.3)
55
+ concurrent-ruby (1.1.9)
56
+ console (1.13.1)
57
+ fiber-local
39
58
  database_cleaner (1.7.0)
40
- debug_inspector (0.0.3)
41
- diff-lcs (1.3)
42
- docile (1.3.1)
43
- dpl (1.10.11)
44
- faraday (0.17.0)
59
+ debug_inspector (1.1.0)
60
+ diff-lcs (1.4.4)
61
+ docile (1.4.0)
62
+ dpl (1.10.16)
63
+ faraday (1.8.0)
64
+ faraday-em_http (~> 1.0)
65
+ faraday-em_synchrony (~> 1.0)
66
+ faraday-excon (~> 1.1)
67
+ faraday-httpclient (~> 1.0.1)
68
+ faraday-net_http (~> 1.0)
69
+ faraday-net_http_persistent (~> 1.1)
70
+ faraday-patron (~> 1.0)
71
+ faraday-rack (~> 1.0)
45
72
  multipart-post (>= 1.2, < 3)
46
- faraday-http-cache (2.0.0)
47
- faraday (~> 0.8)
48
- ffi (1.11.1)
49
- formatador (0.2.5)
50
- github_changelog_generator (1.15.0)
73
+ ruby2_keywords (>= 0.0.4)
74
+ faraday-em_http (1.0.0)
75
+ faraday-em_synchrony (1.0.0)
76
+ faraday-excon (1.1.0)
77
+ faraday-http-cache (2.2.0)
78
+ faraday (>= 0.8)
79
+ faraday-httpclient (1.0.1)
80
+ faraday-net_http (1.0.1)
81
+ faraday-net_http_persistent (1.2.0)
82
+ faraday-patron (1.0.0)
83
+ faraday-rack (1.0.0)
84
+ ffi (1.15.4)
85
+ fiber-local (1.0.0)
86
+ formatador (0.3.0)
87
+ github_changelog_generator (1.16.4)
51
88
  activesupport
89
+ async (>= 1.25.0)
90
+ async-http-faraday
52
91
  faraday-http-cache
53
92
  multi_json
54
93
  octokit (~> 4.6)
55
94
  rainbow (>= 2.2.1)
56
95
  rake (>= 10.0)
57
- retriable (~> 3.0)
58
- guard (2.15.0)
96
+ google-protobuf (3.19.4)
97
+ guard (2.17.0)
59
98
  formatador (>= 0.2.4)
60
99
  listen (>= 2.7, < 4.0)
61
100
  lumberjack (>= 1.0.12, < 2.0)
@@ -76,74 +115,84 @@ GEM
76
115
  guard (~> 2.0)
77
116
  rubocop (~> 0.20)
78
117
  hirb (0.7.3)
79
- i18n (1.8.2)
118
+ i18n (1.8.10)
80
119
  concurrent-ruby (~> 1.0)
81
120
  interception (0.5)
82
- jaro_winkler (1.5.3)
83
- json (2.3.1)
84
- listen (3.1.5)
85
- rb-fsevent (~> 0.9, >= 0.9.4)
86
- rb-inotify (~> 0.9, >= 0.9.7)
87
- ruby_dep (~> 1.2)
88
- lumberjack (1.0.13)
121
+ jaro_winkler (1.5.4)
122
+ json (2.5.1)
123
+ listen (3.7.0)
124
+ rb-fsevent (~> 0.10, >= 0.10.3)
125
+ rb-inotify (~> 0.9, >= 0.9.10)
126
+ lumberjack (1.2.8)
89
127
  memory_profiler (0.9.14)
90
128
  method_source (0.9.2)
91
- mini_portile2 (2.4.0)
92
- minitest (5.14.1)
93
- multi_json (1.14.1)
129
+ mini_portile2 (2.6.1)
130
+ minitest (5.14.4)
131
+ multi_json (1.15.0)
94
132
  multipart-post (2.1.1)
95
133
  nenv (0.3.0)
96
- nokogiri (1.10.8)
97
- mini_portile2 (~> 2.4.0)
98
- notiffany (0.1.1)
134
+ nio4r (2.5.8)
135
+ nokogiri (1.12.5)
136
+ mini_portile2 (~> 2.6.1)
137
+ racc (~> 1.4)
138
+ notiffany (0.1.3)
99
139
  nenv (~> 0.1)
100
140
  shellany (~> 0.0)
101
- octokit (4.14.0)
141
+ octokit (4.21.0)
142
+ faraday (>= 0.9)
102
143
  sawyer (~> 0.8.0, >= 0.5.3)
103
- parallel (1.17.0)
104
- parser (2.6.3.0)
105
- ast (~> 2.4.0)
144
+ parallel (1.21.0)
145
+ parser (3.0.2.0)
146
+ ast (~> 2.4.1)
106
147
  pg (1.1.4)
107
- pg_query (1.2.0)
148
+ pg_query (2.1.3)
149
+ google-protobuf (>= 3.19.2)
150
+ protocol-hpack (1.4.2)
151
+ protocol-http (0.22.5)
152
+ protocol-http1 (0.14.2)
153
+ protocol-http (~> 0.22)
154
+ protocol-http2 (0.14.2)
155
+ protocol-hpack (~> 1.4)
156
+ protocol-http (~> 0.18)
108
157
  pry (0.12.2)
109
158
  coderay (~> 1.1.0)
110
159
  method_source (~> 0.9.0)
111
160
  pry-alias (0.0.1)
112
161
  binding_of_caller
113
162
  pry
114
- pry-doc (1.0.0)
163
+ pry-doc (1.2.0)
115
164
  pry (~> 0.11)
116
165
  yard (~> 0.9.11)
117
166
  pry-nav (0.3.0)
118
167
  pry (>= 0.9.10, < 0.13.0)
119
- pry-rescue (1.5.0)
168
+ pry-rescue (1.5.2)
120
169
  interception (>= 0.5)
121
170
  pry (>= 0.12.0)
122
171
  pry-stack_explorer (0.4.9.3)
123
172
  binding_of_caller (>= 0.7)
124
173
  pry (>= 0.9.11)
125
- public_suffix (4.0.1)
174
+ public_suffix (4.0.6)
175
+ racc (1.5.2)
126
176
  rainbow (3.0.0)
127
- rake (13.0.1)
128
- rake-compiler (1.0.7)
177
+ rake (13.0.6)
178
+ rake-compiler (1.1.1)
129
179
  rake
130
- rb-fsevent (0.10.3)
131
- rb-inotify (0.10.0)
180
+ rb-fsevent (0.11.0)
181
+ rb-inotify (0.10.1)
132
182
  ffi (~> 1.0)
133
- retriable (3.1.2)
134
- rspec (3.8.0)
135
- rspec-core (~> 3.8.0)
136
- rspec-expectations (~> 3.8.0)
137
- rspec-mocks (~> 3.8.0)
138
- rspec-core (3.8.0)
139
- rspec-support (~> 3.8.0)
140
- rspec-expectations (3.8.3)
183
+ rspec (3.10.0)
184
+ rspec-core (~> 3.10.0)
185
+ rspec-expectations (~> 3.10.0)
186
+ rspec-mocks (~> 3.10.0)
187
+ rspec-core (3.10.1)
188
+ rspec-support (~> 3.10.0)
189
+ rspec-expectations (3.10.1)
141
190
  diff-lcs (>= 1.2.0, < 2.0)
142
- rspec-support (~> 3.8.0)
143
- rspec-mocks (3.8.0)
191
+ rspec-support (~> 3.10.0)
192
+ rspec-mocks (3.10.2)
144
193
  diff-lcs (>= 1.2.0, < 2.0)
145
- rspec-support (~> 3.8.0)
146
- rspec-support (3.8.0)
194
+ rspec-support (~> 3.10.0)
195
+ rspec-support (3.10.2)
147
196
  rubocop (0.71.0)
148
197
  jaro_winkler (~> 1.5.1)
149
198
  parallel (~> 1.10)
@@ -151,8 +200,8 @@ GEM
151
200
  rainbow (>= 2.2.2, < 4.0)
152
201
  ruby-progressbar (~> 1.7)
153
202
  unicode-display_width (>= 1.4.0, < 1.7)
154
- ruby-progressbar (1.10.1)
155
- ruby_dep (1.5.0)
203
+ ruby-progressbar (1.11.0)
204
+ ruby2_keywords (0.0.5)
156
205
  sawyer (0.8.2)
157
206
  addressable (>= 2.3.5)
158
207
  faraday (> 0.8, < 2.0)
@@ -166,19 +215,20 @@ GEM
166
215
  hirb
167
216
  simplecov
168
217
  simplecov-html (0.10.2)
169
- stackprof (0.2.13)
170
- thor (0.20.3)
171
- thread_safe (0.3.6)
172
- tzinfo (1.2.7)
173
- thread_safe (~> 0.1)
174
- unicode-display_width (1.6.0)
175
- yard (0.9.20)
218
+ stackprof (0.2.17)
219
+ thor (1.1.0)
220
+ timers (4.3.3)
221
+ tzinfo (2.0.4)
222
+ concurrent-ruby (~> 1.0)
223
+ unicode-display_width (1.6.1)
224
+ yard (0.9.26)
225
+ zeitwerk (2.4.2)
176
226
 
177
227
  PLATFORMS
178
228
  ruby
179
229
 
180
230
  DEPENDENCIES
181
- appraisal (~> 2.2.0)
231
+ appraisal (~> 2.4.1)
182
232
  approvals (~> 0.0.24)
183
233
  arel_toolkit!
184
234
  bundler (~> 2.0)
@@ -205,4 +255,4 @@ DEPENDENCIES
205
255
  stackprof (~> 0.2)
206
256
 
207
257
  BUNDLED WITH
208
- 2.1.4
258
+ 2.3.6
data/README.md CHANGED
@@ -143,9 +143,26 @@ This gem aims to have full support for PostgreSQL's SQL. In order to do so, it n
143
143
 
144
144
  ## Development
145
145
 
146
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
147
-
148
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
146
+ 1. Check out the repo
147
+ 1. Run `bin/setup` to install dependencies.
148
+ 1. Start the postgres database `docker compose up`
149
+ 1. Run `bundle exec rspec` to run the tests
150
+ 1. Run `bundle exec appraisal rspec` to run the tests for the different gem sets
151
+
152
+ You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`.
153
+
154
+ ## Releasing
155
+
156
+ 1. Update version in `version.rb`
157
+ 1. Create a new branch `v<<VERSION_HERE>>`
158
+ 1. Run `bundle install`
159
+ 1. Run `bundle exec appraisal install`
160
+ 1. Run `bundle exec rake changelog`
161
+ 1. Commit the changes
162
+ 1. Open a PR with name `Version <<VERSION_HERE>>` ([example](https://github.com/mvgijssel/arel_toolkit/pull/172))
163
+ 1. Merge the PR
164
+ 1. Checkout the master branch and pull latest changes
165
+ 1. Run `bundle exec rake release`
149
166
 
150
167
  ## Contributing
151
168
 
data/arel_toolkit.gemspec CHANGED
@@ -25,9 +25,9 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ['lib']
26
26
  spec.extensions = ['ext/pg_result_init/extconf.rb']
27
27
 
28
- spec.add_dependency 'activerecord'
28
+ spec.add_dependency 'activerecord', '>= 5.0.0'
29
29
  spec.add_dependency 'pg', '~> 1.1.4'
30
- spec.add_dependency 'pg_query', '~> 1.2.0'
30
+ spec.add_dependency 'pg_query', '~> 2.1'
31
31
 
32
32
  spec.add_development_dependency 'bundler', '~> 2.0'
33
33
  spec.add_development_dependency 'dpl', '~> 1.10.11'
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency 'rake-compiler', '~> 1.0'
37
37
  spec.add_development_dependency 'rspec', '~> 3.8'
38
38
  spec.add_development_dependency 'approvals', '~> 0.0.24'
39
- spec.add_development_dependency 'appraisal', '~> 2.2.0'
39
+ spec.add_development_dependency 'appraisal', '~> 2.4.1'
40
40
  spec.add_development_dependency 'database_cleaner', '~> 1.7.0'
41
41
  spec.add_development_dependency 'simplecov', '~> 0.16.1'
42
42
  spec.add_development_dependency 'simplecov-console', '~> 0.4.2'
@@ -47,10 +47,8 @@ Gem::Specification.new do |spec|
47
47
  spec.add_development_dependency 'guard-rspec', '~> 4.7'
48
48
  spec.add_development_dependency 'guard-rubocop', '~> 1.3.0'
49
49
  spec.add_development_dependency 'guard-rake', '~> 1.0.0'
50
-
51
50
  spec.add_development_dependency 'stackprof', '~> 0.2'
52
51
  spec.add_development_dependency 'memory_profiler', '~> 0.9'
53
-
54
52
  spec.add_development_dependency 'pry'
55
53
  spec.add_development_dependency 'pry-nav'
56
54
  spec.add_development_dependency 'pry-doc'
data/bin/console CHANGED
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'bundler/setup'
4
+ require 'pry'
5
+
4
6
  require 'arel_toolkit'
5
7
  require_relative '../spec/support/active_record'
6
8
 
@@ -8,5 +10,4 @@ require_relative '../spec/support/active_record'
8
10
  # with your gem easier. You can also use a different console, if you like.
9
11
 
10
12
  # (If you use this, don't forget to add pry to your Gemfile!)
11
- require 'pry'
12
13
  Pry.start
data/bin/setup CHANGED
@@ -3,6 +3,27 @@ set -euo pipefail
3
3
  IFS=$'\n\t'
4
4
  set -vx
5
5
 
6
- bundle install
6
+ asdf plugin-add ruby || true
7
+ asdf install
8
+
9
+ # Make sure "gem" is available
10
+ asdf reshim ruby
11
+
12
+ # Need specific version of bundler for this ruby version
13
+ gem install bundler -v 2.2.19
14
+
15
+ # Make sure "bundle" is available
16
+ asdf reshim ruby
7
17
 
8
- # Do any other automated setup that you need to do here
18
+ EXPECTED_VERSION="Bundler version 2.2.19"
19
+ BUNDLER_VERSION=$(bundle --version)
20
+
21
+ if [[ "$BUNDLER_VERSION" != "$EXPECTED_VERSION" ]]; then
22
+ echo "Using the wrong bundler version: '$BUNDLER_VERSION'. Expected '$EXPECTED_VERSION'"
23
+ exit 1
24
+ fi
25
+
26
+ bundle install
27
+ bundle exec appraisal install
28
+ bundle exec rake clean
29
+ bundle exec rake compile
@@ -0,0 +1,11 @@
1
+ version: '3.8'
2
+ services:
3
+ database:
4
+ image: postgres:latest
5
+ container_name: arel_toolkit_database
6
+ environment:
7
+ POSTGRES_PASSWORD: postgres
8
+ POSTGRES_USER: postgres
9
+ POSTGRES_DB: arel_toolkit_test
10
+ ports:
11
+ - 5432:5432