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 |
|---|---|---|---|---|---|---|---|---|
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/logger.rb | lib/zookeeper/logger.rb | module Zookeeper
module Logger
def self.wrapped_logger
if defined?(@@wrapped_logger)
@@wrapped_logger
else
@@wrapped_logger = ::Logger.new(STDERR).tap { |l| l.level = ::Logger::FATAL }
end
end
def self.wrapped_logger=(log)
@@wrapped_logger = log
end
# @pr... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/core_ext.rb | lib/zookeeper/core_ext.rb | # @private
module ::Kernel
unless method_defined?(:silence_warnings)
def silence_warnings
with_warnings(nil) { yield }
end
end
unless method_defined?(:with_warnings)
def with_warnings(flag)
old_verbose, $VERBOSE = $VERBOSE, flag
yield
ensure
$VERBOSE = old_verbose
end
... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/stat.rb | lib/zookeeper/stat.rb | module Zookeeper
class Stat
attr_reader :version, :exists, :czxid, :mzxid, :ctime, :mtime, :cversion, :aversion, :ephemeralOwner, :dataLength, :numChildren, :pzxid
alias :ephemeral_owner :ephemeralOwner
alias :num_children :numChildren
alias :data_length :dataLength
def initialize(val)
@exists = !!val
... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/acls.rb | lib/zookeeper/acls.rb | module Zookeeper
module ACLs
class Id
attr_reader :scheme, :id
def initialize(hash)
@scheme = hash[:scheme]
@id = hash[:id]
end
def to_hash
{ :id => id, :scheme => scheme }
end
end
class ACL
attr_reader :perms, :id
def initialize(hash)
@perms = hash[:perms... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/callbacks.rb | lib/zookeeper/callbacks.rb | module Zookeeper
module Callbacks
class Base
attr_reader :proc, :completed, :context
# allows for easier construction of a user callback block that will be
# called with the callback object itself as an argument.
#
# @example
#
# Base.create do |cb|
# puts "watcher callback ... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/constants.rb | lib/zookeeper/constants.rb | module Zookeeper
module Constants
include ACLs::Constants
# file type masks
ZOO_EPHEMERAL = 1
ZOO_SEQUENCE = 2
# session state
ZOO_EXPIRED_SESSION_STATE = -112
ZOO_AUTH_FAILED_STATE = -113
ZOO_CLOSED_STATE = 0
ZOO_CONNECTING_STATE = 1
ZOO_ASSOCIATING_STATE = 2
ZOO_C... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/continuation.rb | lib/zookeeper/continuation.rb | module Zookeeper
# @private
# sigh, slightly different than the userland callbacks, the continuation
# provides sync call semantics around an async api
class Continuation
include Constants
include Logger
OPERATION_TIMEOUT = 30 # seconds
# for keeping track of which continuations are pending, a... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/compatibility.rb | lib/zookeeper/compatibility.rb | module Zookeeper
# @private
def self.warn_about_compatability_once!
return if @warned_about_compatibility
@warned_about_compatibility = true
warn <<-EOS
-----------------------------------------------------------------------------
NOTICE: ZOOKEEPER BACKWARDS COMPATIBILTY EANBLED!!
... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/request_registry.rb | lib/zookeeper/request_registry.rb | module Zookeeper
class RequestRegistry
include Constants
include Logger
# @param [Hash] opts
# @option opts [String] :chroot_path (nil) if given, will be used to
# correct a discrepancy between the C and Java clients when using a
# chrooted connection. If given, the chroot path will be st... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/client.rb | lib/zookeeper/client.rb | # figure out what platform we're on
# this way there's no ambiguity about which file to include
# or which class we're subclassing.
if defined?(::JRUBY_VERSION)
Zookeeper.require_root('java/java_base')
else
Zookeeper.require_root('ext/zookeeper_base')
end
module Zookeeper
if defined?(::JRUBY_VERSION)
class... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/client_methods.rb | lib/zookeeper/client_methods.rb | module Zookeeper
module ClientMethods
extend Forwardable
include Constants
include ACLs
include Logger
# @req_registry is set up in the platform-specific base classes
def_delegators :@req_registry, :setup_call
private :setup_call
def reopen(timeout=10, watcher=nil, opts = {})
warn "WARN: Zookeeper... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/latch.rb | lib/zookeeper/latch.rb | module Zookeeper
# a cross-thread gate of sorts.
class Latch
def initialize(count = 1)
@count = count
@mutex = Monitor.new
@cond = @mutex.new_cond
end
def release
@mutex.synchronize {
@count -= 1 if @count > 0
@cond.broadcast if @count.zero?
}
end
... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/monitor.rb | lib/zookeeper/monitor.rb | module Zookeeper
# just like stdlib Monitor but provides the SAME API AS MUTEX, FFS!
class Monitor
include MonitorMixin
alias try_enter try_mon_enter
alias enter mon_enter
alias exit mon_exit
# here, HERE!
# *here* are the methods that are the same
# god *dammit*
alias lock mon_en... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/forked.rb | lib/zookeeper/forked.rb | module Zookeeper
module Forked
# the includer provides an 'original_pid' method, which is set
# when the original 'owning' process creates the object.
#
# @return [true] if the current PID differs from the original_pid value
# @return [false] if the current PID matches the original_pid value
... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/logger/forwarding_logger.rb | lib/zookeeper/logger/forwarding_logger.rb | module Zookeeper
module Logger
# h/t _eric and Papertrail
# @private
class ForwardingLogger
attr_accessor :level, :formatter
@@mutex = Monitor.new unless defined?(@@mutex)
@@loggers = {} unless defined?(@@loggers)
def self.for(logger, name)
@@mutex.synchronize do
... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/lib/zookeeper/common/queue_with_pipe.rb | lib/zookeeper/common/queue_with_pipe.rb | module Zookeeper
module Common
# Ceci n'est pas une pipe
class QueueWithPipe
extend Forwardable
include Logger
# raised when close has been called, and pop() is performed
#
class ShutdownException < StandardError; end
# @private
KILL_TOKEN = Object.new unless defined?(KILL_TOKEN)
... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
zk-ruby/zookeeper | https://github.com/zk-ruby/zookeeper/blob/a497f79d4d138f1a497b38e27d314530416967fb/java/java_base.rb | java/java_base.rb | require 'java'
require 'thread'
# require 'rubygems'
# gem 'slyphon-log4j', '= 1.2.15'
# gem 'zk-ruby-zookeeper_jar', "= #{Zookeeper::DRIVER_VERSION}"
require 'log4j'
require 'zookeeper_jar'
# XXX: reindent this WHOLE FILE later
module Zookeeper
# The low-level wrapper-specific methods for the Java lib,
# subclass... | ruby | MIT | a497f79d4d138f1a497b38e27d314530416967fb | 2026-01-04T17:33:54.311549Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
require "foundation_rails_helper"
require "capybara"
# turning off deprecations
ActiveSupport::Deprecation.silenced = true
I18n.enforce_available_locales = false
| ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/spec/support/mock_rails.rb | spec/support/mock_rails.rb | # frozen_string_literal: true
require 'bundler/setup'
require 'action_view'
require 'action_controller'
require 'active_model'
require 'active_support/core_ext'
# Thanks to Justin French for formtastic spec
module FoundationRailsSpecHelper
include ActionView::Helpers::FormHelper
include ActionView::Helpers::FormOp... | ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/spec/support/classes/genre.rb | spec/support/classes/genre.rb | # frozen_string_literal: true
require 'active_model'
class Genre
extend ActiveModel::Naming if defined?(ActiveModel::Naming)
include ActiveModel::Conversion if defined?(ActiveModel::Conversion)
def to_label
end
def persisted?
end
end
| ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/spec/support/classes/book.rb | spec/support/classes/book.rb | # frozen_string_literal: true
require 'active_model'
class Book
extend ActiveModel::Naming if defined?(ActiveModel::Naming)
include ActiveModel::Conversion if defined?(ActiveModel::Conversion)
def to_label
end
def persisted?
end
end
| ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/spec/support/classes/author.rb | spec/support/classes/author.rb | # frozen_string_literal: true
require 'active_model'
class Author
extend ActiveModel::Naming if defined?(ActiveModel::Naming)
include ActiveModel::Conversion if defined?(ActiveModel::Conversion)
def to_label
end
def persisted?
end
end
| ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/spec/foundation_rails_helper/flash_helper_spec.rb | spec/foundation_rails_helper/flash_helper_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe FoundationRailsHelper::FlashHelper do
include ActionView::Context if defined?(ActionView::Context)
include ActionView::Helpers::FormTagHelper
include FoundationRailsHelper::FlashHelper
KEY_MATCHING = FoundationRailsHelper::FlashHelper::DEFAULT_KEY_M... | ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/spec/foundation_rails_helper/configuration_spec.rb | spec/foundation_rails_helper/configuration_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe FoundationRailsHelper do
describe FoundationRailsHelper::Configuration do
describe "#button_class" do
it "default value is 'success button'" do
config = FoundationRailsHelper::Configuration.new
expect(config.button_class).to eq("s... | ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/spec/foundation_rails_helper/form_builder_spec.rb | spec/foundation_rails_helper/form_builder_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe "FoundationRailsHelper::FormHelper" do
include FoundationRailsSpecHelper
before do
mock_everything
end
it "should have FoundationRailsHelper::FormHelper as default buidler" do
form_for(@author) do |builder|
expect(builder.class).to eq... | ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | true |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/lib/foundation_rails_helper.rb | lib/foundation_rails_helper.rb | # frozen_string_literal: true
require 'foundation_rails_helper/version'
require 'foundation_rails_helper/configuration'
require 'foundation_rails_helper/form_builder'
require 'foundation_rails_helper/size_class_calculator'
require 'foundation_rails_helper/flash_helper'
require 'foundation_rails_helper/action_view_exten... | ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/lib/railtie.rb | lib/railtie.rb | # frozen_string_literal: true
module Railtie
class Railtie < Rails::Railtie
# initializer 'setup foundation form builder' do
#
# end
end
end
| ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/lib/foundation_rails_helper/version.rb | lib/foundation_rails_helper/version.rb | # frozen_string_literal: true
module FoundationRailsHelper
VERSION = '4.0.1'
end
| ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/lib/foundation_rails_helper/action_view_extension.rb | lib/foundation_rails_helper/action_view_extension.rb | # frozen_string_literal: true
ActionView::Base.default_form_builder = FoundationRailsHelper::FormBuilder
ActionView::Base.field_error_proc = proc do |html_tag, _instance_tag|
html_tag
end
| ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/lib/foundation_rails_helper/size_class_calculator.rb | lib/foundation_rails_helper/size_class_calculator.rb | # frozen_string_literal: true
module FoundationRailsHelper
class SizeClassCalculator
def initialize(size_options)
@small = size_options[:small]
@medium = size_options[:medium]
@large = size_options[:large]
end
def classes
[small_class, medium_class, large_class].compact.join(' ')
... | ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/lib/foundation_rails_helper/configuration.rb | lib/foundation_rails_helper/configuration.rb | # frozen_string_literal: true
module FoundationRailsHelper
class << self
attr_writer :configuration
end
def self.configuration
@configuration ||= Configuration.new
end
def self.reset
@configuration = Configuration.new
end
def self.configure
yield(configuration)
end
class Configurat... | ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/lib/foundation_rails_helper/form_builder.rb | lib/foundation_rails_helper/form_builder.rb | # frozen_string_literal: true
require 'action_view/helpers'
module FoundationRailsHelper
class FormBuilder < ActionView::Helpers::FormBuilder
include ActionView::Helpers::TagHelper
include ActionView::Helpers::OutputSafetyHelper
%w(file_field email_field text_field text_area telephone_field phone_field
... | ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
sgruhier/foundation_rails_helper | https://github.com/sgruhier/foundation_rails_helper/blob/bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5/lib/foundation_rails_helper/flash_helper.rb | lib/foundation_rails_helper/flash_helper.rb | # frozen_string_literal: true
require 'action_view/helpers'
module FoundationRailsHelper
module FlashHelper
# <div class="callout [success alert secondary]" data-closable>
# This is an alert box.
# <button name="button" type="submit" class="close-button" data-close="">
# <span>×</span>
... | ruby | MIT | bc33600db7a2d16ce3cdc1f8369d0d7e7c4245b5 | 2026-01-04T17:34:12.156649Z | false |
ascendbruce/awesome_rails_console | https://github.com/ascendbruce/awesome_rails_console/blob/70914eb510c7e800d8e4c0b169a5edb016d48153/spec/awesome_rails_console_spec.rb | spec/awesome_rails_console_spec.rb | require 'spec_helper'
describe AwesomeRailsConsole do
it 'has a version number' do
expect(AwesomeRailsConsole::VERSION).not_to be nil
end
# TODO: Add more test or remove rspec entirely
end
| ruby | MIT | 70914eb510c7e800d8e4c0b169a5edb016d48153 | 2026-01-04T17:34:18.799970Z | false |
ascendbruce/awesome_rails_console | https://github.com/ascendbruce/awesome_rails_console/blob/70914eb510c7e800d8e4c0b169a5edb016d48153/spec/spec_helper.rb | spec/spec_helper.rb | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'awesome_rails_console'
| ruby | MIT | 70914eb510c7e800d8e4c0b169a5edb016d48153 | 2026-01-04T17:34:18.799970Z | false |
ascendbruce/awesome_rails_console | https://github.com/ascendbruce/awesome_rails_console/blob/70914eb510c7e800d8e4c0b169a5edb016d48153/spec/awesome_rails_console/prompts_spec.rb | spec/awesome_rails_console/prompts_spec.rb | require 'spec_helper'
require 'awesome_rails_console/prompts'
describe AwesomeRailsConsole::Prompts do
let(:old_prompt) { double('Pry.config.prompt') }
describe '.choose_prompt_for_pry_version' do
before do
expect(Pry.config).to receive(:prompt).and_return(old_prompt)
end
context 'pry version ... | ruby | MIT | 70914eb510c7e800d8e4c0b169a5edb016d48153 | 2026-01-04T17:34:18.799970Z | false |
ascendbruce/awesome_rails_console | https://github.com/ascendbruce/awesome_rails_console/blob/70914eb510c7e800d8e4c0b169a5edb016d48153/lib/awesome_rails_console.rb | lib/awesome_rails_console.rb | require "awesome_rails_console/version"
if defined?(Rails)
require "awesome_rails_console/prompts"
require "awesome_rails_console/railtie"
end
| ruby | MIT | 70914eb510c7e800d8e4c0b169a5edb016d48153 | 2026-01-04T17:34:18.799970Z | false |
ascendbruce/awesome_rails_console | https://github.com/ascendbruce/awesome_rails_console/blob/70914eb510c7e800d8e4c0b169a5edb016d48153/lib/awesome_rails_console/prompts.rb | lib/awesome_rails_console/prompts.rb | require "pry-rails"
module AwesomeRailsConsole
module Prompts
def self.choose_prompt_for_pry_version
old_prompt = Pry.config.prompt
Pry.config.prompt = if Pry::VERSION && (Gem::Version.new(Pry::VERSION) >= Gem::Version.new('0.13.0'))
post_pry_13_prompt(old_prompt)
else
pre_pry_... | ruby | MIT | 70914eb510c7e800d8e4c0b169a5edb016d48153 | 2026-01-04T17:34:18.799970Z | false |
ascendbruce/awesome_rails_console | https://github.com/ascendbruce/awesome_rails_console/blob/70914eb510c7e800d8e4c0b169a5edb016d48153/lib/awesome_rails_console/version.rb | lib/awesome_rails_console/version.rb | module AwesomeRailsConsole
VERSION = "0.4.5"
end
| ruby | MIT | 70914eb510c7e800d8e4c0b169a5edb016d48153 | 2026-01-04T17:34:18.799970Z | false |
ascendbruce/awesome_rails_console | https://github.com/ascendbruce/awesome_rails_console/blob/70914eb510c7e800d8e4c0b169a5edb016d48153/lib/awesome_rails_console/railtie.rb | lib/awesome_rails_console/railtie.rb | require "pry-rails"
require "awesome_print"
module AwesomeRailsConsole
class Railtie < Rails::Railtie
initializer "awesome_rails_console.initialize" do |app|
disables_pry_plugin_loading
use_awesome_print_for_formatting
set_prompt_name_to_project_name
show_rails_env_name_before_prompt
... | ruby | MIT | 70914eb510c7e800d8e4c0b169a5edb016d48153 | 2026-01-04T17:34:18.799970Z | false |
ascendbruce/awesome_rails_console | https://github.com/ascendbruce/awesome_rails_console/blob/70914eb510c7e800d8e4c0b169a5edb016d48153/lib/generators/awesome_rails_console/install/install_generator.rb | lib/generators/awesome_rails_console/install/install_generator.rb | require 'rails/generators/base'
class AwesomeRailsConsole::InstallGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
def update_gemfile
gem_group :development, :test do
gem 'hirb'
gem 'hirb-unicode-steakknife', require: 'hirb-unicode'
gem 'pry-byebug'
... | ruby | MIT | 70914eb510c7e800d8e4c0b169a5edb016d48153 | 2026-01-04T17:34:18.799970Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/.yard_gfm_support.rb | .yard_gfm_support.rb | # Gratefully and liberally taken from the MIT-licensed https://github.com/bensheldon/good_job/pull/113/files
require "kramdown"
require "kramdown-parser-gfm"
# Custom markup provider class that always renders Kramdown using GFM (Github Flavored Markdown).
# GFM is needed to render markdown tables and fenced code block... | ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
# Skip coverage checks for single spec runs outside CI environments
begin
ci_indicators = %w[CI GITHUB_ACTIONS GITLAB_CI TRAVIS CIRCLECI BUILD_ID CONTINUOUS_INTEGRATION]
running_in_ci = ci_indicators.any? { |k| ENV[k] }
requested_specs = ARGV.select { |a| a =~ %r{(^|/)spec/.+_spec\.... | ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/spec/integration/roda_integration_spec.rb | spec/integration/roda_integration_spec.rb | # frozen_string_literal: true
RSpec.describe "Roda integration with OmniAuth::Strategies::LDAP", :integration do
before(:all) do
begin
require "roda"
rescue LoadError
skip "roda gem not installed; skipping roda integration specs"
else
require_relative "../sample/roda_app"
end
end
... | ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/spec/integration/middleware_spec.rb | spec/integration/middleware_spec.rb | # frozen_string_literal: true
RSpec.describe "OmniAuth LDAP middleware (Rack stack)", type: :integration do
include Rack::Test::Methods
let(:app) do
Rack::Builder.new do
use OmniAuth::Test::PhonySession
# Test middleware: if a callback path is requested, copy mock_auth into env so the app sees it.... | ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/spec/omniauth/adaptor_spec.rb | spec/omniauth/adaptor_spec.rb | # frozen_string_literal: true
RSpec.describe OmniAuth::LDAP::Adaptor do
let(:valid_config) { {host: "127.0.0.1", port: 389, method: "plain", uid: "uid", base: "dc=test,dc=local"} }
describe ".validate" do
it "raises ArgumentError when required keys are missing" do
expect { described_class.validate({}) }... | ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/spec/omniauth/strategies/ldap_spec.rb | spec/omniauth/strategies/ldap_spec.rb | # frozen_string_literal: true
RSpec.describe "OmniAuth::Strategies::LDAP" do
# :title => "My LDAP",
# :host => '10.101.10.1',
# :port => 389,
# :method => :plain,
# :verify_certificates => true,
# :base => 'dc=intridea, dc=com',
# :uid => 'sAMAccountName',
# :name_proc => Proc.new {|name| name.gsub(/@.... | ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/spec/omniauth-ldap/adaptor_spec.rb | spec/omniauth-ldap/adaptor_spec.rb | # frozen_string_literal: true
RSpec.describe OmniAuth::LDAP::Adaptor do
describe "initialize" do
it "throws exception when must have field is not set" do
#[:host, :port, :method, :bind_dn]
expect {
described_class.new({host: "192.168.1.145", method: "plain"})
}.to raise_error(ArgumentEr... | ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/spec/config/vcr.rb | spec/config/vcr.rb | # VCR/WebMock: record and replay HTTP to external services (RubyGems, GitHub, etc.)
# require "webmock/rspec"
# require "vcr"
# VCR.configure do |c|
# c.cassette_library_dir = File.join(__dir__, "..", "support", "fixtures", "vcr_cassettes")
# c.hook_into :webmock
# c.configure_rspec_metadata!
# c.default_casset... | ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/spec/config/omniauth.rb | spec/config/omniauth.rb | require "logger"
require "omniauth"
if OmniAuth.config.respond_to?(:logger=)
logger = Logger.new($stdout)
OmniAuth.config.logger = logger
end
| ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/spec/config/debug.rb | spec/config/debug.rb | load_debugger = ENV.fetch("DEBUG", "false").casecmp("true").zero?
puts "LOADING DEBUGGER: #{load_debugger}" if load_debugger
require "debug" if load_debugger
| ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/spec/config/rspec/rack_test.rb | spec/config/rspec/rack_test.rb | require "rack/test"
RSpec.configure do |config|
config.include Rack::Test::Methods
end
| ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/spec/sample/roda_app.rb | spec/sample/roda_app.rb | # frozen_string_literal: true
begin
require "roda"
rescue LoadError
# roda not available in this environment; the integration spec will skip
else
class SampleRodaApp < Roda
plugin :sessions, secret: "019a50f6-7880-75be-be8e-e147143543bc-ce1b45052f04-d1d3-4f21-b2f1"
route do |r|
r.root do
'... | ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/lib/omniauth-ldap.rb | lib/omniauth-ldap.rb | # Integrate the VersionGem helper into the OmniAuth::LDAP::Version module
# to expose common version-related helper methods. This file is the public
# entry point required by consumers of the gem.
#
# @example
# require 'omniauth-ldap'
# OmniAuth::LDAP::VERSION # => "2.3.2"
require "version_gem"
require "omniauth... | ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/lib/omniauth/strategies/ldap.rb | lib/omniauth/strategies/ldap.rb | # frozen_string_literal: true
require "omniauth"
require "omniauth/version"
# OmniAuth strategies namespace.
#
# This file implements an LDAP authentication strategy for OmniAuth.
# It provides both an interactive request phase (login form) and a
# callback phase which binds to an LDAP directory to authenticate the
#... | ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/lib/omniauth-ldap/version.rb | lib/omniauth-ldap/version.rb | module OmniAuth
module LDAP
# Version namespace for the omniauth-ldap gem
#
# This module contains the version constant used by rubygems and in code
# consumers. It intentionally exposes VERSION both inside the Version
# namespace and as OmniAuth::LDAP::VERSION for compatibility.
module Versio... | ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
omniauth/omniauth-ldap | https://github.com/omniauth/omniauth-ldap/blob/70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9/lib/omniauth-ldap/adaptor.rb | lib/omniauth-ldap/adaptor.rb | # frozen_string_literal: true
# this code borrowed pieces from activeldap and net-ldap
# External Gems
require "net/ldap"
require "net/ntlm"
require "rack"
require "sasl"
module OmniAuth
module LDAP
# Adaptor encapsulates the behavior required to connect to an LDAP server
# and perform searches and binds. ... | ruby | MIT | 70f6f26b69bace0cdeb2d2b1fe1e77b26a9ef2c9 | 2026-01-04T17:34:15.471194Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/init.rb | init.rb | File.dirname(__FILE__) + "/rails/init.rb" | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/rails/init.rb | rails/init.rb | require "authlogic-connect"
# copied from open_id_authentication plugin on github
# this is the Rails 2.x equivalent.
# Rails 3 equivalent is in authlogic_connect/engine.rb
if Rails.version < '3'
config.gem 'rack-openid', :lib => 'rack/openid', :version => '>=0.2.1'
end
require 'open_id_authentication'
config.mid... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/test/test_oauth.rb | test/test_oauth.rb | require File.dirname(__FILE__) + '/test_helper.rb'
module AuthlogicConnect
class OauthTest < ActiveSupport::TestCase
context "Oauth (with TwitterToken)" do
setup do
@user = User.new(:login => "viatropos")
controller.params.merge!(:authentication_type => "user")
Authlogic::Session::B... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/test/test_user.rb | test/test_user.rb | require File.dirname(__FILE__) + '/test_helper.rb'
module AuthlogicConnect
class UserTest < Test::Unit::TestCase
context "User creation" do
setup do
@user = User.new(:login => "viatropos")
end
should "make sure we are loading the models" do
assert_equal "viatropos", @user... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/test/test_helper.rb | test/test_helper.rb | require "rubygems"
require "ruby-debug"
gem 'test-unit'
require "test/unit"
require 'active_support'
require 'active_support/test_case'
require "active_record"
require "active_record/fixtures"
require 'action_controller'
require 'shoulda'
require 'mocha'
require File.dirname(__FILE__) + '/libs/database'
require File.d... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/test/test_openid.rb | test/test_openid.rb | require File.dirname(__FILE__) + '/test_helper.rb'
module AuthlogicConnect
class OpenIdTest < Test::Unit::TestCase
context "OpenId" do
setup do
@user = User.new(:login => "viatropos")
controller.params.merge!(:authentication_type => "user")
Authlogic::Session::Base.controller = cont... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/test/controllers/test_users_controller.rb | test/controllers/test_users_controller.rb | require File.dirname(__FILE__) + '/../test_helper.rb'
class UsersControllerTest < ActionController::TestCase
tests UsersController
context "when signed out" do
# setup { sign_out }
context "on GET to #new" do
setup { get :new }
should "do something???" do
puts "REQUEST: #{@us... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/test/libs/user_session.rb | test/libs/user_session.rb | class UserSession < Authlogic::Session::Base
end
| ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/test/libs/database.rb | test/libs/database.rb |
begin
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
rescue ArgumentError
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :dbfile => ":memory:")
end
ActiveRecord::Base.configurations = true
# this schema was directly copied from
# http://github.com/viatrop... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/test/libs/user.rb | test/libs/user.rb | class User < ActiveRecord::Base
acts_as_authentic do |config|
config.validate_email_field = false
config.validate_login_field = false
config.validate_password_field = false
end
end
| ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/generators/authlogic_connect_migration/authlogic_connect_migration.rb | generators/authlogic_connect_migration/authlogic_connect_migration.rb | class AuthlogicConnectMigrationGenerator < Rails::Generator::Base
def manifest
record do |m|
m.migration_template 'migration.rb', 'db/create_users', :migration_file_name => "create_users"
m.migration_template 'migration.rb', 'db/create_sessions', :migration_file_name => "create_sessions"
m.mi... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/generators/authlogic_connect_migration/templates/create_users.rb | generators/authlogic_connect_migration/templates/create_users.rb | class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
# authlogic
t.timestamps
t.string :login, :null => false
t.string :crypted_password, :null => false
t.string :password_salt, :null => false
t.string :persistence_token, :null => false
t.int... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/generators/authlogic_connect_migration/templates/create_sessions.rb | generators/authlogic_connect_migration/templates/create_sessions.rb | class CreateSessions < ActiveRecord::Migration
def self.up
create_table :sessions do |t|
t.string :session_id, :null => false
t.text :data
t.timestamps
end
add_index :sessions, :session_id
add_index :sessions, :updated_at
end
def self.down
drop_table :sessions
end
end
| ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/generators/authlogic_connect_migration/templates/create_tokens.rb | generators/authlogic_connect_migration/templates/create_tokens.rb | class CreateTokens < ActiveRecord::Migration
def self.up
create_table :tokens do |t|
t.integer :user_id
t.string :type, :limit => 30
t.string :key, :limit => 1024 # This has to be huge because of Yahoo's excessively large tokens
t.string :secret
t.boolean :active # whether or not it'... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic-connect.rb | lib/authlogic-connect.rb | require 'active_record'
require "rubygems"
require 'authlogic'
require 'oauth'
require 'oauth2'
this = File.dirname(__FILE__)
library = "#{this}/authlogic_connect"
require "#{this}/open_id_authentication"
require "#{library}/ext"
require "#{library}/authlogic_connect"
require "#{library}/callback_filter"
require "#{l... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/open_id_authentication.rb | lib/open_id_authentication.rb | # copied from open_id_authentication plugin on github
require 'uri'
require 'openid'
require 'rack/openid'
module OpenIdAuthentication
def self.new(app)
store = OpenIdAuthentication.store
if store.nil?
Rails.logger.warn "OpenIdAuthentication.store is nil. Using in-memory store."
end
::Rack::Op... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/common.rb | lib/authlogic_connect/common.rb | module AuthlogicConnect::Common
end
require File.dirname(__FILE__) + "/common/state"
require File.dirname(__FILE__) + "/common/variables"
require File.dirname(__FILE__) + "/common/user"
require File.dirname(__FILE__) + "/common/session"
ActiveRecord::Base.send(:include, AuthlogicConnect::Common::User)
Authlogic::Sess... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/ext.rb | lib/authlogic_connect/ext.rb | # these are extensions I've found useful for this project
class String
# normalizes an OpenID according to http://openid.net/specs/openid-authentication-2_0.html#normalization
def normalize_identifier
# clean up whitespace
identifier = self.dup.strip
# if an XRI has a prefix, strip it.
identifier.g... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/openid.rb | lib/authlogic_connect/openid.rb | module AuthlogicConnect::Openid
end
require File.dirname(__FILE__) + "/openid/state"
require File.dirname(__FILE__) + "/openid/variables"
require File.dirname(__FILE__) + "/openid/process"
require File.dirname(__FILE__) + "/openid/user"
require File.dirname(__FILE__) + "/openid/session"
ActiveRecord::Base.send(:inclu... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/rack_state.rb | lib/authlogic_connect/rack_state.rb | class AuthlogicConnect::RackState
def initialize(app)
@app = app
end
# this intercepts how the browser interprets the url.
# so we override it and say,
# "if we've stored a variable in the session called :auth_callback_method,
# then convert that into a POST call so we re-call the original method"
... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/callback_filter.rb | lib/authlogic_connect/callback_filter.rb | class AuthlogicConnect::CallbackFilter
def initialize(app)
@app = app
end
# this intercepts how the browser interprets the url.
# so we override it and say,
# "if we've stored a variable in the session called :auth_callback_method,
# then convert that into a POST call so we re-call the original metho... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/authlogic_connect.rb | lib/authlogic_connect/authlogic_connect.rb | module AuthlogicConnect
KEY = "connect" unless defined?(KEY)
OAUTH = "oauth" unless defined?(OAUTH)
OPEN_ID = "open_id" unless defined?(OPEN_ID)
class << self
attr_accessor :config
def config=(value)
value.recursively_symbolize_keys!
@config = value
end
def key(path... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/engine.rb | lib/authlogic_connect/engine.rb | module AuthlogicConnect
class Engine < Rails::Engine
initializer "authlogic_connect.authentication_hook" do |app|
app.middleware.use AuthlogicConnect::CallbackFilter
app.middleware.use OpenIdAuthentication
end
initializer "authlogic_connect.finalize", :after => "authlogic_connect.aut... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/access_token.rb | lib/authlogic_connect/access_token.rb | class AccessToken < ActiveRecord::Base
belongs_to :user
def client
self.class.client
end
def consumer
self.class.consumer
end
def service_name
self.class.service_name
end
def settings
self.class.settings
end
def config
self.class.config
end
def get(path)
... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth.rb | lib/authlogic_connect/oauth.rb | module AuthlogicConnect::Oauth
end
require File.dirname(__FILE__) + "/oauth/state"
require File.dirname(__FILE__) + "/oauth/variables"
require File.dirname(__FILE__) + "/oauth/process"
require File.dirname(__FILE__) + "/oauth/user"
require File.dirname(__FILE__) + "/oauth/session"
require File.dirname(__FILE__) + "/oa... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/common/session.rb | lib/authlogic_connect/common/session.rb | module AuthlogicConnect::Common
module Session
def self.included(base)
base.class_eval do
include Variables
include InstanceMethods
end
end
module InstanceMethods
# core save method coordinating how to save the session.
# want to destroy the blo... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/common/variables.rb | lib/authlogic_connect/common/variables.rb | module AuthlogicConnect::Common::Variables
include AuthlogicConnect::Common::State
attr_reader :processing_authentication
def auth_class
is_auth_session? ? self.class : session_class
end
def auth_controller
is_auth_session? ? controller : session_class.controller
end
def auth_params
... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/common/state.rb | lib/authlogic_connect/common/state.rb | # This class holds query/state variables common to oauth and openid
module AuthlogicConnect::Common::State
def auth_controller?
!auth_controller.blank?
end
def auth_params?
auth_controller? && !auth_params.blank?
end
def auth_session?
!auth_session.blank?
end
def is_auth_session?
... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/common/user.rb | lib/authlogic_connect/common/user.rb | # This class is the main api for the user.
# It is also required to properly sequence the save methods
# for the different authentication types (oauth and openid)
module AuthlogicConnect::Common::User
def self.included(base)
base.class_eval do
add_acts_as_authentic_module(InstanceMethods, :append)
... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth/session.rb | lib/authlogic_connect/oauth/session.rb | module AuthlogicConnect::Oauth
# This module is responsible for adding oauth
# to the Authlogic::Session::Base class.
module Session
def self.included(base)
base.class_eval do
include InstanceMethods
end
end
module InstanceMethods
include Process
def self.included... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth/variables.rb | lib/authlogic_connect/oauth/variables.rb | module AuthlogicConnect::Oauth::Variables
include AuthlogicConnect::Oauth::State
# this doesn't do anything yet, just to show what variables
# we need from the form
def oauth_variables
[:oauth_provider]
end
# this comes straight from either the params or session.
# it is required for most of t... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth/state.rb | lib/authlogic_connect/oauth/state.rb | # all these methods must return true or false
module AuthlogicConnect::Oauth::State
# 1. to call
# checks that we just passed parameters to it,
# and that the parameters say 'authentication_method' == 'oauth'
def oauth_request?
auth_params? && oauth_provider?
end
# 2. from call
# checks that the... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth/process.rb | lib/authlogic_connect/oauth/process.rb | module AuthlogicConnect::Oauth::Process
include AuthlogicConnect::Oauth::Variables
# Step 2: after save is called, it runs this method for validation
def validate_by_oauth
if processing_authentication
authentication_protocol(:oauth, :start) || authentication_protocol(:oauth, :complete)
end
end
... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth/helper.rb | lib/authlogic_connect/oauth/helper.rb | module AuthlogicConnect::Oauth::Helper
# options include "name"
def oauth_register_hidden_input
oauth_input(:type => "user")
end
def oauth_login_hidden_input
oauth_input(:type => "session")
end
def oauth_input(options = {})
tag(:input, {:type => "hidden", :name => "authentication_type",... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth/user.rb | lib/authlogic_connect/oauth/user.rb | module AuthlogicConnect::Oauth::User
def self.included(base)
base.class_eval do
# add_acts_as_authentic_module makes sure it is
# only added to the user model, not all activerecord models.
add_acts_as_authentic_module(InstanceMethods, :prepend)
end
end
module InstanceMethods
in... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth/tokens/twitter_token.rb | lib/authlogic_connect/oauth/tokens/twitter_token.rb | class TwitterToken < OauthToken
key :user_id
settings "http://api.twitter.com",
:authorize_url => "http://api.twitter.com/oauth/authenticate"
end
| ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth/tokens/vimeo_token.rb | lib/authlogic_connect/oauth/tokens/vimeo_token.rb | # http://www.vimeo.com/api/docs/oauth
# http://www.vimeo.com/api/applications/new
# http://vimeo.com/api/applications
class VimeoToken < OauthToken
key do |access_token|
body = JSON.parse(access_token.get("http://vimeo.com/api/v2/#{access_token.token}/info.json"))
user_id = body.first["id"]
end
sett... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth/tokens/foursquare_token.rb | lib/authlogic_connect/oauth/tokens/foursquare_token.rb | class FoursquareToken < OauthToken
key do |access_token|
body = JSON.parse(access_token.get("/user.json").body)
user_id = body['user']['id'].to_s
end
settings "http://api.foursquare.com/:api_version",
:request_token_url => "http://foursquare.com/oauth/request_token",
:access_token_url => ... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth/tokens/myspace_token.rb | lib/authlogic_connect/oauth/tokens/myspace_token.rb | # http://wiki.developer.myspace.com/index.php?title=Category:MySpaceID
# http://developerwiki.myspace.com/index.php?title=OAuth_REST_API_Usage_-_Authentication_Process
# http://developerwiki.myspace.com/index.php?title=How_to_Set_Up_a_New_Application_for_OpenID
# http://developer.myspace.com/Modules/Apps/Pages/ApplyDev... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth/tokens/meetup_token.rb | lib/authlogic_connect/oauth/tokens/meetup_token.rb | # http://www.meetup.com/meetup_api/docs/#oauth
# protected resources: http://api.meetup.com
class MeetupToken < OauthToken
key :user_id
settings "http://www.meetup.com/"
:request_token_path => "/oauth/request",
:authorize_path => "/authorize",
:access_token_path => "/oauth/access"
end
| ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth/tokens/facebook_token.rb | lib/authlogic_connect/oauth/tokens/facebook_token.rb | # http://www.facebook.com/developers/apps.php
# http://developers.facebook.com/setup/
class FacebookToken < OauthToken
version 2.0
settings "https://graph.facebook.com",
:authorize_url => "https://graph.facebook.com/oauth/authorize",
:scope => "email, offline_access"
end
| ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth/tokens/google_token.rb | lib/authlogic_connect/oauth/tokens/google_token.rb | # http://code.google.com/apis/accounts/docs/OAuth_ref.html
# http://code.google.com/apis/accounts/docs/OpenID.html#settingup
# http://code.google.com/apis/accounts/docs/OAuth.html
# http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto.html
# http://www.manu-j.com/blog/add-google-oauth-ruby-on-rails-site... | ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
lancejpollard/authlogic-connect | https://github.com/lancejpollard/authlogic-connect/blob/3b1959ec07f1a9c4164753fea5a5cb1079b88257/lib/authlogic_connect/oauth/tokens/get_satisfaction_token.rb | lib/authlogic_connect/oauth/tokens/get_satisfaction_token.rb | # http://getsatisfaction.com/developers/oauth
class GetSatisfactionToken < OauthToken
settings "http://getsatisfaction.com",
:request_token_path => "/api/request_token",
:authorize_url => "/api/authorize",
:access_token_path => "/api/access_token"
end
| ruby | MIT | 3b1959ec07f1a9c4164753fea5a5cb1079b88257 | 2026-01-04T17:34:23.062865Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.