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
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/definer.rb
lib/graphql/models/definer.rb
# frozen_string_literal: true # This is a helper class. It lets you build simple DSL's. Methods called against the class are # converted into attributes in a hash. module GraphQL module Models class Definer def initialize(*methods) @values = {} methods.each do |m| define_singleton...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/definition_helpers.rb
lib/graphql/models/definition_helpers.rb
# frozen_string_literal: true require 'ostruct' module GraphQL module Models module DefinitionHelpers def self.types GraphQL::Define::TypeDefiner.instance end # Returns a promise that will eventually resolve to the model that is at the end of the path def self.load_and_traverse(...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/active_record_extension.rb
lib/graphql/models/active_record_extension.rb
# frozen_string_literal: true module GraphQL module Models module ActiveRecordExtension class EnumTypeHash extend Forwardable attr_accessor :hash def initialize @hash = {}.with_indifferent_access end def [](attribute) type = hash[attribute] ...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/promise_relation_connection.rb
lib/graphql/models/promise_relation_connection.rb
# frozen_string_literal: true module GraphQL module Models class PromiseRelationConnection < GraphQL::Relay::RelationConnection def edges # Can't do any optimization if the request is asking for the last X items, since there's # no easy way to turn it into a generalized query. retur...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/relation_loader.rb
lib/graphql/models/relation_loader.rb
# frozen_string_literal: true module GraphQL module Models class RelationLoader < GraphQL::Batch::Loader attr_reader :model_class def initialize(model_class) @model_class = model_class end def perform(load_requests) # Group the requests to load by id into a single relati...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/helpers.rb
lib/graphql/models/helpers.rb
# frozen_string_literal: true module GraphQL::Models module Helpers def self.orders_to_sql(orders) expressions = orders.map do |expr| case expr when Arel::Nodes::SqlLiteral expr.to_s else expr.to_sql end end expressions.join(', ') end ...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/reflection.rb
lib/graphql/models/reflection.rb
# frozen_string_literal: true # Exposes utility methods for getting metadata out of active record models module GraphQL::Models module Reflection class << self # Returns the possible values for an attribute on a model by examining inclusion validators def possible_values(model_class, attribute) ...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/backed_by_model.rb
lib/graphql/models/backed_by_model.rb
# frozen_string_literal: true module GraphQL module Models class BackedByModel DEFAULT_OBJECT_TO_MODEL = -> (obj) { obj } def initialize(graph_type, model_type, base_model_type: model_type, path: [], object_to_model: DEFAULT_OBJECT_TO_MODEL, detect_nulls: true) model_type = model_type.to_s.c...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/mutation_field_map.rb
lib/graphql/models/mutation_field_map.rb
# frozen_string_literal: true module GraphQL::Models class MutationFieldMap attr_accessor :model_type, :find_by, :null_behavior, :fields, :nested_maps, :legacy_nulls # These are used when this is a proxy_to or a nested field map attr_accessor :name, :association, :has_many, :required, :path def ini...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/relation_load_request.rb
lib/graphql/models/relation_load_request.rb
# frozen_string_literal: true module GraphQL module Models class RelationLoadRequest attr_reader :relation def initialize(relation) @relation = relation end #################################################################### # Public members that all load requests should ...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/association_load_request.rb
lib/graphql/models/association_load_request.rb
# frozen_string_literal: true module GraphQL module Models class AssociationLoadRequest attr_reader :base_model, :association, :context def initialize(base_model, association_name, context) @base_model = base_model @association = base_model.association(association_name) @cont...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/database_types.rb
lib/graphql/models/database_types.rb
# frozen_string_literal: true module GraphQL module Models module DatabaseTypes TypeStruct = Struct.new(:input, :output) def self.registered_type(database_type) @registered_types ||= {}.with_indifferent_access result = @registered_types[database_type] return nil if result.ni...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/instrumentation.rb
lib/graphql/models/instrumentation.rb
# frozen_string_literal: true class GraphQL::Models::Instrumentation # @param skip_nil_models If true, field resolvers (in proxy_to or backed_by_model blocks) will not be invoked if the model is nil. def initialize(skip_nil_models = true) @skip_nil_models = skip_nil_models end def instrument(type, field) ...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/monkey_patches/graphql_query_context.rb
lib/graphql/models/monkey_patches/graphql_query_context.rb
# frozen_string_literal: true class GraphQL::Query::Context def cached_models @cached_models ||= Set.new end end class GraphQL::Query::Context::FieldResolutionContext def cached_models @context.cached_models end end
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/mutation_helpers/apply_changes.rb
lib/graphql/models/mutation_helpers/apply_changes.rb
# frozen_string_literal: true module GraphQL::Models module MutationHelpers def self.apply_changes(field_map, model, inputs, context) # This will hold a flattened list of attributes/models that we actually changed changes = [] # Values will now contain the list of inputs that we should actuall...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/mutation_helpers/print_input_fields.rb
lib/graphql/models/mutation_helpers/print_input_fields.rb
# frozen_string_literal: true module GraphQL::Models module MutationHelpers def self.print_input_fields(field_map, definer, map_name_prefix) definer.instance_exec do field_map.fields.each do |f| field_type = f[:type] if f[:required] && !field_map.leave_null_unchanged? ...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/mutation_helpers/authorization.rb
lib/graphql/models/mutation_helpers/authorization.rb
# frozen_string_literal: true module GraphQL::Models module MutationHelpers def self.authorize_changes(context, all_changes) changed_models = all_changes.group_by { |c| c[:model_instance] } changed_models.each do |model, changes| changes.map { |c| c[:action] }.uniq.each do |action| ...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/mutation_helpers/validation.rb
lib/graphql/models/mutation_helpers/validation.rb
# frozen_string_literal: true module GraphQL::Models module MutationHelpers def self.validate_changes(inputs, field_map, root_model, context, all_changes) invalid_fields = {} unknown_errors = [] changed_models = all_changes.group_by { |c| c[:model_instance] } changed_models.reject { |m,...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/mutation_helpers/validation_error.rb
lib/graphql/models/mutation_helpers/validation_error.rb
# frozen_string_literal: true module GraphQL::Models module MutationHelpers class ValidationError < GraphQL::ExecutionError attr_accessor :invalid_arguments, :unknown_errors def initialize(invalid_arguments, unknown_errors) @invalid_arguments = invalid_arguments @unknown_errors = unk...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/definition_helpers/attributes.rb
lib/graphql/models/definition_helpers/attributes.rb
# frozen_string_literal: true module GraphQL module Models module DefinitionHelpers def self.resolve_nullability(graphql_type, model_class, attribute_or_association, detect_nulls, options) # If detect_nulls is true, it means that everything on the path (ie, between base_model_class and model_class)...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
goco-inc/legacy-graphql-activerecord
https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/definition_helpers/associations.rb
lib/graphql/models/definition_helpers/associations.rb
# frozen_string_literal: true module GraphQL module Models module DefinitionHelpers def self.define_proxy(graph_type, base_model_type, model_type, path, association, object_to_model, detect_nulls, &block) reflection = model_type.reflect_on_association(association) raise ArgumentError, "Asso...
ruby
MIT
025be0879466ee2e6d7324f4dd59b6a306e0e211
2026-01-04T17:48:42.035378Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/spec_helper.rb
spec/spec_helper.rb
# This file was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause # this file to always be loaded, without a need to explicitly require it in any # file...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/integration/integration_spec.rb
spec/integration/integration_spec.rb
require 'spec_helper' RSpec.describe 'Fix DB Schema Conflicts' do let(:expected_lines) { reference_db_schema.lines } it 'generates a sorted schema with no extra spacing' do `cd spec/test-app && rm -f db/schema.rb && rake db:migrate` generated_lines = File.readlines('spec/test-app/db/schema.rb') ge...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/unit/autocorrect_configuration_spec.rb
spec/unit/autocorrect_configuration_spec.rb
require 'spec_helper' require 'fix_db_schema_conflicts/autocorrect_configuration' RSpec.describe FixDBSchemaConflicts::AutocorrectConfiguration do subject(:autocorrect_config) { described_class } it 'for versions up to 0.49.0' do installed_rubocop(version: '0.39.0') expect(autocorrect_config.load).to eq(...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/app/helpers/application_helper.rb
spec/test-app/app/helpers/application_helper.rb
module ApplicationHelper end
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/app/controllers/application_controller.rb
spec/test-app/app/controllers/application_controller.rb
class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception end
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/app/models/person.rb
spec/test-app/app/models/person.rb
class Person < ActiveRecord::Base end
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/app/models/company.rb
spec/test-app/app/models/company.rb
class Company < ActiveRecord::Base end
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/db/seeds.rb
spec/test-app/db/seeds.rb
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # # Examples: # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/db/schema.rb
spec/test-app/db/schema.rb
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # dat...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/db/migrate/20160322223225_create_people.rb
spec/test-app/db/migrate/20160322223225_create_people.rb
class CreatePeople < ActiveRecord::Migration def change create_table :people do |t| t.string :first_name t.string :last_name t.integer :age t.date :birthdate t.timestamps null: false end end end
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/db/migrate/20160322223258_create_companies.rb
spec/test-app/db/migrate/20160322223258_create_companies.rb
class CreateCompanies < ActiveRecord::Migration def change create_table :companies do |t| t.string :name t.string :addr1 t.string :addr2 t.string :city t.string :state t.string :zip t.string :phone t.timestamps null: false end add_index :companies, :name ...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/test/test_helper.rb
spec/test-app/test/test_helper.rb
ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. fixtures :all # Add more helper methods to be used by all tests here... end
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/test/models/person_test.rb
spec/test-app/test/models/person_test.rb
require 'test_helper' class PersonTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/test/models/company_test.rb
spec/test-app/test/models/company_test.rb
require 'test_helper' class CompanyTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/application.rb
spec/test-app/config/application.rb
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module TestApp class Application < Rails::Application # Settings in config/environments/* take prece...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/environment.rb
spec/test-app/config/environment.rb
# Load the Rails application. require File.expand_path('../application', __FILE__) # Initialize the Rails application. Rails.application.initialize!
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/routes.rb
spec/test-app/config/routes.rb
Rails.application.routes.draw do # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". # You can have the root of your site routed with "root" # root 'welcome#index' # Example of regular route: # get 'products/:id' => 'ca...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/boot.rb
spec/test-app/config/boot.rb
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' # Set up gems listed in the Gemfile.
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/initializers/filter_parameter_logging.rb
spec/test-app/config/initializers/filter_parameter_logging.rb
# Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. Rails.application.config.filter_parameters += [:password]
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/initializers/session_store.rb
spec/test-app/config/initializers/session_store.rb
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_test-app_session'
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/initializers/wrap_parameters.rb
spec/test-app/config/initializers/wrap_parameters.rb
# Be sure to restart your server when you modify this file. # This file contains settings for ActionController::ParamsWrapper which # is enabled by default. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do wrap_parameters f...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/initializers/inflections.rb
spec/test-app/config/initializers/inflections.rb
# Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections # are locale specific, and you may define rules for as many different # locales as you wish. All of these examples are active by default: # ActiveSupport::Inflector.inflections(:en) do |inflec...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/initializers/cookies_serializer.rb
spec/test-app/config/initializers/cookies_serializer.rb
# Be sure to restart your server when you modify this file. Rails.application.config.action_dispatch.cookies_serializer = :json
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/initializers/assets.rb
spec/test-app/config/initializers/assets.rb
# Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = '1.0' # Add additional assets to the asset load path # Rails.application.config.assets.paths << Emoji.images_path # Precompile additional ...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/initializers/backtrace_silencers.rb
spec/test-app/config/initializers/backtrace_silencers.rb
# Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } # You can also remove all the silencers if you're trying to debug a probl...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/initializers/mime_types.rb
spec/test-app/config/initializers/mime_types.rb
# Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/environments/test.rb
spec/test-app/config/environments/test.rb
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suit...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/environments/development.rb
spec/test-app/config/environments/development.rb
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web serv...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/spec/test-app/config/environments/production.rb
spec/test-app/config/environments/production.rb
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web serve...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/lib/fix-db-schema-conflicts.rb
lib/fix-db-schema-conflicts.rb
require 'fix_db_schema_conflicts/schema_dumper.rb' module FixDBSchemaConflicts require 'fix_db_schema_conflicts/railtie' if defined?(Rails) end
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/lib/fix_db_schema_conflicts/version.rb
lib/fix_db_schema_conflicts/version.rb
module FixDBSchemaConflicts VERSION='3.1.1' end
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/lib/fix_db_schema_conflicts/railtie.rb
lib/fix_db_schema_conflicts/railtie.rb
require 'fix-db-schema-conflicts' require 'rails' module FixDBSchemaConflicts class Railtie < Rails::Railtie railtie_name :fix_db_schema_conflicts rake_tasks do load "fix_db_schema_conflicts/tasks/db.rake" end end end
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/lib/fix_db_schema_conflicts/schema_dumper.rb
lib/fix_db_schema_conflicts/schema_dumper.rb
require 'delegate' module FixDBSchemaConflicts module SchemaDumper class ConnectionWithSorting < SimpleDelegator def extensions __getobj__.extensions.sort end def columns(table) __getobj__.columns(table).sort_by(&:name) end def indexes(table) __getobj__.ind...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
jakeonrails/fix-db-schema-conflicts
https://github.com/jakeonrails/fix-db-schema-conflicts/blob/ae9135e0bb1fb142dd483f883da0064b8be17732/lib/fix_db_schema_conflicts/autocorrect_configuration.rb
lib/fix_db_schema_conflicts/autocorrect_configuration.rb
module FixDBSchemaConflicts class AutocorrectConfiguration def self.load new.load end def load if less_than_rubocop?(49) '.rubocop_schema.yml' elsif less_than_rubocop?(53) '.rubocop_schema.49.yml' elsif less_than_rubocop?(77) '.rubocop_schema.53.yml' ...
ruby
MIT
ae9135e0bb1fb142dd483f883da0064b8be17732
2026-01-04T17:48:46.828270Z
false
blowmage/minitest-rails-capybara
https://github.com/blowmage/minitest-rails-capybara/blob/b2664ae1290f194f1e547342c6f0012a4859e717/test/rails_helper.rb
test/rails_helper.rb
require "minitest/autorun" require "action_controller" require "action_controller/railtie" class TestApp < Rails::Application config.secret_token = "821c600ece97fc4ba952d67655b4b475" config.eager_load = false initialize! routes.draw do root to: "hello#world" end end class HelloController < ActionControl...
ruby
MIT
b2664ae1290f194f1e547342c6f0012a4859e717
2026-01-04T17:48:44.113676Z
false
blowmage/minitest-rails-capybara
https://github.com/blowmage/minitest-rails-capybara/blob/b2664ae1290f194f1e547342c6f0012a4859e717/test/test_spec_type.rb
test/test_spec_type.rb
require "rails_helper" class TestCapybaraSpecType < Minitest::Test def assert_capybara actual assert_equal Capybara::Rails::TestCase, actual end def refute_capybara actual refute_equal Capybara::Rails::TestCase, actual end def test_spec_type_resolves_for_matching_feature_strings assert_capybara...
ruby
MIT
b2664ae1290f194f1e547342c6f0012a4859e717
2026-01-04T17:48:44.113676Z
false
blowmage/minitest-rails-capybara
https://github.com/blowmage/minitest-rails-capybara/blob/b2664ae1290f194f1e547342c6f0012a4859e717/test/test_sanity.rb
test/test_sanity.rb
require "minitest/autorun" require "minitest-rails-capybara" class TestMinitestRailsCapybara < Minitest::Unit::TestCase def test_sanity assert Minitest::Rails::Capybara::VERSION end end
ruby
MIT
b2664ae1290f194f1e547342c6f0012a4859e717
2026-01-04T17:48:44.113676Z
false
blowmage/minitest-rails-capybara
https://github.com/blowmage/minitest-rails-capybara/blob/b2664ae1290f194f1e547342c6f0012a4859e717/test/test_dsl.rb
test/test_dsl.rb
require "rails_helper" describe "Capybara DSL Feature Test" do it "can call using_wait_time" do ret = "ZOMG! using_wait_time was called!" Capybara.stub :using_wait_time, ret do assert_equal ret, using_wait_time(6) {} end end it "can call page" do ret = "ZOMG! page called current_session!"...
ruby
MIT
b2664ae1290f194f1e547342c6f0012a4859e717
2026-01-04T17:48:44.113676Z
false
blowmage/minitest-rails-capybara
https://github.com/blowmage/minitest-rails-capybara/blob/b2664ae1290f194f1e547342c6f0012a4859e717/test/test_assertions_expectation.rb
test/test_assertions_expectation.rb
require "rails_helper" describe "Capybara Assertions and Expectations Feature Test" do describe "have_content" do it "has page with content" do visit root_path assert_content page, "Hello World" refute_content page, "Goobye All!" page.must_have_content "Hello World" page.wont_have_...
ruby
MIT
b2664ae1290f194f1e547342c6f0012a4859e717
2026-01-04T17:48:44.113676Z
false
blowmage/minitest-rails-capybara
https://github.com/blowmage/minitest-rails-capybara/blob/b2664ae1290f194f1e547342c6f0012a4859e717/test/test_spec.rb
test/test_spec.rb
require "rails_helper" feature "Capybara Spec DSL Feature Test" do scenario "works unnested" do assert true end feature "when nested" do scenario "works nested" do assert true end end given(:thing) { "I am a thing." } scenario "given works unnested" do assert_equal "I am a thing."...
ruby
MIT
b2664ae1290f194f1e547342c6f0012a4859e717
2026-01-04T17:48:44.113676Z
false
blowmage/minitest-rails-capybara
https://github.com/blowmage/minitest-rails-capybara/blob/b2664ae1290f194f1e547342c6f0012a4859e717/lib/minitest-rails-capybara.rb
lib/minitest-rails-capybara.rb
require "minitest-rails" module Minitest module Rails module Capybara VERSION = "3.0.2" end end end
ruby
MIT
b2664ae1290f194f1e547342c6f0012a4859e717
2026-01-04T17:48:44.113676Z
false
blowmage/minitest-rails-capybara
https://github.com/blowmage/minitest-rails-capybara/blob/b2664ae1290f194f1e547342c6f0012a4859e717/lib/minitest/rails/capybara.rb
lib/minitest/rails/capybara.rb
require "minitest/rails" # Load minitest-capybara and minitest-matchers require "minitest-capybara" require "capybara/rails" require "minitest/metadata" module Capybara module Rails class Helpers # :nodoc: include ::Rails.application.routes.url_helpers include ::Rails.application.routes.mounted_helpe...
ruby
MIT
b2664ae1290f194f1e547342c6f0012a4859e717
2026-01-04T17:48:44.113676Z
false
blowmage/minitest-rails-capybara
https://github.com/blowmage/minitest-rails-capybara/blob/b2664ae1290f194f1e547342c6f0012a4859e717/lib/generators/minitest/feature/feature_generator.rb
lib/generators/minitest/feature/feature_generator.rb
require "minitest-rails" require "generators/minitest" module Minitest module Generators class FeatureGenerator < Base def self.source_root @_minitest_capybara_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), "templates")) end class_option :spec, type: :boolean, defa...
ruby
MIT
b2664ae1290f194f1e547342c6f0012a4859e717
2026-01-04T17:48:44.113676Z
false
blowmage/minitest-rails-capybara
https://github.com/blowmage/minitest-rails-capybara/blob/b2664ae1290f194f1e547342c6f0012a4859e717/lib/generators/minitest/feature/templates/feature_test.rb
lib/generators/minitest/feature/templates/feature_test.rb
require "test_helper" class <%= class_name %>Test < Capybara::Rails::TestCase # test "sanity" do # visit root_path # assert_content page, "Hello World" # refute_content page, "Goodbye All!" # end end
ruby
MIT
b2664ae1290f194f1e547342c6f0012a4859e717
2026-01-04T17:48:44.113676Z
false
blowmage/minitest-rails-capybara
https://github.com/blowmage/minitest-rails-capybara/blob/b2664ae1290f194f1e547342c6f0012a4859e717/lib/generators/minitest/feature/templates/feature_spec.rb
lib/generators/minitest/feature/templates/feature_spec.rb
require "test_helper" feature "<%= class_name %>" do # scenario "the test is sound" do # visit root_path # page.must_have_content "Hello World" # page.wont_have_content "Goodbye All!" # end end
ruby
MIT
b2664ae1290f194f1e547342c6f0012a4859e717
2026-01-04T17:48:44.113676Z
false
nhoizey/jekyll-postfiles
https://github.com/nhoizey/jekyll-postfiles/blob/14c161dece423ecf731c04fb84ad486ac7f19275/spec/jekyll_postfiles_spec.rb
spec/jekyll_postfiles_spec.rb
require "spec_helper" describe Jekyll::PostFiles do let(:page) { make_page } let(:site) { make_site } let(:post) { make_post } let(:context) { make_context(:page => page, :site => site) } let(:url) { "" } before do Jekyll.logger.log_level = :error site.process end it "c...
ruby
MIT
14c161dece423ecf731c04fb84ad486ac7f19275
2026-01-04T17:48:46.711514Z
false
nhoizey/jekyll-postfiles
https://github.com/nhoizey/jekyll-postfiles/blob/14c161dece423ecf731c04fb84ad486ac7f19275/spec/spec_helper.rb
spec/spec_helper.rb
$LOAD_PATH.unshift File.expand_path("../lib", __dir__) require "jekyll" require "jekyll-postfiles" ENV["JEKYLL_LOG_LEVEL"] = "error" def dest_dir File.expand_path("../tmp/dest", __dir__) end def source_dir File.expand_path("fixtures", __dir__) end CONFIG_DEFAULTS = { "source" => source_dir, "destinatio...
ruby
MIT
14c161dece423ecf731c04fb84ad486ac7f19275
2026-01-04T17:48:46.711514Z
false
nhoizey/jekyll-postfiles
https://github.com/nhoizey/jekyll-postfiles/blob/14c161dece423ecf731c04fb84ad486ac7f19275/lib/jekyll-postfiles.rb
lib/jekyll-postfiles.rb
# frozen_string_literal: true require "jekyll/postfiles"
ruby
MIT
14c161dece423ecf731c04fb84ad486ac7f19275
2026-01-04T17:48:46.711514Z
false
nhoizey/jekyll-postfiles
https://github.com/nhoizey/jekyll-postfiles/blob/14c161dece423ecf731c04fb84ad486ac7f19275/lib/jekyll/postfiles.rb
lib/jekyll/postfiles.rb
# frozen_string_literal: true require "jekyll" require "pathname" module Jekyll module PostFiles # there's a bug in the regex Document::DATE_FILENAME_MATCHER: # %r!^(?:.+/)*(\d{2,4}-\d{1,2}-\d{1,2})-(.*)(\.[^.]+)$! # used by: # jekyll/lib/jekyll/readers/post_reader.rb#read_posts # which ult...
ruby
MIT
14c161dece423ecf731c04fb84ad486ac7f19275
2026-01-04T17:48:46.711514Z
false
nhoizey/jekyll-postfiles
https://github.com/nhoizey/jekyll-postfiles/blob/14c161dece423ecf731c04fb84ad486ac7f19275/lib/jekyll/postfiles/version.rb
lib/jekyll/postfiles/version.rb
# frozen_string_literal: true module Jekyll module PostFiles VERSION = "3.1.0" end end
ruby
MIT
14c161dece423ecf731c04fb84ad486ac7f19275
2026-01-04T17:48:46.711514Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/indent_block_spec.rb
spec/indent_block_spec.rb
require 'spec_helper' describe Minidown do describe 'indent should parse as code block' do it 'should parse correct' do str =<<HERE Here is a Python code example without syntax highlighting: def foo: if not bar: return true HERE Minidown.render(str).should == "<p>Here is a Python c...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/h1_and_h2_spec.rb
spec/h1_and_h2_spec.rb
require 'spec_helper' describe Minidown do describe '======== or -------' do it 'should parse as text' do %w{===== =====hello ------nihao}.each do |str| Minidown.render(str).should == "<p>#{str}</p>" end end it 'should parse as h1' do %w{======= ==== === = ==}.each do |s| ...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/code_block_spec.rb
spec/code_block_spec.rb
require 'spec_helper' describe Minidown do describe 'code_block' do it 'should parse correct' do str =<<HERE ``` should in code block in block ``` HERE Minidown.render(str).should == "<pre><code>should in code block\n\nin block</code></pre>" end it 'should allow tildes as well as backquotes...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/raw_html_spec.rb
spec/raw_html_spec.rb
require 'spec_helper' describe Minidown do describe 'raw html spec' do it 'should render correctly' do Minidown.render('<a></a>').should == "<p><a></a></p>" end it 'should render mutilple line well' do str = '<table> <tr> <td>first</td> </tr> <tr> <td>second</td> </tr> </table>' Minido...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/li_spec.rb
spec/li_spec.rb
require 'spec_helper' describe Minidown do describe 'ul' do it 'should basic parse correct' do %w{* + -}.each do |s| str = "#{s} ul" Minidown.render(str).should == '<ul><li>ul</li></ul>' str = " #{s} ul" Minidown.render(str).should == '<ul><li>ul</li></ul>' str = "#{...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/blank_line_spec.rb
spec/blank_line_spec.rb
require 'spec_helper' describe Minidown do describe 'blank line' do it 'should parse as nothing' do ['', "\n", "\n\n", "\n\n\n\n"].each do |str| Minidown.render(str).should == '' end end it 'should be ignore when blank is the first line' do str = "\na" Minidown.render(str...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/table_spec.rb
spec/table_spec.rb
require 'spec_helper' describe Minidown do describe 'table' do it 'should parse correct' do str =<<HERE First Header | Second Header ------------- | ------------- Content Cell | Content Cell Content Cell | Content Cell HERE Minidown.render(str).should == '<table><thead><tr><th>First Header</th><th...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/start_with_shape_spec.rb
spec/start_with_shape_spec.rb
require 'spec_helper' describe Minidown do describe '###### title' do it 'should parse "#" as text' do Minidown.render('#').should == '<p>#</p>' end it 'should parse "#####"' do (2..7).map{|n| '#' * n}.each do |str| tag = "h#{str.size - 1}" Minidown.render(str).should == "<#{...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/paragraph_spec.rb
spec/paragraph_spec.rb
require 'spec_helper' describe Minidown do describe 'paragraph' do it 'should correct' do str = 'line1 line2 new paragraph some space same paragraph new p' Minidown.render(str).should == '<p>line1<br>line2</p><p>new paragraph<br> some space<br>same paragraph</p><p>new p</p>' end end en...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/start_with_gt_spec.rb
spec/start_with_gt_spec.rb
require 'spec_helper' describe Minidown do describe 'start with <' do it 'should parse as blockquote' do [">block", "> block", "> block", "> block"].each do |str| Minidown.render(str).should == "<blockquote><p>#{str[1..-1].strip}</p></blockquote>" end end it 'should parse correc...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/text_element_spec.rb
spec/text_element_spec.rb
require 'spec_helper' describe Minidown do describe 'text element' do it 'escape' do str = "<>" Minidown.render(str).should == "<p>&lt;&gt;</p>" end it 'escape special symbol' do str = '\\\\ \\` \\* \\_ \\{ \\} \\[ \\] \\( \\) \\# \\+ \\- \\. \\!' Minidown.render(str).should ==...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/dividing_line_spec.rb
spec/dividing_line_spec.rb
require 'spec_helper' describe Minidown do describe 'dividing line' do it 'parsed correct' do str = '***' Minidown.render(str).should == '<hr>' str = '---' Minidown.render(str).should == '<hr>' str = ' *** ' Minidown.render(str).should == '<hr>' str = ' * * * ' Min...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/task_list_spec.rb
spec/task_list_spec.rb
require 'spec_helper' describe Minidown do describe 'task list' do it 'should parse correct' do str =<<HERE - [ ] a task list item - [ ] list syntax required - [ ] normal **formatting**, @mentions, #1234 refs - [ ] incomplete - [x] completed HERE Minidown.render(str).should == '<ul class="task-...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/spec_helper.rb
spec/spec_helper.rb
require 'minidown' require 'pry'
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/spec/minidown_spec.rb
spec/minidown_spec.rb
require 'spec_helper' describe Minidown do it 'Minidown.render should == Parser#render' do Minidown.render("hello").should == Minidown::Parser.new.render("hello") end it 'allow options' do options = {} Minidown.render("hello", options).should == Minidown::Parser.new(options).render("hello") end en...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/lib/minidown.rb
lib/minidown.rb
require "minidown/version" require 'minidown/parser' require 'minidown/utils' require 'minidown/elements' require 'minidown/document' module Minidown class << self def render str, options = {} Parser.new(options).render str end end end
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/lib/minidown/element.rb
lib/minidown/element.rb
require 'minidown/html_helper' module Minidown class Element attr_accessor :content, :doc, :nodes, :children include HtmlHelper def raw_content @content end def raw_content= str @content = str end def unparsed_lines doc.lines end def initialize doc, cont...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/lib/minidown/version.rb
lib/minidown/version.rb
module Minidown VERSION = "2.1.1" end
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/lib/minidown/elements.rb
lib/minidown/elements.rb
require 'minidown/element' require 'minidown/elements/raw_html_element' require 'minidown/elements/html_element' require 'minidown/elements/line_element' require 'minidown/elements/text_element' require 'minidown/elements/block_element' require 'minidown/elements/table_element' require 'minidown/elements/paragraph_elem...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/lib/minidown/utils.rb
lib/minidown/utils.rb
module Minidown module Utils Regexp = { lines: /\n|\r\n/, blank_line: /\A\s*\z/, raw_html: /\A\s*(\<(?=[^\<\>]).+(?<=[^\<\>])\>)*\s*\z/, h1_or_h2: /\A([=-]{3,})(.*)/, start_with_shape: /\A(\#{1,6})\s*(.+?)\s*#*\z/, start_with_quote: /\A\>\s*(.+)/, unorder_list: /\A(\s*)[*...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/lib/minidown/parser.rb
lib/minidown/parser.rb
module Minidown class Parser def initialize options = {} @options = options.freeze end def render str parse(str).to_html end protected def parse str lines = str.split Utils::Regexp[:lines] doc = Document.new lines, @options doc.parse doc end end end
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/lib/minidown/document.rb
lib/minidown/document.rb
module Minidown class Document attr_accessor :lines, :nodes, :links_ref, :options attr_reader :within_block RefRegexp = { link_ref_define: /\A\s*\[(.+)\]\:\s+(\S+)\s*(.*)/, link_title: /((?<=\").+?(?=\"))/ } TagRegexp ={ h1h6: /\Ah[1-6]\z/ } def initialize lines, optio...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/lib/minidown/html_helper.rb
lib/minidown/html_helper.rb
module Minidown module HtmlHelper def build_tag name, attr = nil content = '' yield content if block_given? if attr attr = attr.map{|k, v| "#{k}=\"#{v}\""}.join ' '.freeze "<#{name} #{attr}>#{content}</#{name}>" else "<#{name}>#{content}</#{name}>" end end...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/lib/minidown/elements/html_element.rb
lib/minidown/elements/html_element.rb
module Minidown class HtmlElement < Element attr_reader :name def initialize doc, content, name super doc, content @name = name end def parse nodes << self end def to_html build_tag @name do |tag| # self.content is some Element self.content = cont...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/lib/minidown/elements/dividing_line_element.rb
lib/minidown/elements/dividing_line_element.rb
module Minidown class DividingLineElement < Element def parse nodes << self end def to_html '<hr>' end end end
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/lib/minidown/elements/list_group_element.rb
lib/minidown/elements/list_group_element.rb
module Minidown class ListGroupElement < Element IndentRegexp = /\A\s{4,}(.+)/ StartWithBlankRegexp = /\A\s+(.+)/ attr_accessor :lists, :indent_level def parse nodes << self while line = unparsed_lines.shift #handle nested list if (line =~ UnorderListElement::Nest...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/lib/minidown/elements/table_element.rb
lib/minidown/elements/table_element.rb
module Minidown class TableElement < Element AlignSpecRegexp = /\A\|?\s*([\-:]\-+[\-:]\s*(?:\|\s*[\-:]\-+[\-:]\s*)*)\|?\s*\z/ def initialize doc, content, raw_head super doc, content @raw_head = raw_head @heads = @raw_head.split('|'.freeze).map! &:strip @column_count = @heads.count ...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/lib/minidown/elements/indent_code_element.rb
lib/minidown/elements/indent_code_element.rb
module Minidown class IndentCodeElement < Element def initialize *_ super @lines = [content] end def parse while line = unparsed_lines.shift case line when Utils::Regexp[:indent_code] @lines << $1 else unparsed_lines.unshift line bre...
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false
jjyr/minidown
https://github.com/jjyr/minidown/blob/675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a/lib/minidown/elements/raw_html_element.rb
lib/minidown/elements/raw_html_element.rb
module Minidown class RawHtmlElement < Element def parse nodes << self end def to_html content end end end
ruby
MIT
675e535bf6e559c4a2ae4174fbf1c7a160f8ed5a
2026-01-04T17:48:47.033200Z
false