arel_extensions 2.1.2 → 2.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +1 -2
  3. data/.github/workflows/ruby.yml +43 -91
  4. data/.gitignore +7 -6
  5. data/.rubocop.yml +62 -1
  6. data/Gemfile +11 -11
  7. data/README.md +1 -1
  8. data/Rakefile +4 -4
  9. data/TODO +0 -1
  10. data/appveyor.yml +73 -0
  11. data/arel_extensions.gemspec +11 -11
  12. data/gemfiles/rails3.gemfile +10 -10
  13. data/gemfiles/rails4.gemfile +14 -14
  14. data/gemfiles/rails5_0.gemfile +13 -13
  15. data/gemfiles/rails5_1_4.gemfile +13 -13
  16. data/gemfiles/rails5_2.gemfile +15 -14
  17. data/gemfiles/rails6.gemfile +13 -12
  18. data/gemfiles/rails6_1.gemfile +13 -12
  19. data/gemfiles/rails7.gemfile +9 -8
  20. data/gemspecs/arel_extensions-v1.gemspec +12 -12
  21. data/gemspecs/arel_extensions-v2.gemspec +11 -11
  22. data/init/mssql.sql +0 -0
  23. data/init/mysql.sql +0 -0
  24. data/init/oracle.sql +0 -0
  25. data/init/postgresql.sql +0 -0
  26. data/init/sqlite.sql +0 -0
  27. data/lib/arel_extensions/attributes.rb +2 -2
  28. data/lib/arel_extensions/boolean_functions.rb +2 -4
  29. data/lib/arel_extensions/common_sql_functions.rb +12 -12
  30. data/lib/arel_extensions/comparators.rb +14 -14
  31. data/lib/arel_extensions/date_duration.rb +7 -7
  32. data/lib/arel_extensions/helpers.rb +19 -16
  33. data/lib/arel_extensions/insert_manager.rb +1 -1
  34. data/lib/arel_extensions/math.rb +44 -31
  35. data/lib/arel_extensions/math_functions.rb +18 -18
  36. data/lib/arel_extensions/nodes/abs.rb +0 -0
  37. data/lib/arel_extensions/nodes/aggregate_function.rb +0 -0
  38. data/lib/arel_extensions/nodes/blank.rb +1 -1
  39. data/lib/arel_extensions/nodes/case.rb +4 -6
  40. data/lib/arel_extensions/nodes/cast.rb +5 -5
  41. data/lib/arel_extensions/nodes/ceil.rb +0 -0
  42. data/lib/arel_extensions/nodes/change_case.rb +0 -0
  43. data/lib/arel_extensions/nodes/coalesce.rb +1 -1
  44. data/lib/arel_extensions/nodes/collate.rb +9 -9
  45. data/lib/arel_extensions/nodes/concat.rb +2 -2
  46. data/lib/arel_extensions/nodes/date_diff.rb +10 -10
  47. data/lib/arel_extensions/nodes/duration.rb +0 -0
  48. data/lib/arel_extensions/nodes/find_in_set.rb +0 -0
  49. data/lib/arel_extensions/nodes/floor.rb +0 -0
  50. data/lib/arel_extensions/nodes/format.rb +0 -0
  51. data/lib/arel_extensions/nodes/formatted_number.rb +2 -2
  52. data/lib/arel_extensions/nodes/function.rb +21 -21
  53. data/lib/arel_extensions/nodes/is_null.rb +0 -0
  54. data/lib/arel_extensions/nodes/json.rb +7 -7
  55. data/lib/arel_extensions/nodes/length.rb +0 -0
  56. data/lib/arel_extensions/nodes/levenshtein_distance.rb +1 -1
  57. data/lib/arel_extensions/nodes/locate.rb +1 -1
  58. data/lib/arel_extensions/nodes/log10.rb +0 -0
  59. data/lib/arel_extensions/nodes/matches.rb +1 -1
  60. data/lib/arel_extensions/nodes/md5.rb +0 -0
  61. data/lib/arel_extensions/nodes/power.rb +0 -0
  62. data/lib/arel_extensions/nodes/rand.rb +0 -0
  63. data/lib/arel_extensions/nodes/repeat.rb +2 -2
  64. data/lib/arel_extensions/nodes/replace.rb +2 -2
  65. data/lib/arel_extensions/nodes/round.rb +0 -0
  66. data/lib/arel_extensions/nodes/soundex.rb +2 -2
  67. data/lib/arel_extensions/nodes/std.rb +0 -0
  68. data/lib/arel_extensions/nodes/substring.rb +1 -1
  69. data/lib/arel_extensions/nodes/sum.rb +0 -0
  70. data/lib/arel_extensions/nodes/then.rb +1 -1
  71. data/lib/arel_extensions/nodes/trim.rb +2 -2
  72. data/lib/arel_extensions/nodes/union.rb +4 -4
  73. data/lib/arel_extensions/nodes/union_all.rb +3 -3
  74. data/lib/arel_extensions/nodes/wday.rb +0 -0
  75. data/lib/arel_extensions/nodes.rb +0 -0
  76. data/lib/arel_extensions/null_functions.rb +0 -0
  77. data/lib/arel_extensions/predications.rb +10 -10
  78. data/lib/arel_extensions/railtie.rb +1 -1
  79. data/lib/arel_extensions/set_functions.rb +3 -3
  80. data/lib/arel_extensions/string_functions.rb +8 -8
  81. data/lib/arel_extensions/tasks.rb +2 -2
  82. data/lib/arel_extensions/version.rb +1 -1
  83. data/lib/arel_extensions/visitors/convert_format.rb +0 -0
  84. data/lib/arel_extensions/visitors/ibm_db.rb +20 -20
  85. data/lib/arel_extensions/visitors/mssql.rb +150 -130
  86. data/lib/arel_extensions/visitors/mysql.rb +147 -149
  87. data/lib/arel_extensions/visitors/oracle.rb +141 -135
  88. data/lib/arel_extensions/visitors/oracle12.rb +16 -16
  89. data/lib/arel_extensions/visitors/postgresql.rb +147 -139
  90. data/lib/arel_extensions/visitors/sqlite.rb +85 -87
  91. data/lib/arel_extensions/visitors/to_sql.rb +146 -148
  92. data/lib/arel_extensions/visitors.rb +7 -7
  93. data/lib/arel_extensions.rb +56 -32
  94. data/test/arelx_test_helper.rb +14 -13
  95. data/test/database.yml +5 -5
  96. data/test/real_db_test.rb +81 -81
  97. data/test/support/fake_record.rb +2 -2
  98. data/test/test_comparators.rb +5 -5
  99. data/test/visitors/test_bulk_insert_oracle.rb +5 -5
  100. data/test/visitors/test_bulk_insert_sqlite.rb +5 -5
  101. data/test/visitors/test_bulk_insert_to_sql.rb +5 -5
  102. data/test/visitors/test_oracle.rb +14 -14
  103. data/test/visitors/test_to_sql.rb +87 -87
  104. data/test/with_ar/all_agnostic_test.rb +411 -306
  105. data/test/with_ar/insert_agnostic_test.rb +19 -16
  106. data/test/with_ar/test_bulk_sqlite.rb +5 -5
  107. data/test/with_ar/test_math_sqlite.rb +12 -12
  108. data/test/with_ar/test_string_mysql.rb +20 -20
  109. data/test/with_ar/test_string_sqlite.rb +20 -20
  110. data/version_v1.rb +1 -1
  111. data/version_v2.rb +1 -1
  112. metadata +3 -9
  113. data/.travis/oracle/download.js +0 -152
  114. data/.travis/oracle/download.sh +0 -30
  115. data/.travis/oracle/download_ojdbc.js +0 -116
  116. data/.travis/oracle/install.sh +0 -34
  117. data/.travis/setup_accounts.sh +0 -9
  118. data/.travis/sqlite3/extension-functions.sh +0 -6
  119. data/.travis.yml +0 -193
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c069fafddb858e0acc7cee0bf1bc435c2127ccdf6e5d870b8e9caff0d31abdb1
4
- data.tar.gz: 2d0898c4d35fbe0ac72ccb395ef79ae63f10b662ce6003cea0702d55c27b2729
3
+ metadata.gz: 460764a1fc17c5359b553da4b62d75b2300cc4a0ead64ce1ddcf3e897d703045
4
+ data.tar.gz: 751125d207b3485e3220b6335cbd7050516ea7d8bb8cd88b3810e00c0a80fb86
5
5
  SHA512:
