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 |
|---|---|---|---|---|---|---|---|---|
alexandreruban/action-markdown | https://github.com/alexandreruban/action-markdown/blob/d12722da01d0d2b254e132b4c21fb090a6af31d5/test/templates/form_helper_test.rb | test/templates/form_helper_test.rb | require "test_helper"
class ActionMarkdown::FormHelperTest < ActionView::TestCase
tests ActionMarkdown::TagHelper
def form_with(*, **)
@output_buffer = super
end
teardown do
I18n.backend.reload!
end
setup do
I18n.backend.store_translations("placeholder",
activerecord: {
attribu... | ruby | MIT | d12722da01d0d2b254e132b4c21fb090a6af31d5 | 2026-01-04T17:37:09.729781Z | false |
alexandreruban/action-markdown | https://github.com/alexandreruban/action-markdown/blob/d12722da01d0d2b254e132b4c21fb090a6af31d5/lib/action_markdown.rb | lib/action_markdown.rb | require "action_markdown/version"
require "action_markdown/engine"
require "redcarpet"
require "rouge"
module ActionMarkdown
extend ActiveSupport::Autoload
autoload :Attribute
autoload :Content
autoload :Renderer
autoload :Rendering
autoload :Serialization
end
| ruby | MIT | d12722da01d0d2b254e132b4c21fb090a6af31d5 | 2026-01-04T17:37:09.729781Z | false |
alexandreruban/action-markdown | https://github.com/alexandreruban/action-markdown/blob/d12722da01d0d2b254e132b4c21fb090a6af31d5/lib/generators/action_markdown/install/install_generator.rb | lib/generators/action_markdown/install/install_generator.rb | module ActionMarkdown
module Generators
class InstallGenerator < ::Rails::Generators::Base
source_root ActionMarkdown::Engine.root
def create_migrations
rails_command "railties:install:migrations FROM=action_markdown", inline: true
end
def create_action_markdown_files
cop... | ruby | MIT | d12722da01d0d2b254e132b4c21fb090a6af31d5 | 2026-01-04T17:37:09.729781Z | false |
alexandreruban/action-markdown | https://github.com/alexandreruban/action-markdown/blob/d12722da01d0d2b254e132b4c21fb090a6af31d5/lib/action_markdown/content.rb | lib/action_markdown/content.rb | module ActionMarkdown
class Content
include ActiveModel::Conversion, Rendering, Serialization
def initialize(body)
@body = body
end
def to_markdown
body
end
def to_html
markdown_renderer.render(body)
end
def to_s
render partial: to_partial_path, layout: fals... | ruby | MIT | d12722da01d0d2b254e132b4c21fb090a6af31d5 | 2026-01-04T17:37:09.729781Z | false |
alexandreruban/action-markdown | https://github.com/alexandreruban/action-markdown/blob/d12722da01d0d2b254e132b4c21fb090a6af31d5/lib/action_markdown/version.rb | lib/action_markdown/version.rb | module ActionMarkdown
VERSION = "0.1.4"
end
| ruby | MIT | d12722da01d0d2b254e132b4c21fb090a6af31d5 | 2026-01-04T17:37:09.729781Z | false |
alexandreruban/action-markdown | https://github.com/alexandreruban/action-markdown/blob/d12722da01d0d2b254e132b4c21fb090a6af31d5/lib/action_markdown/serialization.rb | lib/action_markdown/serialization.rb | # frozen_string_literal: true
module ActionMarkdown
module Serialization
extend ActiveSupport::Concern
class_methods do
def load(content)
new(content) if content
end
def dump(content)
case content
when nil
nil
when self
content.to_markdo... | ruby | MIT | d12722da01d0d2b254e132b4c21fb090a6af31d5 | 2026-01-04T17:37:09.729781Z | false |
alexandreruban/action-markdown | https://github.com/alexandreruban/action-markdown/blob/d12722da01d0d2b254e132b4c21fb090a6af31d5/lib/action_markdown/attribute.rb | lib/action_markdown/attribute.rb | module ActionMarkdown
module Attribute
def has_markdown(name)
class_eval <<-CODE, __FILE__, __LINE__ + 1
def #{name}
markdown_#{name} || build_markdown_#{name}
end
def #{name}=(body)
self.#{name}.body = body
end
CODE
has_one :"markdown_#{name... | ruby | MIT | d12722da01d0d2b254e132b4c21fb090a6af31d5 | 2026-01-04T17:37:09.729781Z | false |
alexandreruban/action-markdown | https://github.com/alexandreruban/action-markdown/blob/d12722da01d0d2b254e132b4c21fb090a6af31d5/lib/action_markdown/rendering.rb | lib/action_markdown/rendering.rb | module ActionMarkdown
module Rendering
private
def render(*args, &block)
action_controller_renderer.render(*args, &block)
end
def action_controller_renderer
ActionController::Base.renderer
end
end
end
| ruby | MIT | d12722da01d0d2b254e132b4c21fb090a6af31d5 | 2026-01-04T17:37:09.729781Z | false |
alexandreruban/action-markdown | https://github.com/alexandreruban/action-markdown/blob/d12722da01d0d2b254e132b4c21fb090a6af31d5/lib/action_markdown/renderer.rb | lib/action_markdown/renderer.rb | require "rouge/plugins/redcarpet"
module ActionMarkdown
class Renderer < Redcarpet::Render::HTML
include Rouge::Plugins::Redcarpet
end
end
| ruby | MIT | d12722da01d0d2b254e132b4c21fb090a6af31d5 | 2026-01-04T17:37:09.729781Z | false |
alexandreruban/action-markdown | https://github.com/alexandreruban/action-markdown/blob/d12722da01d0d2b254e132b4c21fb090a6af31d5/lib/action_markdown/engine.rb | lib/action_markdown/engine.rb | module ActionMarkdown
class Engine < ::Rails::Engine
isolate_namespace ActionMarkdown
initializer "action_markdown.attribute" do
ActiveSupport.on_load(:active_record) do
extend ActionMarkdown::Attribute
end
end
initializer "action_markdown.helper" do
ActiveSupport.on_load(:... | ruby | MIT | d12722da01d0d2b254e132b4c21fb090a6af31d5 | 2026-01-04T17:37:09.729781Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/spec/spec_helper.rb | spec/spec_helper.rb | require 'git-utils'
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
config.filter_run :focus
# Disallow the old-style 'object.should' syntax.
config.expect_with :rspec do |c|
c.syntax = :expect
end
end
| ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/spec/commands/switch_spec.rb | spec/commands/switch_spec.rb | require 'spec_helper'
describe Switch do
let(:command) { Switch.new(['other-branch']) }
before do
command.stub(:current_branch).and_return('test-br')
command.stub(:other_branch).and_return('other-branch')
end
subject { command }
its(:cmd) { should match /git checkout #{command.other_branch}/ }
d... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/spec/commands/sync_fork_spec.rb | spec/commands/sync_fork_spec.rb | require 'spec_helper'
describe SyncFork do
let(:command) { SyncFork.new }
subject { command }
its(:cmd) { should match /git checkout master/ }
its(:cmd) { should match /git fetch upstream/ }
its(:cmd) { should match /git merge upstream\/master/ }
describe "command-line command" do
subject { `bin/gi... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/spec/commands/command_spec.rb | spec/commands/command_spec.rb | require 'spec_helper'
describe Command do
let(:command) { Command.new }
subject { command }
it { should respond_to(:cmd) }
it { should respond_to(:args) }
it { should respond_to(:options) }
it { should respond_to(:parse) }
end | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/spec/commands/merge_branch_spec.rb | spec/commands/merge_branch_spec.rb | require 'spec_helper'
describe MergeBranch do
let(:command) { MergeBranch.new }
before { command.stub(:current_branch).and_return('tau-manifesto') }
subject { command }
its(:cmd) { should match /git merge/ }
shared_examples "merge-into-branch with known options" do
subject { command }
it "should ... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/spec/commands/push_branch_spec.rb | spec/commands/push_branch_spec.rb | require 'spec_helper'
describe PushBranch do
let(:command) { PushBranch.new(['remote_branch']) }
before do
command.stub(:current_branch).and_return('test-br')
end
subject { command }
its(:cmd) do
should match /git push --set-upstream origin #{command.current_branch}/
end
describe "command-line... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/spec/commands/delete_remote_branch_spec.rb | spec/commands/delete_remote_branch_spec.rb | require 'spec_helper'
describe DeleteRemoteBranch do
let(:command) { DeleteRemoteBranch.new(['remote_branch']) }
before do
command.stub(:current_branch).and_return('test-br')
command.stub(:delete_safely?).and_return(true)
end
subject { command }
its(:cmd) { should match /git push origin :remote_bra... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/spec/commands/sync_spec.rb | spec/commands/sync_spec.rb | require 'spec_helper'
describe Sync do
let(:command) { Sync.new }
before do
command.stub(:current_branch).and_return('test-br')
end
subject { command }
its(:cmd) { should match /git checkout master/ }
its(:cmd) { should match /git pull/ }
its(:cmd) { should match /git checkout #{command.current_bra... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/spec/commands/open_spec.rb | spec/commands/open_spec.rb | require 'spec_helper'
describe Open do
let(:command) { Open.new }
before do
command.stub(:current_branch).and_return('test-br')
end
subject { command }
its(:cmd) { should match /open #{command.page_url}/ }
it "should have the right page URLs" do
urls = %w[
https://mwatson@bitbucket.org/atlassian... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/spec/commands/pull_request_spec.rb | spec/commands/pull_request_spec.rb | require 'spec_helper'
describe PullRequest do
let(:command) { PullRequest.new }
before do
command.stub(:current_branch).and_return('test-br')
end
subject { command }
its(:cmd) { should match /open #{command.new_pr_url}/ }
it "should have the right pull request URLs" do
urls = %w[
https://mwatson... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/lib/git-utils.rb | lib/git-utils.rb | require "git-utils/version"
require "git-utils/options"
require "git-utils/command"
require "git-utils/merge_branch"
require "git-utils/open"
require "git-utils/delete_remote_branch"
require "git-utils/push_branch"
require "git-utils/switch"
require "git-utils/sync"
require "git-utils/sync_fork"
require "git-utils/pull... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/lib/git-utils/merge_branch.rb | lib/git-utils/merge_branch.rb | require 'git-utils/command'
class MergeBranch < Command
def parser
OptionParser.new do |opts|
opts.banner = "Usage: git merge-into-branch [branch] [options]"
opts.on_tail("-h", "--help", "this usage guide") do
puts opts.to_s; exit 0
end
end
end
# Returns a command appropriate ... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/lib/git-utils/command.rb | lib/git-utils/command.rb | require 'optparse'
require 'ostruct'
require 'git-utils/options'
class Command
attr_accessor :args, :cmd, :options, :known_options, :unknown_options
def initialize(args = [])
self.args = args
self.options = OpenStruct.new
parse
end
def parse
self.known_options = Options::known_options(parse... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/lib/git-utils/delete_remote_branch.rb | lib/git-utils/delete_remote_branch.rb | require 'git-utils/command'
class DeleteRemoteBranch < Command
def parser
OptionParser.new do |opts|
opts.banner = "Usage: git delete-remote-branch <branch>"
opts.on("-o", "--override", "override unsafe delete") do |opt|
self.options.override = opt
end
opts.on_tail("-h", "--help"... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/lib/git-utils/version.rb | lib/git-utils/version.rb | module Git
module Utils
VERSION = "2.4.0"
end
end
| ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/lib/git-utils/sync_fork.rb | lib/git-utils/sync_fork.rb | require 'git-utils/command'
class SyncFork < Command
def parser
OptionParser.new do |opts|
opts.banner = "Usage: git sync-fork [default]"
opts.on_tail("-h", "--help", "this usage guide") do
puts opts.to_s; exit 0
end
end
end
# Returns a command appropriate for executing at the... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/lib/git-utils/pull_request.rb | lib/git-utils/pull_request.rb | require 'git-utils/command'
class PullRequest < Command
def parser
OptionParser.new do |opts|
opts.banner = "Usage: git pull-request"
opts.on_tail("-h", "--help", "this usage guide") do
puts opts.to_s; exit 0
end
end
end
# Returns the URL for a new pull request.
def new_pr_u... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/lib/git-utils/options.rb | lib/git-utils/options.rb | require 'optparse'
module Options
# Returns a list of options unknown to a particular options parser
# For example, if '-a' is a known option but '-b' and '-c' are not,
# unknown_options(parser, ['-a', '-b', '-c']) returns ['-b', '-c'].
# It also preserves arguments, so
# unknown_options(parser, ['-a', '-b... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/lib/git-utils/sync.rb | lib/git-utils/sync.rb | require 'git-utils/command'
class Sync < Command
def parser
OptionParser.new do |opts|
opts.banner = "Usage: git sync [branch]"
opts.on_tail("-h", "--help", "this usage guide") do
puts opts.to_s; exit 0
end
end
end
# Returns a command appropriate for executing at the command l... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/lib/git-utils/push_branch.rb | lib/git-utils/push_branch.rb | require 'git-utils/command'
class PushBranch < Command
def parser
OptionParser.new do |opts|
opts.banner = "Usage: git push-branch"
opts.on_tail("-h", "--help", "this usage guide") do
puts opts.to_s; exit 0
end
end
end
# Returns a command appropriate for executing at the comma... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/lib/git-utils/open.rb | lib/git-utils/open.rb | require 'git-utils/command'
class Open < Command
def parser
OptionParser.new do |opts|
opts.banner = "Usage: git open"
opts.on("-p", "--print", "print URL instead of opening") do |opt|
self.options.print = opt
end
opts.on_tail("-h", "--help", "this usage guide") do
puts o... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
mhartl/git-utils | https://github.com/mhartl/git-utils/blob/e43216dba9c181713dd2c85e68d4e5a59296cc9d/lib/git-utils/switch.rb | lib/git-utils/switch.rb | require 'git-utils/command'
class Switch < Command
def parser
OptionParser.new do |opts|
opts.banner = "Usage: git switch <pattern>"
opts.on_tail("-h", "--help", "this usage guide") do
puts opts.to_s; exit 0
end
end
end
# Returns the branch to switch to.
# When multiple bran... | ruby | MIT | e43216dba9c181713dd2c85e68d4e5a59296cc9d | 2026-01-04T17:37:10.792768Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/spec/spec_helper.rb | spec/spec_helper.rb | require "rubygems"
require "bundler/setup"
require "combustion"
require "capybara/rspec"
require "devise"
require "devise-guests"
Combustion.initialize!(:active_record, :action_mailer)
require "rspec/rails"
require "capybara/rails"
RSpec.configure do |config|
config.infer_spec_type_from_file_location!
end
| ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/spec/integration/simple_integration_spec.rb | spec/integration/simple_integration_spec.rb | require "spec_helper"
describe "Simple Integration", type: :request do
it "should work" do
end
end
| ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/spec/helpers/devise_guests_helpers_spec.rb | spec/helpers/devise_guests_helpers_spec.rb | require "spec_helper"
describe "devise guest helpers", type: :helper do
end
| ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/spec/controllers/application_controller_spec.rb | spec/controllers/application_controller_spec.rb | require "spec_helper"
require "ostruct"
describe ApplicationController, type: :controller do
controller do
end
before(:each) do
@mock_warden = OpenStruct.new
@controller.request.env["warden"] = @mock_warden
end
it "should create an anonymous user for a guest" do
allow(@mock_warden).to receive(:... | ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/spec/internal/app/controllers/application_controller.rb | spec/internal/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
end
| ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/spec/internal/app/models/user.rb | spec/internal/app/models/user.rb | class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
end
| ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/spec/internal/db/schema.rb | spec/internal/db/schema.rb | ActiveRecord::Schema.define do
create_table "users", force: true do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_cou... | ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/spec/internal/config/routes.rb | spec/internal/config/routes.rb | Rails.application.routes.draw do
devise_for :users
end
| ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/spec/internal/config/initializers/devise.rb | spec/internal/config/initializers/devise.rb | Devise.setup do |config|
require "devise/orm/active_record"
require "devise-guests"
config.helpers << DeviseGuests::Controllers::Helpers
config.secret_key = "71da52cff5ef1a77c9ccdc5153993e0e58054c288c86e005d9f7eca6ac7a9279825c7903f1de5960e900543ab0cf7f85b6d307c43b53719bebcdb9cdcfe8b7e7"
end
| ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/lib/devise-guests.rb | lib/devise-guests.rb | require "devise"
module DeviseGuests
require "devise-guests/version"
module Controllers
autoload :Helpers, "devise-guests/controllers/helpers"
autoload :UrlHelpers, "devise-guests/controllers/url_helpers"
end
require "devise-guests/engine"
end
| ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/lib/devise-guests/version.rb | lib/devise-guests/version.rb | module DeviseGuests
VERSION = "0.8.3"
end
| ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/lib/devise-guests/engine.rb | lib/devise-guests/engine.rb | require "rails"
require "devise"
module DeviseGuests
class Engine < ::Rails::Engine
initializer "devise_guests.add_helpers" do
Devise.include_helpers(DeviseGuests::Controllers)
Devise.helpers << DeviseGuests::Controllers::Helpers
end
# This makes our rake tasks visible.
rake_tasks do
... | ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/lib/devise-guests/controllers/helpers.rb | lib/devise-guests/controllers/helpers.rb | module DeviseGuests::Controllers
module Helpers
extend ActiveSupport::Concern
included do
include ActiveSupport::Callbacks
end
module ClassMethods
end
def self.define_helpers(mapping) # :nodoc:
class_name = mapping.class_name
mapping = mapping.name
class_eval <<-MET... | ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/lib/devise-guests/controllers/url_helpers.rb | lib/devise-guests/controllers/url_helpers.rb | module DeviseGuests::Controllers
module UrlHelpers
end
end
| ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/lib/generators/devise_guests/devise_guests_generator.rb | lib/generators/devise_guests/devise_guests_generator.rb | module DeviseGuests
module Generators
class DeviseGuestsGenerator < Rails::Generators::NamedBase
include Rails::Generators::ResourceHelpers
namespace "devise_guests"
source_root File.expand_path("../templates", __FILE__)
desc "Generates devise guests attributes into a model with the give... | ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/lib/generators/active_record/devise_guests_generator.rb | lib/generators/active_record/devise_guests_generator.rb | require "rails/generators/active_record"
require "generators/devise/orm_helpers"
module ActiveRecord
module Generators
class DeviseGuestsGenerator < ActiveRecord::Generators::Base
include Devise::Generators::OrmHelpers
source_root File.expand_path("../templates", __FILE__)
def copy_devise_migr... | ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
cbeer/devise-guests | https://github.com/cbeer/devise-guests/blob/374375109f748c499acae99081de31080dcbc05f/lib/generators/active_record/templates/migration_existing.rb | lib/generators/active_record/templates/migration_existing.rb | class AddDeviseGuestsTo<%= table_name.camelize %> < ActiveRecord::Migration<%= migration_version %>
def self.up
change_table(:<%= table_name %>) do |t|
<%= migration_data -%>
end
end
def self.down
# By default, we don't want to make any assumption about how to roll back a migration when your
# m... | ruby | MIT | 374375109f748c499acae99081de31080dcbc05f | 2026-01-04T17:37:10.085909Z | false |
nettofarah/graphql-query-resolver | https://github.com/nettofarah/graphql-query-resolver/blob/75771bef1a3c80266e000218f8209b5d522b31f9/spec/spec_helper.rb | spec/spec_helper.rb | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'graphql/query_resolver'
require 'active_record'
require 'byebug'
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
require 'support/schema'
require 'support/activerecord_models'
require 'support/factories'
require 'sup... | ruby | MIT | 75771bef1a3c80266e000218f8209b5d522b31f9 | 2026-01-04T17:37:12.825066Z | false |
nettofarah/graphql-query-resolver | https://github.com/nettofarah/graphql-query-resolver/blob/75771bef1a3c80266e000218f8209b5d522b31f9/spec/support/graphql_schema.rb | spec/support/graphql_schema.rb | require 'graphql'
require 'graphql/query_resolver'
GraphQL::Relay::ConnectionType.default_nodes_field = true
RestaurantType = GraphQL::ObjectType.define do
name "restaurant"
field :id, types.ID
field :name, types.String
field :owner do
type ChefType
resolve -> (obj, args, ctx) {
obj.owner
... | ruby | MIT | 75771bef1a3c80266e000218f8209b5d522b31f9 | 2026-01-04T17:37:12.825066Z | false |
nettofarah/graphql-query-resolver | https://github.com/nettofarah/graphql-query-resolver/blob/75771bef1a3c80266e000218f8209b5d522b31f9/spec/support/factories.rb | spec/support/factories.rb | module TestData
def self.nv(name)
Vendor.new(name: name)
end
def self.create_netto
Chef.create(name: 'Netto', email: 'nettofarah@gmail.com').tap do |netto|
Recipe.create(title: 'Turkey Sandwich', chef: netto).tap do |r|
r.ingredients.create(name: 'Turkey', quantity: 'a lot', vendor: nv('T... | ruby | MIT | 75771bef1a3c80266e000218f8209b5d522b31f9 | 2026-01-04T17:37:12.825066Z | false |
nettofarah/graphql-query-resolver | https://github.com/nettofarah/graphql-query-resolver/blob/75771bef1a3c80266e000218f8209b5d522b31f9/spec/support/activerecord_models.rb | spec/support/activerecord_models.rb | class Recipe < ActiveRecord::Base
belongs_to :chef
has_many :ingredients #, through: :recipes_ingredients
serialize :metadata, JSON
end
class Ingredient < ActiveRecord::Base
belongs_to :vendor
end
class Vendor < ActiveRecord::Base
has_many :ingredients
end
class Restaurant < ActiveRecord::Base
belongs_t... | ruby | MIT | 75771bef1a3c80266e000218f8209b5d522b31f9 | 2026-01-04T17:37:12.825066Z | false |
nettofarah/graphql-query-resolver | https://github.com/nettofarah/graphql-query-resolver/blob/75771bef1a3c80266e000218f8209b5d522b31f9/spec/support/schema.rb | spec/support/schema.rb | ActiveRecord::Schema.define do
create_table :recipes, force: true do |t|
t.column :title, :string
t.column :num_steps, :integer
t.column :chef_id, :integer
t.column :metadata, :text
end
create_table :ingredients, force: true do |t|
t.column :name, :string
t.column :quantity, :string
t... | ruby | MIT | 75771bef1a3c80266e000218f8209b5d522b31f9 | 2026-01-04T17:37:12.825066Z | false |
nettofarah/graphql-query-resolver | https://github.com/nettofarah/graphql-query-resolver/blob/75771bef1a3c80266e000218f8209b5d522b31f9/spec/graphql/query_resolver_spec.rb | spec/graphql/query_resolver_spec.rb | require 'spec_helper'
describe GraphQL::QueryResolver do
before(:each) do
TestData.create_netto
end
it 'groups queries' do
data = nil
queries = track_queries do
data = GQL.query(%{
query {
recipes {
title
ingredients { name }
}
}
... | ruby | MIT | 75771bef1a3c80266e000218f8209b5d522b31f9 | 2026-01-04T17:37:12.825066Z | false |
nettofarah/graphql-query-resolver | https://github.com/nettofarah/graphql-query-resolver/blob/75771bef1a3c80266e000218f8209b5d522b31f9/lib/graphql/query_resolver.rb | lib/graphql/query_resolver.rb | require "graphql"
require "graphql/query_resolver/version"
module GraphQL
module QueryResolver
def self.run(model_class, context, return_type)
to_load = yield
dependencies = {}
reflection_dependencies = map_dependencies(model_class, context.ast_node)
dependencies = reflection_dependenci... | ruby | MIT | 75771bef1a3c80266e000218f8209b5d522b31f9 | 2026-01-04T17:37:12.825066Z | false |
nettofarah/graphql-query-resolver | https://github.com/nettofarah/graphql-query-resolver/blob/75771bef1a3c80266e000218f8209b5d522b31f9/lib/graphql/query_resolver/version.rb | lib/graphql/query_resolver/version.rb | module GraphQL
module QueryResolver
VERSION = "0.2.0"
end
end
| ruby | MIT | 75771bef1a3c80266e000218f8209b5d522b31f9 | 2026-01-04T17:37:12.825066Z | false |
yegor256/iri | https://github.com/yegor256/iri/blob/30f0ece5374e6e935b4380a0ffda7c4b6595ee0d/test/test_iri.rb | test/test_iri.rb | # frozen_string_literal: true
# SPDX-FileCopyrightText: Copyright (c) 2019-2026 Yegor Bugayenko
# SPDX-License-Identifier: MIT
require_relative '../test/test__helper'
require_relative '../lib/iri'
# Iri test.
# Author:: Yegor Bugayenko (yegor256@gmail.com)
# Copyright:: Copyright (c) 2019-2026 Yegor Bugayenko
# Lice... | ruby | MIT | 30f0ece5374e6e935b4380a0ffda7c4b6595ee0d | 2026-01-04T17:37:13.956601Z | false |
yegor256/iri | https://github.com/yegor256/iri/blob/30f0ece5374e6e935b4380a0ffda7c4b6595ee0d/test/test__helper.rb | test/test__helper.rb | # frozen_string_literal: true
# SPDX-FileCopyrightText: Copyright (c) 2019-2026 Yegor Bugayenko
# SPDX-License-Identifier: MIT
$stdout.sync = true
require 'simplecov'
require 'simplecov-cobertura'
unless SimpleCov.running
SimpleCov.command_name('test')
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.n... | ruby | MIT | 30f0ece5374e6e935b4380a0ffda7c4b6595ee0d | 2026-01-04T17:37:13.956601Z | false |
yegor256/iri | https://github.com/yegor256/iri/blob/30f0ece5374e6e935b4380a0ffda7c4b6595ee0d/lib/iri.rb | lib/iri.rb | # frozen_string_literal: true
# SPDX-FileCopyrightText: Copyright (c) 2019-2026 Yegor Bugayenko
# SPDX-License-Identifier: MIT
require 'uri'
# Iri is a simple, immutable URI builder with a fluent interface.
#
# The Iri class provides methods to manipulate different parts of a URI,
# including the scheme, host, port,... | ruby | MIT | 30f0ece5374e6e935b4380a0ffda7c4b6595ee0d | 2026-01-04T17:37:13.956601Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/spec/message_spec.rb | spec/message_spec.rb | require 'spec_helper'
class SpecMessageClass < DripDrop::Message
include DripDrop::SubclassedMessage
end
describe DripDrop::Message do
describe "basic message" do
def create_basic
attrs = {
:name => 'test',
:head => {'foo' => 'bar'},
:body => ['foo', 'bar', 'baz']
}
m... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/spec/spec_helper.rb | spec/spec_helper.rb | require File.expand_path(File.join(File.dirname(__FILE__), %w[. .. lib dripdrop]))
require 'set'
Thread.abort_on_exception = true
# Used to test websocket clients.
require 'gimite-websocket'
def rand_addr(scheme='tcp')
"#{scheme}://127.0.0.1:#{rand(10_000) + 20_000}"
end
def run_reactor(time=0.2,opts={},&block)
... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/spec/node_spec.rb | spec/node_spec.rb | require 'spec_helper'
describe DripDrop::Node do
shared_examples_for "all initialization methods" do
it "should start EventMachine" do
EM.reactor_running?.should be_true
end
it "should start ZMQMachine" do
pending "This is not repeatedly reliable"
@ddn.zm_reactor.running?.should be... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/spec/gimite-websocket.rb | spec/gimite-websocket.rb | # Copyright: Hiroshi Ichikawa <http://gimite.net/en/>
# Lincense: New BSD Lincense
# Reference: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol
require "socket"
require "uri"
require "digest/md5"
require "openssl"
class WebSocket
class << self
attr_accessor(:debug)
end
class Error... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/spec/node/nodelet_spec.rb | spec/node/nodelet_spec.rb | require 'spec_helper'
describe "nodelets" do
class SpecialNodelet < DripDrop::Node::Nodelet
def action
route :worker1, :zmq_pull, distributor_output.address, :connect
route :worker2, :zmq_pull, distributor_output.address, :connect
end
end
before(:all) do
nodelets = {}
... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/spec/node/routing_spec.rb | spec/node/routing_spec.rb | require 'spec_helper'
describe "routing" do
shared_examples_for "all routing" do
it "should define all routes in the table" do
@expected_routing.keys.each do |route_name|
@node.routing.keys.should include(route_name)
end
end
it "should define a handler in the routing table for ea... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/spec/node/zmq_pushpull_spec.rb | spec/node/zmq_pushpull_spec.rb | require 'spec_helper'
require 'set'
describe "zmq push/pull" do
def pp_send_messages(to_send)
responses = []
push = nil
pull = nil
@node = run_reactor(2) do
addr = rand_addr
push = zmq_push(addr, :bind)
pull1 = zmq_pull(addr, :connect)
pull2 = zmq_pull(addr,... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/spec/node/http_spec.rb | spec/node/http_spec.rb | require 'spec_helper'
require 'set'
if defined?(EM::HttpServer)
describe "http" do
def http_send_messages(to_send,addr=rand_addr('http'),&block)
responses = []
client = nil
server = nil
@node = run_reactor(2) do
zmq_subscribe(rand_addr, :bind) do |message|
end
client... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/spec/node/zmq_m2_spec.rb | spec/node/zmq_m2_spec.rb | require 'spec_helper'
m2_req = '34f9cfef-dc52-4b7f-b197-098765432112 16 /handlertest 537:{"PATH":"/handlertest","accept-language":"en-us,en;q=0.5","user-agent":"Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20110207 Gentoo Firefox/3.6.13","host":"it.wishdev.org:6767","accept-charset":"ISO-8859-1,utf-... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/spec/node/zmq_xrepxreq_spec.rb | spec/node/zmq_xrepxreq_spec.rb | require 'spec_helper'
describe "zmq xreq/xrep" do
def xr_tranceive_messages(to_send,&block)
recvd = []
replied = []
req = nil
rep = nil
@node = run_reactor(1.5) do
addr = rand_addr
rep = zmq_xrep(addr, :bind)
req = zmq_xreq(addr, :connect)
rep.on_recei... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/spec/node/websocket_spec.rb | spec/node/websocket_spec.rb | require 'spec_helper'
describe "websockets" do
def websockets_send_messages(to_send,&block)
received = []
responses = []
seen_signatures = Set.new
server = nil
open_message = DripDrop::Message.new('open', :body => 'test')
open_received = false
close_occured = false
e... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/example/pubsub.rb | example/pubsub.rb | require 'rubygems'
require 'dripdrop/node'
Thread.abort_on_exception = true
#Define our handlers
DripDrop::Node.new do
route :pub, :zmq_publish, 'tcp://127.0.0.1:2200', :bind
route :sub1, :zmq_subscribe, pub.address, :connect, :topic_filter => /[13579]$/
route :sub2, :zmq_subscribe, pub.address, :connect, :to... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/example/subclass.rb | example/subclass.rb | require 'dripdrop'
Thread.abort_on_exception = true
#We will create a subclass of the Message class
#which will add a timestamp to the header every
#time it is passed around
#First our subclass
class TimestampedMessage < DripDrop::Message
def self.create_message(*args)
obj = super
obj.head['timestamps'] = ... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/example/combined.rb | example/combined.rb | require 'dripdrop'
Thread.abort_on_exception = true #Always a good idea in multithreaded apps.
# Encapsulates our EM and ZMQ reactors
DripDrop::Node.new do
# Define all our sockets
route :stats_pub, :zmq_publish, 'tcp://127.0.0.1:2200', :bind
route :stats_sub1, :zmq_subscribe, stats_pub.address, :conn... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/example/pushpull.rb | example/pushpull.rb | require 'dripdrop/node'
Thread.abort_on_exception = true
DripDrop::Node.new do
z_addr = 'tcp://127.0.0.1:2200'
zmq_pull(z_addr, :connect).on_receive do |message|
puts "Receiver 2 #{message.body}"
end
zmq_pull(z_addr, :connect).on_receive do |message|
puts "Receiver 1 #{message.body}"
end
push =... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/example/xreq_xrep.rb | example/xreq_xrep.rb | require 'dripdrop/node'
Thread.abort_on_exception = true
DripDrop::Node.new do
route :xrep_server, :zmq_xrep, 'tcp://127.0.0.1:2200', :bind
route :xreq_client, :zmq_xreq, xrep_server.address, :connect
xrep_server.on_receive do |message,response|
puts "REP #{message.body}"
response.send_message(mes... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/example/agent_test.rb | example/agent_test.rb | ##
##TODO: This badly needs to be rewritten
##
require 'rubygems'
require 'dripdrop/agent'
agent = DripDrop::Agent.new(ZMQ::PUB,'tcp://127.0.0.1:2900',:connect)
loop do
agent.send_message('test', :body => 'hello', :head => {:key => 'value'})
puts "SEND"
sleep 1
end
| ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/example/http.rb | example/http.rb | require 'dripdrop/node'
Thread.abort_on_exception = true
DripDrop::Node.new do
addr = 'http://127.0.0.1:2200'
i = 0
http_server(addr).on_receive do |msg,response|
i += 1
response.send_message(msg)
end
EM::PeriodicTimer.new(1) do
client = http_client(addr)
msg = DripDrop::Message.new('htt... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/example/complex/client.rb | example/complex/client.rb | require 'rubygems'
require 'websocket'
require 'dripdrop/message'
Thread.abort_on_exception = true
client = WebSocket.new('ws://127.0.0.1:8080')
Thread.new do
while data = client.receive
puts data
end
end
i = 0
while sleep 1
i += 1
puts '.'
client.send(DripDrop::Message.new('Client Broadcast', :body =... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/example/complex/server.rb | example/complex/server.rb | require 'dripdrop'
Thread.abort_on_exception = true
class ComplexExample < DripDrop::Node
def initialize(mode=:all)
super()
@mode = mode
end
def action
nodelet :ws_listener, WSListener do |n|
n.route :ws_listener, :websocket, 'ws://127.0.0.1:8080'
n.route :broadcast_in, :zmq_subscribe... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/example/complex/service.rb | example/complex/service.rb | require 'rubygems'
require 'sinatra'
require 'dripdrop/message'
post '/endpoint' do
puts DripDrop::Message.decode_json(request.body.read).inspect
DripDrop::Message.new('ack').json_encoded
end
| ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/example/complex/websocket.rb | example/complex/websocket.rb | # Copyright: Hiroshi Ichikawa <http://gimite.net/en/>
# Lincense: New BSD Lincense
# Reference: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol
require "socket"
require "uri"
require "digest/md5"
require "openssl"
class WebSocket
class << self
attr_accessor(:debug)
end
class Error... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/example/websockets/server.rb | example/websockets/server.rb | require 'rubygems'
require 'dripdrop'
class MyApp < DripDrop::Node
def action
route :my_server, :websocket_server, 'ws://127.0.0.1:9292'
my_server.on_open do |my_client|
EM::PeriodicTimer.new(1) do
my_client.send_message(:name => 'time_request', :body => Time.now.to_s)
end
end
end... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/lib/dripdrop.rb | lib/dripdrop.rb | require 'dripdrop/message'
require 'dripdrop/node'
| ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/lib/dripdrop/agent.rb | lib/dripdrop/agent.rb | require 'dripdrop/message'
#Check if we're in 1.8.7
unless defined?(RUBY_ENGINE)
require 'zmq'
ZMQGEM = :rbzmq
else
require 'ffi-rzmq'
ZMQGEM = :ffirzmq
end
require 'uri'
class DripDrop
#The Agent class is a simple ZMQ Pub client. It uses DripDrop::Message messages
class Agent
attr_reader :address, :co... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/lib/dripdrop/version.rb | lib/dripdrop/version.rb | class DripDrop
VERSION = "0.11.0"
end
| ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/lib/dripdrop/node.rb | lib/dripdrop/node.rb | require 'rubygems'
require 'ffi-rzmq'
require 'eventmachine'
require 'uri'
require 'resolv'
require 'ipaddr'
require 'dripdrop/message'
require 'dripdrop/node/nodelet'
require 'dripdrop/handlers/base'
require 'dripdrop/handlers/zeromq'
require 'dripdrop/handlers/websocket_server'
require 'dripdrop/handlers/mongrel2'
r... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/lib/dripdrop/message.rb | lib/dripdrop/message.rb | require 'rubygems'
if RUBY_PLATFORM == 'java'
require 'json'
else
require 'yajl'
require 'yajl/json_gem'
end
class DripDrop
class WrongMessageClassError < StandardError; end
# DripDrop::Message messages are exchanged between all tiers in the architecture
# A Message is composed of a name, head, and bod... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/lib/dripdrop/node/nodelet.rb | lib/dripdrop/node/nodelet.rb | class DripDrop::Node
# See the documentation for +nodelet+ in DripDrop::Node
class Nodelet
attr_accessor :name, :routing
def initialize(ctx, name, *configure_args)
@ctx = ctx
@name = name
@internal_routing = {}
configure(*configure_args)
end
... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/lib/dripdrop/handlers/http_server.rb | lib/dripdrop/handlers/http_server.rb | require 'evma_httpserver'
class DripDrop
class HTTPServerHandlerResponse < BaseHandler
attr_reader :em_response, :message_class
def initialize(em_response)
@em_response = em_response
end
def send_message(message)
message = dd_messagify(message)
@em_response.status = 200
@em... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/lib/dripdrop/handlers/http_client.rb | lib/dripdrop/handlers/http_client.rb | class DripDrop
class HTTPClientHandler < BaseHandler
attr_reader :address, :opts
def initialize(uri, opts={})
@uri = uri
@address = @uri.to_s
@opts = opts
@message_class = @opts[:message_class] || DripDrop.default_message_class
end
def send_message(message,&blo... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/lib/dripdrop/handlers/base.rb | lib/dripdrop/handlers/base.rb | class DripDrop
class BaseHandler
def on_error(&block)
@err_cbak = block
end
def handle_error(exception,*extra)
if @err_cbak
begin
@err_cbak.call(exception,*extra)
rescue StandardError => e
print_exception(e)
end
else
print_excepti... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/lib/dripdrop/handlers/mongrel2.rb | lib/dripdrop/handlers/mongrel2.rb | =begin
Large portion of at least the concepts (and plenty of the code) used here come from m2r
https://github.com/perplexes/m2r
Under the following license
Copyright (c) 2009 Pradeep Elankumaran
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentati... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/lib/dripdrop/handlers/websocket_server.rb | lib/dripdrop/handlers/websocket_server.rb | require 'em-websocket'
class DripDrop
class WebSocketHandler < BaseHandler
class SocketError < StandardError; attr_accessor :reason, :connection end
attr_reader :ws, :address, :thread
def initialize(address,opts={})
@opts = opts
@raw = false #Deal in strings or ZMQ::Messag... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
andrewvc/dripdrop | https://github.com/andrewvc/dripdrop/blob/d1b661f83eeeb9b25f9f580e496fd717ab465330/lib/dripdrop/handlers/zeromq.rb | lib/dripdrop/handlers/zeromq.rb | require 'ffi-rzmq'
require 'em-zeromq'
class DripDrop
SEQ_CTR_KEY = '_dd/xctr'
#Setup the default message class handler first
class << self
attr_accessor :default_message_class
DripDrop.default_message_class = DripDrop::Message
end
class ZMQBaseHandler < BaseHandler
attr_reader :connection
... | ruby | MIT | d1b661f83eeeb9b25f9f580e496fd717ab465330 | 2026-01-04T17:37:14.788033Z | false |
delano/gibbler | https://github.com/delano/gibbler/blob/74f34302f8d2eaa035cd19cde823337c3d8a0752/lib/gibbler.rb | lib/gibbler.rb | unless defined?(GIBBLER_LIB_HOME)
GIBBLER_LIB_HOME = File.expand_path File.dirname(__FILE__)
end
%w{attic}.each do |dir|
$:.unshift File.join(GIBBLER_LIB_HOME, '..', '..', dir, 'lib')
end
require 'thread'
require 'attic'
require 'digest/sha1'
# # frozen_string_literal: true
# require_relative "gibbler/version"
... | ruby | MIT | 74f34302f8d2eaa035cd19cde823337c3d8a0752 | 2026-01-04T17:37:13.874436Z | false |
delano/gibbler | https://github.com/delano/gibbler/blob/74f34302f8d2eaa035cd19cde823337c3d8a0752/lib/gibbler/version.rb | lib/gibbler/version.rb | # frozen_string_literal: true
module Gibbler
module VERSION
def self.to_s
load_config
[@version[:MAJOR], @version[:MINOR], @version[:PATCH]].join('.')
end
alias_method :inspect, :to_s
def self.load_config
require 'yaml'
@version ||= YAML.load_file(::File.join(GIBBLER_LIB_HOME... | ruby | MIT | 74f34302f8d2eaa035cd19cde823337c3d8a0752 | 2026-01-04T17:37:13.874436Z | false |
delano/gibbler | https://github.com/delano/gibbler/blob/74f34302f8d2eaa035cd19cde823337c3d8a0752/lib/gibbler/aliases.rb | lib/gibbler/aliases.rb |
require 'gibbler/mixins'
class Gibbler < String
module Object
alias :digest :gibbler
alias :changed? :gibbled?
alias :digest_fields :gibbler_fields
# The cache is in the Attic.
def digest_cache; gibbler_cache; end
end
#--
# Aliases for Gibbler::Histo... | ruby | MIT | 74f34302f8d2eaa035cd19cde823337c3d8a0752 | 2026-01-04T17:37:13.874436Z | false |
delano/gibbler | https://github.com/delano/gibbler/blob/74f34302f8d2eaa035cd19cde823337c3d8a0752/lib/gibbler/history.rb | lib/gibbler/history.rb |
class Gibbler < String
class NoRevert < Gibbler::Error
def message; "Revert not implemented for #{@obj}" end
end
class NoHistory < Gibbler::Error
def message; "No history for #{@obj}"; end
end
class BadDigest < Gibbler::Error
def message; "Unknown digest: #{@obj}"; end
end
module History
... | ruby | MIT | 74f34302f8d2eaa035cd19cde823337c3d8a0752 | 2026-01-04T17:37:13.874436Z | false |
delano/gibbler | https://github.com/delano/gibbler/blob/74f34302f8d2eaa035cd19cde823337c3d8a0752/lib/gibbler/mixins.rb | lib/gibbler/mixins.rb | # rubocop:disable all
require 'gibbler'
class NilClass; include Gibbler::Nil; end
class String; include Gibbler::String; end
class Symbol; include Gibbler::String; end
class Integer; include Gibbler::String; end
class TrueClass; include Gibbler:... | ruby | MIT | 74f34302f8d2eaa035cd19cde823337c3d8a0752 | 2026-01-04T17:37:13.874436Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.