arel_extensions 1.4.0 → 2.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +2 -1
  3. data/.gitignore +6 -7
  4. data/.rubocop.yml +3 -67
  5. data/.travis/oracle/download.js +152 -0
  6. data/.travis/oracle/download.sh +30 -0
  7. data/.travis/oracle/download_ojdbc.js +116 -0
  8. data/.travis/oracle/install.sh +34 -0
  9. data/.travis/setup_accounts.sh +9 -0
  10. data/.travis/sqlite3/extension-functions.sh +6 -0
  11. data/.travis.yml +223 -0
  12. data/Gemfile +28 -2
  13. data/README.md +90 -239
  14. data/Rakefile +30 -48
  15. data/TODO +1 -0
  16. data/appveyor.yml +22 -60
  17. data/arel_extensions.gemspec +14 -13
  18. data/functions.html +3 -3
  19. data/gemfiles/rails3.gemfile +10 -10
  20. data/gemfiles/rails4.gemfile +29 -0
  21. data/gemfiles/rails5_0.gemfile +29 -0
  22. data/gemfiles/rails5_1_4.gemfile +14 -14
  23. data/gemfiles/rails5_2.gemfile +14 -16
  24. data/init/mssql.sql +4 -4
  25. data/init/mysql.sql +38 -38
  26. data/init/oracle.sql +0 -0
  27. data/init/postgresql.sql +21 -21
  28. data/init/sqlite.sql +0 -0
  29. data/lib/arel_extensions/attributes.rb +3 -15
  30. data/lib/arel_extensions/boolean_functions.rb +14 -53
  31. data/lib/arel_extensions/common_sql_functions.rb +17 -16
  32. data/lib/arel_extensions/comparators.rb +28 -27
  33. data/lib/arel_extensions/date_duration.rb +13 -17
  34. data/lib/arel_extensions/insert_manager.rb +15 -18
  35. data/lib/arel_extensions/math.rb +53 -55
  36. data/lib/arel_extensions/math_functions.rb +39 -46
  37. data/lib/arel_extensions/nodes/abs.rb +1 -0
  38. data/lib/arel_extensions/nodes/blank.rb +2 -1
  39. data/lib/arel_extensions/nodes/case.rb +19 -20
  40. data/lib/arel_extensions/nodes/cast.rb +8 -10
  41. data/lib/arel_extensions/nodes/ceil.rb +1 -1
  42. data/lib/arel_extensions/nodes/coalesce.rb +4 -3
  43. data/lib/arel_extensions/nodes/collate.rb +10 -9
  44. data/lib/arel_extensions/nodes/concat.rb +18 -9
  45. data/lib/arel_extensions/nodes/date_diff.rb +26 -42
  46. data/lib/arel_extensions/nodes/duration.rb +3 -0
  47. data/lib/arel_extensions/nodes/find_in_set.rb +1 -0
  48. data/lib/arel_extensions/nodes/floor.rb +1 -1
  49. data/lib/arel_extensions/nodes/format.rb +8 -35
  50. data/lib/arel_extensions/nodes/formatted_number.rb +23 -22
  51. data/lib/arel_extensions/nodes/function.rb +37 -42
  52. data/lib/arel_extensions/nodes/is_null.rb +0 -0
  53. data/lib/arel_extensions/nodes/json.rb +39 -52
  54. data/lib/arel_extensions/nodes/length.rb +0 -5
  55. data/lib/arel_extensions/nodes/levenshtein_distance.rb +1 -1
  56. data/lib/arel_extensions/nodes/locate.rb +2 -1
  57. data/lib/arel_extensions/nodes/log10.rb +2 -1
  58. data/lib/arel_extensions/nodes/matches.rb +7 -5
  59. data/lib/arel_extensions/nodes/md5.rb +1 -0
  60. data/lib/arel_extensions/nodes/power.rb +5 -5
  61. data/lib/arel_extensions/nodes/rand.rb +1 -0
  62. data/lib/arel_extensions/nodes/repeat.rb +5 -3
  63. data/lib/arel_extensions/nodes/replace.rb +8 -16
  64. data/lib/arel_extensions/nodes/round.rb +6 -5
  65. data/lib/arel_extensions/nodes/soundex.rb +15 -15
  66. data/lib/arel_extensions/nodes/std.rb +21 -18
  67. data/lib/arel_extensions/nodes/substring.rb +16 -8
  68. data/lib/arel_extensions/nodes/then.rb +1 -1
  69. data/lib/arel_extensions/nodes/trim.rb +6 -4
  70. data/lib/arel_extensions/nodes/union.rb +8 -5
  71. data/lib/arel_extensions/nodes/union_all.rb +7 -4
  72. data/lib/arel_extensions/nodes/wday.rb +4 -0
  73. data/lib/arel_extensions/nodes.rb +1 -1
  74. data/lib/arel_extensions/null_functions.rb +5 -19
  75. data/lib/arel_extensions/predications.rb +43 -44
  76. data/lib/arel_extensions/railtie.rb +5 -5
  77. data/lib/arel_extensions/set_functions.rb +7 -5
  78. data/lib/arel_extensions/string_functions.rb +29 -59
  79. data/lib/arel_extensions/tasks.rb +6 -6
  80. data/lib/arel_extensions/version.rb +1 -1
  81. data/lib/arel_extensions/visitors/ibm_db.rb +31 -24
  82. data/lib/arel_extensions/visitors/mssql.rb +191 -422
  83. data/lib/arel_extensions/visitors/mysql.rb +212 -350
  84. data/lib/arel_extensions/visitors/oracle.rb +178 -220
  85. data/lib/arel_extensions/visitors/oracle12.rb +31 -18
  86. data/lib/arel_extensions/visitors/postgresql.rb +173 -256
  87. data/lib/arel_extensions/visitors/sqlite.rb +126 -140
  88. data/lib/arel_extensions/visitors/to_sql.rb +237 -298
  89. data/lib/arel_extensions/visitors.rb +62 -83
  90. data/lib/arel_extensions.rb +31 -224
  91. data/test/database.yml +7 -15
  92. data/test/helper.rb +18 -0
  93. data/test/real_db_test.rb +117 -120
  94. data/test/support/fake_record.rb +3 -9
  95. data/test/test_comparators.rb +17 -14
  96. data/test/visitors/test_bulk_insert_oracle.rb +11 -11
  97. data/test/visitors/test_bulk_insert_sqlite.rb +13 -12
  98. data/test/visitors/test_bulk_insert_to_sql.rb +13 -11
  99. data/test/visitors/test_oracle.rb +55 -55
  100. data/test/visitors/test_to_sql.rb +226 -419
  101. data/test/with_ar/all_agnostic_test.rb +366 -709
  102. data/test/with_ar/insert_agnostic_test.rb +21 -27
  103. data/test/with_ar/test_bulk_sqlite.rb +16 -17
  104. data/test/with_ar/test_math_sqlite.rb +26 -26
  105. data/test/with_ar/test_string_mysql.rb +33 -31
  106. data/test/with_ar/test_string_sqlite.rb +34 -30
  107. metadata +34 -43
  108. data/.github/workflows/publish.yml +0 -29
  109. data/.github/workflows/release.yml +0 -30
  110. data/.github/workflows/ruby.yml +0 -399
  111. data/CONTRIBUTING.md +0 -102
  112. data/NEWS.md +0 -78
  113. data/bin/build +0 -15
  114. data/bin/compose +0 -6
  115. data/bin/publish +0 -8
  116. data/dev/arelx.dockerfile +0 -44
  117. data/dev/compose.yaml +0 -71
  118. data/dev/postgres.dockerfile +0 -5
  119. data/dev/rbenv +0 -189
  120. data/gemfiles/rails4_2.gemfile +0 -38
  121. data/gemfiles/rails5.gemfile +0 -29
  122. data/gemfiles/rails6.gemfile +0 -33
  123. data/gemfiles/rails6_1.gemfile +0 -33
  124. data/gemfiles/rails7.gemfile +0 -33
  125. data/gemfiles/rails7_1.gemfile +0 -33
  126. data/gemfiles/rails7_2.gemfile +0 -33
  127. data/gemspecs/arel_extensions-v1.gemspec +0 -27
  128. data/gemspecs/arel_extensions-v2.gemspec +0 -27
  129. data/generate_gems.sh +0 -15
  130. data/lib/arel_extensions/aliases.rb +0 -14
  131. data/lib/arel_extensions/helpers.rb +0 -62
  132. data/lib/arel_extensions/nodes/aggregate_function.rb +0 -13
  133. data/lib/arel_extensions/nodes/formatted_date.rb +0 -42
  134. data/lib/arel_extensions/nodes/rollup.rb +0 -36
  135. data/lib/arel_extensions/nodes/select.rb +0 -10
  136. data/lib/arel_extensions/nodes/sum.rb +0 -7
  137. data/lib/arel_extensions/visitors/convert_format.rb +0 -37
  138. data/test/arelx_test_helper.rb +0 -74
  139. data/version_v1.rb +0 -3
  140. data/version_v2.rb +0 -3
