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 |
|---|---|---|---|---|---|---|---|---|
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/mysql2spatial.rb | test/adapters/mysql2spatial.rb | # frozen_string_literal: true
ENV["ARE_DB"] = "mysql2spatial"
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/sqlite3_proxy.rb | test/adapters/sqlite3_proxy.rb | # frozen_string_literal: true
ENV["ARE_DB"] = "sqlite3"
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/mysql2.rb | test/adapters/mysql2.rb | # frozen_string_literal: true
ENV["ARE_DB"] = "mysql2"
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/jdbcmysql.rb | test/adapters/jdbcmysql.rb | # frozen_string_literal: true
ENV["ARE_DB"] = "jdbcmysql"
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/seamless_database_pool.rb | test/adapters/seamless_database_pool.rb | # frozen_string_literal: true
ENV["ARE_DB"] = "seamless_database_pool"
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/trilogy_proxy.rb | test/adapters/trilogy_proxy.rb | # frozen_string_literal: true
require 'logger'
ENV["ARE_DB"] = "trilogy"
if ENV['AR_VERSION'].to_f <= 7.0
require "activerecord-trilogy-adapter"
require "trilogy_adapter/connection"
ActiveRecord::Base.extend TrilogyAdapter::Connection
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/mysql2_makara.rb | test/adapters/mysql2_makara.rb | # frozen_string_literal: true
ENV["ARE_DB"] = "mysql2_makara"
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/janus_mysql2.rb | test/adapters/janus_mysql2.rb | # frozen_string_literal: true
ENV["ARE_DB"] = "mysql2"
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/postgresql_proxy.rb | test/adapters/postgresql_proxy.rb | # frozen_string_literal: true
ENV["ARE_DB"] = "postgresql"
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/postgresql.rb | test/adapters/postgresql.rb | # frozen_string_literal: true
ENV["ARE_DB"] = "postgresql"
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/trilogy.rb | test/adapters/trilogy.rb | # frozen_string_literal: true
require 'logger'
ENV["ARE_DB"] = "trilogy"
if ENV['AR_VERSION'].to_f <= 7.0
require "activerecord-trilogy-adapter"
require "trilogy_adapter/connection"
ActiveRecord::Base.extend TrilogyAdapter::Connection
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/janus_trilogy.rb | test/adapters/janus_trilogy.rb | # frozen_string_literal: true
require 'logger'
ENV["ARE_DB"] = "trilogy"
if ENV['AR_VERSION'].to_f <= 7.0
require "activerecord-trilogy-adapter"
require "trilogy_adapter/connection"
ActiveRecord::Base.extend TrilogyAdapter::Connection
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/sqlite3.rb | test/adapters/sqlite3.rb | # frozen_string_literal: true
ENV["ARE_DB"] = "sqlite3"
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/postgresql_makara.rb | test/adapters/postgresql_makara.rb | # frozen_string_literal: true
ENV["ARE_DB"] = "postgresql"
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/adapters/postgis.rb | test/adapters/postgis.rb | # frozen_string_literal: true
ENV["ARE_DB"] = "postgis"
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/trilogy/import_test.rb | test/trilogy/import_test.rb | # frozen_string_literal: true
require File.expand_path("#{File.dirname(__FILE__)}/../test_helper")
require File.expand_path("#{File.dirname(__FILE__)}/../support/assertions")
require File.expand_path("#{File.dirname(__FILE__)}/../support/mysql/import_examples")
should_support_mysql_import_functionality
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/schema/postgresql_schema.rb | test/schema/postgresql_schema.rb | # frozen_string_literal: true
ActiveRecord::Schema.define do
execute('CREATE extension IF NOT EXISTS "hstore";')
execute('CREATE extension IF NOT EXISTS "pgcrypto";')
execute('CREATE extension IF NOT EXISTS "uuid-ossp";')
# create ENUM if it does not exist yet
begin
execute('CREATE TYPE vendor_type AS E... | ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/schema/version.rb | test/schema/version.rb | # frozen_string_literal: true
class SchemaInfo < ActiveRecord::Base
if respond_to?(:table_name=)
self.table_name = 'schema_info'
else
# this is becoming deprecated in ActiveRecord but not all adapters supported it
# at this time
set_table_name 'schema_info'
end
VERSION = 12
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/schema/postgis_schema.rb | test/schema/postgis_schema.rb | # frozen_string_literal: true
require File.expand_path("#{File.dirname(__FILE__)}/postgresql_schema")
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/schema/jdbcpostgresql_schema.rb | test/schema/jdbcpostgresql_schema.rb | # frozen_string_literal: true
require File.expand_path("#{File.dirname(__FILE__)}/postgresql_schema")
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/schema/mysql2_schema.rb | test/schema/mysql2_schema.rb | # frozen_string_literal: true
ActiveRecord::Schema.define do
create_table :books, force: :cascade do |t|
t.string :title, null: false
t.virtual :upper_title, type: :string, as: "upper(`title`)" if t.respond_to?(:virtual)
t.string :publisher, null: false, default: 'Default Publisher'
t.string :author_... | ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/schema/sqlite3_schema.rb | test/schema/sqlite3_schema.rb | # frozen_string_literal: true
ActiveRecord::Schema.define do
create_table :alarms, force: true do |t|
t.column :device_id, :integer, null: false
t.column :alarm_type, :integer, null: false
t.column :status, :integer, null: false
t.column :metadata, :text
t.column :secret_key, :binary
t.dateti... | ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/schema/generic_schema.rb | test/schema/generic_schema.rb | # frozen_string_literal: true
ActiveRecord::Schema.define do
create_table :schema_info, force: :cascade do |t|
t.integer :version
end
add_index :schema_info, :version, unique: true
SchemaInfo.create version: SchemaInfo::VERSION
create_table :group, force: :cascade do |t|
t.string :order
t.times... | ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/test/sqlite3_proxy/import_test.rb | test/sqlite3_proxy/import_test.rb | # frozen_string_literal: true
require File.expand_path("#{File.dirname(__FILE__)}/../test_helper")
require File.expand_path("#{File.dirname(__FILE__)}/../support/sqlite3/import_examples")
should_support_sqlite3_import_functionality
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import.rb | lib/activerecord-import.rb | # frozen_string_literal: true
require "active_support/lazy_load_hooks"
ActiveSupport.on_load(:active_record) do
require "activerecord-import/base"
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/version.rb | lib/activerecord-import/version.rb | # frozen_string_literal: true
module ActiveRecord
module Import
VERSION = "2.2.0"
end
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/base.rb | lib/activerecord-import/base.rb | # frozen_string_literal: true
require "pathname"
require "active_record"
require "active_record/version"
module ActiveRecord::Import
ADAPTER_PATH = "activerecord-import/active_record/adapters"
def self.base_adapter(adapter)
case adapter
when 'mysql2_makara' then 'mysql2'
when 'mysql2spatial' then 'my... | ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/value_sets_parser.rb | lib/activerecord-import/value_sets_parser.rb | # frozen_string_literal: true
require 'active_support/core_ext/array'
module ActiveRecord::Import
class ValueSetTooLargeError < StandardError
attr_reader :size
def initialize(msg = "Value set exceeds max size", size = 0)
@size = size
super(msg)
end
end
class ValueSetsBytesParser
at... | ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/synchronize.rb | lib/activerecord-import/synchronize.rb | # frozen_string_literal: true
module ActiveRecord # :nodoc:
class Base # :nodoc:
# Synchronizes the passed in ActiveRecord instances with data
# from the database. This is like calling reload on an individual
# ActiveRecord instance but it is intended for use on multiple instances.
#
# This uses ... | ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/import.rb | lib/activerecord-import/import.rb | # frozen_string_literal: true
module ActiveRecord::Import::ConnectionAdapters; end
module ActiveRecord::Import # :nodoc:
Result = Struct.new(:failed_instances, :num_inserts, :ids, :results, :affected_rows)
module ImportSupport # :nodoc:
def supports_import? # :nodoc:
true
end
end
module OnDupl... | ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | true |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/adapters/sqlite3_adapter.rb | lib/activerecord-import/adapters/sqlite3_adapter.rb | # frozen_string_literal: true
module ActiveRecord::Import::SQLite3Adapter
include ActiveRecord::Import::ImportSupport
include ActiveRecord::Import::OnDuplicateKeyUpdateSupport
MIN_VERSION_FOR_IMPORT = "3.7.11"
MIN_VERSION_FOR_UPSERT = "3.24.0"
SQLITE_LIMIT_COMPOUND_SELECT = 500
# Override our conformance... | ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/adapters/mysql2_adapter.rb | lib/activerecord-import/adapters/mysql2_adapter.rb | # frozen_string_literal: true
require "activerecord-import/adapters/mysql_adapter"
module ActiveRecord::Import::Mysql2Adapter
include ActiveRecord::Import::MysqlAdapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/adapters/postgresql_proxy_adapter.rb | lib/activerecord-import/adapters/postgresql_proxy_adapter.rb | # frozen_string_literal: true
require "activerecord-import/adapters/postgresql_adapter"
require "activerecord-import/adapters/active_record_proxy_adapter"
module ActiveRecord::Import::PostgreSQLProxyAdapter
include ActiveRecord::Import::PostgreSQLAdapter
include ActiveRecord::Import::ActiveRecordProxyAdapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/adapters/sqlite3_proxy_adapter.rb | lib/activerecord-import/adapters/sqlite3_proxy_adapter.rb | # frozen_string_literal: true
require "activerecord-import/adapters/sqlite3_adapter"
require "activerecord-import/adapters/active_record_proxy_adapter"
module ActiveRecord::Import::SQLite3ProxyAdapter
include ActiveRecord::Import::SQLite3Adapter
include ActiveRecord::Import::ActiveRecordProxyAdapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/adapters/active_record_proxy_adapter.rb | lib/activerecord-import/adapters/active_record_proxy_adapter.rb | # frozen_string_literal: true
module ActiveRecord::Import::ActiveRecordProxyAdapter
def insert_many(*args, **kwargs, &block)
sticking_to_primary { super(*args, **kwargs, &block) }
end
def insert(*args, **kwargs, &block)
sticking_to_primary { super(*args, **kwargs, &block) }
end
def sticking_to_prim... | ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/adapters/mysql_adapter.rb | lib/activerecord-import/adapters/mysql_adapter.rb | # frozen_string_literal: true
module ActiveRecord::Import::MysqlAdapter
include ActiveRecord::Import::ImportSupport
include ActiveRecord::Import::OnDuplicateKeyUpdateSupport
NO_MAX_PACKET = 0
QUERY_OVERHEAD = 8 # This was shown to be true for MySQL, but it's not clear where the overhead is from.
# +sql+ ca... | ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/adapters/mysql2_proxy_adapter.rb | lib/activerecord-import/adapters/mysql2_proxy_adapter.rb | # frozen_string_literal: true
require "activerecord-import/adapters/mysql2_adapter"
require "activerecord-import/adapters/active_record_proxy_adapter"
module ActiveRecord::Import::Mysql2ProxyAdapter
include ActiveRecord::Import::Mysql2Adapter
include ActiveRecord::Import::ActiveRecordProxyAdapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/adapters/postgresql_adapter.rb | lib/activerecord-import/adapters/postgresql_adapter.rb | # frozen_string_literal: true
module ActiveRecord::Import::PostgreSQLAdapter
include ActiveRecord::Import::ImportSupport
include ActiveRecord::Import::OnDuplicateKeyUpdateSupport
MIN_VERSION_FOR_UPSERT = 90_500
def insert_many( sql, values, options = {}, *args ) # :nodoc:
number_of_inserts = 1
return... | ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/adapters/trilogy_adapter.rb | lib/activerecord-import/adapters/trilogy_adapter.rb | # frozen_string_literal: true
require "activerecord-import/adapters/mysql_adapter"
module ActiveRecord::Import::TrilogyAdapter
include ActiveRecord::Import::MysqlAdapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/adapters/trilogy_proxy_adapter.rb | lib/activerecord-import/adapters/trilogy_proxy_adapter.rb | # frozen_string_literal: true
require "activerecord-import/adapters/trilogy_adapter"
require "activerecord-import/adapters/active_record_proxy_adapter"
module ActiveRecord::Import::TrilogyProxyAdapter
include ActiveRecord::Import::TrilogyAdapter
include ActiveRecord::Import::ActiveRecordProxyAdapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/adapters/em_mysql2_adapter.rb | lib/activerecord-import/adapters/em_mysql2_adapter.rb | # frozen_string_literal: true
require "activerecord-import/adapters/mysql_adapter"
module ActiveRecord::Import::EMMysql2Adapter
include ActiveRecord::Import::MysqlAdapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/adapters/abstract_adapter.rb | lib/activerecord-import/adapters/abstract_adapter.rb | # frozen_string_literal: true
module ActiveRecord::Import::AbstractAdapter
module InstanceMethods
def next_value_for_sequence(sequence_name)
%(#{sequence_name}.nextval)
end
def insert_many( sql, values, _options = {}, *args ) # :nodoc:
number_of_inserts = 1
base_sql, post_sql = case s... | ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/active_record/adapters/sqlite3_adapter.rb | lib/activerecord-import/active_record/adapters/sqlite3_adapter.rb | # frozen_string_literal: true
require "active_record/connection_adapters/sqlite3_adapter"
require "activerecord-import/adapters/sqlite3_adapter"
class ActiveRecord::ConnectionAdapters::SQLite3Adapter
include ActiveRecord::Import::SQLite3Adapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/active_record/adapters/mysql2_adapter.rb | lib/activerecord-import/active_record/adapters/mysql2_adapter.rb | # frozen_string_literal: true
require "active_record/connection_adapters/mysql2_adapter"
require "activerecord-import/adapters/mysql2_adapter"
class ActiveRecord::ConnectionAdapters::Mysql2Adapter
include ActiveRecord::Import::Mysql2Adapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/active_record/adapters/postgresql_proxy_adapter.rb | lib/activerecord-import/active_record/adapters/postgresql_proxy_adapter.rb | # frozen_string_literal: true
require "active_record/connection_adapters/postgresql_proxy_adapter"
require "activerecord-import/adapters/postgresql_proxy_adapter"
ActiveSupport.on_load(:active_record_postgresqlproxyadapter) do |klass|
klass.include(ActiveRecord::Import::PostgreSQLProxyAdapter)
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/active_record/adapters/sqlite3_proxy_adapter.rb | lib/activerecord-import/active_record/adapters/sqlite3_proxy_adapter.rb | # frozen_string_literal: true
require "active_record/connection_adapters/sqlite3_proxy_adapter"
require "activerecord-import/adapters/sqlite3_proxy_adapter"
ActiveSupport.on_load(:active_record_sqlite3proxyadapter) do |klass|
klass.include(ActiveRecord::Import::SQLite3ProxyAdapter)
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/active_record/adapters/jdbcpostgresql_adapter.rb | lib/activerecord-import/active_record/adapters/jdbcpostgresql_adapter.rb | # frozen_string_literal: true
require "active_record/connection_adapters/postgresql_adapter"
require "activerecord-import/adapters/postgresql_adapter"
class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
include ActiveRecord::Import::PostgreSQLAdapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/active_record/adapters/mysql2_proxy_adapter.rb | lib/activerecord-import/active_record/adapters/mysql2_proxy_adapter.rb | # frozen_string_literal: true
require "active_record/connection_adapters/mysql2_proxy_adapter"
require "activerecord-import/adapters/mysql2_proxy_adapter"
ActiveSupport.on_load(:active_record_mysql2proxyadapter) do |klass|
klass.include(ActiveRecord::Import::Mysql2ProxyAdapter)
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/active_record/adapters/postgresql_adapter.rb | lib/activerecord-import/active_record/adapters/postgresql_adapter.rb | # frozen_string_literal: true
require "active_record/connection_adapters/postgresql_adapter"
require "activerecord-import/adapters/postgresql_adapter"
class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
include ActiveRecord::Import::PostgreSQLAdapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/active_record/adapters/trilogy_adapter.rb | lib/activerecord-import/active_record/adapters/trilogy_adapter.rb | # frozen_string_literal: true
require "active_record/connection_adapters/trilogy_adapter"
require "activerecord-import/adapters/trilogy_adapter"
class ActiveRecord::ConnectionAdapters::TrilogyAdapter
include ActiveRecord::Import::TrilogyAdapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/active_record/adapters/jdbcsqlite3_adapter.rb | lib/activerecord-import/active_record/adapters/jdbcsqlite3_adapter.rb | # frozen_string_literal: true
require "active_record/connection_adapters/sqlite3_adapter"
require "activerecord-import/adapters/sqlite3_adapter"
class ActiveRecord::ConnectionAdapters::SQLite3Adapter
include ActiveRecord::Import::SQLite3Adapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/active_record/adapters/trilogy_proxy_adapter.rb | lib/activerecord-import/active_record/adapters/trilogy_proxy_adapter.rb | # frozen_string_literal: true
require "active_record/connection_adapters/trilogy_proxy_adapter"
require "activerecord-import/adapters/trilogy_proxy_adapter"
ActiveSupport.on_load(:active_record_trilogyproxyadapter) do |klass|
klass.include(ActiveRecord::Import::TrilogyProxyAdapter)
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/active_record/adapters/seamless_database_pool_adapter.rb | lib/activerecord-import/active_record/adapters/seamless_database_pool_adapter.rb | # frozen_string_literal: true
require "seamless_database_pool"
require "active_record/connection_adapters/seamless_database_pool_adapter"
require "activerecord-import/adapters/mysql_adapter"
class ActiveRecord::ConnectionAdapters::SeamlessDatabasePoolAdapter
include ActiveRecord::Import::MysqlAdapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/active_record/adapters/jdbcmysql_adapter.rb | lib/activerecord-import/active_record/adapters/jdbcmysql_adapter.rb | # frozen_string_literal: true
require "active_record/connection_adapters/mysql2_adapter"
require "activerecord-import/adapters/mysql2_adapter"
class ActiveRecord::ConnectionAdapters::Mysql2Adapter
include ActiveRecord::Import::Mysql2Adapter
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
zdennis/activerecord-import | https://github.com/zdennis/activerecord-import/blob/d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3/lib/activerecord-import/active_record/adapters/abstract_adapter.rb | lib/activerecord-import/active_record/adapters/abstract_adapter.rb | # frozen_string_literal: true
require "activerecord-import/adapters/abstract_adapter"
module ActiveRecord # :nodoc:
module ConnectionAdapters # :nodoc:
class AbstractAdapter # :nodoc:
include ActiveRecord::Import::AbstractAdapter::InstanceMethods
end
end
end
| ruby | MIT | d3d3f8a130ed8c31b6ea487a18f264b3a9288dd3 | 2026-01-04T15:47:04.039287Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/init.rb | init.rb | require File.join(File.dirname(__FILE__), 'lib', 'awesome_print')
| ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/rails/init.rb | rails/init.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
#
# Load awesome_print when instal... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/methods_spec.rb | spec/methods_spec.rb | require 'spec_helper'
RSpec.describe 'Single method' do
after do
Object.instance_eval { remove_const :Hello } if defined?(Hello)
end
it 'plain: should handle a method with no arguments' do
method = ''.method(:upcase)
if RUBY_VERSION >= '2.4.0'
expect(method.ai(plain: true)).to eq('String#upcas... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/misc_spec.rb | spec/misc_spec.rb | require 'net/http'
require 'spec_helper'
RSpec.describe 'AwesomePrint' do
describe 'Misc' do
it 'handle weird objects that return nil on inspect' do
weird = Class.new do
def inspect
nil
end
end
expect(weird.new.ai(plain: true)).to eq('')
end
it 'handle frozen... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/colors_spec.rb | spec/colors_spec.rb | require 'spec_helper'
RSpec.describe 'AwesomePrint' do
def stub_tty!(output = true, stream = STDOUT)
if output
stream.instance_eval { def tty?; true; end }
else
stream.instance_eval { def tty?; false; end }
end
end
describe 'colorization' do
PLAIN = '[ 1, :two, "three", [ nil, [ tru... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/active_record_helper.rb | spec/active_record_helper.rb | if ExtVerifier.has_rails?
# Required to use the column support
module Rails
def self.env
{}
end
end
# Establish connection to in-memory SQLite DB
ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'
# Create the users table
ActiveRecord::Migration.verbose = fals... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/objects_spec.rb | spec/objects_spec.rb | require 'spec_helper'
RSpec.describe 'Objects' do
after do
Object.instance_eval { remove_const :Hello } if defined?(Hello)
end
describe 'Formatting an object' do
it 'attributes' do
class Hello
attr_reader :abra
attr_writer :ca
attr_accessor :dabra
def initializ... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/formats_spec.rb | spec/formats_spec.rb | require 'spec_helper'
require 'bigdecimal'
require 'rational'
require 'set'
RSpec.describe 'AwesomePrint' do
describe 'Array' do
before do
@arr = [1, :two, 'three', [nil, [true, false]]]
end
it 'empty array' do
expect([].ai).to eq('[]')
end
it 'plain multiline' do
expect(@arr.... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/spec_helper.rb | spec/spec_helper.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
#
# Running specs from the command... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/support/ext_verifier.rb | spec/support/ext_verifier.rb | module ExtVerifier
def require_dependencies!(dependencies)
dependencies.each do |dependency|
begin
require dependency
rescue LoadError
end
end
end
module_function :require_dependencies!
def has_rails?
defined?(Rails)
end
module_function :has_rails?
def has_mongoid?... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/support/mongoid_versions.rb | spec/support/mongoid_versions.rb | module MongoidVersions
def mongoid_version
Gem::Version.new(Mongoid::VERSION)
end
def mongoid_5_0?
Gem::Requirement.new('~> 5.0.0').satisfied_by?(mongoid_version)
end
def mongoid_6_0?
Gem::Requirement.new('~> 6.0.0').satisfied_by?(mongoid_version)
end
def mongoid_7_0?
Gem::Requirement.n... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/support/active_record_data.rb | spec/support/active_record_data.rb | require 'pathname'
class ActiveRecordData
class << self
data_file_selector = Pathname(File.dirname(__FILE__)).join('active_record_data', '*.txt')
# Example generated method
# data_filename = '/path/to/ap/spec/support/active_record_data/4_2_diana.txt'
#
# def self.raw_4_2_dana
# File.read(d... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/support/rails_versions.rb | spec/support/rails_versions.rb | module RailsVersions
def rails_version
Gem::Version.new(Rails::VERSION::STRING)
end
def rails_6_1?
Gem::Requirement.new('~> 6.1.0').satisfied_by?(rails_version)
end
alias_method :activerecord_6_1?, :rails_6_1?
def rails_6_0?
Gem::Requirement.new('~> 6.0.0').satisfied_by?(rails_version)
end
... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/core_ext/string_spec.rb | spec/core_ext/string_spec.rb | require 'spec_helper'
RSpec.describe 'String extensions' do
[:gray, :red, :green, :yellow, :blue, :purple, :cyan, :white].each_with_index do |color, i|
it "should have #{color} color" do
expect(color.to_s.send(color)).to eq("\e[1;#{30 + i}m#{color}\e[0m")
end
it "should have #{color}ish color" do
... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/core_ext/logger_spec.rb | spec/core_ext/logger_spec.rb | require 'spec_helper'
require 'logger'
require 'awesome_print/core_ext/logger'
RSpec.describe 'AwesomePrint logging extensions' do
before(:all) do
@logger = Logger.new('/dev/null') rescue Logger.new('nul')
end
describe 'ap method' do
it 'should awesome_inspect the given object' do
object = doubl... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/ext/action_view_spec.rb | spec/ext/action_view_spec.rb | require 'spec_helper'
RSpec.describe 'AwesomePrint ActionView extensions', skip: -> { !ExtVerifier.has_rails? }.call do
before do
@view = if rails_6_1?
ActionView::Base.new(ActionView::LookupContext.new([]), {}, {})
else
ActionView::Base.new
end
end
it "us... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/ext/ostruct_spec.rb | spec/ext/ostruct_spec.rb | require 'spec_helper'
RSpec.describe 'AwesomePrint Ostruct extension' do
before do
@ap = AwesomePrint::Inspector.new(plain: true, sort_keys: true)
end
it 'empty hash' do
struct = OpenStruct.new
expect(@ap.send(:awesome, struct)).to eq('OpenStruct {}')
end
it 'plain multiline' do
struct = Op... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/ext/mongo_mapper_spec.rb | spec/ext/mongo_mapper_spec.rb | require 'spec_helper'
RSpec.describe 'AwesomePrint/MongoMapper', skip: -> { !ExtVerifier.has_mongo_mapper? }.call do
if ExtVerifier.has_mongo_mapper?
before :all do
class MongoUser
include MongoMapper::Document
key :first_name, String
key :last_name, String
end
end
a... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/ext/active_support_spec.rb | spec/ext/active_support_spec.rb | require 'spec_helper'
RSpec.describe 'AwesomePrint::ActiveSupport', skip: -> { !ExtVerifier.has_rails? }.call do
before do
@ap = AwesomePrint::Inspector.new
end
it 'should format ActiveSupport::TimeWithZone as regular Time' do
Time.zone = 'Eastern Time (US & Canada)'
time = Time.utc(2007, 2, 10, 20,... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/ext/active_record_spec.rb | spec/ext/active_record_spec.rb | require 'spec_helper'
require 'active_record_helper'
RSpec.describe 'AwesomePrint/ActiveRecord', skip: -> { !ExtVerifier.has_rails? }.call do
describe 'ActiveRecord instance, attributes only (default)' do
before do
ActiveRecord::Base.default_timezone = :utc
@diana = User.new(name: 'Diana', rank: 1, a... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/ext/mongoid_spec.rb | spec/ext/mongoid_spec.rb | require 'spec_helper'
RSpec.describe 'AwesomePrint/Mongoid', skip: -> { !ExtVerifier.has_mongoid? }.call do
if ExtVerifier.has_mongoid?
before :all do
class MongoUser
include Mongoid::Document
field :first_name, type: String
field :last_name, type: String
end
end
a... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/ext/nokogiri_spec.rb | spec/ext/nokogiri_spec.rb | require 'spec_helper'
RSpec.describe 'AwesomePrint/Nokogiri' do
it 'should colorize tags' do
xml = Nokogiri::XML('<html><body><h1></h1></body></html>')
expect(xml.ai).to eq <<-EOS
<?xml version=\"1.0\"?>\e[1;32m
\e[0m<\e[1;36mhtml\e[0m>\e[1;32m
\e[0m<\e[1;36mbody\e[0m>\e[1;32m
\e[0m<\e[1;36mh1\e[0m/>\e... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/ext/ripple_spec.rb | spec/ext/ripple_spec.rb | require 'spec_helper'
RSpec.describe 'AwesomePrint/Ripple', skip: -> { !ExtVerifier.has_ripple? }.call do
if ExtVerifier.has_ripple?
before :all do
class RippleUser
include Ripple::Document
key_on :_id
property :_id, String
property :first_name, String
property :la... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/spec/ext/nobrainer_spec.rb | spec/ext/nobrainer_spec.rb | require 'spec_helper'
RSpec.describe 'AwesomePrint/NoBrainer', skip: -> { !ExtVerifier.has_nobrainer? }.call do
if ExtVerifier.has_nobrainer?
before :all do
NoBrainer.configure do |config|
config.app_name = 'ap_test'
config.environment = :test
end
end
before :all do
cl... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print.rb | lib/awesome_print.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
#
# AwesomePrint might be loaded i... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/ap.rb | lib/ap.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
#
# Keeping this for backwards com... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/version.rb | lib/awesome_print/version.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
module AwesomePrint
def self.ver... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/formatters.rb | lib/awesome_print/formatters.rb | module AwesomePrint
module Formatters
require 'awesome_print/formatters/object_formatter'
require 'awesome_print/formatters/struct_formatter'
require 'awesome_print/formatters/hash_formatter'
require 'awesome_print/formatters/array_formatter'
require 'awesome_print/formatters/simple_formatter'
... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/inspector.rb | lib/awesome_print/inspector.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
require_relative 'indentator'
mod... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/indentator.rb | lib/awesome_print/indentator.rb | module AwesomePrint
class Indentator
attr_reader :shift_width, :indentation
def initialize(indentation)
@indentation = indentation
@shift_width = indentation.freeze
end
def indent
@indentation += shift_width
yield
ensure
@indentation -= shift_width
end
end
en... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/formatter.rb | lib/awesome_print/formatter.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
require 'awesome_print/formatters'... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/custom_defaults.rb | lib/awesome_print/custom_defaults.rb | module AwesomePrint
class << self
attr_accessor :defaults, :force_colors
# Class accessor to force colorized output (ex. forked subprocess where TERM
# might be dumb).
#---------------------------------------------------------------------------
def force_colors!(value = true)
@force_colors ... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/colorize.rb | lib/awesome_print/colorize.rb | autoload :CGI, 'cgi'
module AwesomePrint
module Colorize
# Pick the color and apply it to the given string as necessary.
#------------------------------------------------------------------------------
def colorize(str, type)
str = CGI.escapeHTML(str) if options[:html]
if options[:plain] || !... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/core_ext/logger.rb | lib/awesome_print/core_ext/logger.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
module AwesomePrint
module Logge... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/core_ext/method.rb | lib/awesome_print/core_ext/method.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
#
# Method#name was intorduced in ... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/core_ext/kernel.rb | lib/awesome_print/core_ext/kernel.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
module Kernel
def ai(options = ... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/core_ext/class.rb | lib/awesome_print/core_ext/class.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
class Class #:nodoc:
#
# Inter... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/core_ext/string.rb | lib/awesome_print/core_ext/string.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
class String
#
# ANSI color co... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/core_ext/object.rb | lib/awesome_print/core_ext/object.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
class Object #:nodoc:
#
# Inte... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/core_ext/awesome_method_array.rb | lib/awesome_print/core_ext/awesome_method_array.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
#
# The following makes it possibl... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/ext/nokogiri.rb | lib/awesome_print/ext/nokogiri.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
module AwesomePrint
module Nokog... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/ext/active_record.rb | lib/awesome_print/ext/active_record.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
module AwesomePrint
module Activ... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/ext/sequel.rb | lib/awesome_print/ext/sequel.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
module AwesomePrint
module Seque... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/ext/ostruct.rb | lib/awesome_print/ext/ostruct.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
module AwesomePrint
module OpenS... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
awesome-print/awesome_print | https://github.com/awesome-print/awesome_print/blob/8a7ff0aabacbebf694c3e27242809219a96d5a3b/lib/awesome_print/ext/mongoid.rb | lib/awesome_print/ext/mongoid.rb | # Copyright (c) 2010-2016 Michael Dvorkin and contributors
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
module AwesomePrint
module Mongo... | ruby | MIT | 8a7ff0aabacbebf694c3e27242809219a96d5a3b | 2026-01-04T15:47:21.696474Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.