source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | lib/neo4j/core/cypher_session/adaptors/schema.rb | Ruby | mit | 97 | master | 1,213 | module Neo4j
module Core
class CypherSession
module Adaptors
module Schema
def version(session)
result = query(session, 'CALL dbms.components()', {}, skip_instrumentation: true)
# BTW: community / enterprise could be retrieved via `result.first.edition`
... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | lib/neo4j/core/cypher_session/adaptors/bolt.rb | Ruby | mit | 97 | master | 10,067 | require 'neo4j/core/cypher_session/adaptors'
require 'neo4j/core/cypher_session/adaptors/has_uri'
require 'neo4j/core/cypher_session/adaptors/schema'
require 'neo4j/core/cypher_session/adaptors/bolt/pack_stream'
require 'neo4j/core/cypher_session/adaptors/bolt/chunk_writer_io'
require 'neo4j/core/cypher_session/respons... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | lib/neo4j/core/cypher_session/adaptors/embedded.rb | Ruby | mit | 97 | master | 4,544 | require 'neo4j/core/cypher_session/adaptors'
require 'neo4j/core/cypher_session/responses/embedded'
require 'active_support/hash_with_indifferent_access'
module Neo4j
module Core
class CypherSession
module Adaptors
class Embedded < Base
attr_reader :graph_db, :path
def initiali... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | lib/neo4j/core/cypher_session/adaptors/has_uri.rb | Ruby | mit | 97 | master | 1,767 | require 'active_support/concern'
module Neo4j
module Core
class CypherSession
module Adaptors
# Containing the logic for dealing with adaptors which use URIs
module HasUri
extend ActiveSupport::Concern
module ClassMethods
attr_reader :default_uri
... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | lib/neo4j/core/cypher_session/adaptors/http.rb | Ruby | mit | 97 | master | 7,890 | require 'neo4j/core/cypher_session/adaptors'
require 'neo4j/core/cypher_session/adaptors/has_uri'
require 'neo4j/core/cypher_session/responses/http'
require 'uri'
# TODO: Work with `Query` objects
module Neo4j
module Core
class CypherSession
module Adaptors
class HTTP < Base
attr_reader :... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | lib/neo4j/core/cypher_session/adaptors/bolt/chunk_writer_io.rb | Ruby | mit | 97 | master | 1,401 | require 'stringio'
class ChunkWriterIO < StringIO
# Writer for chunked data.
MAX_CHUNK_SIZE = 0xFFFF
def initialize
@output_buffer = []
@output_size = 0
super
end
# Write some bytes, splitting into chunks if necessary.
def write_with_chunking(string)
until string.empty?
future_size... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | lib/neo4j/core/cypher_session/adaptors/bolt/pack_stream.rb | Ruby | mit | 97 | master | 9,478 | require 'stringio'
module Neo4j
module Core
# Implements the the PackStream packing and unpacking specifications
# as specified by Neo Technology for the Neo4j graph database
module PackStream
MARKER_TYPES = {
C0: nil,
C1: [:float, 64],
C2: false,
C3: true,
C... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | lib/neo4j/core/cypher_session/responses/driver.rb | Ruby | mit | 97 | master | 2,507 | require 'neo4j/core/cypher_session/responses'
module Neo4j
module Core
class CypherSession
module Responses
class Driver < Base
attr_reader :results
def initialize(responses, options = {})
@wrap_level = options[:wrap_level] || Neo4j::Core::Config.wrapping_level
... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | lib/neo4j/core/cypher_session/responses/http.rb | Ruby | mit | 97 | master | 4,148 | require 'neo4j/core/cypher_session/responses'
module Neo4j
module Core
class CypherSession
module Responses
class HTTP < Base
attr_reader :results, :request_data
def initialize(faraday_response, options = {})
@faraday_response = faraday_response
@request... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | lib/neo4j/core/cypher_session/responses/bolt.rb | Ruby | mit | 97 | master | 4,057 | require 'neo4j/core/cypher_session/responses'
require 'active_support/core_ext/hash/keys'
module Neo4j
module Core
class CypherSession
module Responses
class Bolt < Base
attr_reader :results, :result_info
def initialize(queries, flush_messages_proc, options = {})
@w... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | lib/neo4j/core/cypher_session/responses/embedded.rb | Ruby | mit | 97 | master | 4,061 | require 'neo4j/core/cypher_session/responses'
module Neo4j
module Core
class CypherSession
module Responses
class Embedded < Base
attr_reader :results, :request_data
def initialize(execution_results, options = {})
# validate_response!(execution_results)
... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/helpers.rb | Ruby | mit | 97 | master | 561 | module Helpers
def server_username
ENV['NEO4J_USERNAME'] || 'neo4j'
end
def server_password
ENV['NEO4J_PASSWORD'] || 'neo4jrb rules, ok?'
end
def basic_auth_hash
if server_uri.user && server_uri.password
{
username: server_uri.user,
password: server_uri.password
}
... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/neo4j_spec_helpers.rb | Ruby | mit | 97 | master | 990 | module Neo4jSpecHelpers
class << self
attr_accessor :expect_queries_count
end
self.expect_queries_count = 0
Neo4j::Core::CypherSession::Adaptors::Base.subscribe_to_query do |_message|
self.expect_queries_count += 1
end
def expect_queries(count)
start_count = Neo4jSpecHelpers.expect_queries_co... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/spec_helper.rb | Ruby | mit | 97 | master | 3,392 | # To run coverage via travis
require 'simplecov'
require 'coveralls'
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
SimpleCov.start do
add_filter 'spec'
end
# To run it manually via Rake
if ENV['COVERAGE']
require 'simplecov'
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
SimpleCov.start
end... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/lib/yard_rspec.rb | Ruby | mit | 97 | master | 1,142 | class RSpecDescribeHandler < YARD::Handlers::Ruby::Base
handles method_call(:describe)
def process
param = statement.parameters.first.jump(:string_content).source
parse_block(statement.last.last, owner: obj_for_param(param))
rescue YARD::Handlers::NamespaceMissingError
end
private
def obj_for_pa... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/neo4j/core/cypher_session_spec.rb | Ruby | mit | 97 | master | 549 | require 'spec_helper'
require 'neo4j/core/cypher_session'
describe Neo4j::Core::CypherSession do
describe '#initialize' do
it 'fails with invalid adaptor' do
expect do
Neo4j::Core::CypherSession.new(Object.new)
end.to raise_error ArgumentError, /^Invalid adaptor: /
end
it 'takes an A... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/neo4j/core/transaction_spec.rb | Ruby | mit | 97 | master | 1,640 | require 'spec_helper'
require 'neo4j/transaction'
describe Neo4j::Transaction do
describe '.session_and_run_in_tx_from_args' do
let(:session_double) do
class_double(Neo4j::Core::CypherSession).tap do |double|
allow(double).to receive(:is_a?).with(Class) { true }
end
end
subject do
... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/neo4j/core/query_spec.rb | Ruby | mit | 97 | master | 30,964 | require 'spec_helper'
class DocGenerator
QUERY_DOCS_PATH = File.join('..', 'neo4j', 'docs')
RST_HEADER_ORDER = %w[- ~ ^]
def initialize(filename)
@filename = filename
@last_headers = []
base_path = File.join(QUERY_DOCS_PATH, "#{filename}.base")
@enabled = ENV['GENERATE_QUERY_DOCS'] && File.exi... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/neo4j/core/wrappable_spec.rb | Ruby | mit | 97 | master | 1,100 | require 'spec_helper'
require 'neo4j/core/wrappable'
describe Neo4j::Core::Wrappable do
before do
stub_const 'WrapperClass', (Class.new do
attr_reader :wrapped_object
def initialize(obj)
@wrapped_object = obj
end
end)
stub_const 'WrappableClass', (Class.new do
include Ne... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/neo4j/core/query_parameters_spec.rb | Ruby | mit | 97 | master | 972 | require 'spec_helper'
describe Neo4j::Core::Query::Parameters do
let(:parameters) { Neo4j::Core::Query::Parameters.new }
it 'lets you add params' do
expect(parameters.add_param(:foo, 1)).to eq(:foo)
expect(parameters.to_hash).to eq(foo: 1)
end
it 'lets you add a second param' do
expect(parameter... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/neo4j/core/shared_examples/adaptor.rb | Ruby | mit | 97 | master | 15,400 | # Requires that an `adaptor` let variable exist with the connected adaptor
RSpec.shared_examples 'Neo4j::Core::CypherSession::Adaptor' do
let(:real_session) do
expect(adaptor).to receive(:connect)
Neo4j::Core::CypherSession.new(adaptor)
end
let(:session_double) { double('session', adaptor: adaptor) }
b... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/neo4j/core/cypher_session/cypher_error_spec.rb | Ruby | mit | 97 | master | 1,045 | require 'spec_helper'
require 'neo4j/core/cypher_session/adaptors'
module Neo4j
module Core
describe CypherSession::CypherError do
let(:code) { 'SomeError' }
let(:message) { 'some fancy error' }
let(:stack_trace) { "class1:1\nclass2:2\nclass3:3" }
subject { described_class.new_from(code, ... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/neo4j/core/cypher_session/adaptors/bolt_spec.rb | Ruby | mit | 97 | master | 2,321 | require 'spec_helper'
require 'neo4j/core/cypher_session/adaptors/bolt'
require './spec/neo4j/core/shared_examples/adaptor'
describe Neo4j::Core::CypherSession::Adaptors::Bolt, bolt: true do
let(:extra_options) { {} }
let(:url) { test_bolt_url }
let(:adaptor) { test_bolt_adaptor(url, extra_options) }
subject ... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/neo4j/core/cypher_session/adaptors/embedded_spec.rb | Ruby | mit | 97 | master | 1,106 | if RUBY_PLATFORM == 'java'
require 'spec_helper'
require 'neo4j/core/cypher_session/adaptors/embedded'
require './spec/neo4j/core/shared_examples/adaptor'
require 'tmpdir'
require 'neo4j-community'
describe Neo4j::Core::CypherSession::Adaptors::Embedded do
let(:adaptor_class) { Neo4j::Core::CypherSessi... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/neo4j/core/cypher_session/adaptors/http_spec.rb | Ruby | mit | 97 | master | 3,126 | require 'spec_helper'
require 'neo4j/core/cypher_session/adaptors/http'
require './spec/neo4j/core/shared_examples/adaptor'
describe Neo4j::Core::CypherSession::Adaptors::HTTP do
before(:all) { setup_http_request_subscription }
let(:adaptor_class) { Neo4j::Core::CypherSession::Adaptors::HTTP }
let(:url) { ENV['... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/neo4j/core/cypher_session/adaptors/driver_spec.rb | Ruby | mit | 97 | master | 1,930 | if RUBY_PLATFORM =~ /java/
require 'spec_helper'
require 'neo4j/core/cypher_session/adaptors/driver'
require './spec/neo4j/core/shared_examples/adaptor'
require 'neo4j/driver'
def port
URI(ENV['NEO4J_BOLT_URL']).port
end
describe Neo4j::Core::CypherSession::Adaptors::Driver, bolt: true do
let(:a... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/neo4j/core/cypher_session/adaptors/has_uri_spec.rb | Ruby | mit | 97 | master | 2,012 | require 'spec_helper'
require 'neo4j/core/cypher_session/adaptors/has_uri'
describe Neo4j::Core::CypherSession::Adaptors::HasUri do
let(:uri_validation) {}
let(:default_url) {}
let!(:adaptor) do
scoped_default_url = default_url
scoped_uri_validation = uri_validation
Class.new do
include Neo4j::... |
github | neo4jrb/neo4j-core | https://github.com/neo4jrb/neo4j-core | spec/neo4j/core/cypher_session/adaptors/bolt/pack_stream_spec.rb | Ruby | mit | 97 | master | 23,151 | require 'spec_helper'
require './lib/neo4j/core/cypher_session/adaptors/bolt/pack_stream'
module Neo4j
# rubocop:disable Metrics/ModuleLength
module Core
# rubocop:disable Metrics/LineLength
describe PackStream do
describe PackStream::Packer do
describe '#unpack_value!' do
let(:argu... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | devise_openid_authenticatable.gemspec | Ruby | mit | 97 | master | 1,264 | # -*- encoding: utf-8 -*-
require File.expand_path('../lib/devise_openid_authenticatable/version', __FILE__)
Gem::Specification.new do |gem|
gem.authors = ["Nat Budin"]
gem.email = ["natbudin@gmail.com"]
gem.description = %q{OpenID authentication module for Devise using Rack::OpenID}
gem.summar... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | Rakefile | Ruby | mit | 97 | master | 518 | require 'bundler/gem_tasks'
require 'rdoc/task'
require 'rspec/mocks/version'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
desc 'Default: run specs.'
task :default => :spec
desc 'Generate documentation for the devise_openid_authenticatable plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_d... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | Gemfile | Ruby | mit | 97 | master | 311 | source 'https://rubygems.org'
ruby '2.3.1'
# Specify your gem's dependencies in devise_openid_authenticatable.gemspec
gemspec
group :test do
gem 'rails', '~> 5.0.0'
gem 'devise', '~> 4.2.0'
gem 'test-unit' # Ruby > 2.1, see github.com/rspec/rspec-rails/issues/1273
gem 'rails-controller-testing'
end |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | lib/devise_openid_authenticatable.rb | Ruby | mit | 97 | master | 374 | require 'devise'
require 'devise_openid_authenticatable/config'
require 'devise_openid_authenticatable/railtie'
require 'devise_openid_authenticatable/schema'
require 'devise_openid_authenticatable/strategy'
Devise.add_module :openid_authenticatable,
:strategy => true,
:model => 'devise_openid_authenticatable/mod... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | lib/devise_openid_authenticatable/railtie.rb | Ruby | mit | 97 | master | 482 | require 'devise_openid_authenticatable/controller'
if defined?(::Rails::Railtie)
module DeviseOpenidAuthenticatable
class Railtie < Rails::Railtie
initializer "devise.openid_initialization" do |config|
config.middleware.insert_before(Warden::Manager, Rack::OpenID)
end
initializer... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | lib/devise_openid_authenticatable/config.rb | Ruby | mit | 97 | master | 427 | module DeviseOpenidAuthenticatable
module Config
mattr_accessor :identity_url
end
end
module DeviseOpenidAuthenticatable
module Configurable
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def openid_authenticatable
yield DeviseOpenidAuthenticatab... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | lib/devise_openid_authenticatable/schema.rb | Ruby | mit | 97 | master | 350 | require 'devise/version'
# Devise 2.1 removes schema stuff
if Devise::VERSION < "2.1"
require 'devise/schema'
Devise::Schema.class_eval do
def openid_authenticatable
if respond_to?(:apply_devise_schema)
apply_devise_schema :identity_url, String
else
apply_schema :identity_url, Strin... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | lib/devise_openid_authenticatable/controller.rb | Ruby | mit | 97 | master | 458 | module DeviseOpenidAuthenticatable
module Controller
extend ActiveSupport::Concern
included do
alias_method_chain :verify_authenticity_token, :openid_response_check
end
protected
def verify_authenticity_token_with_openid_response_check
verify_authenticity_token_without_openid_respons... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | lib/devise_openid_authenticatable/model.rb | Ruby | mit | 97 | master | 399 | module Devise
module Models
module OpenidAuthenticatable
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def find_by_identity_url(identity_url)
where(:identity_url => identity_url).first
end
end
module InstanceMethods... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | lib/devise_openid_authenticatable/strategy.rb | Ruby | mit | 97 | master | 4,529 | require 'devise/strategies/base'
require 'rack/openid'
class Devise::Strategies::OpenidAuthenticatable < Devise::Strategies::Authenticatable
def valid?
valid_mapping? && ( provider_response? || identity_param? )
end
def authenticate!
logger.debug("Authenticating with OpenID for mapping #{mapping.to}")
... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | spec/spec_helper.rb | Ruby | mit | 97 | master | 1,538 | ENV["RAILS_ENV"] = "test"
$:.unshift File.dirname(__FILE__)
$:.unshift File.expand_path('../../lib', __FILE__)
require "scenario/config/environment"
require "rails/test_help"
require 'rspec/rails'
require 'sham_rack'
require 'rots'
Webrat.configure do |config|
config.mode = :rails
config.open_error_files = false
... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | spec/strategy_spec.rb | Ruby | mit | 97 | master | 11,328 | require 'spec_helper'
describe Devise::Strategies::OpenidAuthenticatable do
include RSpec::Rails::RequestExampleGroup
def openid_params
{
"openid.identity"=>identity,
"openid.sig"=>"OWYQspA5zZhoqRFhfSMFX/hLkok=",
"openid.return_to"=>"http://www.example.com/users/sign_in?_method=post",
... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | spec/model_spec.rb | Ruby | mit | 97 | master | 264 | require 'spec_helper'
describe Devise::Models::OpenidAuthenticatable do
it 'should respond to find_by_identity_url' do
User.included_modules.should include(Devise::Models::OpenidAuthenticatable)
User.should respond_to(:find_by_identity_url)
end
end |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | spec/scenario/app/models/user.rb | Ruby | mit | 97 | master | 392 | class User < ActiveRecord::Base
devise :openid_authenticatable, :rememberable
def self.build_from_identity_url(identity_url)
new do |user|
user.identity_url = identity_url
end
end
def self.openid_required_fields
["http://axschema.org/contact/email"]
end
def openid_fields=(fields)
se... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | spec/scenario/app/models/legacy_user.rb | Ruby | mit | 97 | master | 401 | class LegacyUser < ActiveRecord::Base
devise :openid_authenticatable, :rememberable
def self.create_from_identity_url(identity_url)
create do |user|
user.identity_url = identity_url
end
end
def self.openid_required_fields
["http://axschema.org/contact/email"]
end
def openid_fields=(fiel... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | spec/scenario/app/models/database_user.rb | Ruby | mit | 97 | master | 400 | class DatabaseUser < ActiveRecord::Base
devise :database_authenticatable, :openid_authenticatable, :validatable
def self.build_from_identity_url(identity_url)
new(:identity_url => identity_url)
end
def self.openid_required_fields
["http://axschema.org/contact/email"]
end
def openid_fields=(fiel... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | spec/scenario/db/schema.rb | Ruby | mit | 97 | master | 1,674 | # This file is auto-generated from the current state of the database. Instead of editing this file,
# please use the migrations feature of Active Record to incrementally modify your database, and
# then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your datab... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | spec/scenario/db/migrate/20100401102949_create_tables.rb | Ruby | mit | 97 | master | 1,240 | require 'devise/version'
class CreateTables < ActiveRecord::Migration
def self.openid_authenticatable_fields(t)
if Devise::VERSION < "2.1"
require 'devise/schema'
t.openid_authenticatable
else
t.string :identity_url
end
end
def self.rememberable_fields(t)
if Devise::VERSION < "... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | spec/scenario/config/boot.rb | Ruby | mit | 97 | master | 389 | require 'rubygems'
# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../../../Gemfile', __FILE__)
begin
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
rescue Bundler::GemNotFound => e
STDERR.puts e.message
STDERR.puts "Try running `bundle install`."
exit!
end if File.exis... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | spec/scenario/config/application.rb | Ruby | mit | 97 | master | 411 | require File.expand_path('../boot', __FILE__)
require "rails/all"
Bundler.require :default, Rails.env
require "devise"
require "devise_openid_authenticatable"
Devise.setup do |config|
require "devise/orm/active_record"
end
module Scenario
class Application < Rails::Application
config.active_support.deprecat... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | spec/scenario/config/initializers/secret_token.rb | Ruby | mit | 97 | master | 492 | Rails.application.config.secret_token = 'ea942c41850d502f2c8283e26bdc57829f471bb18224ddff0a192c4f32cdf6cb5aa0d82b3a7a7adbeb640c4b06f3aa1cd5f098162d8240f669b39d6b49680571'
Rails.application.config.session_store :cookie_store, key: "_my_scenario"
if Scenario::Application.config.respond_to?(:secret_key_base=)
Scenario::... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | spec/scenario/config/environments/development.rb | Ruby | mit | 97 | master | 777 | Scenario::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webs... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | spec/scenario/config/environments/test.rb | Ruby | mit | 97 | master | 1,522 | Scenario::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | spec/support/migrations.rb | Ruby | mit | 97 | master | 259 | FileUtils.rm File.expand_path("../../scenario/db/*.sqlite3", __FILE__), :force => true
ActiveRecord::Base.logger = Logger.new(nil)
ActiveRecord::Migration.verbose = false
ActiveRecord::Migrator.migrate(File.expand_path("../../scenario/db/migrate/", __FILE__)) |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/db/schema.rb | Ruby | mit | 97 | master | 2,119 | # encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative sou... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/db/migrate/20100401102949_create_tables.rb | Ruby | mit | 97 | master | 2,077 | superclass = ActiveRecord::Migration
# TODO: Inherit from the 5.0 Migration class directly when we drop support for Rails 4.
superclass = ActiveRecord::Migration[5.0] if superclass.respond_to?(:[])
class CreateTables < superclass
def self.up
create_table :users do |t|
t.string :username
t.string :fac... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/config/routes.rb | Ruby | mit | 97 | master | 3,972 | Rails.application.routes.draw do
# Resources for testing
resources :users, only: [:index] do
member do
get :expire
get :accept
get :edit_form
put :update_form
end
authenticate do
post :exhibit, on: :member
end
end
resources :admins, only: [:index]
# Users scope... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/config/boot.rb | Ruby | mit | 97 | master | 414 | unless defined?(DEVISE_ORM)
DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym
end
module Devise
# Detection for minor differences between Rails 4 and 5 in tests.
def self.rails5?
Rails.version.start_with? '5'
end
end
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/config/application.rb | Ruby | mit | 97 | master | 1,403 | require File.expand_path('../boot', __FILE__)
require "action_controller/railtie"
require "action_mailer/railtie"
require "rails/test_unit/railtie"
Bundler.require :default, DEVISE_ORM
begin
require "#{DEVISE_ORM}/railtie"
rescue LoadError
end
require "devise"
module RailsApp
class Application < Rails::Applica... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/config/environments/test.rb | Ruby | mit | 97 | master | 1,902 | RailsApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test ... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/config/environments/development.rb | Ruby | mit | 97 | master | 1,127 | RailsApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web ... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/config/environments/production.rb | Ruby | mit | 97 | master | 3,417 | RailsApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both thread web ser... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/config/initializers/devise.rb | Ruby | mit | 97 | master | 8,455 | require "omniauth-facebook"
require "omniauth-openid"
# Use this hook to configure devise mailer, warden hooks and so forth. The first
# four configuration values can also be set straight in your models.
Devise.setup do |config|
config.secret_key = "d9eb5171c59a4c817f68b0de27b8c1e340c2341b52cdbc60d3083d4e8958532" \
... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/app/controllers/users_controller.rb | Ruby | mit | 97 | master | 823 | class UsersController < ApplicationController
prepend_before_action :current_user, only: :exhibit
before_action :authenticate_user!, except: [:accept, :exhibit]
respond_to :html, :xml
def index
user_session[:cart] = "Cart"
respond_with(current_user)
end
def edit_form
user_session['last_request... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/app/controllers/application_controller.rb | Ruby | mit | 97 | master | 447 | # Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
protect_from_forgery
before_action :current_user, unless: :devise_controller?
before_action :authenticate_u... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/app/controllers/application_with_fake_engine.rb | Ruby | mit | 97 | master | 593 | class ApplicationWithFakeEngine < ApplicationController
private
helper_method :fake_engine
def fake_engine
@fake_engine ||= FakeEngine.new
end
end
class FakeEngine
def user_on_engine_confirmation_path
'/user_on_engine/confirmation'
end
def new_user_on_engine_session_path
'/user_on_engine/co... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/app/controllers/home_controller.rb | Ruby | mit | 97 | master | 425 | class HomeController < ApplicationController
def index
end
def private
end
def user_dashboard
end
def admin_dashboard
end
def join
end
def set
session["devise.foo_bar"] = "something"
head :ok
end
def unauthenticated
if Devise.rails5?
render body: "unauthenticated", stat... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/app/controllers/users/omniauth_callbacks_controller.rb | Ruby | mit | 97 | master | 491 | class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def facebook
data = request.respond_to?(:get_header) ? request.get_header("omniauth.auth") : request.env["omniauth.auth"]
session["devise.facebook_data"] = data["extra"]["user_hash"]
render json: data
end
def sign_in_faceb... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/app/controllers/custom/registrations_controller.rb | Ruby | mit | 97 | master | 522 | class Custom::RegistrationsController < Devise::RegistrationsController
def new
super do |resource|
@new_block_called = true
end
end
def create
super do |resource|
@create_block_called = true
end
end
def update
super do |resource|
@update_block_called = true
end
e... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/app/mongoid/user_on_engine.rb | Ruby | mit | 97 | master | 1,166 | require 'shared_user_without_omniauth'
class UserOnEngine
include Mongoid::Document
include Shim
include SharedUserWithoutOmniauth
field :username, type: String
field :facebook_token, type: String
## Database authenticatable
field :email, type: String, default: ""
field :encrypted_password, type: Str... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/app/mongoid/user_without_email.rb | Ruby | mit | 97 | master | 952 | require "shared_user_without_email"
class UserWithoutEmail
include Mongoid::Document
include Shim
include SharedUserWithoutEmail
field :username, type: String
field :facebook_token, type: String
## Database authenticatable
field :email, type: String, default: ""
field :encrypted_password, type: Strin... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/app/mongoid/shim.rb | Ruby | mit | 97 | master | 452 | module Shim
extend ::ActiveSupport::Concern
included do
include ::Mongoid::Timestamps
field :created_at, type: DateTime
end
module ClassMethods
def order(attribute)
asc(attribute)
end
def find_by_email(email)
find_by(email: email)
end
end
# overwrite equality (because... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/app/mongoid/user_on_main_app.rb | Ruby | mit | 97 | master | 1,167 | require 'shared_user_without_omniauth'
class UserOnMainApp
include Mongoid::Document
include Shim
include SharedUserWithoutOmniauth
field :username, type: String
field :facebook_token, type: String
## Database authenticatable
field :email, type: String, default: ""
field :encrypted_password, type: St... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/app/mongoid/admin.rb | Ruby | mit | 97 | master | 702 | require 'shared_admin'
class Admin
include Mongoid::Document
include Shim
include SharedAdmin
## Database authenticatable
field :email, type: String
field :encrypted_password, type: String
## Recoverable
field :reset_password_token, type: String
field :reset_password_sent_at, type: T... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/app/mongoid/user.rb | Ruby | mit | 97 | master | 1,171 | require 'shared_user'
class User
include Mongoid::Document
include Shim
include SharedUser
field :username, type: String
field :facebook_token, type: String
## Database authenticatable
field :email, type: String, default: ""
field :encrypted_password, type: String, default: ""
## Reco... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/lib/shared_admin.rb | Ruby | mit | 97 | master | 541 | module SharedAdmin
extend ActiveSupport::Concern
included do
devise :database_authenticatable, :registerable,
:timeoutable, :recoverable, :lockable, :confirmable,
unlock_strategy: :time, lock_strategy: :none,
allow_unconfirmed_access_for: 2.weeks, reconfirmable: true
valid... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/lib/shared_user_without_email.rb | Ruby | mit | 97 | master | 966 | module SharedUserWithoutEmail
extend ActiveSupport::Concern
included do
# NOTE: This is missing :validatable and :confirmable, as they both require
# an email field at the moment. It is also missing :omniauthable because that
# adds unnecessary complexity to the setup
devise :database_authenticatab... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/lib/shared_user.rb | Ruby | mit | 97 | master | 744 | module SharedUser
extend ActiveSupport::Concern
included do
devise :database_authenticatable, :confirmable, :lockable, :recoverable,
:registerable, :rememberable, :timeoutable,
:trackable, :validatable, :omniauthable, password_length: 7..72,
reconfirmable: false
attr_acces... |
github | nbudin/devise_openid_authenticatable | https://github.com/nbudin/devise_openid_authenticatable | rails/lib/shared_user_without_omniauth.rb | Ruby | mit | 97 | master | 334 | module SharedUserWithoutOmniauth
extend ActiveSupport::Concern
included do
devise :database_authenticatable, :confirmable, :lockable, :recoverable,
:registerable, :rememberable, :timeoutable,
:trackable, :validatable, reconfirmable: false
end
def raw_confirmation_token
@raw_confirmation_to... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | Gemfile | Ruby | mit | 97 | master | 583 | source "https://rubygems.org"
gemspec
group :test do
gem "benchmark-ips", "~> 2.7.2"
gem "json", "2.4.1" if RUBY_VERSION == "2.0.0"
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.1.0")
gem "rspec-benchmark"
end
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.7.0")
gem "activesuppo... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | strings-case.gemspec | Ruby | mit | 97 | master | 1,298 | # frozen_string_literal: true
require_relative "lib/strings/case/version"
Gem::Specification.new do |spec|
spec.name = "strings-case"
spec.version = Strings::Case::VERSION
spec.authors = ["Piotr Murach"]
spec.email = ["piotr@piotrmurach.com"]
spec.summary = "Convert string... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | lib/strings/case.rb | Ruby | mit | 97 | master | 11,193 | # frozen_string_literal: true
require "forwardable"
require "strscan"
require_relative "case/acronyms"
require_relative "case/configuration"
require_relative "case/version"
module Strings
# Responsible for converting strings to common cases
#
# @api public
class Case
# The word delimiters
#
# @re... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | lib/strings/case/acronyms.rb | Ruby | mit | 97 | master | 2,351 | # frozen_string_literal: true
module Strings
class Case
# A collection of acronyms
#
# @api private
class Acronyms
# Create instance from an array of acronyms
#
# @example
# acronyms = Strings::Case::Acronyms.new(%w[HTTP XML])
#
# @param [Array<String>, Strings::... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | lib/strings/case/configuration.rb | Ruby | mit | 97 | master | 1,416 | # frozen_string_literal: true
require_relative "acronyms"
module Strings
class Case
# Responsible for storing acronyms configuration
#
# @api private
class Configuration
# All the registered acronyms
#
# @example
# configuration.acronyms
#
# @return [Strings::Ca... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | lib/strings/case/extensions.rb | Ruby | mit | 97 | master | 2,648 | # frozen_string_literal: true
require_relative "../case"
module Strings
class Case
# Responsible for refining the String class with case conversions
#
# @api public
module Extensions
refine String do
# Convert string to camel case
#
# @see Strings::Case#camelcase
... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/spec_helper.rb | Ruby | mit | 97 | master | 901 | # frozen_string_literal: true
if ENV["COVERAGE"] == "true"
require "simplecov"
require "coveralls"
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
])
SimpleCov.start do
command_name "spec"
add_filter "spec... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/unit/constcase_spec.rb | Ruby | mit | 97 | master | 3,547 | # frozen_string_literal: true
RSpec.describe Strings::Case, "#constcase" do
{
nil => nil,
"" => "",
"1234" => "1234",
"FOO" => "FOO",
"FooBar" => "FOO_BAR",
"fooBar" => "FOO_BAR",
"foo bar" => "FOO_BAR",
"Foo - Bar" => "FOO_BAR",
"foo & bar" => "FOO_&_BAR",
"FooFooBar" => "FOO... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/unit/snakecase_spec.rb | Ruby | mit | 97 | master | 3,536 | # frozen_string_literal: true
RSpec.describe Strings::Case, "#snakecase" do
{
nil => nil,
"" => "",
"f" => "f",
"1234" => "1234",
"FOO" => "foo",
"FooBar" => "foo_bar",
"fooBar" => "foo_bar",
"foo bar" => "foo_bar",
"Foo - Bar" => "foo_bar",
"foo & bar" => "foo_&_bar",
"Fo... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/unit/new_spec.rb | Ruby | mit | 97 | master | 575 | # frozen_string_literal: true
RSpec.describe Strings::Case, ".new" do
it "creates a global instance only once" do
described_class.instance_variable_set(:@__instance__, nil)
allow(described_class).to receive(:new).once.and_call_original
described_class.camelcase("test")
described_class.camelcase("tes... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/unit/acronyms_spec.rb | Ruby | mit | 97 | master | 2,055 | # frozen_string_literal: true
RSpec.describe Strings::Case::Acronyms do
it "has no acronyms by default" do
acronyms = described_class.new
expect(acronyms.to_a).to eq([])
end
it "doesn't instantiate from the Strings::Case::Acronyms object" do
acronyms = described_class.new
expect(described_clas... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/unit/camelcase_spec.rb | Ruby | mit | 97 | master | 3,591 | # frozen_string_literal: true
RSpec.describe Strings::Case, "#camelcase" do
{
nil => nil,
"" => "",
"f" => "f",
"1234" => "1234",
"FOO" => "foo",
"FooBar" => "fooBar",
"fooBar" => "fooBar",
"foo bar" => "fooBar",
"Foo - Bar" => "fooBar",
"foo & bar" => "foo&Bar",
"FooFooBa... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/unit/extensions_spec.rb | Ruby | mit | 97 | master | 2,197 | # frozen_string_literal: true
require "strings/case/extensions"
using Strings::Case::Extensions
RSpec.describe Strings::Case::Extensions do
it "camelcase a string" do
expect("foo bar baz".camelcase).to eq("fooBarBaz")
end
it "camelcase a string with acronyms" do
expect("HTTP Response Code".lower_camel... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/unit/sentencecase_spec.rb | Ruby | mit | 97 | master | 3,716 | # frozen_string_literal: true
RSpec.describe Strings::Case, "#sentencecase" do
{
nil => nil,
"" => "",
"f" => "F",
"1234" => "1234",
"FOO" => "Foo",
"FooBar" => "Foo bar",
"fooBar" => "Foo bar",
"foo bar" => "Foo bar",
"Foo - Bar" => "Foo bar",
"foo & bar" => "Foo & bar",
... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/unit/configuration_spec.rb | Ruby | mit | 97 | master | 587 | # frozen_string_literal: true
RSpec.describe Strings::Case::Configuration do
it "sets acronyms to the Strings::Case::Acronyms object" do
config = described_class.new
expect(config.acronyms).to be_a(Strings::Case::Acronyms)
end
it "has no acronyms configured by default" do
config = described_class.n... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/unit/titlecase_spec.rb | Ruby | mit | 97 | master | 3,559 | # frozen_string_literal: true
RSpec.describe Strings::Case, "#titlecase" do
{
nil => nil,
"" => "",
"f" => "F",
"1234" => "1234",
"FOO" => "Foo",
"FooBar" => "Foo Bar",
"fooBar" => "Foo Bar",
"foo bar" => "Foo Bar",
"Foo - Bar" => "Foo Bar",
"foo & bar" => "Foo & Bar",
"Fo... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/unit/headercase_spec.rb | Ruby | mit | 97 | master | 3,642 | # frozen_string_literal: true
RSpec.describe Strings::Case, "#headercase" do
{
nil => nil,
"" => "",
"1234" => "1234",
"FOO" => "Foo",
"FooBar" => "Foo-Bar",
"fooBar" => "Foo-Bar",
"foo bar" => "Foo-Bar",
"Foo - Bar" => "Foo-Bar",
"foo & bar" => "Foo-&-Bar",
"FooFooBar" => "Fo... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/unit/configure_spec.rb | Ruby | mit | 97 | master | 883 | # frozen_string_literal: true
RSpec.describe Strings::Case, "#configure" do
it "configures acronyms within a block" do
strings = described_class.new
strings.configure do |config|
config.acronym "HTTP", "JSON"
config.acronym "XML"
end
expect(strings.camelcase("xml_http_request")).to eq("... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/unit/kebabcase_spec.rb | Ruby | mit | 97 | master | 3,464 | # frozen_string_literal: true
RSpec.describe Strings::Case, "#kebabcase" do
{
"" => "",
"1234" => "1234",
"FOO" => "foo",
"FooBar" => "foo-bar",
"fooBar" => "foo-bar",
"foo bar" => "foo-bar",
"Foo - Bar" => "foo-bar",
"foo & bar" => "foo-&-bar",
"FooFooBar" => "foo-foo-bar",
"... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/unit/pascalcase_spec.rb | Ruby | mit | 97 | master | 3,666 | # frozen_string_literal: true
RSpec.describe Strings::Case, "#pascalcase" do
{
nil => nil,
"" => "",
"f" => "F",
"1234" => "1234",
"FOO" => "Foo",
"FooBar" => "FooBar",
"fooBar" => "FooBar",
"foo bar" => "FooBar",
"Foo - Bar" => "FooBar",
"foo & bar" => "Foo&Bar",
"FooFooB... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/unit/pathcase_spec.rb | Ruby | mit | 97 | master | 3,524 | # frozen_string_literal: true
RSpec.describe Strings::Case, "#pathcase" do
{
nil => nil,
"" => "",
"f" => "f",
"1234" => "1234",
"FOO" => "foo",
"FooBar" => "foo/bar",
"fooBar" => "foo/bar",
"foo bar" => "foo/bar",
"Foo - Bar" => "foo/bar",
"foo & bar" => "foo/&/bar",
"Foo... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | spec/perf/parsecase_spec.rb | Ruby | mit | 97 | master | 1,025 | # frozen_string_literal: true
require "rspec-benchmark"
require "active_support"
RSpec.describe Strings::Case do
include RSpec::Benchmark::Matchers
it "changes case 2.85x slower than ActiveSupport" do
strings_case_class = described_class
expect {
strings_case_class.snakecase("fooBarBaz")
}.to ... |
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | benchmarks/speed.rb | Ruby | mit | 97 | master | 345 | # frozen_string_literal: true
require "benchmark/ips"
require "active_support"
require_relative "../lib/strings-case"
Benchmark.ips do |bench|
bench.report("active_support") do
ActiveSupport::Inflector.underscore("fooBarBaz")
end
bench.report("strings-case") do
Strings::Case.snakecase("fooBarBaz")
e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.