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 |
|---|---|---|---|---|---|---|---|---|
flyerhzm/bullet | https://github.com/flyerhzm/bullet/blob/5f4173292a0566ca5ba0b1ff8e1d6362f3be85b0/lib/bullet/registry/call_stack.rb | lib/bullet/registry/call_stack.rb | # frozen_string_literal: true
module Bullet
module Registry
class CallStack < Base
# remembers found association backtrace
def add(key)
@registry[key] ||= Thread.current.backtrace
end
end
end
end
| ruby | MIT | 5f4173292a0566ca5ba0b1ff8e1d6362f3be85b0 | 2026-01-04T15:39:36.933591Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/spec/omniauth_spec.rb | spec/omniauth_spec.rb | require 'helper'
describe OmniAuth do
describe '.strategies' do
it 'increases when a new strategy is made' do
expect do
class ExampleStrategy
include OmniAuth::Strategy
end
end.to change(OmniAuth.strategies, :size).by(1)
expect(OmniAuth.strategies.last).to eq(ExampleSt... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/spec/helper.rb | spec/helper.rb | require 'simplecov'
require 'coveralls'
require 'simplecov-lcov'
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::LcovFormatter,
Coveralls::SimpleCov::Formatter
]
SimpleCov.start do
add_filter ['/spec... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/spec/omniauth/form_spec.rb | spec/omniauth/form_spec.rb | require 'helper'
describe OmniAuth::Form do
describe '.build' do
it 'yields the instance when called with a block and argument' do
OmniAuth::Form.build { |f| expect(f).to be_kind_of(OmniAuth::Form) }
end
it 'evaluates in the instance when called with a block and no argument' do
f = OmniAuth:... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/spec/omniauth/strategy_spec.rb | spec/omniauth/strategy_spec.rb | require 'helper'
def make_env(path = '/auth/test', props = {})
{
'REQUEST_METHOD' => 'POST',
'PATH_INFO' => path,
'rack.session' => {},
'rack.input' => StringIO.new('test=true')
}.merge(props)
end
describe OmniAuth::Strategy do
let(:app) do
lambda { |_env| [404, {}, ['Awesome']] }
end
l... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | true |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/spec/omniauth/failure_endpoint_spec.rb | spec/omniauth/failure_endpoint_spec.rb | require 'helper'
describe OmniAuth::FailureEndpoint do
subject { OmniAuth::FailureEndpoint }
context 'raise-out environment' do
before do
@rack_env = ENV['RACK_ENV']
ENV['RACK_ENV'] = 'test'
@default = OmniAuth.config.failure_raise_out_environments
OmniAuth.config.failure_raise_out_en... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/spec/omniauth/builder_spec.rb | spec/omniauth/builder_spec.rb | require 'helper'
describe OmniAuth::Builder do
describe '#provider' do
it 'translates a symbol to a constant' do
expect(OmniAuth::Strategies).to receive(:const_get).with('MyStrategy', false).and_return(Class.new)
OmniAuth::Builder.new(nil) do
provider :my_strategy
end
end
it 'a... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/spec/omniauth/auth_hash_spec.rb | spec/omniauth/auth_hash_spec.rb | require 'helper'
describe OmniAuth::AuthHash do
subject { OmniAuth::AuthHash.new }
it 'converts a supplied info key into an InfoHash object' do
subject.info = {:first_name => 'Awesome'}
expect(subject.info).to be_kind_of(OmniAuth::AuthHash::InfoHash)
expect(subject.info.first_name).to eq('Awesome')
e... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/spec/omniauth/key_store_spec.rb | spec/omniauth/key_store_spec.rb | require 'helper'
RSpec.describe OmniAuth::KeyStore do
let(:logger) { double('Logger') }
around(:each) do |example|
patched = monkey_patch_logger
example.run
remove_logger(patched)
end
context 'on Hashie < 3.5.0' do
let(:version) { '3.4.0' }
it 'does not log anything to the console' do
... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/spec/omniauth/strategies/developer_spec.rb | spec/omniauth/strategies/developer_spec.rb | require 'helper'
describe OmniAuth::Strategies::Developer do
let(:app) do
Rack::Builder.new do |b|
b.use Rack::Session::Cookie, :secret => 'abc123'
b.use OmniAuth::Strategies::Developer
b.run lambda { |_env| [200, {}, ['Not Found']] }
end.to_app
end
context 'request phase' do
befor... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/lib/omniauth.rb | lib/omniauth.rb | # TODO: Fixed in https://github.com/rack/rack/pull/1610 for Rack 3
if defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
require 'delegate'
end
require 'rack'
require 'singleton'
require 'logger'
module OmniAuth
class Error < StandardError; end
module Strategies
autoload :Developer, 'omniauth/strategies/develo... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/lib/omniauth/test.rb | lib/omniauth/test.rb | module OmniAuth
# Support for testing OmniAuth strategies.
module Test
autoload :PhonySession, 'omniauth/test/phony_session'
autoload :StrategyMacros, 'omniauth/test/strategy_macros'
autoload :StrategyTestCase, 'omniauth/test/strategy_test_case'
end
end
| ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/lib/omniauth/authenticity_token_protection.rb | lib/omniauth/authenticity_token_protection.rb | require 'rack-protection'
module OmniAuth
class AuthenticityError < StandardError; end
class AuthenticityTokenProtection < Rack::Protection::AuthenticityToken
def initialize(options = {})
@options = default_options.merge(options)
end
def self.call(env)
new.call!(env)
end
def call!... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/lib/omniauth/version.rb | lib/omniauth/version.rb | module OmniAuth
VERSION = '2.1.4'.freeze
end
| ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/lib/omniauth/strategy.rb | lib/omniauth/strategy.rb | require 'omniauth/key_store'
module OmniAuth
class NoSessionError < StandardError; end
# The Strategy is the base unit of OmniAuth's ability to
# wrangle multiple providers. Each strategy provided by
# OmniAuth includes this mixin to gain the default functionality
# necessary to be compatible with the OmniAu... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/lib/omniauth/form.rb | lib/omniauth/form.rb | module OmniAuth
class Form
DEFAULT_CSS = File.read(File.expand_path('../form.css', __FILE__))
attr_accessor :options
def initialize(options = {})
options[:title] ||= 'Authentication Info Required'
options[:header_info] ||= ''
options[:method] ||= 'post'
self.options = options
... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/lib/omniauth/failure_endpoint.rb | lib/omniauth/failure_endpoint.rb | module OmniAuth
# This simple Rack endpoint that serves as the default
# 'failure' mechanism for OmniAuth. If a strategy fails for
# any reason this endpoint will be invoked. The default behavior
# is to redirect to `/auth/failure` except in the case of
# a development `RACK_ENV`, in which case an exception w... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/lib/omniauth/auth_hash.rb | lib/omniauth/auth_hash.rb | require 'omniauth/key_store'
module OmniAuth
# The AuthHash is a normalized schema returned by all OmniAuth
# strategies. It maps as much user information as the provider
# is able to provide into the InfoHash (stored as the `'info'`
# key).
class AuthHash < OmniAuth::KeyStore
def self.subkey_class
... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/lib/omniauth/key_store.rb | lib/omniauth/key_store.rb | require 'hashie/mash'
module OmniAuth
# Generic helper hash that allows method access on deeply nested keys.
class KeyStore < ::Hashie::Mash
# Disables warnings on Hashie 3.5.0+ for overwritten keys
def self.override_logging
require 'hashie/version'
return unless Gem::Version.new(Hashie::VERSIO... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/lib/omniauth/builder.rb | lib/omniauth/builder.rb | module OmniAuth
class Builder < ::Rack::Builder
def on_failure(&block)
OmniAuth.config.on_failure = block
end
def before_options_phase(&block)
OmniAuth.config.before_options_phase = block
end
def before_request_phase(&block)
OmniAuth.config.before_request_phase = block
end
... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/lib/omniauth/test/phony_session.rb | lib/omniauth/test/phony_session.rb | module OmniAuth
module Test
class PhonySession
def initialize(app)
@app = app
end
def call(env)
@session ||= (env['rack.session'] || {})
env['rack.session'] = @session
@app.call(env)
end
end
end
end
| ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/lib/omniauth/test/strategy_macros.rb | lib/omniauth/test/strategy_macros.rb | module OmniAuth
module Test
module StrategyMacros
def sets_an_auth_hash
it 'sets an auth hash' do
expect(last_request.env['omniauth.auth']).to be_kind_of(Hash)
end
end
def sets_provider_to(provider)
it "sets the provider to #{provider}" do
expect((las... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/lib/omniauth/test/strategy_test_case.rb | lib/omniauth/test/strategy_test_case.rb | require 'rack'
require 'omniauth/test'
module OmniAuth
module Test
# Support for testing OmniAuth strategies.
#
# @example Usage
# class MyStrategyTest < Test::Unit::TestCase
# include OmniAuth::Test::StrategyTestCase
# def strategy
# # return the parameters to a Rack::Bui... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
omniauth/omniauth | https://github.com/omniauth/omniauth/blob/20ac5e05a39d58d18aca6419599f7176208f985d/lib/omniauth/strategies/developer.rb | lib/omniauth/strategies/developer.rb | module OmniAuth
module Strategies
# The Developer strategy is a very simple strategy that can be used as a
# placeholder in your application until a different authentication strategy
# is swapped in. It has zero security and should *never* be used in a
# production setting.
#
# ## Usage
#
... | ruby | MIT | 20ac5e05a39d58d18aca6419599f7176208f985d | 2026-01-04T15:39:12.494207Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/spec/github_changelog_generator_spec.rb | spec/github_changelog_generator_spec.rb | # frozen_string_literal: true
RSpec.describe GitHubChangelogGenerator::ChangelogGenerator do
describe "#run" do
let(:arguments) { [] }
let(:instance) { described_class.new(arguments) }
let(:output_path) { File.join(__dir__, "tmp", "test.output") }
after { FileUtils.rm_rf(output_path) }
let(:ge... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
#
# Author:: Enrico Stahn <mail@enricostahn.com>
#
# Copyright 2014, Zanui, <engineering@zanui.com.au>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# h... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/spec/unit/reader_spec.rb | spec/unit/reader_spec.rb | # frozen_string_literal: true
#
# Author:: Enrico Stahn <mail@enricostahn.com>
#
# Copyright 2014, Zanui, <engineering@zanui.com.au>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# h... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/spec/unit/parser_spec.rb | spec/unit/parser_spec.rb | # frozen_string_literal: true
describe GitHubChangelogGenerator::Parser do
let(:argv) { [] }
before do
# Calling abort will abort the test run, allow calls to abort to not accidentaly get positive falses
allow(Kernel).to receive(:abort)
end
describe ".parse_options" do
context "when required argu... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/spec/unit/parser_file_spec.rb | spec/unit/parser_file_spec.rb | # frozen_string_literal: true
describe GitHubChangelogGenerator::ParserFile do
describe ".github_changelog_generator" do
let(:options) { {} }
let(:parser) { described_class.new(options, StringIO.new(file)) }
context "when the well-known default file does not exist" do
let(:parser) { described_clas... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/spec/unit/octo_fetcher_spec.rb | spec/unit/octo_fetcher_spec.rb | # frozen_string_literal: true
VALID_TOKEN = "0123456789abcdef"
INVALID_TOKEN = "0000000000000000"
describe GitHubChangelogGenerator::OctoFetcher do
let(:options) do
{
user: "github-changelog-generator",
project: "changelog_test"
}
end
let(:fetcher) { GitHubChangelogGenerator::OctoFetcher.ne... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/spec/unit/options_spec.rb | spec/unit/options_spec.rb | # frozen_string_literal: true
RSpec.describe GitHubChangelogGenerator::Options do
describe "#initialize" do
context "with known options" do
it "instantiates successfully" do
expect(described_class.new(user: "olle")[:user]).to eq("olle")
end
end
context "with unknown options" do
... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/spec/unit/generator/entry_spec.rb | spec/unit/generator/entry_spec.rb | # frozen_string_literal: true
module GitHubChangelogGenerator
RSpec.describe Entry do
def label(name)
{ "name" => name }
end
def issue(title, labels, body = "", number = "1", user = { "login" => "user" })
{
"title" => "issue #{title}",
"labels" => labels.map { |l| label(l) },... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | true |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/spec/unit/generator/generator_tags_spec.rb | spec/unit/generator/generator_tags_spec.rb | # frozen_string_literal: true
describe GitHubChangelogGenerator::Generator do
def tag_with_name(tag)
{
"name" => tag
}
end
def tags_from_strings(tags_strings)
tags_strings.map do |tag|
tag_with_name(tag)
end
end
describe "#detect_link_tag_time" do
let(:newer_tag) { nil }
... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/spec/unit/generator/generator_processor_spec.rb | spec/unit/generator/generator_processor_spec.rb | # frozen_string_literal: true
module GitHubChangelogGenerator
describe Generator do
let(:default_options) { GitHubChangelogGenerator::Parser.default_options.merge(verbose: false) }
let(:options) { {} }
let(:generator) { described_class.new(default_options.merge(options)) }
let(:bad_label) { { "name" ... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/spec/unit/generator/section_spec.rb | spec/unit/generator/section_spec.rb | # frozen_string_literal: true
module GitHubChangelogGenerator
RSpec.describe Section do
let(:options) { {} }
subject(:section) { described_class.new(options) }
describe "#encapsulate_string" do
let(:string) { "" }
context "with the empty string" do
it "returns the string" do
... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/spec/unit/generator/generator_spec.rb | spec/unit/generator/generator_spec.rb | # frozen_string_literal: true
require "github_changelog_generator/generator/generator"
RSpec.describe GitHubChangelogGenerator::Generator do
let(:header) { "# Changelog" }
let(:generator) { described_class.new({ header: header }) }
let(:content) do
<<~'BASE'
## [1.3.10](https://github.com/xxx/yyy/tree... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator.rb | lib/github_changelog_generator.rb | # frozen_string_literal: true
require "octokit"
require "faraday-http-cache"
require "logger"
require "active_support"
require "active_support/core_ext/object/blank"
require "json"
require "benchmark"
require "github_changelog_generator/helper"
require "github_changelog_generator/options"
require "github_changelog_ge... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/task.rb | lib/github_changelog_generator/task.rb | # frozen_string_literal: true
require "rake"
require "rake/tasklib"
require "github_changelog_generator"
module GitHubChangelogGenerator
class RakeTask < ::Rake::TaskLib
include ::Rake::DSL if defined?(::Rake::DSL)
OPTIONS = %w[ user project token date_format output
bug_prefix enhancement... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/version.rb | lib/github_changelog_generator/version.rb | # frozen_string_literal: true
module GitHubChangelogGenerator
VERSION = "1.16.4"
end
| ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/options.rb | lib/github_changelog_generator/options.rb | # frozen_string_literal: true
require "delegate"
require "github_changelog_generator/helper"
module GitHubChangelogGenerator
# This class wraps Options, and knows a list of known options. Others options
# will raise exceptions.
class Options < SimpleDelegator
# Raised on initializing with unknown keys in th... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/reader.rb | lib/github_changelog_generator/reader.rb | # frozen_string_literal: true
#
# Author:: Enrico Stahn <mail@enricostahn.com>
#
# Copyright 2014, Zanui, <engineering@zanui.com.au>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# h... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/parser.rb | lib/github_changelog_generator/parser.rb | # frozen_string_literal: true
require "github_changelog_generator/helper"
require "github_changelog_generator/argv_parser"
require "github_changelog_generator/parser_file"
require "github_changelog_generator/file_parser_chooser"
module GitHubChangelogGenerator
class Parser
class << self
PARSERS = [
... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/parser_file.rb | lib/github_changelog_generator/parser_file.rb | # frozen_string_literal: true
module GitHubChangelogGenerator
ParserError = Class.new(StandardError)
# ParserFile is a configuration file reader which sets options in the
# given Hash.
#
# In your project's root, you can put a file named
# <tt>.github_changelog_generator</tt> to override defaults.
#
#... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/file_parser_chooser.rb | lib/github_changelog_generator/file_parser_chooser.rb | # frozen_string_literal: true
require "pathname"
module GitHubChangelogGenerator
class FileParserChooser
def initialize(options)
@options = options
@config_file = Pathname.new(options[:config_file])
end
def parse!(_argv)
return nil unless (path = resolve_path)
ParserFile.new(@o... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/octo_fetcher.rb | lib/github_changelog_generator/octo_fetcher.rb | # frozen_string_literal: true
require "tmpdir"
require "async"
require "async/barrier"
require "async/semaphore"
require "async/http/faraday"
module GitHubChangelogGenerator
# A Fetcher responsible for all requests to GitHub and all basic manipulation with related data
# (such as filtering, validating, e.t.c)
#... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/helper.rb | lib/github_changelog_generator/helper.rb | # frozen_string_literal: true
require "logger"
require "rainbow"
module GitHubChangelogGenerator
module Helper
# @return true if the currently running program is a unit test
def self.test?
defined? SpecHelper
end
# :nocov:
@log ||= if test?
Logger.new(nil) # don't show any ... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/argv_parser.rb | lib/github_changelog_generator/argv_parser.rb | # frozen_string_literal: true
require "optparse"
require "github_changelog_generator/version"
module GitHubChangelogGenerator
class ArgvParser
attr_reader :options
def initialize(options = {})
@options = options
end
def parse!(argv)
parser.parse(argv)
rescue OptionParser::ParseErro... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/generator/entry.rb | lib/github_changelog_generator/generator/entry.rb | # frozen_string_literal: true
require "github_changelog_generator/generator/section"
module GitHubChangelogGenerator
# This class generates the content for a single changelog entry. An entry is
# generally either for a specific tagged release or the collection of
# unreleased changes.
#
# An entry is compri... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/generator/generator_processor.rb | lib/github_changelog_generator/generator/generator_processor.rb | # frozen_string_literal: true
module GitHubChangelogGenerator
class Generator
# delete all issues with labels from options[:exclude_labels] array
# @param [Array] issues
# @return [Array] filtered array
def exclude_issues_by_labels(issues)
return issues if !options[:exclude_labels] || options[:... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/generator/section.rb | lib/github_changelog_generator/generator/section.rb | # frozen_string_literal: true
module GitHubChangelogGenerator
# This class generates the content for a single section of a changelog entry.
# It turns the tagged issues and PRs into a well-formatted list of changes to
# be later incorporated into a changelog entry.
#
# @see GitHubChangelogGenerator::Entry
... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/generator/generator_tags.rb | lib/github_changelog_generator/generator/generator_tags.rb | # frozen_string_literal: true
module GitHubChangelogGenerator
class Generator
# fetch, filter tags, fetch dates and sort them in time order
def fetch_and_filter_tags
since_tag
due_tag
all_tags = @fetcher.fetch_all_tags
fetch_tags_dates(all_tags) # Creates a Hash @tag_times_hash
... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/generator/generator.rb | lib/github_changelog_generator/generator/generator.rb | # frozen_string_literal: true
require "github_changelog_generator/octo_fetcher"
require "github_changelog_generator/generator/generator_fetcher"
require "github_changelog_generator/generator/generator_processor"
require "github_changelog_generator/generator/generator_tags"
require "github_changelog_generator/generator... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
github-changelog-generator/github-changelog-generator | https://github.com/github-changelog-generator/github-changelog-generator/blob/df6622dbdc907e7c3a4f851383a47c47715393b2/lib/github_changelog_generator/generator/generator_fetcher.rb | lib/github_changelog_generator/generator/generator_fetcher.rb | # frozen_string_literal: true
module GitHubChangelogGenerator
class Generator
# Fetch event for issues and pull requests
# @return [Array] array of fetched issues
def fetch_events_for_issues_and_pr
print "Fetching events for issues and PR: 0/#{@issues.count + @pull_requests.count}\r" if options[:ve... | ruby | MIT | df6622dbdc907e7c3a4f851383a47c47715393b2 | 2026-01-04T15:39:33.741598Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/simple_form_test.rb | test/simple_form_test.rb | # frozen_string_literal: true
require 'test_helper'
class SimpleFormTest < ActiveSupport::TestCase
test 'setup block yields self' do
SimpleForm.setup do |config|
assert_equal SimpleForm, config
end
end
test 'setup block configure Simple Form' do
SimpleForm.setup do |config|
assert_equal ... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/test_helper.rb | test/test_helper.rb | # frozen_string_literal: true
require 'minitest/autorun'
require 'active_model'
require 'action_controller'
require 'action_view'
ActionView::RoutingUrlFor.include ActionDispatch::Routing::UrlFor
require 'action_view/template'
require 'action_view/test_case'
module Rails
def self.env
ActiveSupport::StringInqu... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/support/mock_controller.rb | test/support/mock_controller.rb | # frozen_string_literal: true
class MockController
attr_writer :action_name
def _routes
self
end
def action_name
defined?(@action_name) ? @action_name : "edit"
end
def url_for(*)
"http://example.com"
end
def url_options
{}
end
def polymorphic_mappings(*); {}; end
def hash_for... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/support/misc_helpers.rb | test/support/misc_helpers.rb | # frozen_string_literal: true
module MiscHelpers
def store_translations(locale, translations, &block)
I18n.backend.store_translations locale, translations
yield
ensure
I18n.reload!
I18n.backend.send :init_translations
end
def assert_no_select(selector, value = nil)
assert_select(selector, t... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/support/models.rb | test/support/models.rb | # frozen_string_literal: true
Association = Struct.new(:klass, :name, :macro, :scope, :options)
Column = Struct.new(:name, :type, :limit) do
end
Relation = Struct.new(:records) do
delegate :each, to: :records
def where(conditions = nil)
self.class.new conditions ? [records.first] : records
end
def order... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/support/discovery_inputs.rb | test/support/discovery_inputs.rb | # frozen_string_literal: true
class StringInput < SimpleForm::Inputs::StringInput
def input(wrapper_options = nil)
"<section>#{super}</section>".html_safe
end
end
class NumericInput < SimpleForm::Inputs::NumericInput
def input(wrapper_options = nil)
"<section>#{super}</section>".html_safe
end
end
clas... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/form_builder/wrapper_test.rb | test/form_builder/wrapper_test.rb | # frozen_string_literal: true
require 'test_helper'
class WrapperTest < ActionView::TestCase
test 'wrapper does not have error class for attribute without errors' do
with_form_for @user, :active
assert_no_select 'div.field_with_errors'
end
test 'wrapper does not have error class when object is not prese... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/form_builder/error_test.rb | test/form_builder/error_test.rb | # frozen_string_literal: true
require 'test_helper'
# Tests for f.error and f.full_error
class ErrorTest < ActionView::TestCase
def with_error_for(object, *args)
with_concat_form_for(object) do |f|
f.error(*args)
end
end
def with_full_error_for(object, *args)
with_concat_form_for(object) do |f... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/form_builder/association_test.rb | test/form_builder/association_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class AssociationTest < ActionView::TestCase
def with_association_for(object, *args)
with_concat_form_for(object) do |f|
f.association(*args)
end
end
test 'builder does not allow creating an association input when no object exis... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/form_builder/general_test.rb | test/form_builder/general_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class FormBuilderTest < ActionView::TestCase
def with_custom_form_for(object, *args, &block)
with_concat_custom_form_for(object) do |f|
f.input(*args, &block)
end
end
test 'nested simple fields yields an instance of FormBuilder'... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/form_builder/label_test.rb | test/form_builder/label_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class LabelTest < ActionView::TestCase
def with_label_for(object, *args, &block)
with_concat_form_for(object) do |f|
f.label(*args, &block)
end
end
test 'builder generates a label for the attribute' do
with_label_for @user, ... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/form_builder/button_test.rb | test/form_builder/button_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class ButtonTest < ActionView::TestCase
def with_button_for(object, *args)
with_concat_form_for(object) do |f|
f.button(*args)
end
end
test 'builder creates buttons' do
with_button_for :post, :submit
assert_select 'form ... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/form_builder/error_notification_test.rb | test/form_builder/error_notification_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
# Tests for f.error_notification
class ErrorNotificationTest < ActionView::TestCase
def with_error_notification_for(object, options = {}, &block)
with_concat_form_for(object) do |f|
f.error_notification(options)
end
end
test 'er... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/form_builder/hint_test.rb | test/form_builder/hint_test.rb | # frozen_string_literal: true
require 'test_helper'
# Tests for f.hint
class HintTest < ActionView::TestCase
def with_hint_for(object, *args)
with_concat_form_for(object) do |f|
f.hint(*args)
end
end
test 'hint does not be generated by default' do
with_hint_for @user, :name
assert_no_selec... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/form_builder/input_field_test.rb | test/form_builder/input_field_test.rb | # frozen_string_literal: true
require 'test_helper'
# Tests for f.input_field
class InputFieldTest < ActionView::TestCase
test "builder input_field only renders the input tag, nothing else" do
with_input_field_for @user, :name
assert_select 'form > input.required.string'
assert_no_select 'div.string'
... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/action_view_extensions/form_helper_test.rb | test/action_view_extensions/form_helper_test.rb | # frozen_string_literal: true
require 'test_helper'
class FormHelperTest < ActionView::TestCase
test 'SimpleForm for yields an instance of FormBuilder' do
simple_form_for :user do |f|
assert f.instance_of?(SimpleForm::FormBuilder)
end
end
test 'SimpleForm adds default class to form' do
with_c... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/action_view_extensions/builder_test.rb | test/action_view_extensions/builder_test.rb | # frozen_string_literal: true
require 'test_helper'
class BuilderTest < ActionView::TestCase
def with_custom_form_for(object, *args, &block)
with_concat_custom_form_for(object) do |f|
assert f.instance_of?(CustomFormBuilder)
yield f
end
end
def with_collection_radio_buttons(object, attribute... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/components/label_test.rb | test/components/label_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
# Isolated tests for label without triggering f.label.
class IsolatedLabelTest < ActionView::TestCase
def with_label_for(object, attribute_name, type, options = {})
with_concat_form_for(object) do |f|
options[:reflection] = Association.n... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/components/custom_components_test.rb | test/components/custom_components_test.rb | # frozen_string_literal: true
require 'test_helper'
# Module that represents a custom component.
module Numbers
def number(wrapper_options = nil)
@number ||= options[:number].to_s.html_safe
end
end
# Module that represents a custom component.
module InputGroup
def prepend(wrapper_options = nil)
span_ta... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/generators/simple_form_generator_test.rb | test/generators/simple_form_generator_test.rb | # frozen_string_literal: true
require 'test_helper'
class SimpleFormGeneratorTest < Rails::Generators::TestCase
tests SimpleForm::Generators::InstallGenerator
destination File.expand_path('../../tmp', __FILE__)
setup :prepare_destination
teardown { rm_rf(destination_root) }
test 'generates example locale fi... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/collection_radio_buttons_input_test.rb | test/inputs/collection_radio_buttons_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class CollectionRadioButtonsInputTest < ActionView::TestCase
test 'input generates boolean radio buttons by default for radio types' do
with_input_for @user, :active, :radio_buttons
assert_select 'input[type=radio][value=true].radio_button... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/datetime_input_test.rb | test/inputs/datetime_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
# Tests for datetime, date and time inputs when HTML5 compatibility is enabled in the wrapper.
class DateTimeInputWithHtml5Test < ActionView::TestCase
test 'input generates a datetime input for datetime attributes if HTML5 compatibility is explici... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/file_input_test.rb | test/inputs/file_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class FileInputTest < ActionView::TestCase
test 'input generates a file field' do
with_input_for @user, :name, :file
assert_select 'input#user_name[type=file]'
end
test "input generates a file field that doesn't accept placeholder" do... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/general_test.rb | test/inputs/general_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class InputTest < ActionView::TestCase
test 'input generates css class based on default input type' do
with_input_for @user, :name, :string
assert_select 'input.string'
with_input_for @user, :description, :text
assert_select 'texta... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/boolean_input_test.rb | test/inputs/boolean_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class BooleanInputTest < ActionView::TestCase
test 'input generates a checkbox by default for boolean attributes' do
with_input_for @user, :active, :boolean
assert_select 'input[type=checkbox].boolean#user_active'
assert_select 'label.... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/grouped_collection_select_input_test.rb | test/inputs/grouped_collection_select_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class GroupedCollectionSelectInputTest < ActionView::TestCase
test 'grouped collection accepts array collection form' do
with_input_for @user, :tag_ids, :grouped_select,
collection: [['Authors', %w[Jose Carlos]], ['General', %w[Bob John]... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/required_test.rb | test/inputs/required_test.rb | # frozen_string_literal: true
require 'test_helper'
class RequiredTest < ActionView::TestCase
# REQUIRED AND PRESENCE VALIDATION
test 'builder input obtains required from ActiveModel::Validations when it is included' do
with_form_for @validating_user, :name
assert_select 'input.required[required]#validatin... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/readonly_test.rb | test/inputs/readonly_test.rb | # frozen_string_literal: true
require 'test_helper'
class ReadonlyTest < ActionView::TestCase
test 'string input generates readonly elements when readonly option is true' do
with_input_for @user, :name, :string, readonly: true
assert_select 'input.string.readonly[readonly]'
end
test 'text input generate... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/string_input_test.rb | test/inputs/string_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class StringInputTest < ActionView::TestCase
test 'input maps text field to string attribute' do
with_input_for @user, :name, :string
assert_select "input#user_name[type=text][name='user[name]'][value='New in SimpleForm!']"
end
test '... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/collection_select_input_test.rb | test/inputs/collection_select_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class CollectionSelectInputTest < ActionView::TestCase
test 'input generates a boolean select with options by default for select types' do
with_input_for @user, :active, :select
assert_select 'select.select#user_active'
assert_select '... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/color_input_test.rb | test/inputs/color_input_test.rb | # frozen_string_literal: true
require 'test_helper'
class ColorInputTest < ActionView::TestCase
test 'input generates a color field' do
with_input_for @user, :favorite_color, :color
assert_select 'input[type=color].color#user_favorite_color'
end
end
| ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/time_zone_input_test.rb | test/inputs/time_zone_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class TimeZoneInputTest < ActionView::TestCase
test 'input generates a time zone select field' do
with_input_for @user, :time_zone, :time_zone
assert_select 'select#user_time_zone'
assert_select 'select option[value=Brasilia]', '(GMT-0... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/collection_check_boxes_input_test.rb | test/inputs/collection_check_boxes_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class CollectionCheckBoxesInputTest < ActionView::TestCase
test 'input check boxes does not include for attribute by default' do
with_input_for @user, :gender, :check_boxes, collection: %i[male female]
assert_select 'label'
assert_no_s... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/numeric_input_test.rb | test/inputs/numeric_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class NumericInputTest < ActionView::TestCase
test 'input generates an integer text field for integer attributes ' do
with_input_for @user, :age, :integer
assert_select 'input[type=number].integer#user_age'
end
test 'input generates a... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/country_input_test.rb | test/inputs/country_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class CountryInputTest < ActionView::TestCase
COUNTRY_SELECT_SEPARATOR =
if Gem::Version.new(CountrySelect::VERSION) >= Gem::Version.new("11.0.0")
"hr"
else
'option[value="---------------"][disabled=disabled]'
end
test '... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/hidden_input_test.rb | test/inputs/hidden_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class HiddenInputTest < ActionView::TestCase
test 'input generates a hidden field' do
with_input_for @user, :name, :hidden
assert_no_select 'input[type=text]'
assert_select 'input#user_name[type=hidden]'
end
test 'hint does not be... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/disabled_test.rb | test/inputs/disabled_test.rb | # frozen_string_literal: true
require 'test_helper'
class DisabledTest < ActionView::TestCase
test 'string input is disabled when disabled option is true' do
with_input_for @user, :name, :string, disabled: true
assert_select 'input.string.disabled[disabled]'
end
test 'text input is disabled when disable... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/weekday_input_test.rb | test/inputs/weekday_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class WeekdayInputTest < ActionView::TestCase
test 'input generates a weekday select' do
with_input_for @user, :born_at, :weekday
assert_select 'select.weekday#user_born_at'
end
test 'input generates a weekday select that accepts plac... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/rich_text_area_input_test.rb | test/inputs/rich_text_area_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class RichTextAreaInputTest < ActionView::TestCase
test 'input generates a text area for text attributes' do
with_input_for @user, :description, :text
assert_select 'textarea.text#user_description'
end
test 'input generates a text are... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/discovery_test.rb | test/inputs/discovery_test.rb | # frozen_string_literal: true
require 'test_helper'
class DiscoveryTest < ActionView::TestCase
# Setup new inputs and remove them after the test.
def discovery(value = false)
swap SimpleForm, cache_discovery: value do
begin
load "support/discovery_inputs.rb"
yield
ensure
Sim... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/test/inputs/text_input_test.rb | test/inputs/text_input_test.rb | # frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class TextInputTest < ActionView::TestCase
test 'input generates a text area for text attributes' do
with_input_for @user, :description, :text
assert_select 'textarea.text#user_description'
end
test 'input generates a text area for te... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/lib/simple_form.rb | lib/simple_form.rb | # frozen_string_literal: true
require 'action_view'
require 'action_pack'
require 'simple_form/action_view_extensions/form_helper'
require 'simple_form/action_view_extensions/builder'
require 'active_support/core_ext/hash/slice'
require 'active_support/core_ext/hash/except'
require 'active_support/core_ext/hash/reverse... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/lib/simple_form/error_notification.rb | lib/simple_form/error_notification.rb | # frozen_string_literal: true
module SimpleForm
class ErrorNotification
delegate :object, :object_name, :template, to: :@builder
def initialize(builder, options)
@builder = builder
@message = options.delete(:message)
@options = options
end
def render
if has_errors?
te... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/lib/simple_form/version.rb | lib/simple_form/version.rb | # frozen_string_literal: true
module SimpleForm
VERSION = "5.4.0".freeze
end
| ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/lib/simple_form/map_type.rb | lib/simple_form/map_type.rb | # frozen_string_literal: true
require 'active_support/core_ext/class/attribute'
module SimpleForm
module MapType
def self.extended(base)
base.class_attribute :mappings
base.mappings = {}
end
def map_type(*types)
map_to = types.extract_options![:to]
raise ArgumentError, "You need ... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/lib/simple_form/components.rb | lib/simple_form/components.rb | # frozen_string_literal: true
module SimpleForm
# Components are a special type of helpers that can work on their own.
# For example, by using a component, it will automatically change the
# output under given circumstances without user input. For example,
# the disabled helper always need a disabled: true opti... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
heartcombo/simple_form | https://github.com/heartcombo/simple_form/blob/584127a00bfe027ff5fb779fa11f859045d5ae9f/lib/simple_form/helpers.rb | lib/simple_form/helpers.rb | # frozen_string_literal: true
module SimpleForm
# Helpers are made of several helpers that cannot be turned on automatically.
# For instance, disabled cannot be turned on automatically, it requires the
# user to explicitly pass the option disabled: true so it may work.
module Helpers
autoload :Autofocus, '... | ruby | MIT | 584127a00bfe027ff5fb779fa11f859045d5ae9f | 2026-01-04T15:39:08.979660Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.