6
- metadata.gz: aa4f685f2548b172488d6f3537754c51ad269773a2ff525b7e114e8d4da38bfe41c38cbeee20cb67d7557b46c39c10d218e80181ffa5ebe6be393763981d57d3
7
- data.tar.gz: 664cf3c829c5df39b3ef8c9913cec516214482e328f01a8c71370aa937abc47194a20b31b8d930a297c322e22025d1af9b1b49384df08ec65860203b8bf27f78
6
+ metadata.gz: a8781a647977d941173ed7dc68c256bb85ecf4c490908baa21ec1e36f32a35e4c175f5c51a69a50e3af4b4921c4575a5bacb8b3748ffe46a8852bac08bb1444c
7
+ data.tar.gz: 45dbf8f8537750c23ef4d7718cfed20a5e5618b86d84cd4f23154db6e9a92fdef9a4befec53ac29da230e21fbcf8c98f311a3ceef89532cc947cb0a9d3c39f31
data/.codeclimate.yml CHANGED
@@ -21,5 +21,4 @@ ratings:
21
21
  - "**.rb"
22
22
  - "**.md"
23
23
  exclude_paths:
24
- - .travis/**/*
25
- - test/**/*
24
+ - test/**/*
@@ -148,32 +148,41 @@ jobs:
148
148
  matrix:
