repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
equivalent/scrapbook2
https://github.com/equivalent/scrapbook2/blob/b39d2865158b4730fe6edd442420301db958cc89/examples/custom_rails_yaml_config/config/initializers/local_app_config.rb
examples/custom_rails_yaml_config/config/initializers/local_app_config.rb
begin LOCAL_APP_CONFIG = YAML.load_file("#{Rails.root}/config/local_app_config.yml")[Rails.env] || {} rescue Rails.logger.warn "No config/local_app_config.yml not found" LOCAL_APP_CONFIG = {} end
ruby
MIT
b39d2865158b4730fe6edd442420301db958cc89
2026-01-04T17:38:11.379134Z
false
equivalent/scrapbook2
https://github.com/equivalent/scrapbook2/blob/b39d2865158b4730fe6edd442420301db958cc89/examples/custom_rails_yaml_config/config/initializers/fog_credentials.rb
examples/custom_rails_yaml_config/config/initializers/fog_credentials.rb
CarrierWave.configure do |config| config.fog_credentials = { :provider => 'AWS', :aws_access_key_id => LOCAL_APP_CONFIG.send(:[], 'private_key'), :aws_secret_access_key => LOCAL_APP_CONFIG.send(:[], 'secret'), :region => 'eu-west-1' } config.fog_directory = "my...
ruby
MIT
b39d2865158b4730fe6edd442420301db958cc89
2026-01-04T17:38:11.379134Z
false
equivalent/scrapbook2
https://github.com/equivalent/scrapbook2/blob/b39d2865158b4730fe6edd442420301db958cc89/examples/dummy_model_for_creating_views/field.rb
examples/dummy_model_for_creating_views/field.rb
# This model is just for demo only, please git remove this file before implementing/merging real model class Field include ActiveModel::Validations include ActiveModel::Conversion extend ActiveModel::Naming attr_accessor :name, :type def initialize(options={}) options.each.each do |key, value| se...
ruby
MIT
b39d2865158b4730fe6edd442420301db958cc89
2026-01-04T17:38:11.379134Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/version_v2.rb
version_v2.rb
module ArelExtensions VERSION = '2.4.0'.freeze end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/version_v1.rb
version_v1.rb
module ArelExtensions VERSION = '1.6.0'.freeze end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/real_db_test.rb
test/real_db_test.rb
require 'rubygems' require 'minitest/autorun' require 'active_record' $:.unshift "#{File.dirname(__FILE__)}../../lib" require 'arel_extensions' def setup_db ActiveRecord::Base.configurations = ConfigLoader.load('test/database.yml') ActiveRecord::Base.establish_connection(ENV['DB'].try(:to_sym) || (RUBY_PLATFORM =...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/test_comparators.rb
test/test_comparators.rb
require 'arelx_test_helper' module ArelExtensions module Nodes describe ArelExtensions::Comparators do before do @conn = FakeRecord::Base.new Arel::Table.engine = @conn @visitor = Arel::Visitors::ToSql.new @conn.connection @table = Arel::Table.new(:users) @attr = @ta...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/config_loader.rb
test/config_loader.rb
require 'erb' require 'yaml' module ConfigLoader def self.load(path) yaml_content = ERB.new(File.read(path)).result YAML.load(yaml_content) end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/arelx_test_helper.rb
test/arelx_test_helper.rb
require 'active_record' require 'arel' require 'arel_extensions/constants' require 'fileutils' require 'minitest/autorun' require 'rubygems' require 'support/fake_record' require_relative './config_loader' ENV['AREL_EXTENSIONS_IN_TEST'] = '1' # Useful for deprecation warnings. def colored(color, msg) /^xterm|-256c...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/support/fake_record.rb
test/support/fake_record.rb
require 'arel_extensions/constants' module FakeRecord class Column < Struct.new(:name, :type) end class Connection attr_reader :tables attr_accessor :visitor def initialize(visitor = nil) @tables = %w{users photos developers products} @columns = { 'users' => [ Column.n...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/visitors/test_bulk_insert_oracle.rb
test/visitors/test_bulk_insert_oracle.rb
require 'arelx_test_helper' module ArelExtensions module BulkInsertOracle describe 'the oracle bulk insert visitor' do before do @conn = FakeRecord::Base.new @visitor = Arel::Visitors::Oracle.new @conn.connection @table = Arel::Table.new(:users) @cols = %w[name comments crea...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/visitors/test_oracle.rb
test/visitors/test_oracle.rb
require 'arelx_test_helper' module ArelExtensions module VisitorOracle describe 'the Oracle visitor' do before do @conn = FakeRecord::Base.new Arel::Table.engine = @conn @visitor = Arel::Visitors::Oracle.new @conn.connection @table = Arel::Table.new(:users) @attr = @...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/visitors/test_bulk_insert_to_sql.rb
test/visitors/test_bulk_insert_to_sql.rb
require 'arelx_test_helper' module ArelExtensions module BulkInsertToSql describe 'the to_sql visitor can bulk insert' do before do @conn = FakeRecord::Base.new Arel::Table.engine = @conn @visitor = Arel::Visitors::ToSql.new @conn.connection @table = Arel::Table.new(:users) ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/visitors/test_to_sql.rb
test/visitors/test_to_sql.rb
require 'arelx_test_helper' require 'set' module ArelExtensions module VisitorToSql describe 'the to_sql visitor' do before do if Arel::Table.engine.is_a?(ActiveRecord::Base) puts 'This is a hack.' # As a matter of fact, if the whole if-block is removed, the to_sql # t...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/visitors/test_bulk_insert_sqlite.rb
test/visitors/test_bulk_insert_sqlite.rb
require 'arelx_test_helper' module ArelExtensions module BulkInsertSQLlite describe 'the sqlite visitor can bulk insert' do before do @conn = FakeRecord::Base.new @visitor = Arel::Visitors::SQLite.new @conn.connection @table = Arel::Table.new(:users) Arel::Table.engine = @co...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/with_ar/test_string_sqlite.rb
test/with_ar/test_string_sqlite.rb
require 'arelx_test_helper' require 'date' module ArelExtensions module WithAr describe 'the sqlite visitor can do string operations' do before do ActiveRecord::Base.configurations = ConfigLoader.load('test/database.yml') ActiveRecord::Base.establish_connection(ENV['DB'] || (RUBY_PLATFORM =...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/with_ar/test_string_mysql.rb
test/with_ar/test_string_mysql.rb
require 'arelx_test_helper' require 'date' module ArelExtensions module WithAr describe 'the mysql visitor can do string operations' do before do ActiveRecord::Base.configurations = ConfigLoader.load('test/database.yml') ActiveRecord::Base.establish_connection(ENV['DB'] || (RUBY_PLATFORM ==...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/with_ar/insert_agnostic_test.rb
test/with_ar/insert_agnostic_test.rb
require 'arelx_test_helper' require 'date' module ArelExtensions module WithAr class InsertManagerTest < Minitest::Test def connect_db ActiveRecord::Base.configurations = ConfigLoader.load('test/database.yml') if ENV['DB'] == 'oracle' && ((defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx') || (...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/with_ar/all_agnostic_test.rb
test/with_ar/all_agnostic_test.rb
require 'arelx_test_helper' require 'date' # class ActiveRecord::ConnectionAdapters::SQLServerAdapter # # We use *args to avoid breaking signature changes between versions. # # internal_exec_sql_query(sql, name = "SQL", binds = [], prepare: false) # def internal_exec_sql_query(*args) # sql = args.first # ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
true
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/with_ar/test_bulk_sqlite.rb
test/with_ar/test_bulk_sqlite.rb
require 'arelx_test_helper' module ArelExtensions module WithAr describe 'the sqlite visitor' do before do ActiveRecord::Base.configurations = ConfigLoader.load('test/database.yml') ActiveRecord::Base.establish_connection(ENV['DB'] || (RUBY_PLATFORM == 'java' ? :"jdbc-sqlite" : :sqlite)) ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/test/with_ar/test_math_sqlite.rb
test/with_ar/test_math_sqlite.rb
require 'arelx_test_helper' module ArelExtensions module WithAr describe 'the sqlite visitor can do maths' do before do ActiveRecord::Base.configurations = ConfigLoader.load('test/database.yml') ActiveRecord::Base.establish_connection(ENV['DB'] || (RUBY_PLATFORM == 'java' ? :"jdbc-sqlite" :...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions.rb
lib/arel_extensions.rb
require 'arel' require 'arel_extensions/constants' require 'base64' require 'arel_extensions/railtie' if defined?(Rails::Railtie) # UnaryOperation|Grouping|Extract < Unary < Arel::Nodes::Node # Equality|Regexp|Matches < Binary < Arel::Nodes::Node # Count|NamedFunction < Function < Arel::Nodes::Node # pure Arel inter...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/attributes.rb
lib/arel_extensions/attributes.rb
require 'arel_extensions/aliases' require 'arel_extensions/math' require 'arel_extensions/comparators' require 'arel_extensions/date_duration' require 'arel_extensions/math_functions' require 'arel_extensions/null_functions' require 'arel_extensions/string_functions' require 'arel_extensions/predications' module ArelE...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/boolean_functions.rb
lib/arel_extensions/boolean_functions.rb
require 'arel_extensions/nodes/then' module ArelExtensions module BooleanFunctions def ⋀(other) self.and(other) end def and *others Arel::Nodes::And.new self, others end def ⋁(other) self.or(other) end def or *others Arel::Nodes::Or.new self, others end ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/predications.rb
lib/arel_extensions/predications.rb
module ArelExtensions module Predications def when right, expression = nil ArelExtensions::Nodes::Case.new(self).when(right, expression) end def matches(other, escape = nil, case_sensitive = nil) if AREL_VERSION < V7 Arel::Nodes::Matches.new(self, Arel.quoted(other), escape) els...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/null_functions.rb
lib/arel_extensions/null_functions.rb
require 'arel_extensions/nodes/coalesce' require 'arel_extensions/nodes/is_null' module ArelExtensions module NullFunctions # if_present returns nil if the the value is nil or blank def if_present Arel.when(self.cast(:string).present).then(self) end # ISNULL function lets you return an altern...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/date_duration.rb
lib/arel_extensions/date_duration.rb
require 'arel_extensions/nodes/format' require 'arel_extensions/nodes/formatted_date' require 'arel_extensions/nodes/duration' require 'arel_extensions/nodes/wday' module ArelExtensions module DateDuration # function returns the year (as a number) given a date value. def year ArelExtensions::Nodes::Dur...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/version.rb
lib/arel_extensions/version.rb
module ArelExtensions VERSION = '2.4.0'.freeze end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/common_sql_functions.rb
lib/arel_extensions/common_sql_functions.rb
module ArelExtensions class CommonSqlFunctions def initialize(cnx) @cnx = cnx if cnx && cnx.adapter_name =~ /sqlite/i && !$load_extension_disabled begin db = cnx.raw_connection db.enable_load_extension(1) db.load_extension('/usr/lib/sqlite3/pcre.so') db....
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes.rb
lib/arel_extensions/nodes.rb
require 'arel_extensions/nodes/function' require 'arel_extensions/nodes/aggregate_function'
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/math.rb
lib/arel_extensions/math.rb
require 'arel_extensions/nodes' require 'arel_extensions/nodes/function' require 'arel_extensions/nodes/concat' require 'arel_extensions/nodes/cast' require 'arel_extensions/nodes/date_diff' require 'arel_extensions/nodes/duration' require 'arel_extensions/nodes/wday' require 'arel_extensions/nodes/union' require 'are...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/warning.rb
lib/arel_extensions/warning.rb
module ArelExtensions class RubyDeprecator if RUBY_VERSION.split('.')[0].to_i < 3 def warn msg Kernel.warn(msg) end else def warn msg Kernel.warn(msg, category: :deprecated) end end end # To configure deprecations in a Rails application, you can do something ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/math_functions.rb
lib/arel_extensions/math_functions.rb
require 'arel_extensions/nodes/abs' require 'arel_extensions/nodes/ceil' require 'arel_extensions/nodes/floor' require 'arel_extensions/nodes/round' require 'arel_extensions/nodes/rand' require 'arel_extensions/nodes/formatted_number' require 'arel_extensions/nodes/log10' require 'arel_extensions/nodes/power' require '...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/constants.rb
lib/arel_extensions/constants.rb
module ArelExtensions ACTIVE_RECORD_VERSION = Gem::Version.new(ActiveRecord::VERSION::STRING).freeze AREL_VERSION = Gem::Version.new(Arel::VERSION).freeze V10 = Gem::Version.new('10.0').freeze V5 = Gem::Version.new('5.0').freeze V6 = Gem::Version.new('6.0').freeze V7 = Gem::Version.new('7.0').freeze V7_0 ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/helpers.rb
lib/arel_extensions/helpers.rb
module ArelExtensions # # column_of # # Before the creation of these methods, getting the column name was done # uniquely through the code found in `column_of_via_arel_table`. # # This turned out to be unreliable, most notably when using adapters that do # not come with activerecord standard batteries. ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/railtie.rb
lib/arel_extensions/railtie.rb
require 'rails' module ArelExtensions class Railtie < Rails::Railtie rake_tasks do load 'arel_extensions/tasks.rb' end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/string_functions.rb
lib/arel_extensions/string_functions.rb
require 'arel_extensions/nodes/byte_size' require 'arel_extensions/nodes/char_length' require 'arel_extensions/nodes/concat' # if Arel::VERSION.to_i < 7 require 'arel_extensions/nodes/length' require 'arel_extensions/nodes/locate' require 'arel_extensions/nodes/substring' require 'arel_extensions/nodes/matches' require...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/set_functions.rb
lib/arel_extensions/set_functions.rb
require 'arel_extensions/nodes/union' require 'arel_extensions/nodes/union_all' module ArelExtensions module SetFunctions def +(other) ArelExtensions::Nodes::Union.new(self, other) end def union(other) ArelExtensions::Nodes::Union.new(self, other) end def union_all(other) Arel...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/comparators.rb
lib/arel_extensions/comparators.rb
module ArelExtensions module Comparators def >(other) Arel::Nodes::GreaterThan.new self, Arel.quoted(other, self) end def >=(other) Arel::Nodes::GreaterThanOrEqual.new self, Arel.quoted(other, self) end def <(other) Arel::Nodes::LessThan.new self, Arel.quoted(other, self) e...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/aliases.rb
lib/arel_extensions/aliases.rb
module ArelExtensions module Aliases # Install an alias, if present. def xas other if other.present? Arel::Nodes::As.new(self, Arel.sql(other)) else self end end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/insert_manager.rb
lib/arel_extensions/insert_manager.rb
require 'arel' module ArelExtensions module InsertManager def bulk_insert(cols, data) raise ArgumentError, 'cols must be present' if cols.blank? columns = case cols.first when Array case cols.first.first when Arel::Attributes::Attribute cols w...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/tasks.rb
lib/arel_extensions/tasks.rb
namespace :arel_extensions do desc 'Install DB functions into current DB' task install_functions: :environment do @env_db = if ENV['DB'] == 'oracle' && ((defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx') || (RUBY_PLATFORM == 'java')) # not supported (RUBY_PLATFORM == 'java' ? 'jdbc-sqlite' : 'sqlit...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/visitors.rb
lib/arel_extensions/visitors.rb
# MSSQL visitors for java and rails ≥ 7 are painful to work with: # requiring the exact path to the visitor is needed even if the # AR adapter was loaded. It's also needed exactly here because: # 1. putting it inside the visitor or anywhere else will not # guarantee its actual loading. # 2. it needs to load before a...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/change_case.rb
lib/arel_extensions/nodes/change_case.rb
module ArelExtensions module Nodes class Downcase < Function RETURN_TYPE = :string end class Upcase < Function RETURN_TYPE = :string end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/ceil.rb
lib/arel_extensions/nodes/ceil.rb
module ArelExtensions module Nodes class Ceil < Function RETURN_TYPE = :number end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/formatted_date.rb
lib/arel_extensions/nodes/formatted_date.rb
require 'strscan' module ArelExtensions module Nodes class FormattedDate < Function RETURN_TYPE = :string attr_accessor :col_type, :iso_format, :time_zone def initialize expr col = expr[0] @iso_format = convert_format(expr[1]) @time_zone = expr[2] @col_type = ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/coalesce.rb
lib/arel_extensions/nodes/coalesce.rb
module ArelExtensions module Nodes class Coalesce < Function RETURN_TYPE = :string attr_accessor :left_node_type def return_type @left_node_type || self.class.const_get(:RETURN_TYPE) end def initialize expr tab = expr.map { |arg| convert_to_node(arg) ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/std.rb
lib/arel_extensions/nodes/std.rb
module ArelExtensions module Nodes class Std < AggregateFunction RETURN_TYPE = :number attr_accessor :unbiased_estimator def initialize node, **opts @unbiased_estimator = opts[:unbiased] ? true : false super node, **opts end end class Variance < AggregateFunction ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/locate.rb
lib/arel_extensions/nodes/locate.rb
module ArelExtensions module Nodes class Locate < Function RETURN_TYPE = :integer def initialize expr tab = expr.map do |arg| convert_to_node(arg) end super(tab) end end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/duration.rb
lib/arel_extensions/nodes/duration.rb
module ArelExtensions module Nodes class Duration < Function RETURN_TYPE = :number attr_accessor :with_interval def initialize left, right, aliaz = nil tab = Array.new tab << left tab << right @with_interval = left.end_with?('i') super(tab, aliaz) ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/replace.rb
lib/arel_extensions/nodes/replace.rb
module ArelExtensions module Nodes class Replace < Function RETURN_TYPE = :string attr_accessor :left, :pattern, :substitute def initialize left, pattern, substitute @left = convert_to_node(left) @pattern = convert_to_node(pattern) @substitute = convert_to_node(substitut...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/log10.rb
lib/arel_extensions/nodes/log10.rb
module ArelExtensions module Nodes class Log10 < Function RETURN_TYPE = :number end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/format.rb
lib/arel_extensions/nodes/format.rb
require 'strscan' module ArelExtensions module Nodes class Format < Function RETURN_TYPE = :string attr_accessor :col_type, :iso_format, :time_zone def initialize expr col = expr[0] @iso_format = convert_format(expr[1]) @time_zone = expr[2] @col_type = type_of...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/wday.rb
lib/arel_extensions/nodes/wday.rb
module ArelExtensions module Nodes class Wday < Function def initialize other, aliaz = nil tab = Array.new tab << other super(tab, aliaz) end def date @expressions.first end end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/select.rb
lib/arel_extensions/nodes/select.rb
module Arel module Nodes class SelectCore # havings did not exist in rails < 5.2 if !method_defined?(:havings) alias :havings :having end end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/is_null.rb
lib/arel_extensions/nodes/is_null.rb
require 'arel_extensions/boolean_functions' module ArelExtensions module Nodes class IsNull < Arel::Nodes::Unary include ArelExtensions::BooleanFunctions RETURN_TYPE = :boolean end class IsNotNull < Arel::Nodes::Unary include ArelExtensions::BooleanFunctions RETURN_TYPE = :boolea...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/blank.rb
lib/arel_extensions/nodes/blank.rb
require 'arel_extensions/boolean_functions' module ArelExtensions module Nodes class Blank < Arel::Nodes::Unary include ArelExtensions::BooleanFunctions RETURN_TYPE = :boolean def initialize expr super expr.first end end class NotBlank < Arel::Nodes::Unary include ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/length.rb
lib/arel_extensions/nodes/length.rb
module ArelExtensions module Nodes class Length < Function RETURN_TYPE = :integer attr_accessor :bytewise def initialize(node, bytewise = true) @bytewise = bytewise super([node]) end end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/sum.rb
lib/arel_extensions/nodes/sum.rb
module ArelExtensions module Nodes class Sum < AggregateFunction RETURN_TYPE = :number end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/abs.rb
lib/arel_extensions/nodes/abs.rb
module ArelExtensions module Nodes class Abs < Function RETURN_TYPE = :number end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/json.rb
lib/arel_extensions/nodes/json.rb
module ArelExtensions module Nodes class JsonNode < Function RETURN_TYPE = :json attr_accessor :dict def merge *expr args = [self] + expr.map{|e| Json.new(e)} JsonMerge.new(args) end def get key JsonGet.new(self, key) end def set key, value ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/union_all.rb
lib/arel_extensions/nodes/union_all.rb
module ArelExtensions module Nodes class UnionAll < Arel::Nodes::UnionAll def initialize left, right super(left, right) end def union_all(other) ArelExtensions::Nodes::UnionAll.new(self, other) end def as other Arel::Nodes::TableAlias.new Arel.grouping(self)...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/aggregate_function.rb
lib/arel_extensions/nodes/aggregate_function.rb
module ArelExtensions module Nodes class AggregateFunction < Function attr_accessor :order, :group def initialize node, **opts @order = Array.wrap(opts[:order]).map{|e| convert_to_node(e)} @group = Array.wrap(opts[:group]).map{|e| convert_to_node(e)} super [node] end ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/date_diff.rb
lib/arel_extensions/nodes/date_diff.rb
require 'date' module ArelExtensions module Nodes class DateDiff < Function # difference entre colonne date et date string/date attr_accessor :left_node_type attr_accessor :right_node_type RETURN_TYPE = :integer # by default... def initialize(expr) res = [] col = expr.fi...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/floor.rb
lib/arel_extensions/nodes/floor.rb
module ArelExtensions module Nodes class Floor < Function RETURN_TYPE = :number end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/cast.rb
lib/arel_extensions/nodes/cast.rb
module ArelExtensions module Nodes class Cast < Function @return_type = :string attr_accessor :as_attr def initialize expr @as_attr = expr[1] case expr[1] when :int, 'bigint', 'int', 'smallint', 'tinyint', 'bit' @return_type = :int when :float, :decima...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/md5.rb
lib/arel_extensions/nodes/md5.rb
module ArelExtensions module Nodes class MD5 < Function RETURN_TYPE = :string end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/case.rb
lib/arel_extensions/nodes/case.rb
module ArelExtensions module Nodes if AREL_VERSION < V7_1 class Case < Arel::Nodes::Node include Arel::Expressions include Arel::Math include Arel::Predications include Arel::OrderPredications attr_accessor :case, :conditions, :default def initialize expressi...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/power.rb
lib/arel_extensions/nodes/power.rb
module ArelExtensions module Nodes class Power < Function RETURN_TYPE = :number def initialize expr super [convert_to_node(expr.first), convert_to_number(expr[1])] end end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/matches.rb
lib/arel_extensions/nodes/matches.rb
module ArelExtensions module Nodes class IMatches < Arel::Nodes::Matches attr_accessor :case_sensitive if AREL_VERSION < V7 def initialize(left, right, escape = nil) r = Arel.quoted(right) if AREL_VERSION < V7 # managed by default in version 7+ (rails 5), so useful for rails 3 & 4 ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/substring.rb
lib/arel_extensions/nodes/substring.rb
module ArelExtensions module Nodes class Substring < Function RETURN_TYPE = :string def initialize expr tab = [convert_to_node(expr[0]), convert_to_node(expr[1])] if expr[2] tab << convert_to_node(expr[2]) end super(tab) end end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/byte_size.rb
lib/arel_extensions/nodes/byte_size.rb
module ArelExtensions module Nodes class ByteSize < Function RETURN_TYPE = :integer def initialize(node) super([node]) end end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/soundex.rb
lib/arel_extensions/nodes/soundex.rb
module ArelExtensions module Nodes class Soundex < Function include Arel::Expressions include ArelExtensions::Comparators RETURN_TYPE = :string def ==(other) Arel::Nodes::Equality.new self, Arel.quoted(other, self) end def !=(other) Arel::Nodes::NotEqual.new ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/formatted_number.rb
lib/arel_extensions/nodes/formatted_number.rb
module ArelExtensions module Nodes class FormattedNumber < Function RETURN_TYPE = :string attr_accessor :locale, :prefix, :suffix, :flags, :scientific_notation, :width, :precision, :type, :original_string def initialize expr # expr[1] = {locale: 'fr_FR', type: "e"/"f"/"d", prefix: "$ "...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/union.rb
lib/arel_extensions/nodes/union.rb
module ArelExtensions module Nodes class Union < Arel::Nodes::Union def initialize left, right super(left, right) end def +(other) ArelExtensions::Nodes::Union.new(self, other) end def union(other) ArelExtensions::Nodes::UnionAll.new(self, other) end ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/rollup.rb
lib/arel_extensions/nodes/rollup.rb
# The following is a patch to activerecord when it doesn't # have RollUp defined, i.e. for rails < 5.2 begin Arel::Nodes.const_get('RollUp') rescue NameError => _ module Arel module Nodes class RollUp < Arel::Nodes::Unary end end end module Arel module Visitors class PostgreSQL ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/function.rb
lib/arel_extensions/nodes/function.rb
require 'arel_extensions/predications' # This is required for rails 6.1 # See https://github.com/thoughtbot/shoulda-matchers/issues/335 if !Array.respond_to?(:wrap) require 'active_support/core_ext/array/wrap' end module ArelExtensions module Nodes class Function < Arel::Nodes::Function include Arel::Ma...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/concat.rb
lib/arel_extensions/nodes/concat.rb
module ArelExtensions::Nodes class Concat < Function RETURN_TYPE = :string def initialize expr tab = expr.map { |arg| # flatten nested concats. node = convert_to_node(arg) if node.is_a?(Concat) node.expressions else node end }.flatten.re...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/find_in_set.rb
lib/arel_extensions/nodes/find_in_set.rb
module ArelExtensions module Nodes class FindInSet < Function RETURN_TYPE = :integer end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/char_length.rb
lib/arel_extensions/nodes/char_length.rb
module ArelExtensions module Nodes class CharLength < Function RETURN_TYPE = :integer def initialize(node) super([node]) end end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/levenshtein_distance.rb
lib/arel_extensions/nodes/levenshtein_distance.rb
module ArelExtensions module Nodes class LevenshteinDistance < Function RETURN_TYPE = :number def initialize expr super [convert_to_node(expr.first), Arel.quoted(expr[1])] end end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/trim.rb
lib/arel_extensions/nodes/trim.rb
module ArelExtensions module Nodes class Trim < Function RETURN_TYPE = :string def initialize expr tab = expr.map { |arg| convert_to_node(arg) } super(tab) end def +(other) ArelExtensions::Nodes::Concat.new(self.expressions + [other]) end ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/collate.rb
lib/arel_extensions/nodes/collate.rb
module ArelExtensions module Nodes class Collate < Function RETURN_TYPE = :string attr_accessor :ai, :ci, :option def initialize left, option = nil, ai = false, ci = false @ai = ai @ci = ci @option = option tab = [convert_to_node(left)] super(tab) ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/rand.rb
lib/arel_extensions/nodes/rand.rb
module ArelExtensions module Nodes class Rand < Function RETURN_TYPE = :number def initialize(seed = nil) if seed && seed.length == 1 super seed else super [] end end end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/then.rb
lib/arel_extensions/nodes/then.rb
module ArelExtensions module Nodes class Then < Function def initialize expr tab = expr.map { |arg| convert_to_node(arg) } super(tab) end end end end
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/repeat.rb
lib/arel_extensions/nodes/repeat.rb
module ArelExtensions module Nodes class Repeat < Function RETURN_TYPE = :string def initialize expr tab = expr.map { |arg| convert_to_node(arg) } super(tab) end def +(other) ArelExtensions::Nodes::Concat.new(self.expressions + [other]) end...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/nodes/round.rb
lib/arel_extensions/nodes/round.rb
module ArelExtensions module Nodes class Round < Function RETURN_TYPE = :number def initialize expr if expr && expr.length == 1 super [convert_to_node(expr.first)] else super [convert_to_node(expr.first), convert_to_number(expr[1])] end end end ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/visitors/mysql.rb
lib/arel_extensions/visitors/mysql.rb
module ArelExtensions module Visitors class Arel::Visitors::MySQL DATE_MAPPING = { 'd' => 'DAY', 'm' => 'MONTH', 'w' => 'WEEK', 'y' => 'YEAR', 'wd' => 'WEEKDAY', 'h' => 'HOUR', 'mn' => 'MINUTE', 's' => 'SECOND' }.freeze DATE_FORMAT_DIRECTIVES = { # ISO C / POSIX '%Y' => ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/visitors/convert_format.rb
lib/arel_extensions/visitors/convert_format.rb
module ArelExtensions module Visitors # Convert date format in strftime syntax to whatever the RDBMs # wants, based on the table of conversion +mapping+. def self.strftime_to_format format, mapping @mapping_regexps ||= {} @mapping_regexps[mapping] ||= Regexp.new( mapping ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/visitors/to_sql.rb
lib/arel_extensions/visitors/to_sql.rb
module ArelExtensions module Visitors class Arel::Visitors::ToSql COMMA = ', ' unless defined?(COMMA) # Escape properly the string expression expr. # Take care of escaping. def make_json_string expr Arel.quoted('"') \ + expr .coalesce('') .replace('...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/visitors/oracle.rb
lib/arel_extensions/visitors/oracle.rb
# require 'oracle_visitor' module ArelExtensions module Visitors class Arel::Visitors::Oracle SPECIAL_CHARS = {"\t" => 'CHR(9)', "\n" => 'CHR(10)', "\r" => 'CHR(13)'} DATE_MAPPING = {'d' => 'DAY', 'm' => 'MONTH', 'w' => 'IW', 'y' => 'YEAR', 'wd' => 'D', 'h' => 'HOUR', 'mn' => 'MINUTE', 's' => 'SECOND'...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/visitors/mssql.rb
lib/arel_extensions/visitors/mssql.rb
module ArelExtensions module Visitors module MSSQL MSSQL_CLASS_NAMES = %i[MSSQL SQLServer].freeze mssql_class = Arel::Visitors .constants .select { |c| Arel::Visitors.const_get(c).is_a?(Class) } .find { |c| MSSQL_CLASS_NAMES.include?(c) } # This guard is...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/visitors/postgresql.rb
lib/arel_extensions/visitors/postgresql.rb
module ArelExtensions module Visitors class Arel::Visitors::PostgreSQL DATE_MAPPING = { 'd' => 'DAY', 'm' => 'MONTH', 'w' => 'WEEK', 'y' => 'YEAR', 'wd' => 'DOW', 'h' => 'HOUR', 'mn' => 'MINUTE', 's' => 'SECOND' }.freeze DATE_FORMAT_DIRECTIVES = { '%Y' => 'YYYY', '%C' =>...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/visitors/sqlite.rb
lib/arel_extensions/visitors/sqlite.rb
module ArelExtensions module Visitors class Arel::Visitors::SQLite DATE_MAPPING = { 'd' => '%d', 'm' => '%m', 'w' => '%W', 'y' => '%Y', 'wd' => '%w', 'M' => '%M', 'h' => '%H', 'mn' => '%M', 's' => '%S' }.freeze DATE_FORMAT_DIRECTIVES = { # ISO C / POSIX '%Y' => '%Y', '%C...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/visitors/ibm_db.rb
lib/arel_extensions/visitors/ibm_db.rb
module ArelExtensions module Visitors class Arel::Visitors::IBM_DB def visit_ArelExtensions_Nodes_Ceil o, collector collector << 'CEILING(' collector = visit o.expr, collector collector << ')' collector end def visit_ArelExtensions_Nodes_Trim o, collector ...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
Faveod/arel-extensions
https://github.com/Faveod/arel-extensions/blob/b8d316bf8ee69be08ab139db98daf39004cb4e27/lib/arel_extensions/visitors/oracle12.rb
lib/arel_extensions/visitors/oracle12.rb
module ArelExtensions module Visitors Arel::Visitors.send(:remove_const, 'Oracle12') if Arel::Visitors.const_defined?('Oracle12') Arel::Visitors.const_set('Oracle12', Class.new(Arel::Visitors::Oracle)).class_eval do def visit_Arel_Nodes_SelectOptions(o, collector) collector = maybe_visit o.offs...
ruby
MIT
b8d316bf8ee69be08ab139db98daf39004cb4e27
2026-01-04T17:38:54.483713Z
false
infosimples/deathbycaptcha
https://github.com/infosimples/deathbycaptcha/blob/888ad2b25ef2c90796a6d5ff2f24b6e54063b0e0/spec/spec_helper.rb
spec/spec_helper.rb
RSpec.configure do |config| # Run specs in random order to surface order dependencies. If you find an # order dependency and want to debug it, you can fix the order by providing # the seed, which is printed after each run. # --seed 1234 config.order = "random" # Print tests results with color. config...
ruby
MIT
888ad2b25ef2c90796a6d5ff2f24b6e54063b0e0
2026-01-04T17:38:58.878868Z
false
infosimples/deathbycaptcha
https://github.com/infosimples/deathbycaptcha/blob/888ad2b25ef2c90796a6d5ff2f24b6e54063b0e0/spec/lib/image_captcha_spec.rb
spec/lib/image_captcha_spec.rb
require 'spec_helper' username = CREDENTIALS['username'] password = CREDENTIALS['password'] path2 = './captchas/2.jpg' # path of the captcha (Coordinates API) path3_grid = './captchas/3-grid.jpg' # path of the grid (Image Group API) path3_banner = './captchas/3-banner.jpg' # path of the grid (Ima...
ruby
MIT
888ad2b25ef2c90796a6d5ff2f24b6e54063b0e0
2026-01-04T17:38:58.878868Z
false
infosimples/deathbycaptcha
https://github.com/infosimples/deathbycaptcha/blob/888ad2b25ef2c90796a6d5ff2f24b6e54063b0e0/spec/lib/client_spec.rb
spec/lib/client_spec.rb
require 'spec_helper' username = CREDENTIALS['username'] password = CREDENTIALS['password'] captcha_id = CREDENTIALS['captcha_id'] image64 = Base64.encode64(File.open('captchas/1.png', 'rb').read) describe DeathByCaptcha::Client do describe '.create' do context 'http' do let(:client) { DeathByC...
ruby
MIT
888ad2b25ef2c90796a6d5ff2f24b6e54063b0e0
2026-01-04T17:38:58.878868Z
false
infosimples/deathbycaptcha
https://github.com/infosimples/deathbycaptcha/blob/888ad2b25ef2c90796a6d5ff2f24b6e54063b0e0/lib/deathbycaptcha.rb
lib/deathbycaptcha.rb
require 'base64' require 'openssl' require 'json' require 'bigdecimal' require 'socket' require 'net/http' module DeathByCaptcha end require 'deathbycaptcha/client' require 'deathbycaptcha/exceptions' require 'deathbycaptcha/models' require 'deathbycaptcha/patches' require 'deathbycaptcha/version'
ruby
MIT
888ad2b25ef2c90796a6d5ff2f24b6e54063b0e0
2026-01-04T17:38:58.878868Z
false