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 |
|---|---|---|---|---|---|---|---|---|
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/change_column_test.rb | test/change_column_test.rb | require_relative "test_helper"
class ChangeColumnTest < Minitest::Test
def test_unsafe
assert_unsafe ChangeColumn
end
def test_varchar_to_text
skip unless postgresql?
assert_safe ChangeColumnVarcharToText
end
def test_varchar_to_citext
skip unless postgresql?
assert_safe ChangeColumnVar... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/change_column_default_test.rb | test/change_column_default_test.rb | require_relative "test_helper"
class ChangeColumnDefaultTest < Minitest::Test
def test_partial_inserts
with_partial_inserts(true) do
assert_unsafe ChangeColumnDefault
end
end
def test_partial_inserts_hash
with_partial_inserts(true) do
assert_unsafe ChangeColumnDefaultHash
end
end
... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/add_reference_test.rb | test/add_reference_test.rb | require_relative "test_helper"
class AddReferenceTest < Minitest::Test
def test_basic
if postgresql?
assert_unsafe AddReference
else
assert_safe AddReference
end
end
def test_polymorphic
if postgresql?
assert_unsafe AddReferencePolymorphic
else
assert_safe AddReferenc... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/misc_test.rb | test/misc_test.rb | require_relative "test_helper"
class MiscTest < Minitest::Test
def test_execute_arbitrary_sql
assert_unsafe ExecuteArbitrarySQL
end
def test_rename_column
assert_unsafe RenameColumn
end
def test_rename_table
assert_unsafe RenameTable
end
def test_rename_schema
assert_unsafe RenameSchem... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/support/active_record.rb | test/support/active_record.rb | require "active_record"
# needed for target_version
module Rails
def self.env
ActiveSupport::StringInquirer.new("test")
end
end
$adapter = ENV["ADAPTER"] || "postgresql"
connection_options = {
adapter: $adapter,
database: "strong_migrations_test"
}
if $adapter == "mysql2"
connection_options[:encoding] =... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/support/helpers.rb | test/support/helpers.rb | module Helpers
def postgresql?
$adapter == "postgresql"
end
def mysql?
($adapter == "mysql2" || $adapter == "trilogy") && !ActiveRecord::Base.connection.mariadb?
end
def mariadb?
($adapter == "mysql2" || $adapter == "trilogy") && ActiveRecord::Base.connection.mariadb?
end
def postgresql_ver... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/check_down.rb | test/migrations/check_down.rb | class CheckDown < TestMigration
def up
add_column :users, :age, :integer
end
def down
remove_column :users, :age
end
end
class CheckDownSafe < TestMigration
def up
add_column :users, :age, :integer
end
def down
safety_assured do
remove_column :users, :age
end
end
end
class ... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/add_column.rb | test/migrations/add_column.rb | class AddColumnDefault < TestMigration
def change
add_column :users, :nice, :boolean, default: true
end
end
class AddColumnDefaultNull < TestMigration
def change
add_column :users, :nice, :boolean, default: nil
end
end
class AddColumnDefaultNotNull < TestMigration
def change
add_column :users, :... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/start_after.rb | test/migrations/start_after.rb | class Version < TestMigration
def change
change_column_null :users, :city, false, "San Francisco"
end
def version
20170101000001
end
end
| ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/add_index.rb | test/migrations/add_index.rb | class AddIndex < TestMigration
def change
add_index :users, :name
end
end
class AddIndexes < TestMigration
def change
add_index :users, :name
add_index :users, :city
end
end
class AddIndexUnique < TestMigration
def change
add_index :users, :name, unique: true
end
end
class AddIndexUp < Te... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/change_column_null.rb | test/migrations/change_column_null.rb | class ChangeColumnNull < TestMigration
def change
change_column_null :users, :name, false
end
end
class ChangeColumnNullConstraint < TestMigration
def up
safety_assured do
execute 'ALTER TABLE "users" ADD CONSTRAINT "test" CHECK ("name" IS NOT NULL) NOT VALID'
execute 'ALTER TABLE "users" VAL... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/change_column_default.rb | test/migrations/change_column_default.rb | class ChangeColumnDefault < TestMigration
def change
change_column_default :users, :name, "Test"
end
end
class ChangeColumnDefaultHash < TestMigration
def change
change_column_default :users, :name, from: nil, to: "Test"
end
end
class ChangeColumnDefaultNewColumn < TestMigration
def change
add_c... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/remove_column.rb | test/migrations/remove_column.rb | class RemoveColumn < TestMigration
def change
remove_column :users, :name, :string
end
end
class RemoveColumns < TestMigration
def change
remove_columns :users, :name, :other
end
end
class RemoveColumnsType < TestMigration
def change
remove_columns :users, :name, :other, type: :text
end
end
c... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/add_exclusion_constraint.rb | test/migrations/add_exclusion_constraint.rb | class AddExclusionConstraint < TestMigration
def change
add_exclusion_constraint :users, "credit_score WITH =", using: :gist
end
end
class AddExclusionConstraintNewTable < TestMigration
def change
create_table :new_users do |t|
t.decimal :credit_score, precision: 10, scale: 5
end
add_exclu... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/add_foreign_key.rb | test/migrations/add_foreign_key.rb | class AddForeignKey < TestMigration
def change
add_foreign_key :users, :orders
end
end
class AddForeignKeySafe < TestMigration
def change
add_foreign_key :users, :orders, validate: false
end
end
class AddForeignKeyValidateSameTransaction < TestMigration
def change
add_foreign_key :users, :orders... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/timeouts.rb | test/migrations/timeouts.rb | class CheckTimeouts < TestMigration
include Helpers
def change
safety_assured { execute "SELECT 1" }
$statement_timeout =
if postgresql?
connection.select_all("SHOW statement_timeout").first["statement_timeout"]
elsif mysql?
connection.select_all("SHOW VARIABLES LIKE 'max_execu... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/misc.rb | test/migrations/misc.rb | class ExecuteArbitrarySQL < TestMigration
def change
execute "SELECT 1"
end
end
class RenameColumn < TestMigration
def change
rename_column :users, :properties, :bad_name
end
end
class RenameTable < TestMigration
def change
rename_table :users, :bad_name
end
end
class RenameSchema < TestMigra... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/remove_index.rb | test/migrations/remove_index.rb | class RemoveIndex < TestMigration
def change
remove_index :users, :name
end
end
class RemoveIndexColumn < TestMigration
def change
remove_index :users, column: :name
end
end
class RemoveIndexName < TestMigration
def change
remove_index :users, name: "my_index"
end
end
class RemoveIndexOptions... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/add_check_constraint.rb | test/migrations/add_check_constraint.rb | class AddCheckConstraint < TestMigration
def change
add_check_constraint :users, "credit_score > 0"
end
end
class AddCheckConstraintSafe < TestMigration
def change
add_check_constraint :users, "credit_score > 0", validate: false
end
end
class AddCheckConstraintValidateSameTransaction < TestMigration
... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/add_reference.rb | test/migrations/add_reference.rb | class AddReference < TestMigration
def change
add_reference :users, :device, index: true
end
end
class AddReferencePolymorphic < TestMigration
def change
add_reference :users, :device, polymorphic: true, index: true
end
end
class AddReferenceNoIndex < TestMigration
def change
add_reference :user... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/add_unique_constraint.rb | test/migrations/add_unique_constraint.rb | class AddUniqueConstraint < TestMigration
def change
add_unique_constraint :users, :name
end
end
class AddUniqueConstraintUsingIndex < TestMigration
disable_ddl_transaction!
def up
add_index :users, :name, unique: true, algorithm: :concurrently
add_unique_constraint :users, using_index: "index_use... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/migrations/change_column.rb | test/migrations/change_column.rb | class ChangeColumn < TestMigration
def change
change_column :users, :properties, :bad_name
end
end
class ChangeColumnVarcharToText < TestMigration
def up
change_column :users, :name, :text
end
def down
change_column :users, :name, :string
end
end
class ChangeColumnVarcharToCitext < TestMigrat... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations.rb | lib/strong_migrations.rb | # dependencies
require "active_support"
# adapters
require_relative "strong_migrations/adapters/abstract_adapter"
require_relative "strong_migrations/adapters/mysql_adapter"
require_relative "strong_migrations/adapters/mariadb_adapter"
require_relative "strong_migrations/adapters/postgresql_adapter"
# modules
require... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations/version.rb | lib/strong_migrations/version.rb | module StrongMigrations
VERSION = "2.5.2"
end
| ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations/error_messages.rb | lib/strong_migrations/error_messages.rb | module StrongMigrations
self.error_messages = {
add_column_default:
"Adding a column with a %{default_type} default blocks %{rewrite_blocks} while the entire table is rewritten.
Instead, add the column without a default value, then change the default.
class %{migration_name} < ActiveRecord::Migration%{migration_... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations/railtie.rb | lib/strong_migrations/railtie.rb | # ensure activerecord tasks are loaded first
require "active_record/railtie"
module StrongMigrations
class Railtie < Rails::Railtie
rake_tasks do
load "tasks/strong_migrations.rake"
end
end
end
| ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations/safe_methods.rb | lib/strong_migrations/safe_methods.rb | module StrongMigrations
module SafeMethods
def safe_by_default_method?(method)
StrongMigrations.safe_by_default && !version_safe? && [:add_index, :add_belongs_to, :add_reference, :remove_index, :add_foreign_key, :add_check_constraint, :change_column_null].include?(method)
end
def safe_add_index(*ar... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations/schema_dumper.rb | lib/strong_migrations/schema_dumper.rb | module StrongMigrations
module SchemaDumper
def initialize(connection, ...)
return super unless StrongMigrations.alphabetize_schema
super(WrappedConnection.new(connection), ...)
end
end
class WrappedConnection
delegate_missing_to :@connection
def initialize(connection)
@connec... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations/migration.rb | lib/strong_migrations/migration.rb | module StrongMigrations
module Migration
def migrate(direction)
strong_migrations_checker.direction = direction
super
connection.begin_db_transaction if strong_migrations_checker.transaction_disabled
end
def method_missing(method, *args)
return super if is_a?(ActiveRecord::Schema)... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations/migration_context.rb | lib/strong_migrations/migration_context.rb | module StrongMigrations
module MigrationContext
def up(...)
super
rescue => e
strong_migrations_process_exception(e)
end
def down(...)
super
rescue => e
strong_migrations_process_exception(e)
end
def run(...)
super
rescue => e
strong_migrations_pro... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations/checker.rb | lib/strong_migrations/checker.rb | module StrongMigrations
class Checker
include Checks
include SafeMethods
attr_accessor :direction, :transaction_disabled, :timeouts_set
class << self
attr_accessor :safe
end
def initialize(migration)
@migration = migration
reset
end
def reset
@new_tables = [... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations/checks.rb | lib/strong_migrations/checks.rb | # TODO better pattern
module StrongMigrations
module Checks
private
def check_add_check_constraint(*args)
options = args.extract_options!
table, expression = args
if !new_table?(table)
if postgresql? && options[:validate] != false
add_options = options.merge(validate: fal... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations/migrator.rb | lib/strong_migrations/migrator.rb | module StrongMigrations
module Migrator
def ddl_transaction(migration, ...)
retries = StrongMigrations.lock_timeout_retries > 0 && use_transaction?(migration)
return super unless retries || StrongMigrations.transaction_timeout
# handle MigrationProxy class
migration = migration.send(:migr... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations/adapters/mysql_adapter.rb | lib/strong_migrations/adapters/mysql_adapter.rb | # note: MariaDB inherits from this adapter
# when making changes, be sure to see how it affects it
module StrongMigrations
module Adapters
class MySQLAdapter < AbstractAdapter
def name
"MySQL"
end
def min_version
"8.0"
end
def server_version
@server_version ... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations/adapters/postgresql_adapter.rb | lib/strong_migrations/adapters/postgresql_adapter.rb | module StrongMigrations
module Adapters
class PostgreSQLAdapter < AbstractAdapter
def name
"PostgreSQL"
end
def min_version
"12"
end
def server_version
@version ||= begin
target_version(StrongMigrations.target_postgresql_version) do
ver... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations/adapters/mariadb_adapter.rb | lib/strong_migrations/adapters/mariadb_adapter.rb | module StrongMigrations
module Adapters
class MariaDBAdapter < MySQLAdapter
def name
"MariaDB"
end
def min_version
"10.5"
end
def server_version
@server_version ||= begin
target_version(StrongMigrations.target_mariadb_version) do
select... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/strong_migrations/adapters/abstract_adapter.rb | lib/strong_migrations/adapters/abstract_adapter.rb | module StrongMigrations
module Adapters
class AbstractAdapter
def initialize(checker)
@checker = checker
end
def name
"Unknown"
end
def min_version
end
def set_statement_timeout(timeout)
# do nothing
end
def set_transaction_timeout(... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/lib/generators/strong_migrations/install_generator.rb | lib/generators/strong_migrations/install_generator.rb | require "rails/generators"
module StrongMigrations
module Generators
class InstallGenerator < Rails::Generators::Base
source_root File.join(__dir__, "templates")
def create_initializer
template "initializer.rb", "config/initializers/strong_migrations.rb"
end
def start_after
... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/spec/color_ls_spec.rb | spec/color_ls_spec.rb | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe ColorLS do
it 'has a version number' do
expect(ColorLS::VERSION).not_to be_nil
end
end
| ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
require 'simplecov'
SimpleCov.start do
add_filter '/spec/'
end
if ENV['CI'] == 'never' # FIXME: migrate to new Codecov uploader / action
require 'codecov'
SimpleCov.formatter = SimpleCov::Formatter::Codecov
end
require 'bundler/setup'
require 'colorls'
Dir["#{File.dirname(__FILE... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/spec/support/yaml_sort_checker.rb | spec/support/yaml_sort_checker.rb | # frozen_string_literal: true
require 'yaml'
require 'open3' # workaround https://github.com/samg/diffy#119
require 'diffy'
# Check Yaml if Alphabetically sorted
class YamlSortChecker
class NotSortedError < StandardError; end
def initialize(filename)
@yaml = YAML.load_file(filename)
end
def sorted?(type... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/spec/color_ls/flags_spec.rb | spec/color_ls/flags_spec.rb | # frozen_string_literal: true
require 'spec_helper'
FIXTURES = 'spec/fixtures'
RSpec.describe ColorLS::Flags do
subject do
described_class.new(*args).process
rescue SystemExit => e
raise "colorls exited with #{e.status}" unless e.success?
end
let(:a_txt_file_info) do
instance_double(
Color... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/spec/color_ls/git_spec.rb | spec/color_ls/git_spec.rb | # frozen_string_literal: false
require 'spec_helper'
RSpec.describe ColorLS::Git do
before(:all) do # rubocop:todo RSpec/BeforeAfterAll
`echo` # initialize $CHILD_STATUS
expect($CHILD_STATUS).to be_success # rubocop:todo RSpec/ExpectInHook
end
context 'with file in repository root' do
it 'returns `... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/spec/color_ls/monkey_spec.rb | spec/color_ls/monkey_spec.rb | # frozen_string_literal: true
require 'colorls/monkeys'
RSpec.describe String do # rubocop:disable RSpec/FilePath
describe '#uniq' do
it 'removes all duplicate characters' do
expect('abca'.uniq).to be == 'abc'
end
end
describe String, '#colorize' do
it 'colors a string with red' do
expe... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/spec/color_ls/core_spec.rb | spec/color_ls/core_spec.rb | # frozen_string_literal: false
require 'spec_helper'
RSpec.describe ColorLS::Core do
subject { described_class.new(colors: Hash.new('black')) }
context 'ls' do
it 'works with Unicode characters' do
camera = 'Cámara'.force_encoding(ColorLS.file_encoding)
imagenes = 'Imágenes'.force_encoding(ColorL... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/spec/color_ls/layout_spec.rb | spec/color_ls/layout_spec.rb | # frozen_string_literal: true
require 'spec_helper'
# rubocop:todo RSpec/MultipleDescribes
RSpec.describe(ColorLS::HorizontalLayout, '#each_line') do
subject { described_class.new(array, array.map(&:length), width) }
context 'when empty' do
let(:array) { [] }
let(:width) { 10 }
it 'does nothing' do... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/spec/color_ls/yaml_spec.rb | spec/color_ls/yaml_spec.rb | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe ColorLS::Yaml do
filenames = {
file_aliases: :value,
folder_aliases: :value,
folders: :key,
files: :key
}.freeze
let(:base_directory) { 'lib/yaml' }
filenames.each do |filename, sort_type|
describe filename do
let(:... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/lib/colorls.rb | lib/colorls.rb | # frozen_string_literal: true
require 'yaml'
require 'etc'
require 'English'
require 'filesize'
require 'io/console'
require 'io/console/size'
require 'rainbow/ext/string'
require 'clocale'
require 'unicode/display_width'
require 'addressable/uri'
require_relative 'colorls/core'
require_relative 'colorls/fileinfo'
re... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/lib/colorls/core.rb | lib/colorls/core.rb | # frozen_string_literal: true
module ColorLS
# on Windows (were the special 'nul' device exists) we need to use UTF-8
@file_encoding = File.exist?('nul') ? Encoding::UTF_8 : Encoding::ASCII_8BIT
def self.file_encoding
@file_encoding
end
def self.terminal_width
console = IO.console
width = IO.c... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/lib/colorls/monkeys.rb | lib/colorls/monkeys.rb | # frozen_string_literal: true
class String
def colorize(color)
self.color(color)
end
def uniq
chars.uniq.join
end
end
| ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/lib/colorls/version.rb | lib/colorls/version.rb | # frozen_string_literal: true
module ColorLS
VERSION = '1.5.0'
end
| ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/lib/colorls/flags.rb | lib/colorls/flags.rb | # frozen_string_literal: true
require 'optparse'
require 'colorls/version'
module ColorLS
class Flags
def initialize(*args)
@args = args
@light_colors = false
@opts = default_opts
@report_mode = false
@exit_status_code = 0
parse_options
return unless @opts[:mode] == ... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/lib/colorls/yaml.rb | lib/colorls/yaml.rb | # frozen_string_literal: true
module ColorLS
class Yaml
def initialize(filename)
@filepath = File.join(File.dirname(__FILE__),"../yaml/#{filename}")
@user_config_filepath = File.join(Dir.home, ".config/colorls/#{filename}")
end
def load(aliase: false)
yaml = read_file(@filepath)
... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/lib/colorls/fileinfo.rb | lib/colorls/fileinfo.rb | # frozen_string_literal: true
require 'forwardable'
module ColorLS
class FileInfo
extend Forwardable
@@users = {} # rubocop:disable Style/ClassVars
@@groups = {} # rubocop:disable Style/ClassVars
attr_reader :stats, :name, :path, :parent
def initialize(name:, parent... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/lib/colorls/git.rb | lib/colorls/git.rb | # frozen_string_literal: true
require 'pathname'
require 'set'
module ColorLS
module Git
EMPTY_SET = Set.new.freeze
private_constant :EMPTY_SET
def self.status(repo_path)
prefix, success = git_prefix(repo_path)
return unless success
prefix_path = Pathname.new(prefix)
git_stat... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
athityakumar/colorls | https://github.com/athityakumar/colorls/blob/f066e3216180351df88d2d44ea0e8c788cca0045/lib/colorls/layout.rb | lib/colorls/layout.rb | # frozen_string_literal: true
module ColorLS
class Layout
def initialize(contents, widths, line_size)
@max_widths = widths
@contents = contents
@screen_width = line_size
end
def each_line
return if @contents.empty?
get_chunks(chunk_size).each { |line| yield(line.compact, @... | ruby | MIT | f066e3216180351df88d2d44ea0e8c788cca0045 | 2026-01-04T15:44:05.020663Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/spec_helper.rb | spec/spec_helper.rb | require "coveralls"
require "simplecov"
SimpleCov.start do
add_filter "lib/terraforming.rb"
add_filter "lib/terraforming/version.rb"
formatter SimpleCov::Formatter::MultiFormatter.new([
Coveralls::SimpleCov::Formatter,
SimpleCov::Formatter::HTMLFormatter,
])
end
$LOAD_PATH.unshift File.expand_path('.... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming_spec.rb | spec/lib/terraforming_spec.rb | require 'spec_helper'
describe Terraforming do
it 'has a version number' do
expect(Terraforming::VERSION).not_to be nil
end
end
| ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/cli_spec.rb | spec/lib/terraforming/cli_spec.rb | require "spec_helper"
module Terraforming
describe CLI do
context "resources" do
shared_examples "CLI examples" do
context "without --tfstate" do
it "should export tf" do
expect(klass).to receive(:tf).with(no_args)
described_class.new.invoke(command, [], {})
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/s3_spec.rb | spec/lib/terraforming/resource/s3_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe S3 do
let(:buckets) do
[
{
creation_date: Time.parse("2014-01-01T12:12:12.000Z"),
name: "hoge"
},
{
creation_date: Time.parse("2015-01-01T00:00:00.000Z"),
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/elasti_cache_cluster_spec.rb | spec/lib/terraforming/resource/elasti_cache_cluster_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe ElastiCacheCluster do
let(:client) do
Aws::ElastiCache::Client.new(stub_responses: true)
end
let(:cache_clusters) do
[
{
cache_cluster_id: "hoge",
configuration_endpoint: {
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/iam_role_spec.rb | spec/lib/terraforming/resource/iam_role_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe IAMRole do
let(:client) do
Aws::IAM::Client.new(stub_responses: true)
end
let(:roles) do
[
{
path: "/",
role_name: "hoge_role",
role_id: "ABCDEFGHIJKLMN1234567",
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/sns_topic_spec.rb | spec/lib/terraforming/resource/sns_topic_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe SNSTopic do
let(:client) do
Aws::SNS::Client.new(stub_responses: true)
end
let(:topics) do
[
Aws::SNS::Types::Topic.new(topic_arn: "arn:aws:sns:us-west-2:012345678901:topicOfFanciness"),
]
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/launch_configuration_spec.rb | spec/lib/terraforming/resource/launch_configuration_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe LaunchConfiguration do
let(:client) do
Aws::AutoScaling::Client.new(stub_responses: true)
end
let(:launch_configurations) do
[
{
launch_configuration_name: "launch-123456789",
l... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/sqs_spec.rb | spec/lib/terraforming/resource/sqs_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe SQS do
let(:client) do
Aws::SQS::Client.new(stub_responses: true)
end
let(:queue_urls) do
[
"https://sqs.ap-northeast-1.amazonaws.com/123456789012/test",
]
end
let(:attributes) do
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/rds_spec.rb | spec/lib/terraforming/resource/rds_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe RDS do
let(:client) do
Aws::RDS::Client.new(stub_responses: true)
end
let(:db_instances) do
[
{
publicly_accessible: false,
master_username: "user",
license_model: "... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/network_interface_spec.rb | spec/lib/terraforming/resource/network_interface_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe NetworkInterface do
let(:client) do
Aws::EC2::Client.new(stub_responses: true)
end
let(:network_interfaces) do
[
{
status: "available",
mac_address: "11:11:11:11:11:11",
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/network_acl_spec.rb | spec/lib/terraforming/resource/network_acl_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe NetworkACL do
let(:client) do
Aws::EC2::Client.new(stub_responses: true)
end
let(:network_acls) do
[
{
network_acl_id: "acl-1234abcd",
vpc_id: "vpc-1234abcd",
is_def... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/efs_file_system_spec.rb | spec/lib/terraforming/resource/efs_file_system_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe EFSFileSystem do
let(:client) do
Aws::EFS::Client.new(stub_responses: true)
end
let(:efs_description_0) do
{
creation_time: Time.parse("2016-11-01 11:30:00 -0700"),
creation_token: "console-1... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/vpc_spec.rb | spec/lib/terraforming/resource/vpc_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe VPC do
let(:client) do
Aws::EC2::Client.new(stub_responses: true)
end
let(:vpcs) do
[
{
vpc_id: "vpc-1234abcd",
state: "available",
cidr_block: "10.0.0.0/16",
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/route_table_spec.rb | spec/lib/terraforming/resource/route_table_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe RouteTable do
let(:client) do
Aws::EC2::Client.new(stub_responses: true)
end
let(:route_tables) do
[
{
route_table_id: 'rtb-a12bcd34',
vpc_id: 'vpc-ab123cde',
routes... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/redshift_spec.rb | spec/lib/terraforming/resource/redshift_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe Redshift do
let(:client) do
Aws::Redshift::Client.new(stub_responses: true)
end
let(:clusters) do
[
{
cluster_identifier: "test",
node_type: "dc1.large",
cluster_sta... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/kms_key_spec.rb | spec/lib/terraforming/resource/kms_key_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe KMSKey do
let(:client) do
Aws::KMS::Client.new(stub_responses: true)
end
let(:keys) do
[
{
key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
key_arn: "arn:aws:kms:ap-northeast-1:1... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/db_subnet_group_spec.rb | spec/lib/terraforming/resource/db_subnet_group_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe DBSubnetGroup do
let(:client) do
Aws::RDS::Client.new(stub_responses: true)
end
let(:db_subnet_groups) do
[
{
subnets: [
{
subnet_status: "Active",
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/vpn_gateway_spec.rb | spec/lib/terraforming/resource/vpn_gateway_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe VPNGateway do
let(:client) do
Aws::EC2::Client.new(stub_responses: true)
end
let(:vpn_gateways) do
[
{
vpn_gateway_id: "vgw-1234abcd",
vpc_attachments: [
vpc_id: "... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/elb_spec.rb | spec/lib/terraforming/resource/elb_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe ELB do
let(:client) do
Aws::ElasticLoadBalancing::Client.new(stub_responses: true)
end
let(:load_balancer_descriptions) do
[
{
subnets: [
"subnet-1234abcd",
"sub... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/sns_topic_subscription_spec.rb | spec/lib/terraforming/resource/sns_topic_subscription_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe SNSTopicSubscription do
let(:client) do
Aws::SNS::Client.new(stub_responses: true)
end
let(:subscriptions) do
[
Aws::SNS::Types::Subscription.new(subscription_arn: "arn:aws:sns:us-west-2:012345678901... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/iam_group_membership_spec.rb | spec/lib/terraforming/resource/iam_group_membership_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe IAMGroupMembership do
let(:client) do
Aws::IAM::Client.new(stub_responses: true)
end
let(:groups) do
[
{
path: "/",
group_name: "hoge",
group_id: "ABCDEFGHIJKLMN1234... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/iam_user_spec.rb | spec/lib/terraforming/resource/iam_user_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe IAMUser do
let(:client) do
Aws::IAM::Client.new(stub_responses: true)
end
let(:users) do
[
{
path: "/",
user_name: "hoge",
user_id: "ABCDEFGHIJKLMN1234567",
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/eip_spec.rb | spec/lib/terraforming/resource/eip_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe EIP do
let(:client) do
Aws::EC2::Client.new(stub_responses: true)
end
let(:eips) do
[
{
domain: "vpc",
instance_id: "i-12345678",
network_interface_id: "eni-12345678... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/db_security_group_spec.rb | spec/lib/terraforming/resource/db_security_group_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe DBSecurityGroup do
let(:client) do
Aws::RDS::Client.new(stub_responses: true)
end
let(:db_security_groups) do
[
{
ip_ranges: [],
owner_id: "123456789012",
db_securit... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/iam_group_spec.rb | spec/lib/terraforming/resource/iam_group_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe IAMGroup do
let(:client) do
Aws::IAM::Client.new(stub_responses: true)
end
let(:groups) do
[
{
path: "/",
group_name: "hoge",
group_id: "ABCDEFGHIJKLMN1234567",
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/db_parameter_group_spec.rb | spec/lib/terraforming/resource/db_parameter_group_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe DBParameterGroup do
let(:client) do
Aws::RDS::Client.new(stub_responses: true)
end
let(:db_parameter_groups) do
[
{
db_parameter_group_name: "default.mysql5.6",
db_parameter_gro... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/route53_zone_spec.rb | spec/lib/terraforming/resource/route53_zone_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe Route53Zone do
let(:client) do
Aws::Route53::Client.new(stub_responses: true)
end
let(:hoge_hosted_zone) do
{
id: "/hostedzone/ABCDEFGHIJKLMN",
name: "hoge.net.",
caller_reference: ... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/iam_policy_spec.rb | spec/lib/terraforming/resource/iam_policy_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe IAMPolicy do
let(:client) do
Aws::IAM::Client.new(stub_responses: true)
end
let(:policies) do
[
{
policy_name: "hoge_policy",
policy_id: "ABCDEFGHIJKLMN1234567",
arn... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/auto_scaling_group_spec.rb | spec/lib/terraforming/resource/auto_scaling_group_spec.rb | require "spec_helper"
require "spec_helper"
module Terraforming
module Resource
describe AutoScalingGroup do
let(:client) do
Aws::AutoScaling::Client.new(stub_responses: true)
end
let(:auto_scaling_groups) do
[
{
auto_scaling_group_name: "hoge",
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/nat_gateway_spec.rb | spec/lib/terraforming/resource/nat_gateway_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe NATGateway do
let(:client) do
Aws::EC2::Client.new(stub_responses: true)
end
let(:nat_gateways) do
[
{
nat_gateway_id: "nat-0c5b68b2c4d64e037",
subnet_id: "subnet-cd5645f7",
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/iam_policy_attachment_spec.rb | spec/lib/terraforming/resource/iam_policy_attachment_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe IAMPolicyAttachment do
let(:client) do
Aws::IAM::Client.new(stub_responses: true)
end
let(:policies) do
[
{
policy_name: "hoge",
policy_id: "ABCDEFGHIJKLMN1234567",
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/ec2_spec.rb | spec/lib/terraforming/resource/ec2_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe EC2 do
let(:client) do
Aws::EC2::Client.new(stub_responses: true)
end
let(:instances) do
[
{
instance_id: "i-1234abcd",
image_id: "ami-1234abcd",
state: { code: 16, ... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/dynamo_db_spec.rb | spec/lib/terraforming/resource/dynamo_db_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe DynamoDB do
let(:client) do
Aws::DynamoDB::Client.new(stub_responses: true)
end
let(:tables) do
[
"test-ddb","new-ddb"
]
end
let(:test_ddb_table) do
{
attribute_de... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/iam_user_policy_spec.rb | spec/lib/terraforming/resource/iam_user_policy_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe IAMUserPolicy do
let(:client) do
Aws::IAM::Client.new(stub_responses: true)
end
let(:users) do
[
{
path: "/",
user_name: "hoge",
user_id: "ABCDEFGHIJKLMN1234567",
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/cloud_watch_alarm_spec.rb | spec/lib/terraforming/resource/cloud_watch_alarm_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe CloudWatchAlarm do
let(:client) do
Aws::CloudWatch::Client.new(stub_responses: true)
end
let(:alarms) do
[
{
actions_enabled: true,
alarm_actions: ["arn:aws:sns:region:account:l... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/iam_role_policy_spec.rb | spec/lib/terraforming/resource/iam_role_policy_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe IAMRolePolicy do
let(:client) do
Aws::IAM::Client.new(stub_responses: true)
end
let(:roles) do
[
{
path: "/",
role_name: "hoge_role",
role_id: "ABCDEFGHIJKLMN1234567... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/internet_gateway_spec.rb | spec/lib/terraforming/resource/internet_gateway_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe InternetGateway do
let(:client) do
Aws::EC2::Client.new(stub_responses: true)
end
let(:internet_gateways) do
[
{
internet_gateway_id: "igw-1234abcd",
attachments: [
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/subnet_spec.rb | spec/lib/terraforming/resource/subnet_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe Subnet do
let(:client) do
Aws::EC2::Client.new(stub_responses: true)
end
let(:subnets) do
[
{
subnet_id: "subnet-1234abcd",
state: "available",
vpc_id: "vpc-1234abcd... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/kms_alias_spec.rb | spec/lib/terraforming/resource/kms_alias_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe KMSAlias do
let(:client) do
Aws::KMS::Client.new(stub_responses: true)
end
let(:aliases) do
[
{
alias_name: "alias/aws/acm",
alias_arn: "arn:aws:kms:ap-northeast-1:123456789012:... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/route_table_association_spec.rb | spec/lib/terraforming/resource/route_table_association_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe RouteTableAssociation do
let(:client) do
Aws::EC2::Client.new(stub_responses: true)
end
let(:route_tables) do
[
{
route_table_id: 'rtb-a12bcd34',
vpc_id: 'vpc-ab123cde',
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/alb_spec.rb | spec/lib/terraforming/resource/alb_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe ALB do
let(:client) do
Aws::ElasticLoadBalancingV2::Client.new(stub_responses: true)
end
let(:load_balancers) do
[
{
load_balancer_arn: "arn:aws:elasticloadbalancing:ap-northeast-1:01234567... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/iam_instance_profile_spec.rb | spec/lib/terraforming/resource/iam_instance_profile_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe IAMInstanceProfile do
let(:client) do
Aws::IAM::Client.new(stub_responses: true)
end
let(:instance_profiles) do
[
{
path: "/",
instance_profile_name: "hoge_profile",
... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
dtan4/terraforming | https://github.com/dtan4/terraforming/blob/ab6486872952b61c4dca24d51a8a11f189f91573/spec/lib/terraforming/resource/elasti_cache_subnet_group_spec.rb | spec/lib/terraforming/resource/elasti_cache_subnet_group_spec.rb | require "spec_helper"
module Terraforming
module Resource
describe ElastiCacheSubnetGroup do
let(:client) do
Aws::ElastiCache::Client.new(stub_responses: true)
end
let(:cache_subnet_groups) do
[
{
cache_subnet_group_name: "hoge",
cache_subnet_g... | ruby | MIT | ab6486872952b61c4dca24d51a8a11f189f91573 | 2026-01-04T15:46:47.062437Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.