149
149
  ruby: [3.1, 3.0, 2.7, 2.5, jruby-9.2, jruby-9.3]
150
150
  rails: [7, 6_1, 6, 5_2]
151
- exclude: [
152
- {ruby: 3.1, rails: 6 },
153
- {ruby: 3.1, rails: 5_2},
154
- {ruby: 3.0, rails: 6 },
155
- {ruby: 3.0, rails: 5_2},
156
- {ruby: 2.7, rails: 5_2},
157
- {ruby: 2.5, rails: 7 },
158
- {ruby: jruby-9.2, rails: 7},
159
- {ruby: jruby-9.3, rails: 7},
160
- ]
161
- services:
162
- postgres:
163
- image: postgres:11.6-alpine
164
- env:
165
- POSTGRES_DB: arext_test
166
- POSTGRES_PASSWORD: secret
167
- ports:
168
- - 5432:5432
169
- # needed because the postgres container does not provide a healthcheck
170
- options: >-
171
- --health-cmd "pg_isready -d arext_test -U postgres -p 5432"
172
- --health-interval 10s
173
- --health-timeout 5s
174
- --health-retries 5
151
+ exclude:
152
+ [
153
+ { ruby: 3.1, rails: 6 },
154
+ { ruby: 3.1, rails: 5_2 },
155
+ { ruby: 3.0, rails: 6 },
156
+ { ruby: 3.0, rails: 5_2 },
157
+ { ruby: 2.7, rails: 5_2 },
158
+ { ruby: 2.5, rails: 7 },
159
+ { ruby: jruby-9.2, rails: 7 },
160
+ { ruby: jruby-9.3, rails: 7 },
161
+ ]
175
162
  steps:
176
163
  - uses: actions/checkout@v2
164
+ # PostgreSQL requires locales to be installed on the system to be able
165
+ # to do time and currency conversions at runtime.
166
+ #
167
+ # That's why we're not launching it as a service; pre-built images
168
+ # lack loaclization.
169
+ #
170
+ # After we install locales, we'll install PostgreSQL binaries and start
171
+ # the service.
172
+ - name: setup locale
173
+ run: |
174
+ sudo locale-gen fr_FR.utf8
175
+ sudo update-locale
176
+ - name: setup postgres 11
177
+ run: |
178
+ curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
179
+ echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
180
+ sudo apt update
181
+ sudo apt -y install postgresql-11
182
+ sudo systemctl enable postgresql
183
+ sudo systemctl start postgresql
184
+ sudo su -c "psql -c \"alter user postgres with password 'secret'\"" postgres
185
+ sudo su -c "createdb arelx_test" postgres
177
186
  - name: Set up Ruby
178
187
  uses: ruby/setup-ruby@v1
179
188
  with:
@@ -229,7 +238,7 @@ jobs:
229
238
  env:
230
239
  MYSQL_ALLOW_EMPTY_PASSWORD: true
231
240
  MYSQL_USERNAME: root
232
- MYSQL_DATABASE: arext_test
241
+ MYSQL_DATABASE: arelx_test
233
242
  ports:
234
243
  - 3306:3306
235
244
  options: >-
@@ -268,7 +277,7 @@ jobs:
268
277
  DB_CONNECTION: mysql
269
278
  DB_HOST: 127.0.0.1
270
279
  DB_PORT: 3306
271
- DB_DATABASE: arext_test
280
+ DB_DATABASE: arelx_test
272
281
  DB_USERNAME: root
273
282
  run: bundle exec rake test:mysql
274
283
 
@@ -280,18 +289,19 @@ jobs:
280
289
  fail-fast: false
281
290
  matrix:
282
291
  ruby: [3.1, 3.0, 2.7, 2.5, jruby-9.2, jruby-9.3]
283
- rails: [7, 6_1, 6, 5_2]
292
+ rails: [6_1, 6, 5_2]
293
+ version: [2017, 2019]
284
294
  exclude: [
285
295
  {ruby: 3.1, rails: 6 },
286
296
  {ruby: 3.1, rails: 5_2 },
287
297
  {ruby: 3.0, rails: 6 },
288
298
  {ruby: 3.0, rails: 5_2 },
289
299
  {ruby: 2.7, rails: 5_2 },
290
- {ruby: 2.5, rails: 7 },
291
- {ruby: jruby-9.2, rails: 7 },
300
+ # {ruby: 2.5, rails: 7 },
301
+ # {ruby: jruby-9.2, rails: 7 },
292
302
  {ruby: jruby-9.2, rails: 6_1 },
293
303
  {ruby: jruby-9.2, rails: 6 },
294
- {ruby: jruby-9.3, rails: 7 },
304
+ # {ruby: jruby-9.3, rails: 7 },
295
305
  {ruby: jruby-9.3, rails: 6_1 },
296
306
  {ruby: jruby-9.3, rails: 6 },
297
307
  ]
