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 |
|---|---|---|---|---|---|---|---|---|
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/acts_as_authentic_test/magic_columns_test.rb | test/acts_as_authentic_test/magic_columns_test.rb | # frozen_string_literal: true
require "test_helper"
module ActsAsAuthenticTest
class MagicColumnsTest < ActiveSupport::TestCase
def test_validates_numericality_of_login_count
u = User.new
u.login_count = -1
refute u.valid?
refute u.errors[:login_count].empty?
u.login_count = 0
... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/acts_as_authentic_test/persistence_token_test.rb | test/acts_as_authentic_test/persistence_token_test.rb | # frozen_string_literal: true
require "test_helper"
module ActsAsAuthenticTest
class PersistenceTokenTest < ActiveSupport::TestCase
def test_after_password_set_reset_persistence_token
ben = users(:ben)
old_persistence_token = ben.persistence_token
ben.password = "newpass"
assert_not_equa... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/acts_as_authentic_test/logged_in_status_test.rb | test/acts_as_authentic_test/logged_in_status_test.rb | # frozen_string_literal: true
require "test_helper"
module ActsAsAuthenticTest
class LoggedInStatusTest < ActiveSupport::TestCase
ERROR_MSG = "Multiple calls to %s should result in different relations"
def test_logged_in_timeout_config
assert_equal 10.minutes.to_i, User.logged_in_timeout
assert... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/acts_as_authentic_test/login_test.rb | test/acts_as_authentic_test/login_test.rb | # frozen_string_literal: true
require "test_helper"
module ActsAsAuthenticTest
# Miscellaneous tests for configuration options related to the `login_field`.
class MiscellaneousLoginTest < ActiveSupport::TestCase
def test_login_field_config
assert_equal :login, User.login_field
assert_nil Employee.... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/acts_as_authentic_test/base_test.rb | test/acts_as_authentic_test/base_test.rb | # frozen_string_literal: true
require "test_helper"
module ActsAsAuthenticTest
class BaseTest < ActiveSupport::TestCase
def test_acts_as_authentic
assert_nothing_raised do
User.acts_as_authentic do
end
end
end
def test_acts_as_authentic_with_old_config
assert_raise(Arg... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/acts_as_authentic_test/single_access_test.rb | test/acts_as_authentic_test/single_access_test.rb | # frozen_string_literal: true
require "test_helper"
module ActsAsAuthenticTest
class SingleAccessTest < ActiveSupport::TestCase
def test_change_single_access_token_with_password_config
refute User.change_single_access_token_with_password
refute Employee.change_single_access_token_with_password
... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/acts_as_authentic_test/session_maintenance_test.rb | test/acts_as_authentic_test/session_maintenance_test.rb | # frozen_string_literal: true
require "test_helper"
module ActsAsAuthenticTest
class SessionMaintenanceTest < ActiveSupport::TestCase
def setup
User.log_in_after_create = true
User.log_in_after_password_change = true
end
def test_log_in_after_create_config
assert User.log_in_after_cre... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/acts_as_authentic_test/password_test.rb | test/acts_as_authentic_test/password_test.rb | # frozen_string_literal: true
require "test_helper"
module ActsAsAuthenticTest
class PasswordTest < ActiveSupport::TestCase
# If test_human_name is executed after test_i18n_of_human_name the test will fail.
i_suck_and_my_tests_are_order_dependent!
def test_crypted_password_field_config
assert_equ... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/libs/employee_session.rb | test/libs/employee_session.rb | # frozen_string_literal: true
class EmployeeSession < Authlogic::Session::Base
end
| ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/libs/affiliate.rb | test/libs/affiliate.rb | # frozen_string_literal: true
class Affiliate < ActiveRecord::Base
acts_as_authentic do |c|
c.crypted_password_field = :pw_hash
end
belongs_to :company
end
| ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/libs/project.rb | test/libs/project.rb | # frozen_string_literal: true
class Project < ActiveRecord::Base
has_and_belongs_to_many :users
end
| ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/libs/user_session.rb | test/libs/user_session.rb | # frozen_string_literal: true
class UserSession < Authlogic::Session::Base
end
class BackOfficeUserSession < Authlogic::Session::Base
end
class WackyUserSession < Authlogic::Session::Base
attr_accessor :counter
authenticate_with User
def initialize
@counter = 0
super
end
def persist_by_false
... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/libs/employee.rb | test/libs/employee.rb | # frozen_string_literal: true
class Employee < ActiveRecord::Base
acts_as_authentic do |config|
silence_warnings do
config.crypto_provider = Authlogic::CryptoProviders::Sha512
end
end
belongs_to :company
end
| ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/libs/ldaper.rb | test/libs/ldaper.rb | # frozen_string_literal: true
class Ldaper < ActiveRecord::Base
acts_as_authentic
end
| ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/libs/admin_session.rb | test/libs/admin_session.rb | # frozen_string_literal: true
class AdminSession < Authlogic::Session::Base
end
| ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/libs/admin.rb | test/libs/admin.rb | # frozen_string_literal: true
# This model demonstrates an `after_save` callback.
class Admin < ActiveRecord::Base
acts_as_authentic do |c|
c.crypto_provider = Authlogic::CryptoProviders::SCrypt
end
validates :password, confirmation: true
after_save do
# In rails 5.1 `role_changed?` was deprecated in... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/libs/company.rb | test/libs/company.rb | # frozen_string_literal: true
class Company < ActiveRecord::Base
has_many :employees, dependent: :destroy
has_many :users, dependent: :destroy
end
| ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/test/libs/user.rb | test/libs/user.rb | # frozen_string_literal: true
class User < ActiveRecord::Base
EMAIL = /
\A
[A-Z0-9_.&%+\-']+ # mailbox
@
(?:[A-Z0-9\-]+\.)+ # subdomains
(?:[A-Z]{2,25}) # TLD
\z
/ix.freeze
LOGIN = /\A[a-zA-Z0-9_][a-zA-Z0-9\.+\-_@ ]+\z/.freeze
acts_as_authentic do |c|
c.crypto_provider = Aut... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic.rb | lib/authlogic.rb | # frozen_string_literal: true
require_relative "authlogic/errors"
require_relative "authlogic/i18n"
require_relative "authlogic/random"
require_relative "authlogic/config"
require_relative "authlogic/controller_adapters/abstract_adapter"
require_relative "authlogic/cookie_credentials"
require_relative "authlogic/cry... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/test_case.rb | lib/authlogic/test_case.rb | # frozen_string_literal: true
require_relative "test_case/rails_request_adapter"
require_relative "test_case/mock_api_controller"
require_relative "test_case/mock_cookie_jar"
require_relative "test_case/mock_controller"
require_relative "test_case/mock_logger"
require_relative "test_case/mock_request"
# :nodoc:
modul... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/version.rb | lib/authlogic/version.rb | # frozen_string_literal: true
# :nodoc:
module Authlogic
# Returns a `::Gem::Version`, the version number of the authlogic gem.
#
# It is preferable for a library to provide a `gem_version` method, rather
# than a `VERSION` string, because `::Gem::Version` is easier to use in a
# comparison.
#
# We canno... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/errors.rb | lib/authlogic/errors.rb | # frozen_string_literal: true
module Authlogic
# Parent class of all Authlogic errors.
class Error < StandardError
end
# :nodoc:
class InvalidCryptoProvider < Error
end
# :nodoc:
class NilCryptoProvider < InvalidCryptoProvider
def message
<<~EOS
In version 5, Authlogic used SCrypt b... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/crypto_providers.rb | lib/authlogic/crypto_providers.rb | # frozen_string_literal: true
module Authlogic
# The acts_as_authentic method has a crypto_provider option. This allows you
# to use any type of encryption you like. Just create a class with a class
# level encrypt and matches? method. See example below.
#
# === Example
#
# class MyAwesomeEncryptionMet... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/i18n.rb | lib/authlogic/i18n.rb | # frozen_string_literal: true
require_relative "i18n/translator"
module Authlogic
# This class allows any message in Authlogic to use internationalization. In
# earlier versions of Authlogic each message was translated via configuration.
# This cluttered up the configuration and cluttered up Authlogic. So all
... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/random.rb | lib/authlogic/random.rb | # frozen_string_literal: true
require "securerandom"
module Authlogic
# Generates random strings using ruby's SecureRandom library.
module Random
def self.hex_token
SecureRandom.hex(64)
end
# Returns a string in base64url format as defined by RFC-3548 and RFC-4648.
# We call this a "friendl... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/config.rb | lib/authlogic/config.rb | # frozen_string_literal: true
module Authlogic
# Mixed into `Authlogic::ActsAsAuthentic::Base` and
# `Authlogic::Session::Base`.
module Config
E_USE_NORMAL_RAILS_VALIDATION = <<~EOS
This Authlogic configuration option (%s) is deprecated. Use normal
ActiveRecord validation instead. Detailed instru... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/cookie_credentials.rb | lib/authlogic/cookie_credentials.rb | # frozen_string_literal: true
module Authlogic
# Represents the credentials *in* the cookie. The value of the cookie.
# This is primarily a data object. It doesn't interact with controllers.
# It doesn't know about eg. cookie expiration.
#
# @api private
class CookieCredentials
# @api private
class... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/acts_as_authentic/password.rb | lib/authlogic/acts_as_authentic/password.rb | # frozen_string_literal: true
module Authlogic
module ActsAsAuthentic
# This module has a lot of neat functionality. It is responsible for encrypting your
# password, salting it, and verifying it. It can also help you transition to a new
# encryption algorithm. See the Config sub module for configuration... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/acts_as_authentic/session_maintenance.rb | lib/authlogic/acts_as_authentic/session_maintenance.rb | # frozen_string_literal: true
module Authlogic
module ActsAsAuthentic
# This is one of my favorite features that I think is pretty cool. It's
# things like this that make a library great and let you know you are on the
# right track.
#
# Just to clear up any confusion, Authlogic stores both the r... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/acts_as_authentic/magic_columns.rb | lib/authlogic/acts_as_authentic/magic_columns.rb | # frozen_string_literal: true
module Authlogic
module ActsAsAuthentic
# Magic columns are like ActiveRecord's created_at and updated_at columns.
# They are "magically" maintained for you. Authlogic has the same thing, but
# these are maintained on the session side. Please see "Magic Columns" in
# `Se... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/acts_as_authentic/login.rb | lib/authlogic/acts_as_authentic/login.rb | # frozen_string_literal: true
require_relative "queries/case_sensitivity"
require_relative "queries/find_with_case"
module Authlogic
module ActsAsAuthentic
# Handles everything related to the login field.
module Login
def self.included(klass)
klass.class_eval do
extend Config
... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/acts_as_authentic/email.rb | lib/authlogic/acts_as_authentic/email.rb | # frozen_string_literal: true
module Authlogic
module ActsAsAuthentic
# Sometimes models won't have an explicit "login" or "username" field.
# Instead they want to use the email field. In this case, authlogic provides
# validations to make sure the email submited is actually a valid email.
# Don't wo... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/acts_as_authentic/single_access_token.rb | lib/authlogic/acts_as_authentic/single_access_token.rb | # frozen_string_literal: true
module Authlogic
module ActsAsAuthentic
# This module is responsible for maintaining the single_access token. For
# more information the single access token and how to use it, see "Params"
# in `Session::Base`.
module SingleAccessToken
def self.included(klass)
... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/acts_as_authentic/base.rb | lib/authlogic/acts_as_authentic/base.rb | # frozen_string_literal: true
module Authlogic
module ActsAsAuthentic
# Provides the base functionality for acts_as_authentic
module Base
def self.included(klass)
klass.class_eval do
class_attribute :acts_as_authentic_modules
self.acts_as_authentic_modules ||= []
e... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/acts_as_authentic/persistence_token.rb | lib/authlogic/acts_as_authentic/persistence_token.rb | # frozen_string_literal: true
module Authlogic
module ActsAsAuthentic
# Maintains the persistence token, the token responsible for persisting sessions. This token
# gets stored in the session and the cookie.
module PersistenceToken
def self.included(klass)
klass.class_eval do
add_... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/acts_as_authentic/perishable_token.rb | lib/authlogic/acts_as_authentic/perishable_token.rb | # frozen_string_literal: true
module Authlogic
module ActsAsAuthentic
# This provides a handy token that is "perishable", meaning the token is
# only good for a certain amount of time.
#
# This is useful for resetting password, confirming accounts, etc. Typically
# during these actions you send t... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/acts_as_authentic/logged_in_status.rb | lib/authlogic/acts_as_authentic/logged_in_status.rb | # frozen_string_literal: true
module Authlogic
module ActsAsAuthentic
# Since web applications are stateless there is not sure fire way to tell if
# a user is logged in or not, from the database perspective. The best way to
# do this is to provide a "timeout" based on inactivity. So if that user is
#... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/acts_as_authentic/queries/find_with_case.rb | lib/authlogic/acts_as_authentic/queries/find_with_case.rb | # frozen_string_literal: true
module Authlogic
module ActsAsAuthentic
module Queries
# The query used by public-API method `find_by_smart_case_login_field`.
#
# We use the rails methods `case_insensitive_comparison` and
# `case_sensitive_comparison`. These methods nicely take into account... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/acts_as_authentic/queries/case_sensitivity.rb | lib/authlogic/acts_as_authentic/queries/case_sensitivity.rb | # frozen_string_literal: true
module Authlogic
module ActsAsAuthentic
module Queries
# @api private
class CaseSensitivity
E_UNABLE_TO_DETERMINE_SENSITIVITY = <<~EOS
Authlogic was unable to determine what case-sensitivity to use when
searching for email/login. To specify a ... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/test_case/mock_api_controller.rb | lib/authlogic/test_case/mock_api_controller.rb | # frozen_string_literal: true
module Authlogic
module TestCase
# Basically acts like an API controller but doesn't do anything.
# Authlogic can interact with this, do it's thing and then you can look at
# the controller object to see if anything changed.
class MockAPIController < ControllerAdapters::... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/test_case/mock_request.rb | lib/authlogic/test_case/mock_request.rb | # frozen_string_literal: true
module Authlogic
module TestCase
class MockRequest # :nodoc:
attr_accessor :controller
def initialize(controller)
self.controller = controller
end
def env
@env ||= {
ControllerAdapters::AbstractAdapter::ENV_SESSION_OPTIONS => {}
... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/test_case/mock_logger.rb | lib/authlogic/test_case/mock_logger.rb | # frozen_string_literal: true
module Authlogic
module TestCase
# Simple class to replace real loggers, so that we can raise any errors being logged.
class MockLogger
def error(message)
raise message
end
end
end
end
| ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/test_case/mock_controller.rb | lib/authlogic/test_case/mock_controller.rb | # frozen_string_literal: true
module Authlogic
module TestCase
# Basically acts like a controller but doesn't do anything. Authlogic can interact
# with this, do it's thing and then you can look at the controller object to see if
# anything changed.
class MockController < ControllerAdapters::Abstract... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/test_case/mock_cookie_jar.rb | lib/authlogic/test_case/mock_cookie_jar.rb | # frozen_string_literal: true
module Authlogic
module TestCase
# A mock of `ActionDispatch::Cookies::CookieJar`.
# See action_dispatch/middleware/cookies.rb
class MockCookieJar < Hash # :nodoc:
attr_accessor :set_cookies
def [](key)
hash = super
hash && hash[:value]
end... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/test_case/rails_request_adapter.rb | lib/authlogic/test_case/rails_request_adapter.rb | # frozen_string_literal: true
module Authlogic
module TestCase
# Adapts authlogic to work with the @request object when testing. This way Authlogic
# can set cookies and what not before a request is made, ultimately letting you log in
# users in functional tests.
class RailsRequestAdapter < Controlle... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/controller_adapters/sinatra_adapter.rb | lib/authlogic/controller_adapters/sinatra_adapter.rb | # frozen_string_literal: true
# Authlogic bridge for Sinatra
module Authlogic
module ControllerAdapters
module SinatraAdapter
# Cookie management functions
class Cookies
attr_reader :request, :response
def initialize(request, response)
@request = request
@response... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/controller_adapters/rack_adapter.rb | lib/authlogic/controller_adapters/rack_adapter.rb | # frozen_string_literal: true
module Authlogic
module ControllerAdapters
# Adapter for authlogic to make it function as a Rack middleware.
# First you'll have write your own Rack adapter where you have to set your cookie domain.
#
# class YourRackAdapter < Authlogic::ControllerAdapters::RackAdapt... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/controller_adapters/rails_adapter.rb | lib/authlogic/controller_adapters/rails_adapter.rb | # frozen_string_literal: true
module Authlogic
module ControllerAdapters
# Adapts authlogic to work with rails. The point is to close the gap between
# what authlogic expects and what the rails controller object provides.
# Similar to how ActiveRecord has an adapter for MySQL, PostgreSQL, SQLite,
# e... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/controller_adapters/abstract_adapter.rb | lib/authlogic/controller_adapters/abstract_adapter.rb | # frozen_string_literal: true
module Authlogic
module ControllerAdapters # :nodoc:
# Allows you to use Authlogic in any framework you want, not just rails. See
# the RailsAdapter for an example of how to adapt Authlogic to work with
# your framework.
class AbstractAdapter
E_COOKIE_DOMAIN_ADAPTE... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/i18n/translator.rb | lib/authlogic/i18n/translator.rb | # frozen_string_literal: true
module Authlogic
module I18n
# The default translator used by authlogic/i18n.rb
class Translator
# If the I18n gem is present, calls +I18n.translate+ passing all
# arguments, else returns +options[:default]+.
def translate(key, options = {})
if defined?... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/crypto_providers/sha512.rb | lib/authlogic/crypto_providers/sha512.rb | # frozen_string_literal: true
require "digest/sha2"
module Authlogic
module CryptoProviders
# SHA-512 does not have any practical known attacks against it. However,
# there are better choices. We recommend transitioning to a more secure,
# adaptive hashing algorithm, like scrypt.
class Sha512
... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/crypto_providers/scrypt.rb | lib/authlogic/crypto_providers/scrypt.rb | # frozen_string_literal: true
require "scrypt"
module Authlogic
module CryptoProviders
# SCrypt is the default provider for Authlogic. It is the only
# choice in the adaptive hash family that accounts for hardware
# based attacks by compensating with memory bound as well as cpu
# bound computational... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/crypto_providers/bcrypt.rb | lib/authlogic/crypto_providers/bcrypt.rb | # frozen_string_literal: true
require "bcrypt"
module Authlogic
module CryptoProviders
# The family of adaptive hash functions (BCrypt, SCrypt, PBKDF2)
# is the best choice for password storage today. They have the
# three properties of password hashing that are desirable. They
# are one-way, unique... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/crypto_providers/md5.rb | lib/authlogic/crypto_providers/md5.rb | # frozen_string_literal: true
require "digest/md5"
module Authlogic
module CryptoProviders
# A poor choice. There are known attacks against this algorithm.
class MD5
# V2 hashes the digest bytes in repeated stretches instead of hex characters.
autoload :V2, File.join(__dir__, "md5", "v2")
... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/crypto_providers/sha1.rb | lib/authlogic/crypto_providers/sha1.rb | # frozen_string_literal: true
require "digest/sha1"
module Authlogic
module CryptoProviders
# A poor choice. There are known attacks against this algorithm.
class Sha1
# V2 hashes the digest bytes in repeated stretches instead of hex characters.
autoload :V2, File.join(__dir__, "sha1", "v2")
... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/crypto_providers/sha256.rb | lib/authlogic/crypto_providers/sha256.rb | # frozen_string_literal: true
require "digest/sha2"
module Authlogic
# The acts_as_authentic method has a crypto_provider option. This allows you
# to use any type of encryption you like. Just create a class with a class
# level encrypt and matches? method. See example below.
#
# === Example
#
# class... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/crypto_providers/sha1/v2.rb | lib/authlogic/crypto_providers/sha1/v2.rb | # frozen_string_literal: true
require "digest/sha1"
module Authlogic
module CryptoProviders
class Sha1
# A poor choice. There are known attacks against this algorithm.
class V2
class << self
def join_token
@join_token ||= "--"
end
attr_writer :join_t... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/crypto_providers/md5/v2.rb | lib/authlogic/crypto_providers/md5/v2.rb | # frozen_string_literal: true
require "digest/md5"
module Authlogic
module CryptoProviders
class MD5
# A poor choice. There are known attacks against this algorithm.
class V2
class << self
attr_accessor :join_token
# The number of times to loop through the encryption.
... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/crypto_providers/sha512/v2.rb | lib/authlogic/crypto_providers/sha512/v2.rb | # frozen_string_literal: true
require "digest/sha2"
module Authlogic
module CryptoProviders
class Sha512
# SHA-512 does not have any practical known attacks against it. However,
# there are better choices. We recommend transitioning to a more secure,
# adaptive hashing algorithm, like scrypt.
... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/crypto_providers/sha256/v2.rb | lib/authlogic/crypto_providers/sha256/v2.rb | # frozen_string_literal: true
require "digest/sha2"
module Authlogic
# The acts_as_authentic method has a crypto_provider option. This allows you
# to use any type of encryption you like. Just create a class with a class
# level encrypt and matches? method. See example below.
#
# === Example
#
# class... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/session/base.rb | lib/authlogic/session/base.rb | # frozen_string_literal: true
require "request_store"
module Authlogic
module Session
module Activation
# :nodoc:
class NotActivatedError < ::StandardError
def initialize
super(
"You must activate the Authlogic::Session::Base.controller with " \
"a contr... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | true |
binarylogic/authlogic | https://github.com/binarylogic/authlogic/blob/77da613d09fe8e2be2c980d5a5d3c76109590edd/lib/authlogic/session/magic_column/assigns_last_request_at.rb | lib/authlogic/session/magic_column/assigns_last_request_at.rb | # frozen_string_literal: true
module Authlogic
module Session
module MagicColumn
# Assigns the current time to the `last_request_at` attribute.
#
# 1. The `last_request_at` column must exist
# 2. Assignment can be disabled on a per-controller basis
# 3. Assignment will not happen mo... | ruby | MIT | 77da613d09fe8e2be2c980d5a5d3c76109590edd | 2026-01-04T15:46:27.836259Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/spec_helper.rb | spec/spec_helper.rb | $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require "rspec"
require "neat"
require "aruba/api"
require "css_parser"
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
RSpec.configure do |config|
config.include SassSupport
config... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/support/parser_support.rb | spec/support/parser_support.rb | module ParserSupport
def self.parser
@parser ||= CssParser::Parser.new
end
def self.parse_file(identifier)
parser.load_file!("tmp/#{identifier}.css")
end
def self.show_contents(identifier)
css_file_contents = File.open("tmp/#{identifier}.css").read
css_file_contents.each_line do |line|
... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/support/sass_support.rb | spec/support/sass_support.rb | module SassSupport
def generate_css
_mkdir("tmp")
`sass -I . --update spec/fixtures:tmp --quiet --precision 5`
end
def clean_up
FileUtils.rm_rf("tmp")
end
end
| ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/support/matchers/be_contained_in.rb | spec/support/matchers/be_contained_in.rb | RSpec::Matchers.define :be_contained_in do |expected|
match do |actual|
@query = ParserSupport.parser.find_by_selector(actual, expected)
@query.any?
end
failure_message do |actual|
%{expected selector #{actual} to be contained in #{expected}}
end
end
| ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/support/matchers/have_rule.rb | spec/support/matchers/have_rule.rb | RSpec::Matchers.define :have_rule do |expected|
match do |selector|
@rules = rules_from_selector(selector)
@rules.include? expected
end
failure_message do |selector|
if @rules.empty?
%{no CSS for selector #{selector} were found}
else
rules = @rules.join("; ")
%{Expected selector... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/support/matchers/have_value.rb | spec/support/matchers/have_value.rb | RSpec::Matchers.define :have_value do |expected|
match do |variable|
selector_class = variable.sub("$", ".")
@value_attribute = ParserSupport.parser.find_by_selector(selector_class)[0]
unless @value_attribute.nil?
actual_value = @value_attribute.split(":")[1].strip.sub(";", "")
actual_value =... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/support/matchers/have_ruleset.rb | spec/support/matchers/have_ruleset.rb | RSpec::Matchers.define :have_ruleset do |expected|
match do |selector|
@ruleset = rules_from_selector(selector)
@ruleset.join("; ") == expected
end
failure_message do |selector|
if @ruleset.empty?
%{no CSS for selector #{selector} were found}
else
ruleset = @ruleset.join("; ")
%... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/neat/functions/neat_opposite_direction_spec.rb | spec/neat/functions/neat_opposite_direction_spec.rb | require "spec_helper"
describe "neat-opposite-direction" do
before(:all) do
ParserSupport.parse_file("functions/neat-opposite-direction")
end
context "called with ltr" do
it "returns right" do
rule = "content: right"
expect(".neat-opposite-direction-ltr").to have_rule(rule)
end
end
... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/neat/functions/neat_column_width_spec.rb | spec/neat/functions/neat_column_width_spec.rb | require "spec_helper"
describe "neat-column-width" do
before(:all) do
ParserSupport.parse_file("functions/neat-column-width")
end
context "called with a default twelve column grid" do
it "applies one column" do
rule = "width: calc(8.33333% - 21.66667px)"
expect(".neat-column-width-1-of-12")... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/neat/functions/retrieve_neat_settings_spec.rb | spec/neat/functions/retrieve_neat_settings_spec.rb | require "spec_helper"
describe "retrieve-neat-settings" do
before(:all) do
ParserSupport.parse_file("functions/retrieve-neat-settings")
end
context "called with default settings" do
it "gets default columns" do
rule = "content: 12"
expect(".neat-settings-default-columns").to have_rule(rule)... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/neat/functions/neat_float_direction_spec.rb | spec/neat/functions/neat_float_direction_spec.rb | require "spec_helper"
describe "neat-float-direction" do
before(:all) do
ParserSupport.parse_file("functions/neat-float-direction")
end
context "called with ltr" do
it "returns left" do
rule = "content: left"
expect(".neat-float-direction-ltr").to have_rule(rule)
end
end
context "c... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/neat/functions/neat_parse_media_spec.rb | spec/neat/functions/neat_parse_media_spec.rb | require "spec_helper"
describe "neat-parse-media" do
before(:all) do
ParserSupport.parse_file("functions/neat-parse-media")
end
context "called with number" do
it "gets min-width wraped number" do
rule = 'content: "only screen and (min-width: 100px)"'
expect(".neat-parse-media-number").to h... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/neat/functions/neat_column_default_spec.rb | spec/neat/functions/neat_column_default_spec.rb | require "spec_helper"
describe "neat-column-default" do
before(:all) do
ParserSupport.parse_file("functions/neat-column-default")
end
context "called with default grid" do
it "gets default columns" do
rule = "content: 12"
expect(".neat-column-default-grid").to have_rule(rule)
end
i... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/neat/mixins/grid_media_spec.rb | spec/neat/mixins/grid_media_spec.rb | require "spec_helper"
describe "@include grid-media() {...}" do
before(:all) do
ParserSupport.parse_file("mixins/grid-media")
end
context "with argument ($custom-neat-grid)" do
it "outputs @media only screen and (min-width: 1000px)" do
expect(".grid-column-media-custom-neat-grid").to be_contained_... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/neat/mixins/grid_column_spec.rb | spec/neat/mixins/grid_column_spec.rb | require "spec_helper"
describe "grid-column" do
before(:all) do
ParserSupport.parse_file("mixins/grid-column")
end
context "called without a specified grid" do
it "applies one column in the default 12-column grid" do
ruleset = "width: calc(8.33333% - 21.66667px); " +
"float: left; " +
... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/neat/mixins/grid_collapse_spec.rb | spec/neat/mixins/grid_collapse_spec.rb | require "spec_helper"
describe "grid-collapse" do
before(:all) do
ParserSupport.parse_file("mixins/grid-collapse")
end
context "called with default settings" do
it "adds margin for just the gutter with no specified column" do
ruleset = "margin-left: -20px; " +
"margin-right: -20px; " +
... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/neat/mixins/grid_container_spec.rb | spec/neat/mixins/grid_container_spec.rb | require "spec_helper"
describe "grid-container" do
before(:all) do
ParserSupport.parse_file("mixins/grid-container")
end
context "called with default settings" do
it "adds after element" do
ruleset = "clear: both; " +
"content: \"\"; " +
"display: block;"
expect(".grid-conta... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/neat/mixins/grid_shift_spec.rb | spec/neat/mixins/grid_shift_spec.rb | require "spec_helper"
describe "grid-shift" do
before(:all) do
ParserSupport.parse_file("mixins/grid-shift")
end
context "called with default settings" do
it "adds relative positioning without moving the object" do
rule = "left: auto; position: relative;"
expect(".grid-shift-default").to ha... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/spec/neat/mixins/grid_push_spec.rb | spec/neat/mixins/grid_push_spec.rb | require "spec_helper"
describe "grid-push" do
before(:all) do
ParserSupport.parse_file("mixins/grid-push")
end
context "called with default settings" do
it "adds margin for just the gutter with no specified column" do
rule = "margin-left: 20px"
expect(".grid-push-default").to have_rule(rule... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/lib/neat.rb | lib/neat.rb | require "neat/generator"
module Neat
if defined?(Rails) && defined?(Rails::Engine)
class Engine < ::Rails::Engine
config.assets.paths << File.expand_path("../core", __dir__)
end
else
begin
require "sass"
Sass.load_paths << File.expand_path("../core", __dir__)
rescue LoadError
... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/lib/neat/version.rb | lib/neat/version.rb | module Neat
VERSION = "4.0.0"
end
| ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
thoughtbot/neat | https://github.com/thoughtbot/neat/blob/6c76100ab31585aa1b96354d3992258ce1fc01e3/lib/neat/generator.rb | lib/neat/generator.rb | require "neat/version"
require "fileutils"
require "thor"
module Neat
class Generator < Thor
map ["-v", "--version"] => :version
desc "install", "Install Neat into your project"
method_options path: :string, force: :boolean
def install
if neat_files_already_exist? && !options[:force]
p... | ruby | MIT | 6c76100ab31585aa1b96354d3992258ce1fc01e3 | 2026-01-04T15:46:23.561905Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/add_foreign_key_test.rb | test/add_foreign_key_test.rb | require_relative "test_helper"
class AddForeignKeyTest < Minitest::Test
def test_basic
if postgresql?
assert_unsafe AddForeignKey
else
assert_safe AddForeignKey
end
end
def test_safe
assert_safe AddForeignKeySafe
end
def test_validate_same_transaction
skip unless postgresql?... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/remove_column_test.rb | test/remove_column_test.rb | require_relative "test_helper"
class RemoveColumnTest < Minitest::Test
def test_remove_column
assert_unsafe RemoveColumn
end
def test_remove_columns
assert_unsafe RemoveColumns
end
def test_remove_columns_type
assert_unsafe RemoveColumnsType, 'self.ignored_columns += ["name", "other"]'
end
... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/start_after_test.rb | test/start_after_test.rb | require_relative "test_helper"
class StartAfterTest < Minitest::Test
def test_version_safe
with_start_after(20170101000001) do
assert_safe Version
end
end
def test_version_unsafe
with_start_after(20170101000000) do
assert_unsafe Version
end
end
def test_revert_version_safe
m... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/remove_index_test.rb | test/remove_index_test.rb | require_relative "test_helper"
class RemoveIndexTest < Minitest::Test
def test_concurrently
skip unless postgresql?
migrate AddIndexConcurrently
begin
StrongMigrations.enable_check(:remove_index)
assert_unsafe RemoveIndex, "remove_index :users, :name, algorithm: :concurrently"
assert_u... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/change_column_null_test.rb | test/change_column_null_test.rb | require_relative "test_helper"
class ChangeColumnNullTest < Minitest::Test
def test_basic
if postgresql?
assert_unsafe ChangeColumnNull
else
assert_safe ChangeColumnNull
end
end
def test_constraint
skip unless postgresql?
assert_safe ChangeColumnNullConstraint
end
def test_... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/add_exclusion_constraint_test.rb | test/add_exclusion_constraint_test.rb | require_relative "test_helper"
class AddExclusionConstraintTest < Minitest::Test
def setup
skip unless postgresql?
super
end
def test_basic
assert_unsafe AddExclusionConstraint
end
def test_new_table
assert_safe AddExclusionConstraintNewTable
end
end
| ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/add_unique_constraint_test.rb | test/add_unique_constraint_test.rb | require_relative "test_helper"
class AddUniqueConstraintTest < Minitest::Test
def setup
skip unless postgresql?
super
end
def test_basic
assert_unsafe AddUniqueConstraint
end
def test_using_index
assert_safe AddUniqueConstraintUsingIndex
end
def test_new_table
assert_safe AddUnique... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/add_column_test.rb | test/add_column_test.rb | require_relative "test_helper"
class AddColumnTest < Minitest::Test
def test_default
assert_safe AddColumnDefault
end
def test_default_null
skip unless postgresql?
assert_safe AddColumnDefaultNull
end
def test_default_not_null
skip unless postgresql?
assert_unsafe AddColumnDefaultNotNul... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/safe_by_default_test.rb | test/safe_by_default_test.rb | require_relative "test_helper"
class SafeByDefaultTest < Minitest::Test
def setup
StrongMigrations.safe_by_default = true
super
end
def teardown
StrongMigrations.safe_by_default = false
end
def test_add_index
assert_safe AddIndexes
end
def test_add_index_invalid
skip unless postgre... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/check_down_test.rb | test/check_down_test.rb | require_relative "test_helper"
class CheckDownTest < Minitest::Test
def test_basic
migrate CheckDown
with_check_down do
assert_unsafe CheckDown, direction: :down
end
assert_safe CheckDown, direction: :down
end
def test_safe
migrate CheckDownSafe
with_check_down do
assert_safe... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/test_helper.rb | test/test_helper.rb | require "bundler/setup"
Bundler.require(:default)
require "minitest/autorun"
require_relative "support/active_record"
require_relative "support/helpers"
class Minitest::Test
include Helpers
def migrate(migration, direction: :up, version: 123)
schema_migration.delete_all_versions
migration = migration.new... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/timeouts_test.rb | test/timeouts_test.rb | require_relative "test_helper"
class TimeoutsTest < Minitest::Test
def teardown
reset_timeouts
end
def test_timeouts
skip unless postgresql? || mysql? || mariadb?
StrongMigrations.statement_timeout = 1.hour
StrongMigrations.transaction_timeout = 2.hours
StrongMigrations.lock_timeout = 10.se... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/alphabetize_schema_test.rb | test/alphabetize_schema_test.rb | require_relative "test_helper"
class AlphabetizeSchemaTest < Minitest::Test
def test_default
schema = dump_schema
if ActiveRecord::VERSION::STRING.to_f >= 8.1
expected_columns = <<-EOS
t.string "name"
t.bigint "order_id"
EOS
else
expected_columns = <<-EOS
t.string "name"
... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/multiple_databases_test.rb | test/multiple_databases_test.rb | require_relative "test_helper"
class MultipleDatabasesTest < Minitest::Test
def test_target_version
skip unless postgresql?
with_target_version({primary: 12, animals: 16}) do
with_database(:primary) do
# TODO use new check
# assert_unsafe AddColumnDefault
end
with_database(... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/add_index_test.rb | test/add_index_test.rb | require_relative "test_helper"
class AddIndexTest < Minitest::Test
def test_non_concurrently
if postgresql?
assert_unsafe AddIndex, <<~EOF
Adding an index non-concurrently blocks writes. Instead, use:
class AddIndex < ActiveRecord::Migration[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
ankane/strong_migrations | https://github.com/ankane/strong_migrations/blob/de0104c819ddd0a3d973db8e03e8971ac72a7b15/test/add_check_constraint_test.rb | test/add_check_constraint_test.rb | require_relative "test_helper"
class AddCheckConstraintTest < Minitest::Test
def test_basic
assert_unsafe AddCheckConstraint
end
def test_safe
if postgresql?
assert_safe AddCheckConstraintSafe
else
assert_unsafe AddCheckConstraintSafe
end
end
def test_validate_same_transaction
... | ruby | MIT | de0104c819ddd0a3d973db8e03e8971ac72a7b15 | 2026-01-04T15:46:43.728076Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.