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 |
|---|---|---|---|---|---|---|---|---|
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi.rb | lib/nandi.rb | # frozen_string_literal: true
require "nandi/config"
require "nandi/renderers"
require "nandi/compiled_migration"
require "active_support/core_ext/string/inflections"
module Nandi
class Error < StandardError; end
class << self
def compile(files:, db_name: nil)
compiled = files.
map { |f| Compil... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/index/index_generator.rb | lib/generators/nandi/index/index_generator.rb | # frozen_string_literal: true
require "rails/generators"
require "nandi/formatting"
require "nandi/multi_db_generator"
module Nandi
class IndexGenerator < Rails::Generators::Base
include Nandi::Formatting
include Nandi::MultiDbGenerator
argument :tables, type: :string
argument :columns, type: :stri... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/index/templates/add_index.rb | lib/generators/nandi/index/templates/add_index.rb | # frozen_string_literal: true
class <%= add_index_name.camelize %> < Nandi::Migration
def up
add_index <%= format_value(table) %>,
%i<%= format_value(columns).tr('"', '') %>,
name: <%= format_value(index_name) %>
end
def down
remove_index <%= format_value(table) %>,
... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/compile/compile_generator.rb | lib/generators/nandi/compile/compile_generator.rb | # frozen_string_literal: true
require "rails/generators"
require "nandi"
require "nandi/migration"
require "nandi/file_matcher"
require "nandi/lockfile"
module Nandi
class CompileGenerator < Rails::Generators::Base
source_root File.expand_path("templates", __dir__)
class_option :database,
... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/foreign_key/foreign_key_generator.rb | lib/generators/nandi/foreign_key/foreign_key_generator.rb | # frozen_string_literal: true
require "rails/generators"
require "nandi/formatting"
require "nandi/multi_db_generator"
module Nandi
class ForeignKeyGenerator < Rails::Generators::Base
include Nandi::Formatting
include Nandi::MultiDbGenerator
argument :table, type: :string
argument :target, type: :s... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/foreign_key/templates/add_foreign_key.rb | lib/generators/nandi/foreign_key/templates/add_foreign_key.rb | # frozen_string_literal: true
class <%= add_foreign_key_name.camelize %> < Nandi::Migration
def up
add_foreign_key <%= format_value(table) %>, <%= format_value(target) %><% if any_options? %>,
<% if column %>column: <%= format_value(column) %><% end %><% if column && name %>,<% end %>
<% if name ... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/foreign_key/templates/validate_foreign_key.rb | lib/generators/nandi/foreign_key/templates/validate_foreign_key.rb | # frozen_string_literal: true
class <%= validate_foreign_key_name.camelize %> < Nandi::Migration
def up
validate_constraint <%= format_value(@table) %>, <%= format_value(name) %>
end
def down; end
end
| ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/foreign_key/templates/add_reference.rb | lib/generators/nandi/foreign_key/templates/add_reference.rb | # frozen_string_literal: true
class <%= add_reference_name.camelize %> < Nandi::Migration
def up
add_column <%= format_value(table) %>, <%= format_value(reference_name) %>, <%= format_value(type) %>
end
def down
remove_column <%= format_value(table) %>, <%= format_value(reference_name) %>
end
end
| ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/migration/migration_generator.rb | lib/generators/nandi/migration/migration_generator.rb | # frozen_string_literal: true
require "rails/generators"
require "nandi/multi_db_generator"
module Nandi
class MigrationGenerator < Rails::Generators::NamedBase
include Nandi::MultiDbGenerator
source_root File.expand_path("templates", __dir__)
def create_migration_file
timestamp = Time.now.utc.s... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/migration/templates/migration.rb | lib/generators/nandi/migration/templates/migration.rb | # frozen_string_literal: true
class <%= class_name %> < Nandi::Migration
def up
# Migration instructions go here, eg:
# add_column :widgets, :size, :integer
end
def down
# Reverse migration instructions go here, eg:
# remove_column :widgets, :size
end
end
| ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/not_null_check/not_null_check_generator.rb | lib/generators/nandi/not_null_check/not_null_check_generator.rb | # frozen_string_literal: true
require "rails/generators"
require "nandi/formatting"
require "nandi/multi_db_generator"
module Nandi
class NotNullCheckGenerator < Rails::Generators::Base
include Nandi::Formatting
include Nandi::MultiDbGenerator
argument :table, type: :string
argument :column, type: ... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/not_null_check/templates/add_not_null_check.rb | lib/generators/nandi/not_null_check/templates/add_not_null_check.rb | # frozen_string_literal: true
class <%= add_not_null_check_name.camelize %> < Nandi::Migration
def up
add_check_constraint <%= format_value(table) %>, <%= format_value(name) %>, "<%= column %> IS NOT NULL"
end
def down
drop_constraint <%= format_value(table) %>, <%= format_value(name) %>
end
end
| ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/not_null_check/templates/validate_not_null_check.rb | lib/generators/nandi/not_null_check/templates/validate_not_null_check.rb | # frozen_string_literal: true
class <%= validate_not_null_check_name.camelize %> < Nandi::Migration
def up
validate_constraint <%= format_value(@table) %>, <%= format_value(name) %>
end
def down; end
end
| ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/check_constraint/check_constraint_generator.rb | lib/generators/nandi/check_constraint/check_constraint_generator.rb | # frozen_string_literal: true
require "rails/generators"
require "nandi/formatting"
require "nandi/multi_db_generator"
module Nandi
class CheckConstraintGenerator < Rails::Generators::Base
include Nandi::Formatting
include Nandi::MultiDbGenerator
argument :table, type: :string
argument :name, type:... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/check_constraint/templates/validate_check_constraint.rb | lib/generators/nandi/check_constraint/templates/validate_check_constraint.rb | # frozen_string_literal: true
class <%= validate_check_constraint_name.camelize %> < Nandi::Migration
def up
validate_constraint <%= format_value(table) %>, <%= format_value(name) %>
end
def down; end
end
| ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/generators/nandi/check_constraint/templates/add_check_constraint.rb | lib/generators/nandi/check_constraint/templates/add_check_constraint.rb | # frozen_string_literal: true
class <%= add_check_constraint_name.camelize %> < Nandi::Migration
def up
add_check_constraint <%= format_value(table) %>,
<%= format_value(name) %>,
<<~SQL
-- foo IS NOT NULL OR bar IS NOT NULL
... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/file_diff.rb | lib/nandi/file_diff.rb | # frozen_string_literal: true
module Nandi
class FileDiff
attr_reader :file_path, :known_digest
def initialize(file_path:, known_digest:)
@file_path = file_path
@known_digest = known_digest
end
def file_name
File.basename(file_path)
end
def body
File.read(file_path)... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions.rb | lib/nandi/instructions.rb | # frozen_string_literal: true
require "nandi/instructions/add_index"
require "nandi/instructions/remove_index"
require "nandi/instructions/create_table"
require "nandi/instructions/drop_table"
require "nandi/instructions/add_column"
require "nandi/instructions/add_reference"
require "nandi/instructions/remove_referenc... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/version.rb | lib/nandi/version.rb | # frozen_string_literal: true
module Nandi
VERSION = "2.0.1"
end
| ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/renderers.rb | lib/nandi/renderers.rb | # frozen_string_literal: true
require "nandi/renderers/active_record"
module Nandi
module Renderers; end
end
| ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/multi_db_generator.rb | lib/nandi/multi_db_generator.rb | # frozen_string_literal: true
module Nandi
module MultiDbGenerator
def self.included(base)
base.class_option :database,
default: nil,
type: :string,
desc: "Database to migrate in multi-database mode. " \
"... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/lockfile.rb | lib/nandi/lockfile.rb | # frozen_string_literal: true
require "active_support/core_ext/hash/indifferent_access"
require "digest"
module Nandi
class Lockfile
attr_reader :db_name
class << self
# Registry pattern using class variables to maintain singleton instances
# per database. This ensures that lockfile operations ... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/migration_violations.rb | lib/nandi/migration_violations.rb | # frozen_string_literal: true
module Nandi
class MigrationViolations
def initialize
@ungenerated_files = []
@handwritten_files = []
@out_of_date_files = []
@hand_edited_files = []
end
def add_ungenerated(missing_files, directory)
return if missing_files.empty?
full_p... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/safe_migration_enforcer.rb | lib/nandi/safe_migration_enforcer.rb | # frozen_string_literal: true
require "digest"
require "rails"
require "rails/generators"
require "nandi/file_diff"
require "nandi/file_matcher"
require "nandi/lockfile"
require "nandi/migration_violations"
module Nandi
class SafeMigrationEnforcer
class MigrationLintingFailed < StandardError; end
DEFAULT_... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/formatting.rb | lib/nandi/formatting.rb | # frozen_string_literal: true
module Nandi
module Formatting
class UnsupportedValueError < StandardError; end
module ClassMethods
# Define an accessor method that will retrieve a value
# from a cell's model and format it with the format_value
# method below.
# @param name [String] th... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/multi_database.rb | lib/nandi/multi_database.rb | # frozen_string_literal: true
module Nandi
class MultiDatabase
class Database
# Most DDL changes take a very strict lock, but execute very quickly. For these
# the statement timeout should be very tight, so that if there's an unexpected
# delay the query queue does not back up.
DEFAULT_AC... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/timeout_policies.rb | lib/nandi/timeout_policies.rb | # frozen_string_literal: true
require "nandi/validation/failure_helpers"
require "nandi/migration"
require "nandi/timeout_policies/access_exclusive"
require "nandi/timeout_policies/concurrent"
module Nandi
module TimeoutPolicies
CONCURRENT_OPERATIONS = %i[add_index remove_index].freeze
class Noop
clas... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/validator.rb | lib/nandi/validator.rb | # frozen_string_literal: true
require "dry/monads"
require "nandi/validation"
require "nandi/timeout_policies"
module Nandi
class Validator
include Nandi::Validation::FailureHelpers
class InstructionValidator
def self.call(instruction)
new(instruction).call
end
def initialize(ins... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/config.rb | lib/nandi/config.rb | # frozen_string_literal: true
require "nandi/renderers"
require "nandi/lockfile"
require "nandi/multi_database"
module Nandi
class Config
DEFAULT_COMPILE_FILES = "all"
DEFAULT_LOCKFILE_DIRECTORY = File.join(Dir.pwd, "db")
# The rendering backend used to produce output. The only supported option
# a... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/migration.rb | lib/nandi/migration.rb | # frozen_string_literal: true
require "nandi/instructions"
require "nandi/validator"
require "nandi/validation/failure_helpers"
module Nandi
# @abstract A migration must implement #up (the forward migration), and may
# also implement #down (the rollback sequence).
# The base class for migrations; Nandi's equi... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/validation.rb | lib/nandi/validation.rb | # frozen_string_literal: true
require "nandi/validation/add_column_validator"
require "nandi/validation/add_reference_validator"
require "nandi/validation/add_index_validator"
require "nandi/validation/remove_index_validator"
require "nandi/validation/each_validator"
require "nandi/validation/result"
require "nandi/va... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/compiled_migration.rb | lib/nandi/compiled_migration.rb | # frozen_string_literal: true
require "nandi/file_diff"
module Nandi
class CompiledMigration
class InvalidMigrationError < StandardError; end
attr_reader :file_name, :source_file_path, :class_name, :db_config
def db_name
@db_config.name
end
def self.build(file_name:, db_name:)
new... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/file_matcher.rb | lib/nandi/file_matcher.rb | # frozen_string_literal: true
module Nandi
class FileMatcher
TIMESTAMP_REGEX = /\A(?<operator>>|>=)?(?<timestamp>\d+)\z/
def self.call(*args, **kwargs)
new(*args, **kwargs).call
end
def initialize(files:, spec:)
@files = Set.new(files)
@spec = spec
end
def call
case... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/validation/failure_helpers.rb | lib/nandi/validation/failure_helpers.rb | # frozen_string_literal: true
require "dry/monads/result"
module Nandi
module Validation
module FailureHelpers
def collect_errors(new, old)
return success if new.success? && old.success?
if old.failure?
failure(Array(old.failure) + Array(new.failure))
else
fail... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/validation/add_index_validator.rb | lib/nandi/validation/add_index_validator.rb | # frozen_string_literal: true
require "nandi/validation/failure_helpers"
module Nandi
module Validation
class AddIndexValidator
include Nandi::Validation::FailureHelpers
def self.call(instruction)
new(instruction).call
end
def initialize(instruction)
@instruction = inst... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/validation/add_column_validator.rb | lib/nandi/validation/add_column_validator.rb | # frozen_string_literal: true
require "nandi/validation/failure_helpers"
module Nandi
module Validation
class AddColumnValidator
include Nandi::Validation::FailureHelpers
def self.call(instruction)
new(instruction).call
end
def initialize(instruction)
@instruction = ins... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/validation/add_reference_validator.rb | lib/nandi/validation/add_reference_validator.rb | # frozen_string_literal: true
require "nandi/validation/failure_helpers"
module Nandi
module Validation
class AddReferenceValidator
include Nandi::Validation::FailureHelpers
def self.call(instruction)
new(instruction).call
end
def initialize(instruction)
@instruction = ... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/validation/result.rb | lib/nandi/validation/result.rb | # frozen_string_literal: true
require "nandi/validation/failure_helpers"
module Nandi
module Validation
class Result
include Nandi::Validation::FailureHelpers
attr_reader :errors
def initialize(instruction = nil)
@instruction = instruction
@errors = success
end
de... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/validation/remove_index_validator.rb | lib/nandi/validation/remove_index_validator.rb | # frozen_string_literal: true
require "nandi/validation/failure_helpers"
module Nandi
module Validation
class RemoveIndexValidator
include Nandi::Validation::FailureHelpers
def self.call(instruction)
new(instruction).call
end
def initialize(instruction)
@instruction = i... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/validation/timeout_validator.rb | lib/nandi/validation/timeout_validator.rb | # frozen_string_literal: true
require "nandi/validation/failure_helpers"
module Nandi
module Validation
class TimeoutValidator
include Nandi::Validation::FailureHelpers
def self.call(migration)
new(migration).call
end
def initialize(migration)
@migration = migration
... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/validation/each_validator.rb | lib/nandi/validation/each_validator.rb | # frozen_string_literal: true
require "nandi/validation/failure_helpers"
module Nandi
module Validation
class EachValidator
include Nandi::Validation::FailureHelpers
def self.call(instruction)
new(instruction).call
end
def initialize(instruction)
@instruction = instruct... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/timeout_policies/access_exclusive.rb | lib/nandi/timeout_policies/access_exclusive.rb | # frozen_string_literal: true
require "nandi"
require "nandi/validation/failure_helpers"
module Nandi
module TimeoutPolicies
class AccessExclusive
include Nandi::Validation::FailureHelpers
def self.validate(migration)
new(migration).validate
end
def initialize(migration)
... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/timeout_policies/concurrent.rb | lib/nandi/timeout_policies/concurrent.rb | # frozen_string_literal: true
require "nandi"
require "nandi/validation"
require "nandi/validation/failure_helpers"
module Nandi
module TimeoutPolicies
class Concurrent
include Nandi::Validation::FailureHelpers
def self.validate(migration)
new(migration).validate
end
def initia... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/irreversible_migration.rb | lib/nandi/instructions/irreversible_migration.rb | # frozen_string_literal: true
module Nandi
module Instructions
class IrreversibleMigration
def lock
Nandi::Migration::LockWeights::SHARE
end
def procedure
:irreversible_migration
end
end
end
end
| ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/validate_constraint.rb | lib/nandi/instructions/validate_constraint.rb | # frozen_string_literal: true
module Nandi
module Instructions
class ValidateConstraint
attr_reader :table, :name
def initialize(table:, name:)
@table = table
@name = name
end
def lock
Nandi::Migration::LockWeights::SHARE
end
def procedure
:v... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/remove_not_null_constraint.rb | lib/nandi/instructions/remove_not_null_constraint.rb | # frozen_string_literal: true
module Nandi
module Instructions
class RemoveNotNullConstraint
attr_reader :table, :column
def initialize(table:, column:)
@table = table
@column = column
end
def procedure
:remove_not_null_constraint
end
def lock
... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/add_column.rb | lib/nandi/instructions/add_column.rb | # frozen_string_literal: true
module Nandi
module Instructions
class AddColumn
attr_reader :table, :name, :type, :extra_args
def initialize(table:, name:, type:, **kwargs)
@table = table
@name = name
@type = type
@extra_args = kwargs
end
def procedure
... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/add_index.rb | lib/nandi/instructions/add_index.rb | # frozen_string_literal: true
module Nandi
module Instructions
class AddIndex
def initialize(fields:, table:, **kwargs)
@fields = Array(fields)
@fields = @fields.first if @fields.one?
@table = table
@extra_args = kwargs
end
def procedure
:add_index
... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/drop_table.rb | lib/nandi/instructions/drop_table.rb | # frozen_string_literal: true
module Nandi
module Instructions
class DropTable
attr_reader :table
def initialize(table:)
@table = table
end
def procedure
:drop_table
end
def lock
Nandi::Migration::LockWeights::ACCESS_EXCLUSIVE
end
end
end... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/change_column_default.rb | lib/nandi/instructions/change_column_default.rb | # frozen_string_literal: true
module Nandi
module Instructions
class ChangeColumnDefault
attr_reader :table, :column, :value
def initialize(table:, column:, value:)
@table = table
@column = column
@value = value
end
def procedure
:change_column_default
... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/remove_column.rb | lib/nandi/instructions/remove_column.rb | # frozen_string_literal: true
module Nandi
module Instructions
class RemoveColumn
attr_reader :table, :name, :extra_args
def initialize(table:, name:, **extra_args)
@table = table
@name = name
@extra_args =
if extra_args.any?
extra_args
else
... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/create_table.rb | lib/nandi/instructions/create_table.rb | # frozen_string_literal: true
module Nandi
module Instructions
class CreateTable
Column = Struct.new(:name, :type, :args, keyword_init: true)
attr_reader :table, :columns, :timestamps_args, :extra_args
def initialize(table:, columns_block:, **kwargs)
@table = table
columns_rea... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/remove_reference.rb | lib/nandi/instructions/remove_reference.rb | # frozen_string_literal: true
module Nandi
module Instructions
class RemoveReference
attr_reader :table, :ref_name, :extra_args
def initialize(table:, ref_name:, **kwargs)
@table = table
@ref_name = ref_name
@extra_args = kwargs
end
def procedure
:remove_... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/add_foreign_key.rb | lib/nandi/instructions/add_foreign_key.rb | # frozen_string_literal: true
require "active_support/inflector"
module Nandi
module Instructions
class AddForeignKey
attr_reader :table, :target
def initialize(table:, target:, name: nil, **extra_args)
@table = table
@target = target
@extra_args = extra_args
@name =... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/remove_index.rb | lib/nandi/instructions/remove_index.rb | # frozen_string_literal: true
module Nandi
module Instructions
class RemoveIndex
def initialize(table:, field:)
@table = table
@field = field
end
def procedure
:remove_index
end
def extra_args
if field.is_a?(Hash)
field.merge(algorithm: :c... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/add_check_constraint.rb | lib/nandi/instructions/add_check_constraint.rb | # frozen_string_literal: true
module Nandi
module Instructions
class AddCheckConstraint
attr_reader :table, :name, :check
def initialize(table:, name:, check:)
@table = table
@name = name
@check = check
end
def procedure
:add_check_constraint
end
... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/drop_constraint.rb | lib/nandi/instructions/drop_constraint.rb | # frozen_string_literal: true
module Nandi
module Instructions
class DropConstraint
attr_reader :table, :name
def initialize(table:, name:)
@table = table
@name = name
end
def procedure
:drop_constraint
end
def lock
Nandi::Migration::LockWeig... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/instructions/add_reference.rb | lib/nandi/instructions/add_reference.rb | # frozen_string_literal: true
module Nandi
module Instructions
class AddReference
DEFAULT_EXTRA_ARGS = { index: false }.freeze
attr_reader :table, :ref_name, :extra_args
def initialize(table:, ref_name:, **kwargs)
@table = table
@ref_name = ref_name
@extra_args = DEFAUL... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/renderers/active_record.rb | lib/nandi/renderers/active_record.rb | # frozen_string_literal: true
require "nandi/renderers/active_record/generate"
module Nandi
module Renderers
module ActiveRecord
def self.generate(migration)
Generate.call(migration)
end
end
end
end
| ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/renderers/active_record/instructions.rb | lib/nandi/renderers/active_record/instructions.rb | # frozen_string_literal: true
require "cells"
require "tilt"
require "nandi/formatting"
module Nandi
module Renderers
module ActiveRecord
module Instructions
class Base < ::Cell::ViewModel
include Nandi::Formatting
def template_options_for(_options)
{
... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
gocardless/nandi | https://github.com/gocardless/nandi/blob/bcacafc9bd79a08d4cb7f43e21a776f42d916de2/lib/nandi/renderers/active_record/generate.rb | lib/nandi/renderers/active_record/generate.rb | # frozen_string_literal: true
require "active_record"
require "cell"
require "tilt"
require "nandi/renderers/active_record/instructions"
module Nandi
module Renderers
module ActiveRecord
class Generate < ::Cell::ViewModel
def self.call(*args)
super.call
end
def partials_... | ruby | MIT | bcacafc9bd79a08d4cb7f43e21a776f42d916de2 | 2026-01-04T17:52:04.110442Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/example/step_definitions/first.step.rb | example/step_definitions/first.step.rb | Transform /^#{ORDER}$/ do |order|
order
end
Transform /^background$/ do |background|
"background"
end
#
# This step transform converts "scenario" to "scenario"
#
Transform /^scenario$/ do |scenario|
"scenario"
end
#
# This step definition is all about steps
#
Given /^this (scenario|background|#{ORDER}) step$... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/example/step_definitions/french_steps.rb | example/step_definitions/french_steps.rb | # encoding: utf-8
Soit /^une calculatrice$/ do
@calc = Calculatrice.new
end
Etantdonné /^qu'on tape (.*)$/ do |n|
@calc.push n.to_i
end
Etantdonné /^que j'entre (\d+) pour le (.*) nombre/ do |n, x|
@calc.push n.to_i
end
Lorsque /^je tape sur la touche "="$/ do
@expected_result = @calc.additionner
end
Lorsqu... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/example/step_definitions/struct.rb | example/step_definitions/struct.rb | #
# @see https://github.com/burtlo/yard-cucumber/issues/18
#
CustomerUsageBehavior = Struct.new(:weight, :days, :time, :location, :other_party, :usage_type, :direction, :quantity)
class CustomerProfile
def generate_winner(max=@total_weight)
# blah
end
end | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/example/step_definitions/example.step.rb | example/step_definitions/example.step.rb |
Transform /^#{CUSTOMER}$/ do |customer|
"a transformed customer"
end
Transform /^an? customer$/ do |customer|
"a transformed customer"
end
Transform /^the customer$/ do |customer|
"the transformed customer"
end
Transform /^(#{ORDER}) customer$/ do |order|
"#{order} customer"
end
Transform /^#{TEDDY_BEAR}$/... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/example/step_definitions/support/env.rb | example/step_definitions/support/env.rb |
module Environment
module Database
class Connection
end
end
end | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/example/step_definitions/support/env_support.rb | example/step_definitions/support/env_support.rb |
class SupportClass
end
module Web
module Interface
class CachedReference
end
end
end | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/example/step_definitions/support/support.rb | example/step_definitions/support/support.rb |
ORDER = /(?:first|second|third)/
TEDDY_BEAR = /teddy bear/
CUSTOMER = /(?:(?:an?|the|#{ORDER}) customer|#{TEDDY_BEAR})/ | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard-cucumber.rb | lib/yard-cucumber.rb | require 'yard'
require 'cucumber/platform'
require 'gherkin/parser'
require File.dirname(__FILE__) + "/yard-cucumber/version.rb"
require File.dirname(__FILE__) + "/yard/code_objects/cucumber/base.rb"
require File.dirname(__FILE__) + "/yard/code_objects/cucumber/namespace_object.rb"
require File.dirname(__FILE__) + "/... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard-cucumber/version.rb | lib/yard-cucumber/version.rb | module CucumberInTheYARD
VERSION = '4.0.0'
end
| ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/code_objects/step_transformer.rb | lib/yard/code_objects/step_transformer.rb | module YARD::CodeObjects
class StepTransformerObject < Base
include Cucumber::LocationHelper
attr_reader :constants, :keyword, :source, :value, :literal_value
attr_accessor :steps, :pending, :substeps
# This defines an escape pattern within a string or regex:
# /^the first #{CONSTANT} step$... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/code_objects/step_transform.rb | lib/yard/code_objects/step_transform.rb | module YARD::CodeObjects
class StepTransformObject < StepTransformerObject;
end
end
| ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/code_objects/step_definition.rb | lib/yard/code_objects/step_definition.rb | module YARD::CodeObjects
class StepDefinitionObject < StepTransformerObject;
end
end
| ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/code_objects/cucumber/tag.rb | lib/yard/code_objects/cucumber/tag.rb | module YARD::CodeObjects::Cucumber
class Tag < NamespaceObject
attr_accessor :value, :owners, :total_scenarios
def features
@owners.find_all { |owner| owner.is_a?(Feature) }
end
def scenarios
all = @owners.find_all do |owner|
owner.is_a?(Scenario) || owner.is_a?(ScenarioOutline)... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/code_objects/cucumber/scenario.rb | lib/yard/code_objects/cucumber/scenario.rb | module YARD::CodeObjects::Cucumber
class Scenario < NamespaceObject
attr_accessor :value, :comments, :keyword, :description, :steps, :tags, :feature
def initialize(namespace, name)
super(namespace, name.to_s.strip)
@comments = @description = @keyword = @value = @feature = nil
@steps = []
... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/code_objects/cucumber/feature.rb | lib/yard/code_objects/cucumber/feature.rb | module YARD::CodeObjects::Cucumber
class Feature < NamespaceObject
attr_accessor :background, :comments, :description, :keyword, :scenarios, :tags, :value
def total_scenarios
scenarios.count
end
def initialize(namespace, name)
@comments = ""
@scenarios = []
@tags = []
s... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/code_objects/cucumber/step.rb | lib/yard/code_objects/cucumber/step.rb | module YARD::CodeObjects::Cucumber
class Step < Base
attr_accessor :comments,
:definition,
:examples,
:keyword,
:scenario,
:table,
:text,
:transforms,
:value
def in... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/code_objects/cucumber/base.rb | lib/yard/code_objects/cucumber/base.rb | module YARD::CodeObjects::Cucumber
module LocationHelper
def line_number
files.first.last
end
def file
files.first.first if files && !files.empty?
end
def location
"#{file}:#{line_number}"
end
end
class Base < YARD::CodeObjects::Base
include LocationHelper
de... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/code_objects/cucumber/scenario_outline.rb | lib/yard/code_objects/cucumber/scenario_outline.rb | module YARD::CodeObjects::Cucumber
class ScenarioOutline < NamespaceObject
attr_accessor :value, :comments, :keyword, :description, :steps, :tags, :feature
attr_accessor :scenarios, :examples
def initialize(namespace, name)
super(namespace, name.to_s.strip)
@comments = @description = @value ... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/code_objects/cucumber/namespace_object.rb | lib/yard/code_objects/cucumber/namespace_object.rb | module YARD::CodeObjects::Cucumber
class NamespaceObject < YARD::CodeObjects::NamespaceObject
include LocationHelper
def value;
nil;
end
end
class Requirements < NamespaceObject;
end
class FeatureTags < NamespaceObject;
end
class StepTransformersObject < NamespaceObject;
end
class... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/handlers/constant_transform_handler.rb | lib/yard/handlers/constant_transform_handler.rb | # There might be a nicer way to decorate this class but with my limited knowledge could only get this handler
# to be applied after the default constant handler by inheriting from the default constant handler.
# This is required so that the value assigned from the transform is not overridden in the registry by the
# de... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/handlers/step_definition_handler.rb | lib/yard/handlers/step_definition_handler.rb | #
# Finds and processes all the step definitions defined in the ruby source
# code. By default the english gherkin language will be parsed.
#
# To override the language you can define the step definitions in the YARD
# configuration file `~./yard/config`:
#
# @example `~/.yard/config` with LOLCatz step definitions
#
# ... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/handlers/step_transform_handler.rb | lib/yard/handlers/step_transform_handler.rb |
class YARD::Handlers::Ruby::StepTransformHandler < YARD::Handlers::Ruby::Base
handles method_call(:Transform)
handles method_call(:ParameterType)
process do
nextStatement = nil
instance = YARD::CodeObjects::StepTransformObject.new(step_transform_namespace,step_transformer_name) do |o|
o.source = ... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/handlers/legacy/step_definition_handler.rb | lib/yard/handlers/legacy/step_definition_handler.rb | class YARD::Handlers::Ruby::Legacy::StepDefinitionHandler < YARD::Handlers::Ruby::Legacy::Base
STEP_DEFINITION_MATCH = /^((When|Given|And|Then)\s*(\/.+\/)\s+do(?:\s*\|.+\|)?\s*)$/ unless defined?(STEP_DEFINITION_MATCH)
handles STEP_DEFINITION_MATCH
@@unique_name = 0
def process
keyword = statement.tokens.... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/handlers/legacy/step_transform_handler.rb | lib/yard/handlers/legacy/step_transform_handler.rb | class YARD::Handlers::Ruby::Legacy::StepTransformHandler < YARD::Handlers::Ruby::Legacy::Base
STEP_TRANSFORM_MATCH = /^(Transform\s*(\/.+\/)\s+do(?:\s*\|.+\|)?\s*)$/ unless defined?(STEP_TRANSFORM_MATCH)
handles STEP_TRANSFORM_MATCH
@@unique_name = 0
def process
transform = statement.tokens.to_s[STEP_TRAN... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/handlers/cucumber/base.rb | lib/yard/handlers/cucumber/base.rb | module YARD
module Handlers
module Cucumber
class Base < Handlers::Base
class << self
include Parser::Cucumber
def handles?(node)
handlers.any? do |a_handler|
#log.debug "YARD::Handlers::Cucumber::Base#handles?(#{node.class})"
node.class =... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/handlers/cucumber/feature_handler.rb | lib/yard/handlers/cucumber/feature_handler.rb | module YARD
module Handlers
module Cucumber
class FeatureHandler < Base
handles CodeObjects::Cucumber::Feature
def process
#
# Features have already been created when they were parsed. So there
# is no need to process the feature further. Previously this is wh... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/templates/helpers/base_helper.rb | lib/yard/templates/helpers/base_helper.rb | module YARD::Templates::Helpers
module BaseHelper
def format_object_title(object)
if object.is_a?(YARD::CodeObjects::Cucumber::FeatureTags)
"Tags"
elsif object.is_a?(YARD::CodeObjects::Cucumber::StepTransformersObject)
"Step Definitions and Transforms"
elsif object.is_a?(YARD::... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/server/router.rb | lib/yard/server/router.rb | module YARD
module Server
#
# The YARD::Server::Router needs the following modification,
# so that it will provide routing for the features and tags commands
# to their appropriate definitions
#
Router.class_eval do
alias_method :core_route_list, :route_list
#
# Provide th... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/server/adapter.rb | lib/yard/server/adapter.rb | module YARD
module Server
class Adapter
class << self
alias_method :yard_setup, :setup
#
# To provide the templates necessary for `yard-cucumber` to integrate
# with YARD the adapter has to around-alias the setup method to place
# the `yard-c... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/server/commands/list_command.rb | lib/yard/server/commands/list_command.rb | module YARD
module Server
module Commands
#
# List Features powers the features menu option in `yard server`
#
class ListFeaturesCommand < ListCommand
def type; :features end
def items
Registry.load_all
run_verifier(Registry.all(:feature)... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/yard/parser/cucumber/feature.rb | lib/yard/parser/cucumber/feature.rb | module YARD::Parser::Cucumber
class FeatureParser < YARD::Parser::Base
#
# Each found feature found is creates a new FeatureParser
#
# This logic was copied from the logic found in Cucumber to create the builder
# and then set up the formatter and parser. The difference is really the
# ... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/templates/default/featuretags/html/setup.rb | lib/templates/default/featuretags/html/setup.rb | def init
super
sections.push :namespace
@namespace = object
end
def namespace
erb(:namespace)
end
def all_tags_by_letter
hash = {}
objects = tags
objects = run_verifier(objects)
objects.each {|o| (hash[o.value.to_s[1,1].upcase] ||= []) << o }
hash
end
def tags
@tags ||= Registry.all(:tag).sort_by... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/templates/default/fulldoc/html/setup.rb | lib/templates/default/fulldoc/html/setup.rb | include YARD::Templates::Helpers::HtmlHelper
def init
super
# Additional javascript that power the additional menus, collapsing, etc.
asset "js/cucumber.js", file("js/cucumber.js",true)
serialize_object_type :feature
serialize_object_type :tag
# Generates the requirements splash page with the 'requirem... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/templates/default/requirements/html/setup.rb | lib/templates/default/requirements/html/setup.rb | def init
super
sections.push :requirements
@namespace = object
end
def features
@features ||= Registry.all(:feature)
end
def tags
@tags ||= Registry.all(:tag).sort_by {|l| l.value.to_s }
end
def feature_directories
@feature_directories ||= YARD::CodeObjects::Cucumber::CUCUMBER_NAMESPACE.children.find_al... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/templates/default/steptransformers/html/setup.rb | lib/templates/default/steptransformers/html/setup.rb | def init
super
sections.push :index, :stepdefinitions, :steptransforms, :undefinedsteps
end
def step_definitions
@step_definitions ||= begin
YARD::Registry.all(:stepdefinition).sort_by {|definition| definition.steps.length * -1 }
end
end
def step_transforms
@step_transforms ||= begin
YARD::Registry.... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/templates/default/feature/html/setup.rb | lib/templates/default/feature/html/setup.rb | def init
super
@feature = object
sections.push :feature
sections.push :scenarios if object.scenarios
end
def background
@scenario = @feature.background
@id = "background"
erb(:scenario)
end
def scenarios
scenarios = ""
if @feature.background
@scenario = @feature.background
... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/templates/default/layout/html/setup.rb | lib/templates/default/layout/html/setup.rb | def init
super
end
#
# Append yard-cucumber stylesheet to yard core stylesheets
#
def stylesheets
super + %w(css/cucumber.css)
end
#
# Append yard-cucumber javascript to yard core javascripts
#
def javascripts
super + %w(js/cucumber.js)
end
#
# Append yard-cucumber specific menus 'features' and 'tags'
#
# 'fea... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/templates/default/tag/html/setup.rb | lib/templates/default/tag/html/setup.rb | def init
super
@tag = object
sections.push :tag
end
def features
@tag.features
end
def scenarios
@tag.scenarios
end
def alpha_table(objects)
@elements = Hash.new
objects = run_verifier(objects)
objects.each {|o| (@elements[o.value.to_s[0,1].upcase] ||= []) << o }
@elements.values.each {|v| v.sor... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
burtlo/yard-cucumber | https://github.com/burtlo/yard-cucumber/blob/177e5ad17aa4973660ce646b398118a6408d8913/lib/templates/default/featuredirectory/html/setup.rb | lib/templates/default/featuredirectory/html/setup.rb | def init
super
sections.push :directory
@directory = object
end
def markdown(text)
htmlify(text,:markdown) rescue h(text)
end
def htmlify_with_newlines(text)
text.split("\n").collect {|c| h(c).gsub(/\s/,' ') }.join("<br/>")
end
def directories
@directories ||= @directory.subdirectories
end
def feat... | ruby | MIT | 177e5ad17aa4973660ce646b398118a6408d8913 | 2026-01-04T17:52:15.257300Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.