@@ -305,9 +315,10 @@ jobs:
305
315
  run: |
306
316
  sudo apt-get update -q
307
317
  sudo apt-get install -y freetds-dev
308
- - name: Install MSSQL 2019
309
- uses: potatoqualitee/mssqlsuite@v1
318
+ - name: Install MSSQL ${{ matrix.version }}
319
+ uses: potatoqualitee/mssqlsuite@v1.5.1
310
320
  with:
321
+ version: ${{ matrix.version }}
311
322
  install: sqlengine, sqlclient, sqlpackage, localdb
312
323
  sa-password: Password12!
313
324
  - name: Update system-wide gems
@@ -328,62 +339,3 @@ jobs:
328
339
  bundle install
329
340
  - name: Run test mssql
330
341
  run: bundle exec rake test:mssql
331
-
332
- job_test_windows:
333
- name: test mssql on windows
334
- needs: job_build_gem
335
- runs-on: windows-latest
336
- strategy:
337
- fail-fast: false
338
- matrix:
339
- ruby: [3.1, 3.0, 2.7, 2.5]
340
- rails: [7, 6_1, 6, 5_2]
341
- exclude: [
342
- {ruby: 3.1, rails: 6 },
343
- {ruby: 3.1, rails: 5_2 },
344
- {ruby: 3.0, rails: 6 },
345
- {ruby: 3.0, rails: 5_2 },
346
- {ruby: 2.7, rails: 5_2 },
347
- {ruby: 2.5, rails: 7 },
348
- {ruby: jruby-9.2, rails: 7 },
349
- {ruby: jruby-9.2, rails: 6_1 },
350
- {ruby: jruby-9.2, rails: 6 },
351
- {ruby: jruby-9.3, rails: 7 },
352
- {ruby: jruby-9.3, rails: 6_1 },
353
- {ruby: jruby-9.3, rails: 6 },
354
- ]
355
- steps:
356
- - uses: actions/checkout@v2
357
- - name: Install mssql
358
- uses: potatoqualitee/mssqlsuite@v1
359
- with:
360
- install: sqlengine, sqlclient, sqlpackage, localdb
361
- sa-password: Password12!
362
- - name: Set up Ruby
363
- uses: MSP-Greg/ruby-setup-ruby@win-ucrt-1
364
- with:
365
- ruby-version: ${{ matrix.ruby }}
366
- - name: Install required packages on Windows
367
- shell: cmd
368
- run: |
369
- ridk exec sh -c "pacman --sync --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-gcc"
370
- - name: Update system-wide gems
371
- run: gem update --system
372
- - name: Setup Gemfile
373
- if: ${{ matrix.rails != '5_2' }}
374
- run: |
375
- cp ./gemspecs/arel_extensions-v2.gemspec ./arel_extensions.gemspec
376
- cp ./version_v2.rb lib/arel_extensions/version.rb
377
- cp ./gemfiles/rails${{ matrix.rails }}.gemfile ./Gemfile
378
- - name: bundle install
379
- run: |
380
- bundle config set gemfile .\gemfiles\rails${{ matrix.rails }}.gemfile
381
- bundle install --verbose
382
- - name: Download gem from build job
383
- uses: actions/download-artifact@v2
384
- with:
385
- name: ${{ matrix.ruby }}-${{ matrix.rails }}-gem
386
- - name: Install downloaded gem
387
- run: gem install --local *.gem --verbose
388
- - name: Run test mssql
389
- run: bundle exec rake test:mssql
data/.gitignore CHANGED
@@ -1,9 +1,10 @@
1
- coverage/*
2
- config/database.yml
3
- spec/support/fixtures/*database*
4
1
  *.DS_Store
2
+ *.swp
3
+ .bundle
4
+ Gemfile.lock
5
+ config/database.yml
6
+ coverage/*
5
7
  debug.log
6
8
  pkg
7
- .bundle
8
- *.swp
9
- Gemfile.lock
9
+ spec/support/fixtures/*database*
10
+ vendor/
data/.rubocop.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  AllCops:
2
2
  DisabledByDefault: true
3
3
  Exclude:
4
- - "test/**/*"
4
+ - "vendor/**/*"
5
5
 
6
6
  Layout/EndOfLine:
7
7
  Enabled: true
@@ -9,12 +9,31 @@ Layout/EndOfLine:
9
9
  Layout/ExtraSpacing:
10
10
  Enabled: true
