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 |
|---|---|---|---|---|---|---|---|---|
janko/sequel-activerecord_connection | https://github.com/janko/sequel-activerecord_connection/blob/b40b15071cbf73aca61b86370ca7088c654f9297/lib/sequel/extensions/activerecord_connection/mysql2.rb | lib/sequel/extensions/activerecord_connection/mysql2.rb | require_relative "utils"
module Sequel
module ActiveRecordConnection
module Mysql2
def synchronize(*)
super do |conn|
# required for prepared statements
Utils.add_prepared_statements_cache(conn)
yield conn
end
end
private
def _execute(conn,... | ruby | MIT | b40b15071cbf73aca61b86370ca7088c654f9297 | 2026-01-04T17:39:16.662646Z | false |
janko/sequel-activerecord_connection | https://github.com/janko/sequel-activerecord_connection/blob/b40b15071cbf73aca61b86370ca7088c654f9297/lib/sequel/extensions/activerecord_connection/oracle.rb | lib/sequel/extensions/activerecord_connection/oracle.rb | require_relative "utils"
module Sequel
module ActiveRecordConnection
module Oracle
def synchronize(*)
super do |conn|
raw_connection = conn.respond_to?(:raw_oci_connection) ? conn.raw_oci_connection : conn
# required for prepared statements
Utils.add_prepared_statemen... | ruby | MIT | b40b15071cbf73aca61b86370ca7088c654f9297 | 2026-01-04T17:39:16.662646Z | false |
janko/sequel-activerecord_connection | https://github.com/janko/sequel-activerecord_connection/blob/b40b15071cbf73aca61b86370ca7088c654f9297/lib/sequel/extensions/activerecord_connection/tinytds.rb | lib/sequel/extensions/activerecord_connection/tinytds.rb | require_relative "utils"
module Sequel
module ActiveRecordConnection
module Tinytds
def synchronize(*)
super do |conn|
conn.query_options.merge!(cache_rows: false)
begin
yield conn
ensure
conn.query_options.merge!(cache_rows: true)
en... | ruby | MIT | b40b15071cbf73aca61b86370ca7088c654f9297 | 2026-01-04T17:39:16.662646Z | false |
janko/sequel-activerecord_connection | https://github.com/janko/sequel-activerecord_connection/blob/b40b15071cbf73aca61b86370ca7088c654f9297/lib/sequel/extensions/activerecord_connection/sqlite.rb | lib/sequel/extensions/activerecord_connection/sqlite.rb | require_relative "utils"
module Sequel
module ActiveRecordConnection
module Sqlite
def self.extended(db)
if db.timezone == :utc && db.respond_to?(:current_timestamp_utc)
db.current_timestamp_utc = true
end
end
def synchronize(*)
super do |conn|
conn.... | ruby | MIT | b40b15071cbf73aca61b86370ca7088c654f9297 | 2026-01-04T17:39:16.662646Z | false |
janko/sequel-activerecord_connection | https://github.com/janko/sequel-activerecord_connection/blob/b40b15071cbf73aca61b86370ca7088c654f9297/lib/sequel/extensions/activerecord_connection/jdbc.rb | lib/sequel/extensions/activerecord_connection/jdbc.rb | module Sequel
module ActiveRecordConnection
module Jdbc
def self.extended(db)
if db.timezone == :utc && db.respond_to?(:current_timestamp_utc)
db.current_timestamp_utc = true
end
end
def synchronize(*)
super do |conn|
if database_type == :oracle
... | ruby | MIT | b40b15071cbf73aca61b86370ca7088c654f9297 | 2026-01-04T17:39:16.662646Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/spec_helper.rb | spec/spec_helper.rb | require 'active_record'
require 'activeform-rails'
require 'database_cleaner'
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:database => ':memory:'
)
['CREATE TABLE categories(id INTEGER PRIMARY KEY, title, user_id)',
'CREATE TABLE users(id INTEGER PRIMARY KEY, name, firstname)'].each do |sql|
... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/app/helpers/application_helper.rb | spec/dummy/app/helpers/application_helper.rb | module ApplicationHelper
end
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/app/controllers/categories_controller.rb | spec/dummy/app/controllers/categories_controller.rb | class CategoriesController < ApplicationController
before_action :set_category, only: [:show, :edit, :update, :destroy]
# GET /categories
def index
@categories = Category.all
end
# GET /categories/1
def show
end
# GET /categories/new
def new
@category = Category.new
@form = CategoryForm... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/app/controllers/users_controller.rb | spec/dummy/app/controllers/users_controller.rb | class UsersController < ApplicationController
before_action :set_user, only: [:show, :edit, :update, :destroy]
# GET /users
def index
@users = User.all
end
# GET /users/1
def show
end
# GET /users/new
def new
@form = UserForm.new(user: User.new)
end
# GET /users/1/edit
def edit
@... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/app/controllers/application_controller.rb | spec/dummy/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/app/forms/user_form.rb | spec/dummy/app/forms/user_form.rb | class UserForm
include ActiveForm::Form
include ActiveForm::ValidateUniqueness
properties :name, :category_id, :category, on: :user
validates_uniqueness_of :name, :user
self.main_model = :user
validates :name, presence: true
end
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/app/forms/category_form.rb | spec/dummy/app/forms/category_form.rb | class CategoryForm
include ActiveForm::Form
properties :title, on: :category
self.main_model = :category
validates :title, presence: true
attr_accessor :user_ids
def fill_attributes(attributes)
super(attributes)
end
def save
super do
category.save
category.users = user_ids.dele... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/app/models/category.rb | spec/dummy/app/models/category.rb | class Category < ActiveRecord::Base
has_many :users
end
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/app/models/user.rb | spec/dummy/app/models/user.rb | class User < ActiveRecord::Base
belongs_to :category
end
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/db/schema.rb | spec/dummy/db/schema.rb | # 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... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/db/migrate/20140216201540_create_users.rb | spec/dummy/db/migrate/20140216201540_create_users.rb | class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :name
t.belongs_to :category, index: true
t.timestamps
end
end
end
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/db/migrate/20140222122256_create_categories.rb | spec/dummy/db/migrate/20140222122256_create_categories.rb | class CreateCategories < ActiveRecord::Migration
def change
create_table :categories do |t|
t.string :title
t.timestamps
end
end
end
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/test/helpers/categories_helper_test.rb | spec/dummy/test/helpers/categories_helper_test.rb | require 'test_helper'
class CategoriesHelperTest < ActionView::TestCase
end
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/test/helpers/users_helper_test.rb | spec/dummy/test/helpers/users_helper_test.rb | require 'test_helper'
class UsersHelperTest < ActionView::TestCase
end
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/test/controllers/categories_controller_test.rb | spec/dummy/test/controllers/categories_controller_test.rb | require 'test_helper'
class CategoriesControllerTest < ActionController::TestCase
setup do
@category = categories(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:categories)
end
test "should get new" do
get :new
assert_response :succe... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/test/controllers/users_controller_test.rb | spec/dummy/test/controllers/users_controller_test.rb | require 'test_helper'
class UsersControllerTest < ActionController::TestCase
setup do
@user = users(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:users)
end
test "should get new" do
get :new
assert_response :success
end
test "s... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/test/models/user_test.rb | spec/dummy/test/models/user_test.rb | require 'test_helper'
class UserTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/test/models/category_test.rb | spec/dummy/test/models/category_test.rb | require 'test_helper'
class CategoryTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/config/application.rb | spec/dummy/config/application.rb | require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
require "activeform-rails"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in ... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/config/environment.rb | spec/dummy/config/environment.rb | # Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Dummy::Application.initialize!
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/config/routes.rb | spec/dummy/config/routes.rb | Dummy::Application.routes.draw do
resources :categories
resources :users
root 'users#index'
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
# root 'welcome#in... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/config/boot.rb | spec/dummy/config/boot.rb | # Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/config/initializers/filter_parameter_logging.rb | spec/dummy/config/initializers/filter_parameter_logging.rb | # Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/config/initializers/session_store.rb | spec/dummy/config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/config/initializers/wrap_parameters.rb | spec/dummy/config/initializers/wrap_parameters.rb | # Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters f... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/config/initializers/inflections.rb | spec/dummy/config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflec... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/config/initializers/backtrace_silencers.rb | spec/dummy/config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/config/initializers/mime_types.rb | spec/dummy/config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/config/initializers/secret_token.rb | spec/dummy/config/initializers/secret_token.rb | # Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to diction... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/config/environments/test.rb | spec/dummy/config/environments/test.rb | Dummy::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 sui... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/config/environments/development.rb | spec/dummy/config/environments/development.rb | Dummy::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 ser... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/dummy/config/environments/production.rb | spec/dummy/config/environments/production.rb | Dummy::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 server... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/activeform-rails/form_spec.rb | spec/activeform-rails/form_spec.rb | require 'spec_helper'
describe ActiveForm do
context 'backed by models' do
class Form
include ActiveForm::Form
properties :name, on: :user
properties :title, on: :category
attr_accessor :user, :category
self.main_model = :user
end
describe ".main_class" do
it "refle... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/activeform-rails/validate_uniqueness_spec.rb | spec/activeform-rails/validate_uniqueness_spec.rb | require 'spec_helper'
describe ActiveForm::ValidateUniqueness do
class ValidateUniquenessForm
include ActiveForm::Form
include ActiveForm::ValidateUniqueness
properties :name, :firstname, on: :user
validates_uniqueness_of :name, :user, allow_nil: true
validates_uniqueness_of :firstname, :user, al... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/spec/activeform-rails/validation_spec.rb | spec/activeform-rails/validation_spec.rb | require 'spec_helper'
describe 'ActiveForm ActiveRecord validators' do
context 'backed by models' do
class ValidationForm
include ActiveForm::Form
properties :name, on: :user
validates_presence_of :name
end
context "when name is empty" do
it "is not valid" do
user = User.... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/lib/activeform-rails.rb | lib/activeform-rails.rb | module ActiveForm
class CannotBePersisted < Exception; end
end
require 'active_support/core_ext/module/delegation'
require 'active_record'
require 'activeform-rails/form'
require 'activeform-rails/unpersistent_model'
require 'activeform-rails/validate_uniqueness'
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/lib/activeform-rails/version.rb | lib/activeform-rails/version.rb | module Activeform
VERSION = "0.0.5"
end
| ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/lib/activeform-rails/form.rb | lib/activeform-rails/form.rb | module ActiveForm::Form
def self.included(base)
base.class_eval do
extend ActiveModel::Naming
include ActiveModel::Conversion
include ActiveModel::Validations
end
base.extend ClassMethods
end
module ClassMethods
delegate :model_name, :reflect_on_association, to: :main_class
... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/lib/activeform-rails/unpersistent_model.rb | lib/activeform-rails/unpersistent_model.rb | # UnpersistentModel allows the ActiveForm::Form object to delegate methods to
# this object with expected results
#
# - #model_name is used by Form helpers & Rails frequently to define the form namespace
# - #to_key, #to_param, #id should aways return nil as the Form cannot be persisted unless backed by ActiveModel
# -... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
GCorbel/activeform-rails | https://github.com/GCorbel/activeform-rails/blob/d907b7dd4c9fdffe79b0c08d5a54baa86b415b75/lib/activeform-rails/validate_uniqueness.rb | lib/activeform-rails/validate_uniqueness.rb | module ActiveForm
module ValidateUniqueness
def self.included(base)
base.class_eval do
extend ClassMethods
end
end
module ClassMethods
def validates_uniqueness_of(attribute, model_name, options = {})
validates_each attribute, options do |form, attr, value|
@for... | ruby | MIT | d907b7dd4c9fdffe79b0c08d5a54baa86b415b75 | 2026-01-04T17:39:17.342867Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/spec/spec_helper.rb | spec/spec_helper.rb | require 'coveralls'
Coveralls.wear!
require "simplecov"
SimpleCov.start
require "rapidash"
require "ostruct"
| ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/spec/rapidash/response_error_spec.rb | spec/rapidash/response_error_spec.rb | require 'spec_helper'
class MyCustomResponseError < Rapidash::ResponseError
def errors
if body.kind_of?(Array)
body.join(', ')
else
body
end
end
end
describe Rapidash::ResponseError do
context "standard response error class" do
let(:response) { Rapidash::ResponseError.new(env) }
... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/spec/rapidash/http_client_spec.rb | spec/rapidash/http_client_spec.rb | require "spec_helper"
class HTTPTester < Rapidash::Client
include Rapidash::HTTPClient
end
class HTTPSiteTester < HTTPTester
class << self
attr_accessor :site
end
end
class HTTPErrorTester < HTTPSiteTester
def self.raise_error
true
end
end
describe Rapidash::HTTPClient do
let!(:subject) { HTTPT... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/spec/rapidash/client_spec.rb | spec/rapidash/client_spec.rb | require 'spec_helper'
class OAuthClientTester < Rapidash::Client
method :oauth
end
class HTTPClientTester < Rapidash::Client
method :http
end
class HTTPClientPatchTester < HTTPClientTester
use_patch
end
class HTTPClientExtensionTester < HTTPClientTester
extension :js
end
class HTTPClientErrorTester < HTTPC... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/spec/rapidash/resourceable_spec.rb | spec/rapidash/resourceable_spec.rb | require "spec_helper"
class Rapidash::Repo
attr_accessor :client, :args
def initialize(client, *args)
@client = client
@args = args
end
end
class Rapidash::User
include Rapidash::Resourceable
attr_accessor :client, :url
resource :repos
def initialize(client, *args)
@client = client
self
... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/spec/rapidash/test_client_spec.rb | spec/rapidash/test_client_spec.rb | require "spec_helper"
class TesterClient
include Rapidash::TestClient
end
describe Rapidash::TestClient do
let(:responses) do
{ :get => { "foo" => "bar" } }
end
let(:client) { TesterClient.new(responses) }
describe ".new" do
let(:stubs) { client.stubs }
it "should create Faraday test stubs" d... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/spec/rapidash/oauth_client_spec.rb | spec/rapidash/oauth_client_spec.rb | require 'spec_helper'
class OAuthTester < Rapidash::Client
include Rapidash::OAuthClient
end
class OAuthErrorTester < OAuthTester
def self.raise_error
true
end
end
describe Rapidash::OAuthClient do
let(:options) {
{
:uid => "foo",
:secret => "bar",
:access_token => "baz",
:sit... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/spec/rapidash/base_spec.rb | spec/rapidash/base_spec.rb | require 'spec_helper'
class BaseTester < Rapidash::Base
url "tester"
end
class Base < Rapidash::Base
end
class Rapidash::Resource < Rapidash::Base
end
class BaseTesterClient
class << self
attr_accessor :patch
end
end
class RootTester < Rapidash::Base
root :post
end
describe Rapidash::Base do
descr... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/spec/rapidash/urlable_spec.rb | spec/rapidash/urlable_spec.rb | require 'spec_helper'
class ApiTester < Rapidash::Base
url :foo
end
class BaseUrlTester < Rapidash::Base
url :foo
private
def base_url
"BASE_URL/"
end
end
class ApiTesterNoUrl < Rapidash::Base
end
describe Rapidash::Urlable do
let!(:client) { double }
let(:custom_header) { { :header => { user_... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/spec/rapidash/integration/test_client_spec.rb | spec/rapidash/integration/test_client_spec.rb | require 'spec_helper'
module Integration
class Repo < Rapidash::Base
end
class User < Rapidash::Base
url "members"
resource :repos
end
class Client < Rapidash::Client
method :test
resource :users
end
end
responses = {
:get => {
"members/Gazler" => { :name => "Gary Rennie" }.to_json... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/spec/rapidash/resourceable/collection_spec.rb | spec/rapidash/resourceable/collection_spec.rb | require 'spec_helper'
module CollectionTest; end
class CollectionTest::User < Rapidash::Base
collection :active
end
class CollectionTest::Person < Rapidash::Base
collection :suspend_all, :path => 'deactivate', :method => :post
end
class CollectionTest::Client < Rapidash::Client
method :http
site 'http://acme... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/spec/faraday/raise_rapidash_error_spec.rb | spec/faraday/raise_rapidash_error_spec.rb | require 'spec_helper'
describe Faraday::Response::RaiseRapidashError do
context "successful response" do
let(:env) { { :status => '200' } }
it "should not raise an exception" do
expect {
subject.on_complete(env)
}.to_not raise_exception
end
end
context "error response" do
le... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/examples/github.rb | examples/github.rb | require 'rapidash'
class Repo < Rapidash::Base
def repo!(owner, repo)
self.url += "/#{owner}/#{repo}"
call!
end
end
class User < Rapidash::Base
resource :repos
end
class Emoji < Rapidash::Base
end
class Event < Rapidash::Base
end
class Gist < Rapidash::Base
def public!
self.url += "/public"
... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/lib/rapidash.rb | lib/rapidash.rb | #Required for pluralization and camelcasing
require "active_support/core_ext/string"
require "active_support/core_ext/module/attribute_accessors"
require "json"
require "rapidash/version"
require "faraday/response/raise_rapidash_error"
require "rapidash/response_error"
require "rapidash/resourceable"
require "rapida... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/lib/rapidash/version.rb | lib/rapidash/version.rb | module Rapidash
VERSION = "0.4.0"
end
| ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/lib/rapidash/oauth_client.rb | lib/rapidash/oauth_client.rb | require 'oauth2'
require 'hashie'
module Rapidash
module OAuthClient
attr_accessor :secret, :uid, :access_token, :site
def initialize(options)
[:uid, :secret, :site].each do |key|
if options[key]
self.send("#{key.to_s}=".to_sym, options[key])
else
unless self.class.... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/lib/rapidash/urlable.rb | lib/rapidash/urlable.rb | module Rapidash
module Urlable
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def url(url)
define_method(:initialize) do |*args|
super(*args)
@url = "#{base_url}#{url.to_s}"
@url += "/#{@id}" if @id
end
end
end... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/lib/rapidash/response_error.rb | lib/rapidash/response_error.rb | module Rapidash
# Rapidash::ResponseError
# Exception that gets raised if the response is an error (4xx or 5xx)
# Raised by Faraday::Response::RaiseRapidashError
# see lib/faraday/response/raise_rapidash_error.rb
#
# Formats a readable error message including HTTP status, method and requested URL
#
# E... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/lib/rapidash/http_client.rb | lib/rapidash/http_client.rb | require 'faraday'
require 'faraday_middleware'
require 'faraday_middleware/multi_json'
module Rapidash
module HTTPClient
attr_accessor :login, :password, :request_default_options
attr_writer :connection
# Provide login and password fields for basic HTTP authentication
# Provide request_default_optio... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/lib/rapidash/base.rb | lib/rapidash/base.rb | module Rapidash
class Base
include Urlable
include Resourceable
attr_accessor :url, :options, :client
class << self
attr_accessor :root_element
def root(name)
@root_element = name.to_sym
end
end
def initialize(*args)
@client, @id, options = args
if @i... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/lib/rapidash/client.rb | lib/rapidash/client.rb | module Rapidash
class Client
include Resourceable
attr_accessor :extension
def initialize
raise ConfigurationError.new "Missing Method, define using `method` on your client"
end
class << self
attr_accessor :patch, :raise_error, :extension, :encoder
def method(method)
... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/lib/rapidash/resourceable.rb | lib/rapidash/resourceable.rb | module Rapidash
module Resourceable
def self.included(base)
base.extend ClassMethods
end
def resource(name, id = nil, options = {})
options[:url] ||= name
if self.respond_to?(:url)
options = {:previous_url => self.url}.merge!(options)
end
client = self
client =... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/lib/rapidash/test_client.rb | lib/rapidash/test_client.rb | # Rapidash::TestClient
# A dummy client for testing with. Create a new test
# client by including this module and initializing
# with a set of responses.
# Example:
#
# class TesterClient
# include Rapidash::TestClient
# end
#
# responses = {
# get: { "foo" => "bar" },
# post: { "baz" => "data" }
# }... | ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
Gazler/rapidash | https://github.com/Gazler/rapidash/blob/c98635e04ab6a744958efab2c21a1ac18de46460/lib/faraday/response/raise_rapidash_error.rb | lib/faraday/response/raise_rapidash_error.rb | require 'faraday'
module Faraday
class Response::RaiseRapidashError < Response::Middleware
def on_complete(env)
status = env[:status].to_i
klass = Rapidash.response_exception_class || Rapidash::ResponseError
raise klass.new(env) if (400..599).include?(status)
end
end
end
| ruby | MIT | c98635e04ab6a744958efab2c21a1ac18de46460 | 2026-01-04T17:39:14.199307Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/spec/spec_helper.rb | spec/spec_helper.rb | require 'bundler/setup'
require 'rack'
require 'rack/stream'
require 'rack/test'
require 'rspec'
Dir[File.expand_path('../support/**/*.rb', __FILE__)].each {|f| require f}
# Used by tests to untangle evented code, but not required for use w/ lib
require 'fiber'
require 'timeout'
# TODO: swap this with em-spec or som... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/spec/support/mock_server.rb | spec/support/mock_server.rb | module Support
class MockServer
class Callback
attr_reader :status, :headers, :body
def initialize(&blk)
@succeed_callback = blk
end
def call(args)
@status, @headers, deferred_body = args
@body = []
deferred_body.each do |s|
@body << s
en... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/spec/integration/server_spec.rb | spec/integration/server_spec.rb | # CI test. see .travis.yml for config variables
if ENV['SERVER']
require 'bundler/setup'
require 'rack'
require 'rack/stream'
require 'rspec'
require 'capybara/rspec'
require 'faraday'
require 'em-eventsource'
require 'capybara'
require 'capybara-webkit'
describe 'Integration', :integration => tru... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/spec/lib/rack/stream_spec.rb | spec/lib/rack/stream_spec.rb | require 'spec_helper'
describe Rack::Stream do
def app
b = Rack::Builder.new
b.use Support::MockServer
b.use Rack::Stream
b.run endpoint
b
end
shared_examples_for 'invalid action' do
it "should raise invalid state" do
get '/'
last_response.errors.should =~ /Invalid action/
... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/spec/lib/rack/stream/dsl_spec.rb | spec/lib/rack/stream/dsl_spec.rb | require 'spec_helper'
describe Rack::Stream::DSL do
subject do
Class.new {include Rack::Stream::DSL}.new
end
before do
EM.stop # TODO: would prefer to have only stream_spec require em
end
context 'raw rack' do
context '#call' do
it 'should declare #call' do
subject.respond_to?(:c... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/websocket_client.rb | examples/websocket_client.rb | require 'faye/websocket'
EM.run {
ws = Faye::WebSocket::Client.new('ws://localhost:3000/')
ws.onopen = lambda do |event|
ws.send("hello world")
end
ws.onmessage = lambda do |event|
puts "message: #{event.data}"
end
ws.onclose = lambda do |event|
puts "websocket closed"
EM.stop
end
} | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/grape/api.rb | examples/grape/api.rb | require 'grape'
require 'rack/stream'
require 'redis'
require 'redis/connection/synchrony'
class API < Grape::API
default_format :txt
helpers do
include Rack::Stream::DSL
def redis
@redis ||= Redis.new
end
def build_message(text)
redis.rpush 'messages', text
redis.ltrim 'messag... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/app/helpers/application_helper.rb | examples/rails/app/helpers/application_helper.rb | module ApplicationHelper
end
| ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/app/controllers/root_controller.rb | examples/rails/app/controllers/root_controller.rb | class RootController < ApplicationController
def index
end
end | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/app/controllers/messages_controller.rb | examples/rails/app/controllers/messages_controller.rb | class MessagesController < ApplicationController
include Rack::Stream::DSL
def index
render :nothing => true
end
def create
render :json => {
:text => params[:text],
:stream_transport => stream_transport
}
end
end | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/app/controllers/application_controller.rb | examples/rails/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
protect_from_forgery
end
| ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/db/seeds.rb | examples/rails/db/seeds.rb | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/config/application.rb | examples/rails/config/application.rb | require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
# require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
if defined?(Bundler)
# If you precompi... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/config/environment.rb | examples/rails/config/environment.rb | # Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Chat::Application.initialize!
| ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/config/routes.rb | examples/rails/config/routes.rb | Chat::Application.routes.draw do
root :to => 'root#index'
# The priority is based upon order of creation:
# first created -> highest priority.
# Sample of regular route:
# match 'products/:id' => 'catalog#view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named ... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/config/boot.rb | examples/rails/config/boot.rb | require 'rubygems'
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
| ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/config/initializers/session_store.rb | examples/rails/config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
Chat::Application.config.session_store :cookie_store, key: '_chat_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generat... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/config/initializers/wrap_parameters.rb | examples/rails/config/initializers/wrap_parameters.rb | # Be sure to restart your server when you modify this file.
#
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters ... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/config/initializers/inflections.rb | examples/rails/config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', ... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/config/initializers/backtrace_silencers.rb | examples/rails/config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/config/initializers/mime_types.rb | examples/rails/config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
| ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/config/initializers/secret_token.rb | examples/rails/config/initializers/secret_token.rb | # Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attac... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/config/environments/test.rb | examples/rails/config/environments/test.rb | Chat::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 suite... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/config/environments/development.rb | examples/rails/config/environments/development.rb | Chat::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 serve... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/examples/rails/config/environments/production.rb | examples/rails/config/environments/production.rb | Chat::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
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_co... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/lib/rack/stream.rb | lib/rack/stream.rb | require 'eventmachine'
require 'em-synchrony'
require 'faye/websocket'
# By default, handle these protocols, there are additional
# handlers available in rack/stream/handlers
require 'rack/stream/handlers'
require 'rack/stream/handlers/http'
require 'rack/stream/handlers/event_source'
require 'rack/stream/handlers/web... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/lib/rack/stream/deferrable_body.rb | lib/rack/stream/deferrable_body.rb | module Rack
class Stream
# From [thin_async](https://github.com/macournoyer/thin_async)
class DeferrableBody
include EM::Deferrable
# @param chunks - object that responds to each. holds initial chunks of content
def initialize(chunks = [])
@queue = []
chunks.each {|c| chunk(... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/lib/rack/stream/dsl.rb | lib/rack/stream/dsl.rb | require 'forwardable'
module Rack
class Stream
# DSL to access Rack::Stream::App methods.
#
# ## Example
# ```ruby
# # config.ru
# class App
# include Rack::Stream::DSL
#
# # declare your rack endpoint with a block
# stream do
# # all `Rack::Stream::App` methods,... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/lib/rack/stream/app.rb | lib/rack/stream/app.rb | module Rack
class Stream
class App
class UnsupportedServerError < StandardError; end
class StateConstraintError < StandardError; end
# The state of the connection
# :new
# :open
# :closed
attr_reader :state
# @private
attr_reader :env
attr_reade... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/lib/rack/stream/handlers.rb | lib/rack/stream/handlers.rb | module Rack
class Stream
# A Handler is responsible for opening and closing connections
# to stream content.
module Handlers
# @private
def find(app)
klass = AbstractHandler.handlers.detect {|h| h.accepts?(app)}
klass.new(app)
end
module_function :find
# A ha... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
mobomo/rack-stream | https://github.com/mobomo/rack-stream/blob/b238d0ee773fd94aa72f88887b4de2d7a21e4b6a/lib/rack/stream/handlers/event_source.rb | lib/rack/stream/handlers/event_source.rb | module Rack
class Stream
module Handlers
# Handler to stream to EventSource
class EventSource < AbstractHandler
def self.accepts?(app)
::Faye::EventSource.eventsource?(app.env)
end
# TODO: browser initiates connection again, isn't closed
def close
@... | ruby | BSD-2-Clause | b238d0ee773fd94aa72f88887b4de2d7a21e4b6a | 2026-01-04T17:39:19.428471Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.