data/dev/arelx.dockerfile DELETED
@@ -1,44 +0,0 @@
1
- FROM ubuntu:22.04
2
-
3
- ENV RBENV_ROOT=/opt/rbenv
4
- ENV PATH=${RBENV_ROOT}/shims:${RBENV_ROOT}/bin:${PATH}
5
- ENV APP_HOME=/app
6
- # I know there's a more reliable way, but this is simpler.
7
- ENV IN_DOCKER=true
8
- ENV DEBIAN_FRONTEND=noninteractive
9
-
10
- RUN mkdir -p $APP_HOME
11
-
12
- RUN apt-get update -q && apt-get install -y \
13
- curl bundler build-essential git gnupg locales \
14
- libbz2-dev libffi-dev liblzma-dev lsb-release libsqlite3-dev libyaml-dev \
15
- make openjdk-17-jdk-headless ruby-dev ruby-full tzdata zlib1g-dev \
16
- && ln -fs /usr/share/zoneinfo/UTC /etc/localtime \
17
- && dpkg-reconfigure --frontend noninteractive tzdata
18
-
19
- RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg \
20
- && echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \
21
- && curl https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc \
22
- && curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | tee /etc/apt/sources.list.d/mssql-release.list \
23
- && apt-get update -q
24
-
25
- RUN ACCEPT_EULA=y DEBIAN_FRONTEND=noninteractive apt-get install -y \
26
- freetds-dev libmysqlclient-dev mysql-client msodbcsql18 mssql-tools18 unixodbc-dev libpq-dev \
27
- && echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc \
28
- && apt-get clean \
29
- && rm -rf /var/lib/apt/lists/* \
30
- && locale-gen en_US.UTF-8
31
-
32
- RUN /bin/bash -c "source ~/.bashrc"
33
-
34
- RUN mkdir -p ${RBENV_ROOT} \
35
- && git clone https://github.com/rbenv/rbenv.git ${RBENV_ROOT} \
36
- && git clone --depth 1 https://github.com/rbenv/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build \
37
- && rbenv init - \
38
- && rbenv global system
39
-
40
- WORKDIR $APP_HOME
41
- COPY ./dev/rbenv ./dev/rbenv
42
- COPY ./.github/workflows/ruby.yml ./.github/workflows/ruby.yml
43
- RUN /usr/bin/gem install colorize psych toml-rb
44
- RUN ./dev/rbenv install && rm ./dev/rbenv ./.github/workflows/ruby.yml
data/dev/compose.yaml DELETED
@@ -1,71 +0,0 @@
1
- name: arelx
2
- services:
3
- arelx:
4
- container_name: arelx-build
5
- build:
6
- context: ..
7
- dockerfile: dev/arelx.dockerfile
8
- volumes:
9
- - ../:/app
10
- entrypoint: ["/usr/bin/ruby", "dev/rbenv", "test"]
11
- network_mode: "host"
12
- depends_on:
13
- mariadb:
14
- condition: service_healthy
15
- postgres:
16
- condition: service_healthy
17
- mssql:
18
- condition: service_healthy
19
- mariadb:
20
- image: mariadb:11.0
21
- container_name: mariadb
22
- environment:
23
- MARIADB_DATABASE: arelx_test
24
- MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: true
25
- ports:
26
- - "3306:3306"
27
- network_mode: "host"
28
- healthcheck:
29
- test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
30
- interval: 10s
31
- timeout: 5s
32
- retries: 3
33
- postgres:
34
- build:
35
- context: ..
36
- dockerfile: dev/postgres.dockerfile
37
- container_name: postgres
38
- environment:
39
- POSTGRES_USER: postgres
40
- POSTGRES_PASSWORD: secret
41
- POSTGRES_DB: arelx_test
42
- ports:
43
- - "5432:5432"
44
- network_mode: "host"
45
- healthcheck:
46
- test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
47
- interval: 10s
48
- timeout: 5s
49
- retries: 3
50
- mssql:
51
- image: mcr.microsoft.com/mssql/server:2019-latest
52
- container_name: mssql
53
- environment:
54
- MSSQL_SA_PASSWORD: Password12!
55
- ACCEPT_EULA: Y
56
- ports:
57
- - "1433:1433"
58
- network_mode: "host"
59
- healthcheck:
60
- test:
61
- [
62
- "CMD-SHELL",
63
- "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $${MSSQL_SA_PASSWORD} -Q 'SELECT 1'",
64
- ]
65
- interval: 30s
66
- retries: 5
67
- timeout: 10s
68
-
69
- networks:
70
- default:
71
- name: arelx-network
@@ -1,5 +0,0 @@
1
- FROM postgres:16
2
-
3
- RUN locale-gen fr_FR.utf8 && update-locale
4
- RUN localedef -i fr_FR -c -f UTF-8 -A /usr/share/locale/locale.alias fr_FR.UTF-8
5
- # ENV LANG fr_FR.utf8
data/dev/rbenv DELETED
@@ -1,189 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'colorize'
5
- require 'etc'
6
- require 'open3'
7
- require 'pathname'
8
- require 'stringio'
9
- require 'toml-rb'
10
- require 'psych'
11
-
12
- workflow = Pathname('.github/workflows/ruby.yml').read.gsub!(/rails: (\d(_\d)?)/, 'rails: "\1"')
13
- jobs = Psych.load(workflow, symbolize_names: true)[:jobs]
14
- data = {}
15
- jobs.each do |name, details|
16
- details[:strategy][:matrix][:versions].each do |entry|
17
- db = name.to_s.gsub(/\Ajob_test_/, '').to_sym
18
- ruby = entry[:ruby]
19
- rails = entry[:rails]
20
- arelx = entry[:arelx]
21
- gemspec = :"arel_extensions-v#{arelx}"
22
- gemfile = :"rails#{rails}"
23
-
24
- data[db] ||= {}
25
- data[db][gemspec] ||= {}
26
- data[db][gemspec][gemfile] ||= []
27
- data[db][gemspec][gemfile] << ruby
28
- data[db][gemspec][gemfile].sort!
29
- end
30
- end
31
-
32
- MATRIX = data.freeze
33
-
34
- def sh(command, exit_on_fail: true, stealth: false)
35
- cmd, args = command.split(' ', 2)
36
- puts "#{'$'.green.bold} #{cmd.blue} #{args&.yellow}"
37
- Open3.popen3(command) do |stdin, stdout, stderr, wait_thr|
38
- stdin.close
39
- out, err =
40
- if stealth
41
- [StringIO.new, StringIO.new]
42
- else
43
- [$stdout, $stderr]
44
- end
45
- th_out = Thread.new do
46
- stdout.each_line { |line| out.puts line }
47
- end
48
- th_err = Thread.new do
49
- stderr.each_line { |line| err.puts line }
50
- end
51
-
52
- th_out.join
53
- th_err.join
54
- wait_thr.join
55
- exit_status = wait_thr.value.exitstatus
56
- if exit_status.nonzero?
57
- warn "'#{command}' failed with exit status #{exit_status}. Aborting …".red
58
- warn stderr if !stealth
59
- exit exit_status if exit_on_fail
60
- end
61
-
62
- if stealth
63
- [out.string, err.string, (exit_status if !exit_on_fail)].compact
64
- end
65
- end
66
- end
67
-
68
- module RBEnv
69
- RBENV_ROOT =
70
- if (root = ENV['RBENV_ROOT']) && root && !root.strip.empty?
71
- Pathname(root)
72
- else
73
- Pathname(Dir.home).join('.rbenv')
74
- end.freeze
75
- RBENV_BUILD = RBENV_ROOT.join('plugins').join('ruby-build').freeze
76
- SHELL = Pathname(Etc.getpwuid.shell).basename.to_s.downcase.to_sym
77
-
78
- def self.available_versions
79
- out, _ = sh "rbenv versions --bare", stealth: true
80
- res = out.lines.map(&:strip)
81
- warn res
82
- res
83
- end
84
-
85
- def self.ensure(ruby_version)
86
- version = RBEnv.resolve_to_latest(ruby_version)
87
- if self.installed?(version)
88
- puts "#{version.yellow} already installed. Skipping …"
89
- else
90
- puts "Installing #{version.yellow}"
91
- sh "rbenv install #{version}"
92
- end
93
- version
94
- end
95
-
96
- def self.install
97
- if RBENV_ROOT.exist?
98
- puts "#{RBENV_ROOT} exists. Skipping …"
99
- else
100
- sh "git clone --depth 1 https://github.com/rbenv/rbenv.git #{RBENV_ROOT}"
101
- puts "Setup your shell to recognize rbenv. Check github.com/rbenv/rbenv."
102
- end
103
-
104
- if RBENV_BUILD.exist?
105
- puts "#{RBENV_BUILD} exists. Skipping …"
106
- else
107
- sh "git clone --depth 1 https://github.com/rbenv/ruby-build.git #{RBENV_BUILD}"
108
- end
109
- end
110
-
111
- def self.installed?(version)
112
- installed = available_versions
113
- puts "installed? = #{installed}"
114
- installed && !installed.empty? && installed.include?(version)
115
- end
116
-
117
- def self.resolve_to_latest(version)
118
- out, _ = sh "rbenv install --list-all", stealth: true
119
- out
120
- .lines
121
- .map(&:strip)
122
- .select { |v| v.match(/^#{Regexp.escape(version)}\.\d+/) }
123
- .max_by { |v| v.split('.').map(&:to_i) }
124
- end
125
-
126
- def self.set(version)
127
- sh "rbenv local #{version}"
128
- end
129
- end
130
-
131
- module CI
132
- def self.help(*_args)
133
- puts "Usage:"
134
- puts " #{$0} [#{CI.singleton_class.instance_methods(false).sort.join(' | ')}]"
135
- puts
136
- puts "You can ask for many commands."
137
- end
138
-
139
- def self.install(*_args)
140
- RBEnv.install
141
- MATRIX
142
- .flat_map { |_, db|
143
- db.flat_map { |_, arelx|
144
- arelx.flat_map { |rails, rubies|
145
- rails.start_with?("rails") ? rubies : []
146
- }
147
- }
148
- }
149
- .uniq
150
- .sort
151
- .each do |version|
152
- RBEnv.ensure(version)
153
- end
154
- end
155
-
156
- # @param args [Array<String>] a list of databases to test
157
- def self.test(*args)
158
- puts "Requested DBs: #{args.inspect}"
159
- MATRIX.each do |db, arelx|
160
- puts "db = #{db}; #{!args.empty? && args.include?(db)}"
161
- if args.empty? || args.include?(db)
162
- puts "Testing #{db}"
163
- else
164
- puts "Skipping #{db}"
165
- next
166
- end
167
- arelx.each do |arelx_version, rails|
168
- sh "cp ./gemspecs/#{arelx_version}.gemspec ./arel_extensions.gemspec"
169
- rails.each do |rails_version, ruby|
170
- sh "cp ./gemfiles/#{rails_version}.gemfile ./Gemfile"
171
- ruby.each do |ruby_version|
172
- full_version = RBEnv.ensure(ruby_version)
173
- RBEnv.set(full_version)
174
- sh "ruby --version"
175
- sh "which ruby"
176
- sh "rm -rf Gemfile.lock vendor"
177
- sh "bundle config set --local path vendor"
178
- sh "bundle install"
179
- sh "bundle exec rake test:#{db}"
180
- end
181
- end
182
- end
183
- end
184
- end
185
- end
186
-
187
- # main
188
- command = ARGV.size.nonzero? ? ARGV : %w[help]
189
- CI.send(command[0], *command[1..])
@@ -1,38 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'arel', '~> 6.0'
4
-
5
- group :development, :test do
6
- # We need to explicitly include bigdecimal for ruby 2.7 .
7
- # See https://github.com/ruby/bigdecimal for details.
8
- rb_version = Gem::Version.new(RUBY_VERSION)
9
- if Gem::Version.new('2.7') <= rb_version && rb_version < Gem::Version.new('2.8')
10
- gem 'bigdecimal', '~> 1.3.5', platforms: %i[mri mingw x64_mingw mswin]
11
- end
12
-
13
- gem 'activesupport', '~> 4.0'
14
- gem 'activemodel', '~> 4.0'
15
- gem 'activerecord', '~> 4.0'
16
-
17
- gem 'sqlite3', '<= 1.3.13', platforms: %i[mri mswin mingw]
18
- gem 'mysql2', '0.4.10', platforms: %i[mri mswin mingw]
19
- gem 'pg', '< 1.0.0', platforms: %i[mri mingw]
20
-
21
- gem 'tiny_tds', platforms: %i[mri mingw x64_mingw mswin]
22
- gem 'activerecord-sqlserver-adapter', '~> 4.2.0', platforms: %i[mri mingw x64_mingw mswin]
23
-
24
- gem 'ruby-oci8', platforms: %i[mri mswin mingw] if ENV.has_key? 'ORACLE_HOME'
25
- gem 'activerecord-oracle_enhanced-adapter', '~> 1.6.0' if ENV.has_key? 'ORACLE_HOME'
26
-
27
- # for JRuby
28
- gem 'activerecord-jdbc-adapter', '~> 1.3', platforms: :jruby
29
- gem 'jdbc-sqlite3', '~> 3.28', platforms: :jruby
30
- gem 'jdbc-postgres', '~> 42.2', platforms: :jruby
31
- gem 'jdbc-mysql', '~> 5.1', platforms: :jruby
32
- gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
33
- gem 'activerecord-jdbcmysql-adapter', platforms: :jruby
34
- gem 'activerecord-jdbcpostgresql-adapter', platforms: :jruby
35
- gem 'activerecord-jdbcmssql-adapter', platforms: :jruby
36
- end
37
-
38
- gemspec path: Dir.pwd
@@ -1,29 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'arel', '~> 7.0'
4
-
5
- group :development, :test do
6
- gem 'activesupport', '~> 5.0'
7
- gem 'activemodel', '~> 5.0'
8
- gem 'activerecord', '5.0.6'
9
-
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
-
14
- gem 'tiny_tds', platforms: %i[mri mingw] if RUBY_PLATFORM.match?(/windows/)
15
- # gem "activerecord-sqlserver-adapter", platforms: [:mri, :mingw]
16
-
17
- gem 'ruby-oci8', platforms: %i[mri mswin mingw] if ENV.has_key? 'ORACLE_HOME'
18
- gem 'activerecord-oracle_enhanced-adapter', '~> 1.7' if ENV.has_key? 'ORACLE_HOME'
19
-
20
- # for JRuby
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
27
- end
28
-
29
- gemspec path: Dir.pwd
@@ -1,33 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'rails', '~> 6.0.0'
4
-
5
- group :development, :test do
6
- gem 'ruby-lsp', platforms: %i[mri]
7
- gem 'debug', platforms: %i[mri]
8
-
9
- gem 'activesupport', '~> 6.0.0'
10
- gem 'activemodel', '~> 6.0.0'
11
- gem 'activerecord', '~> 6.0.0'
12
-
13
- gem 'sqlite3', '~> 1.4', platforms: [:mri]
14
- gem 'mysql2', '0.5.2', platforms: [:mri]
15
- gem 'pg', '< 1.0.0', platforms: [:mri]
16
-
17
- gem 'tiny_tds', platforms: %i[mri mingw x64_mingw mswin]
18
- gem 'activerecord-sqlserver-adapter', '~> 6.0', platforms: %i[mri mingw x64_mingw mswin]
19
- gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw]
20
-
21
- gem 'ruby-oci8', platforms: %i[mri mswin mingw] if ENV.has_key? 'ORACLE_HOME'
22
- gem 'activerecord-oracle_enhanced-adapter', '~> 6.0.0' if ENV.has_key? 'ORACLE_HOME'
23
-
24
- # for JRuby
25
- gem 'activerecord-jdbc-alt-adapter', '~> 60.0', platform: :jruby, require: true
26
- gem 'activerecord-jdbcmysql-adapter', platforms: :jruby
27
- gem 'activerecord-jdbcpostgresql-adapter', platforms: :jruby
28
- gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
29
- gem 'jdbc-mssql', platforms: :jruby, require: true
30
- gem 'jdbc-sqlite3', platforms: :jruby
31
- end
32
-
33
- gemspec path: Dir.pwd
@@ -1,33 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'rails', '~> 6.1.0'
4
-
5
- group :development, :test do
6
- gem 'ruby-lsp', platforms: %i[mri]
7
- gem 'debug', platforms: %i[mri]
8
-
9
- gem 'activesupport', '~> 6.1.0'
10
- gem 'activemodel', '~> 6.1.0'
11
- gem 'activerecord', '~> 6.1.0'
12
-
13
- gem 'sqlite3', '~> 1.4', platforms: [:mri]
14
- gem 'mysql2', '~>0.5', platforms: [:mri]
15
- gem 'pg', '~> 1.1', platforms: [:mri]
16
-
17
- gem 'tiny_tds', platforms: %i[mri mingw x64_mingw mswin]
18
- gem 'activerecord-sqlserver-adapter', '~> 6.1.0', platforms: %i[mri mingw x64_mingw mswin]
19
- gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw]
20
-
21
- gem 'ruby-oci8', platforms: %i[mri mswin mingw] if ENV.has_key? 'ORACLE_HOME'
22
- gem 'activerecord-oracle_enhanced-adapter', '~> 6.0.0' if ENV.has_key? 'ORACLE_HOME'
23
-
24
- # for JRuby
25
- gem 'activerecord-jdbc-alt-adapter', '~> 61.0', platform: :jruby, require: true
26
- gem 'activerecord-jdbcmysql-adapter', platforms: :jruby
27
- gem 'activerecord-jdbcpostgresql-adapter', platforms: :jruby
28
- gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
29
- gem 'jdbc-mssql', platforms: :jruby, require: true
30
- gem 'jdbc-sqlite3', platforms: :jruby
31
- end
32
-
33
- gemspec path: Dir.pwd
@@ -1,33 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'rails', '~> 7.0.1'
4
-
5
- group :development, :test do
6
- gem 'ruby-lsp', platforms: %i[mri]
7
- gem 'debug', platforms: %i[mri]
8
-
9
- gem 'activesupport', '~> 7.0.1'
10
- gem 'activemodel', '~> 7.0.1'
11
- gem 'activerecord', '~> 7.0.1'
12
-
13
- gem 'sqlite3', '~> 1.4', platforms: [:mri]
14
- gem 'mysql2', '~>0.5', platforms: [:mri]
15
- gem 'pg', '~> 1.1', platforms: [:mri]
16
-
17
- gem 'tiny_tds', platforms: %i[mri mingw x64_mingw mswin]
18
- gem 'activerecord-sqlserver-adapter', '~> 7.0.7', platforms: %i[mri mingw x64_mingw mswin]
19
- gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw]
20
-
21
- gem 'ruby-oci8', platforms: %i[mri mswin mingw] if ENV.has_key? 'ORACLE_HOME'
22
- gem 'activerecord-oracle_enhanced-adapter', '~> 6.0.0' if ENV.has_key? 'ORACLE_HOME'
23
-
24
- # for JRuby
25
- gem 'jdbc-mssql', platforms: :jruby, require: true
26
- gem 'jdbc-sqlite3', platform: :jruby
27
- gem 'activerecord-jdbc-alt-adapter', '~> 70.0', platform: :jruby, require: true
28
- gem 'activerecord-jdbcmysql-adapter', platforms: :jruby
29
- gem 'activerecord-jdbcpostgresql-adapter', platforms: :jruby
30
- gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
31
- end
32
-
33
- gemspec path: Dir.pwd
@@ -1,33 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'rails', '~> 7.1'
4
-
5
- group :development, :test do
6
- gem 'ruby-lsp', platforms: %i[mri]
7
- gem 'debug', platforms: %i[mri]
8
-
9
- gem 'activesupport', '~> 7.1'
10
- gem 'activemodel', '~> 7.1'
11
- gem 'activerecord', '~> 7.1'
12
-
13
- gem 'sqlite3', '~> 1.6', platforms: [:mri]
14
- gem 'mysql2', '~>0.5', platforms: [:mri]
15
- gem 'pg', '~> 1.5', platforms: [:mri]
16
-
17
- gem 'tiny_tds', platforms: %i[mri mingw x64_mingw mswin]
18
- gem 'activerecord-sqlserver-adapter', '~> 7.1.0.beta1', platforms: %i[mri mingw x64_mingw mswin]
19
- gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw]
20
-
21
- gem 'ruby-oci8', platforms: %i[mri mswin mingw] if ENV.has_key? 'ORACLE_HOME'
22
- gem 'activerecord-oracle_enhanced-adapter', '~> 7.0.0' if ENV.has_key? 'ORACLE_HOME'
23
-
24
- # for JRuby
25
- gem 'jdbc-mssql', platforms: :jruby, require: true
26
- gem 'jdbc-sqlite3', platform: :jruby
27
- gem 'activerecord-jdbc-alt-adapter', '~> 71.0.0.alpha1', platform: :jruby, require: true
28
- gem 'activerecord-jdbcmysql-adapter', platforms: :jruby
29
- gem 'activerecord-jdbcpostgresql-adapter', platforms: :jruby
30
- gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
31
- end
32
-
33
- gemspec path: Dir.pwd
@@ -1,33 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'rails', '~> 7.2'
4
-
5
- group :development, :test do
6
- gem 'ruby-lsp', platforms: %i[mri]
7
- gem 'debug', platforms: %i[mri]
8
-
9
- gem 'activesupport', '~> 7.2'
10
- gem 'activemodel', '~> 7.2'
11
- gem 'activerecord', '~> 7.2'
12
-
13
- gem 'sqlite3', '~> 1.6', platforms: [:mri]
14
- gem 'mysql2', '~>0.5', platforms: [:mri]
15
- gem 'pg', '~> 1.5', platforms: [:mri]
16
-
17
- gem 'tiny_tds', platforms: %i[mri mingw x64_mingw mswin]
18
- gem 'activerecord-sqlserver-adapter', '~> 7.2', platforms: %i[mri mingw x64_mingw mswin]
19
- gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw]
20
-
21
- gem 'ruby-oci8', platforms: %i[mri mswin mingw] if ENV.has_key? 'ORACLE_HOME'
22
- gem 'activerecord-oracle_enhanced-adapter', '~> 7.0.0' if ENV.has_key? 'ORACLE_HOME'
23
-
24
- # for JRuby
25
- gem 'jdbc-mssql', platforms: :jruby, require: true
26
- gem 'jdbc-sqlite3', platform: :jruby
27
- # gem 'activerecord-jdbc-alt-adapter', '~> 71.0.0.alpha1', platform: :jruby, require: true
28
- gem 'activerecord-jdbcmysql-adapter', platforms: :jruby
29
- gem 'activerecord-jdbcpostgresql-adapter', platforms: :jruby
30
- gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
31
- end
32
-
33
- gemspec path: Dir.pwd
@@ -1,27 +0,0 @@
1
- $:.push File.expand_path('../lib', __FILE__)
2
- require 'arel_extensions/version'
3
-
4
- Gem::Specification.new do |s|
5
- s.name = 'arel_extensions'
6
- s.version = ArelExtensions::VERSION
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'
13
- s.license = 'MIT'
14
-
15
- s.rdoc_options = ['--main', 'README.md']
16
- s.extra_rdoc_files = ['MIT-LICENSE.txt', 'README.md', 'functions.html']
17
-
18
- # Manifest
19
- s.files = `git ls-files`.split("\n")
20
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
- s.require_paths = ['lib']
22
-
23
- s.add_dependency('arel', '>= 6.0')
24
-
25
- s.add_development_dependency('minitest', '~> 5.9')
26
- s.add_development_dependency('rake', '~> 12.3.3')
27
- end
@@ -1,27 +0,0 @@
1
- $:.push File.expand_path('../lib', __FILE__)
2
- require 'arel_extensions/version'
3
-
4
- Gem::Specification.new do |s|
5
- s.name = 'arel_extensions'
6
- s.version = ArelExtensions::VERSION
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'
13
- s.license = 'MIT'
14
-
15
- s.rdoc_options = ['--main', 'README.md']
16
- s.extra_rdoc_files = ['MIT-LICENSE.txt', 'README.md', 'functions.html']
17
-
18
- # Manifest
19
- s.files = `git ls-files`.split("\n")
20
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
- s.require_paths = ['lib']
22
-
23
- s.add_dependency('activerecord', '>= 6.0')
24
-
25
- s.add_development_dependency('minitest', '~> 5.9')
26
- s.add_development_dependency('rake', '~> 12.3.3')
27
- end
data/generate_gems.sh DELETED
@@ -1,15 +0,0 @@
1
-
2
- #gem uninstall arel_extensions
3
-
4
- # VERSION ~> 1
5
- cp ./version_v1.rb lib/arel_extensions/version.rb
6
- cp ./gemspecs/arel_extensions-v1.gemspec ./arel_extensions.gemspec
7
- gem build ./arel_extensions.gemspec
8
-
9
- # VERSION ~> 2
10
- cp ./version_v2.rb lib/arel_extensions/version.rb
11
- mv ./arel_extensions.gemspec ./arel_extensions.gemspec.bck
12
- cp ./gemspecs/arel_extensions-v2.gemspec ./arel_extensions.gemspec
13
- gem build ./arel_extensions.gemspec
14
- cp ./version_v1.rb lib/arel_extensions/version.rb
15
- cp ./gemspecs/arel_extensions-v1.gemspec ./arel_extensions.gemspec
@@ -1,14 +0,0 @@
1
- module ArelExtensions
2
- module Aliases
3
-
4
- # Install an alias, if present.
5
- def xas other
6
- if other.present?
7
- Arel::Nodes::As.new(self, Arel.sql(other))
8
- else
9
- self
10
- end
11
- end
12
-
13
- end
14
- end