11
11
 
12
+ Layout/IndentationWidth:
13
+ Enabled: true
14
+
15
+ Layout/LineLength:
16
+ Enabled: false
17
+
18
+ Layout/SpaceAfterComma:
19
+ Enabled: true
20
+
12
21
  Layout/SpaceAroundEqualsInParameterDefault:
13
22
  Enabled: true
14
23
 
24
+ Layout/SpaceAroundOperators:
25
+ Enabled: true
26
+
27
+ Layout/SpaceInsideHashLiteralBraces:
28
+ Enabled: true
29
+ EnforcedStyle: no_space
30
+
15
31
  Layout/TrailingEmptyLines:
16
32
  Enabled: true
17
33
 
34
+ Metrics/BlockLength:
35
+ Enabled: false
36
+
18
37
  Naming/FileName:
19
38
  Enabled: true
20
39
 
@@ -36,9 +55,45 @@ Style/EmptyElse:
36
55
  Style/Encoding:
37
56
  Enabled: true
38
57
 
58
+ Style/HashSyntax:
59
+ Enabled: true
60
+ EnforcedStyle: ruby19
61
+
39
62
  Style/MethodCallWithArgsParentheses:
40
63
  Enabled: false
41
64
 
65
+ Style/MethodCallWithoutArgsParentheses:
66
+ Enabled: true
67
+
68
+ Style/NegatedIf:
69
+ Enabled: false
70
+
71
+ Style/NumericLiterals:
72
+ Enabled: true
73
+
74
+ Style/RedundantParentheses:
75
+ Enabled: true
76
+
77
+ Style/RedundantRegexpCharacterClass:
78
+ Enabled: true
79
+
80
+ Style/RedundantReturn:
81
+ Enabled: true
82
+
83
+ # Even when conservative, this is unsafe.
84
+ #Style/StringConcatenation:
85
+ # Enabled: true
86
+ # Mode: 'conservative'
87
+
88
+ Style/StringLiterals:
89
+ Enabled: true
90
+
91
+ Style/SymbolArray:
92
+ Enabled: true
93
+
94
+ Style/WordArray:
95
+ Enabled: true
96
+
42
97
  # Performance cops have been transferred to rubocop-performance gem.
43
98
  require: rubocop-performance
44
99
 
@@ -47,3 +102,9 @@ Performance/DoubleStartEndWith:
47
102
 
48
103
  Performance/RedundantMerge:
49
104
  Enabled: true
105
+
106
+ Performance/RegexpMatch:
107
+ Enabled: true
108
+
109
+ Performance/StringReplacement:
110
+ Enabled: true
data/Gemfile CHANGED
@@ -1,21 +1,21 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
5
  group :development, :test do
6
- gem "sqlite3", '<= 1.3.13', platforms: [:mri]
7
- gem "mysql2", '0.4.10', platforms: [:mri]
8
- gem "pg", '< 1', platforms: [:mri]
6
+ gem 'sqlite3', '<= 1.3.13', platforms: [:mri]
7
+ gem 'mysql2', '0.4.10', platforms: [:mri]
8
+ gem 'pg', '< 1', platforms: [:mri]
9
9
 
10
- gem "jdbc-sqlite3", platforms: :jruby
11
- gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
12
- gem "activerecord-jdbcmysql-adapter", platforms: :jruby
13
- gem "activerecord-jdbcpostgresql-adapter", platforms: :jruby
10
+ gem 'jdbc-sqlite3', platforms: :jruby
11
+ gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
12
+ gem 'activerecord-jdbcmysql-adapter', platforms: :jruby
13
+ gem 'activerecord-jdbcpostgresql-adapter', platforms: :jruby
14
14
 
15
- gem "tiny_tds", '~> 2.1', require: false, platforms: [:mri, :mingw, :x64_mingw, :mswin]
16
- gem "activerecord-sqlserver-adapter", '~> 6.0', platforms: [:mri, :mingw, :x64_mingw, :mswin]
15
+ gem 'tiny_tds', '~> 2.1', require: false, platforms: %i[mri mingw x64_mingw mswin]
16
+ gem 'activerecord-sqlserver-adapter', '~> 6.0', platforms: %i[mri mingw x64_mingw mswin]
17
17
 
18
- gem 'ruby-oci8', platforms: [:mri, :mswin, :x64_mingw, :mingw]
18
+ gem 'ruby-oci8', platforms: %i[mri mswin x64_mingw mingw]
19
19
  gem 'activerecord-oracle_enhanced-adapter', '~> 1.6.0'
20
20
 
21
21
  gem 'activesupport', '~> 6.0'
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Arel Extensions
2
2
 
3
- [![Travis Build Status](https://img.shields.io/travis/Faveod/arel-extensions.svg?label=Travis%20build)](http://travis-ci.org/Faveod/arel-extensions)
3
+ ![GitHub workflow](https://github.com/Faveod/arel-extensions/actions/workflows/ruby.yml/badge.svg)
4
4
  [![AppVeyor Build Status](https://img.shields.io/appveyor/ci/yazfav/arel-extensions.svg?label=AppVeyor%20build)](https://ci.appveyor.com/project/yazfav/arel-extensions)
5
5
  [![Security](https://hakiri.io/github/Faveod/arel-extensions/master.svg)](https://hakiri.io/github/Faveod/arel-extensions/master)
6
6
  ![](http://img.shields.io/badge/license-MIT-brightgreen.svg)
data/Rakefile CHANGED
@@ -1,9 +1,9 @@
1
1
  require 'bundler'
2
- Bundler::GemHelper.install_tasks name: "arel_extensions"
2
+ Bundler::GemHelper.install_tasks name: 'arel_extensions'
3
3
 
4
4
  require 'rake/testtask'
5
5
 
6
- desc "Default Task"
6
+ desc 'Default Task'
7
7
  task default: [:test]
8
8
 
9
9
  Rake::TestTask.new(:test) do |t|
@@ -21,7 +21,7 @@ namespace :test do
21
21
  t.pattern = 'test/visitors/test_to_sql.rb'
22
22
  t.warning = true
23
23
  t.verbose = true
24
- t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION)
24
+ t.ruby_opts = ['--dev'] if defined?(JRUBY_VERSION)
25
25
  }
26
26
  end
27
27
 
@@ -33,7 +33,7 @@ end
33
33
  t.pattern = 'test/with_ar/*_agnostic_test.rb'
34
34
  t.warning = false
35
35
  t.verbose = true
36
- t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION)
36
+ t.ruby_opts = ['--dev'] if defined?(JRUBY_VERSION)
37
37
  }
38
38
  end
39
39
 
data/TODO CHANGED
@@ -1,7 +1,6 @@
1
1
  Code quality:
2
2
  + codeclimate.com
3
3
  + gemnasium
4
- + appveyor.com (windows)
5
4
  + hakiri.io
6
5
  - coveralls.io
7
6
  - inch-ci.org
data/appveyor.yml ADDED
@@ -0,0 +1,73 @@
1
+ image: Visual Studio 2015
2
+
3
+ version: "{build}"
4
+
5
+ cache:
6
+ - vendor/bundle
7
+
8
+ environment:
9
+ matrix:
10
+ - RUBY_VERSION: 25-x64
11
+ RAILS: 5_2
12
+ SQL: MSSQL$SQL2012SP1
13
+ - RUBY_VERSION: 25-x64
14
+ RAILS: 5_2
15
+ SQL: MSSQL$SQL2014
16
+ - RUBY_VERSION: 25-x64
17
+ RAILS: 5_2
18
+ SQL: MSSQL$SQL2016
19
+ - RUBY_VERSION: 25-x64
20
+ RAILS: 6
21
+ SQL: MSSQL$SQL2012SP1
22
+ - RUBY_VERSION: 25-x64
23
+ RAILS: 6
24
+ SQL: MSSQL$SQL2014
25
+ - RUBY_VERSION: 25-x64
26
+ RAILS: 6
27
+ SQL: MSSQL$SQL2016
28
+ - RUBY_VERSION: 25-x64
29
+ RAILS: 6_1
30
+ SQL: MSSQL$SQL2012SP1
31
+ - RUBY_VERSION: 25-x64
32
+ RAILS: 6_1
33
+ SQL: MSSQL$SQL2014
34
+ - RUBY_VERSION: 25-x64
35
+ RAILS: 6_1
36
+ SQL: MSSQL$SQL2016
37
+
38
+ install:
39
+ - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
40
+ - gem update --system
41
+ - gem install rubygems-update && update_rubygems
42
+ - bundle config --local path vendor/bundle
43
+ - cp ./gemfiles/rails%RAILS%.gemfile ./Gemfile
44
+ - bundle config set gemfile ./gemfiles/rails%RAILS%.gemfile
45
+ - bundle install
46
+
47
+ build: off
48
+
49
+ before_test:
50
+ - ruby -v
51
+ - gem -v
52
+ - bundle -v
53
+
54
+ test_script:
55
+ - ps: Get-Service '*SQL*'
56
+ - net start %SQL%
57
+ - bundle exec rake test:mssql
58
+
59
+ for:
60
+ -
61
+ matrix:
62
+ except:
63
+ - RAILS: 5_2
64
+ install:
65
+ - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
66
+ - cp ./gemspecs/arel_extensions-v2.gemspec ./arel_extensions.gemspec
67
+ - cp ./version_v2.rb lib/arel_extensions/version.rb
68
+ - cp ./gemfiles/rails%RAILS%.gemfile ./Gemfile
69
+ - gem update --system
70
+ - gem install rubygems-update && update_rubygems
71
+ - bundle config --local path vendor/bundle
72
+ - bundle config set gemfile ./gemfiles/rails%RAILS%.gemfile
73
+ - bundle install
@@ -1,24 +1,24 @@
1
- $:.push File.expand_path("../lib", __FILE__)
2
- require "arel_extensions/version"
1
+ $:.push File.expand_path('../lib', __FILE__)
2
+ require 'arel_extensions/version'
3
3
 
4
4
  Gem::Specification.new do |s|
5
- s.name = "arel_extensions"
5
+ s.name = 'arel_extensions'
6
6
  s.version = ArelExtensions::VERSION
7
7
  s.platform = Gem::Platform::RUBY
8
- s.authors = ["Yann Azoury", "Félix Bellanger", "Julien Delporte"]
9
- s.email = ["yann.azoury@faveod.com", "felix.bellanger@faveod.com", "julien.delporte@faveod.com"]
10
- s.homepage = "https://github.com/Faveod/arel-extensions"
11
- s.description = "Adds new features to Arel"
12
- s.summary = "Extending Arel"
8
+ s.authors = ['Yann Azoury', 'Félix Bellanger', 'Julien Delporte']
9
+ s.email = ['yann.azoury@faveod.com', 'felix.bellanger@faveod.com', 'julien.delporte@faveod.com']
10
+ s.homepage = 'https://github.com/Faveod/arel-extensions'
11
+ s.description = 'Adds new features to Arel'
12
+ s.summary = 'Extending Arel'
13
13
  s.license = 'MIT'
14
14
 
15
- s.rdoc_options = ["--main", "README.md"]
16
- s.extra_rdoc_files = ["MIT-LICENSE.txt", "README.md", 'functions.html']
15
+ s.rdoc_options = ['--main', 'README.md']
16
+ s.extra_rdoc_files = ['MIT-LICENSE.txt', 'README.md', 'functions.html']
17
17
 
18
18
  # Manifest
19
19
  s.files = `git ls-files`.split("\n")
20
20
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
- s.require_paths = ["lib"]
21
+ s.require_paths = ['lib']
22
22
 
23
23
  s.add_dependency('activerecord', '>= 6.0')
24
24
 
@@ -1,20 +1,20 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gem 'arel', '~> 3.0' # too old...
4
4
 
5
5
  group :development, :test do
6
- gem "sqlite3", '<= 1.3.13', platform: [:ruby, :mswin, :mingw]
7
- gem "mysql2", '0.4.10', platform: [:ruby, :mswin, :mingw]
8
- gem "activerecord-mysql2-adapter", platform: [:ruby, :mswin, :mingw]
9
- gem "pg", platform: [:ruby, :mswin, :mingw]
6
+ gem 'sqlite3', '<= 1.3.13', platform: %i[ruby mswin mingw]
7
+ gem 'mysql2', '0.4.10', platform: %i[ruby mswin mingw]
8
+ gem 'activerecord-mysql2-adapter', platform: %i[ruby mswin mingw]
9
+ gem 'pg', platform: %i[ruby mswin mingw]
10
10
  # for JRuby
11
- gem "jdbc-sqlite3", platform: :jruby
12
- gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
13
- gem "activerecord-jdbcmysql-adapter", platform: :jruby
14
- gem "activerecord-jdbcpostgresql-adapter", platform: :jruby
11
+ gem 'jdbc-sqlite3', platform: :jruby
12
+ gem 'activerecord-jdbcsqlite3-adapter', platform: :jruby
13
+ gem 'activerecord-jdbcmysql-adapter', platform: :jruby
14
+ gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
15
15
  gem 'activesupport', '~> 3.2'
16
16
  gem 'activemodel', '~> 3.2'
17
17
  gem 'activerecord', '~> 3.2'
18
18
  end
19
19
 
20
- gemspec path: "../"
20
+ gemspec path: Dir.pwd
@@ -1,4 +1,4 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gem 'arel', '~> 6.0'
4
4
 
@@ -7,23 +7,23 @@ group :development, :test do
7
7
  gem 'activemodel', '~> 4.0'
8
8
  gem 'activerecord', '~> 4.0'
9
9
 
10
- gem "sqlite3", '<= 1.3.13', platforms: [:mri, :mswin, :mingw]
11
- gem "mysql2", '0.4.10', platforms: [:mri, :mswin, :mingw]
12
- gem "pg",'< 1.0.0', platforms: [:mri, :mingw]
10
+ gem 'sqlite3', '<= 1.3.13', platforms: %i[mri mswin mingw]
11
+ gem 'mysql2', '0.4.10', platforms: %i[mri mswin mingw]
12
+ gem 'pg', '< 1.0.0', platforms: %i[mri mingw]
13
13
 
14
- gem "tiny_tds", platforms: [:mri, :mingw, :mswin] if RUBY_PLATFORM =~ /windows/
15
- gem "activerecord-sqlserver-adapter", '~> 4.2.0', platforms: [:mri, :mingw, :mswin] if RUBY_PLATFORM =~ /windows/
14
+ gem 'tiny_tds', platforms: %i[mri mingw mswin] if RUBY_PLATFORM.match?(/windows/)
15
+ gem 'activerecord-sqlserver-adapter', '~> 4.2.0', platforms: %i[mri mingw mswin] if RUBY_PLATFORM.match?(/windows/)
16
16
 
17
- gem 'ruby-oci8', platforms: [:mri, :mswin, :mingw] if ENV.has_key? 'ORACLE_HOME'
17
+ gem 'ruby-oci8', platforms: %i[mri mswin mingw] if ENV.has_key? 'ORACLE_HOME'
18
18
  gem 'activerecord-oracle_enhanced-adapter', '~> 1.6.0' if ENV.has_key? 'ORACLE_HOME'
19
19
 
20
20
  # for JRuby
21
- gem 'activerecord-jdbc-adapter', '~> 1.3',platforms: :jruby
22
- gem "jdbc-sqlite3", platforms: :jruby
23
- gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
24
- gem "activerecord-jdbcmysql-adapter", platforms: :jruby
25
- gem "activerecord-jdbcpostgresql-adapter", platforms: :jruby
26
- gem "activerecord-jdbcmssql-adapter", platforms: :jruby
21
+ gem 'activerecord-jdbc-adapter', '~> 1.3', platforms: :jruby
22
+ gem 'jdbc-sqlite3', platforms: :jruby
23
+ gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
24
+ gem 'activerecord-jdbcmysql-adapter', platforms: :jruby
25
+ gem 'activerecord-jdbcpostgresql-adapter', platforms: :jruby
26
+ gem 'activerecord-jdbcmssql-adapter', platforms: :jruby
27
27
  end
28
28
 
29
- gemspec path: "../"
29
+ gemspec path: Dir.pwd
@@ -1,4 +1,4 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gem 'arel', '~> 7.0'
4
4
 
@@ -7,23 +7,23 @@ group :development, :test do
7
7
  gem 'activemodel', '~> 5.0'
8
8
  gem 'activerecord', '5.0.6'
9
9
 
10
- gem "sqlite3", '<= 1.3.13', platforms: [:mri, :mswin, :mingw]
11
- gem "mysql2", '0.4.10', platforms: [:mri, :mswin, :mingw]
12
- gem "pg",'< 1.0.0', platforms: [:mri, :mingw]
10
+ gem 'sqlite3', '<= 1.3.13', platforms: %i[mri mswin mingw]
11
+ gem 'mysql2', '0.4.10', platforms: %i[mri mswin mingw]
12
+ gem 'pg', '< 1.0.0', platforms: %i[mri mingw]
13
13
 
14
- gem "tiny_tds", platforms: [:mri, :mingw] if RUBY_PLATFORM =~ /windows/
15
- # gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw]
14
+ gem 'tiny_tds', platforms: %i[mri mingw] if RUBY_PLATFORM.match?(/windows/)
15
+ # gem "activerecord-sqlserver-adapter", platforms: [:mri, :mingw]
16
16
 
17
- gem 'ruby-oci8', platforms: [:mri, :mswin, :mingw] if ENV.has_key? 'ORACLE_HOME'
17
+ gem 'ruby-oci8', platforms: %i[mri mswin mingw] if ENV.has_key? 'ORACLE_HOME'
18
18
  gem 'activerecord-oracle_enhanced-adapter', '~> 1.7' if ENV.has_key? 'ORACLE_HOME'
19
19
 
20
20
  # for JRuby
21
21
  gem 'activerecord-jdbc-adapter', github: 'jruby/activerecord-jdbc-adapter', tag: 'v50.0', platforms: :jruby
22
- gem "jdbc-sqlite3", platforms: :jruby
23
- gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
24
- gem "activerecord-jdbcmysql-adapter", platforms: :jruby
25
- gem "activerecord-jdbcpostgresql-adapter", platforms: :jruby
26
- gem "activerecord-jdbcmssql-adapter", platforms: :jruby
22
+ gem 'jdbc-sqlite3', platforms: :jruby
23
+ gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
24
+ gem 'activerecord-jdbcmysql-adapter', platforms: :jruby
25
+ gem 'activerecord-jdbcpostgresql-adapter', platforms: :jruby
26
+ gem 'activerecord-jdbcmssql-adapter', platforms: :jruby
27
27
  end
28
28
 
29
- gemspec path: "../"
29
+ gemspec path: Dir.pwd