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
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
class SessionsController < ApplicationController ############################################################################## # We need to disable the `require_authentication` before filter that # was added in the ApplicationController otherwise when the user # tries to access the login form he/she will be...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/app/controllers/application_controller.rb
app/controllers/application_controller.rb
class ApplicationController < ActionController::Base ############################################################################## # Enable forgery protection. See http://en.wikipedia.org/wiki/CSRF protect_from_forgery ############################################################################## priva...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/app/controllers/cars_controller.rb
app/controllers/cars_controller.rb
class CarsController < ApplicationController ############################################################################## # The following class method tells Rails what formats we can respond # with. This is necessary to use the `respond_with` helper later. respond_to(:html, :xml, :json) ###############...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/app/models/refuel.rb
app/models/refuel.rb
class Refuel < ActiveRecord::Base ############################################################################## attr_accessible(:refueled_at, :odometer, :gallons, :price) ############################################################################## validates(:refueled_at, :presence => true) validates(...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/app/models/car.rb
app/models/car.rb
class Car < ActiveRecord::Base ############################################################################## attr_accessible(:name) ############################################################################## # Validate that the name of a car is unique, but only for a single # user. That is, a singl...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/app/models/user.rb
app/models/user.rb
class User < ActiveRecord::Base ############################################################################## # Restrict which attributes can be changed through mass-assignment # (for example, from an HTML form). The password and # password_confirmation attributes are created below when we call # `has_se...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/db/seeds.rb
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 =>...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/db/schema.rb
db/schema.rb
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # dat...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/db/migrate/20111102210426_create_refuels.rb
db/migrate/20111102210426_create_refuels.rb
class CreateRefuels < ActiveRecord::Migration ############################################################################## def change create_table(:refuels) do |t| t.column(:car_id, :integer) t.column(:refueled_at, :datetime) t.column(:odometer, :integer) t.column(:gallons, ...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/db/migrate/20111102192932_create_cars.rb
db/migrate/20111102192932_create_cars.rb
class CreateCars < ActiveRecord::Migration ############################################################################## def change create_table(:cars) do |t| # Create a foreign key to link to the users table. This could # have been: t.belongs_to(:user) t.column(:user_id, :integer) t....
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/db/migrate/20111102182704_create_users.rb
db/migrate/20111102182704_create_users.rb
class CreateUsers < ActiveRecord::Migration ############################################################################## # With Rails 3.1 you only need one method in your migration: # `change`. It's an instance method and if you are reverting a # migration its actions are reversed automatically. # # I...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/test/factories.rb
test/factories.rb
################################################################################ # FactoryGirl is a nice replacement for test fixtures. For more # information please see: # # https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md # FactoryGirl.define do #########################################...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/test/test_helper.rb
test/test_helper.rb
ENV["RAILS_ENV"] = "test" require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. # # Note: You'll currently still have to declare fixtures explicitly in integrati...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/test/integration/login_flow_test.rb
test/integration/login_flow_test.rb
################################################################################ require('test_helper') ################################################################################ class LoginFlowTest < ActionDispatch::IntegrationTest ###########################################################################...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/test/performance/browsing_test.rb
test/performance/browsing_test.rb
require 'test_helper' require 'rails/performance_test_help' class BrowsingTest < ActionDispatch::PerformanceTest # Refer to the documentation for all available options # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory] # :output => 'tmp/performance', :formats => [:f...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/test/unit/user_test.rb
test/unit/user_test.rb
################################################################################ require('test_helper') ################################################################################ class UserTest < ActiveSupport::TestCase ############################################################################## test "e...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/test/unit/car_test.rb
test/unit/car_test.rb
################################################################################ require('test_helper') ################################################################################ class CarTest < ActiveSupport::TestCase # No logic to test yet. end
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/test/unit/refuel_test.rb
test/unit/refuel_test.rb
################################################################################ require('test_helper') ################################################################################ class RefuelTest < ActiveSupport::TestCase ############################################################################## test ...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/test/unit/helpers/cars_helper_test.rb
test/unit/helpers/cars_helper_test.rb
require 'test_helper' class CarsHelperTest < ActionView::TestCase end
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/test/unit/helpers/sessions_helper_test.rb
test/unit/helpers/sessions_helper_test.rb
require 'test_helper' class SessionsHelperTest < ActionView::TestCase end
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/test/unit/helpers/refuels_helper_test.rb
test/unit/helpers/refuels_helper_test.rb
require 'test_helper' class RefuelsHelperTest < ActionView::TestCase end
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/test/functional/sessions_controller_test.rb
test/functional/sessions_controller_test.rb
################################################################################ require('test_helper') ################################################################################ class SessionsControllerTest < ActionController::TestCase #######################################################################...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/test/functional/refuels_controller_test.rb
test/functional/refuels_controller_test.rb
require 'test_helper' class RefuelsControllerTest < ActionController::TestCase # test "the truth" do # assert true # end end
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/test/functional/cars_controller_test.rb
test/functional/cars_controller_test.rb
require 'test_helper' class CarsControllerTest < ActionController::TestCase # test "the truth" do # assert true # end end
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/config/application.rb
config/application.rb
require File.expand_path('../boot', __FILE__) require 'rails/all' if defined?(Bundler) # If you precompile assets before deploying to production, use this line Bundler.require(*Rails.groups(:assets => %w(development test))) # If you want your assets lazily compiled in production, use this line # Bundler.requi...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/config/environment.rb
config/environment.rb
# Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application Example::Application.initialize!
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/config/routes.rb
config/routes.rb
################################################################################ # To see a complete list of all routes use the following command: # # rake routes # Example::Application.routes.draw do ############################################################################## # Create all the default routes...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/config/boot.rb
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
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/config/initializers/session_store.rb
config/initializers/session_store.rb
# Be sure to restart your server when you modify this file. Example::Application.config.session_store :cookie_store, :key => '_example_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 "rail...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/config/initializers/wrap_parameters.rb
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
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/config/initializers/inflections.rb
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
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/config/initializers/backtrace_silencers.rb
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
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/config/initializers/mime_types.rb
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
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/config/initializers/secret_token.rb
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
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/config/environments/test.rb
config/environments/test.rb
Example::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 ...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/config/environments/development.rb
config/environments/development.rb
Example::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 s...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
devalot/ror-example
https://github.com/devalot/ror-example/blob/2acf777ef9939b6f53c0387f9b2620f76016ae0c/config/environments/production.rb
config/environments/production.rb
Example::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...
ruby
Unlicense
2acf777ef9939b6f53c0387f9b2620f76016ae0c
2026-01-04T17:54:41.674960Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/dataflow.rb
dataflow.rb
require 'monitor' module Dataflow VERSION = "0.3.1" class << self attr_accessor :forker end self.forker = Thread.method(:fork) def self.included(cls) class << cls def declare(*readers) readers.each do |name| class_eval <<-RUBY def #{name} return @_...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/dataflow/future_queue.rb
dataflow/future_queue.rb
module Dataflow class FutureQueue include Dataflow declare :push_port, :pop_port def initialize local do |pushed, popped| unify push_port, Dataflow::Port.new(pushed) unify pop_port, Dataflow::Port.new(popped) Thread.new { loop do barrier pu...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/dataflow/port.rb
dataflow/port.rb
require 'thread' module Dataflow class Port include Dataflow LOCK = Mutex.new class Stream include Dataflow declare :head, :tail # Defining each allows us to use the enumerable mixin # None of the list can be garbage collected less the head is # garbage collected, so...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/dataflow/equality.rb
dataflow/equality.rb
# The purpose of this file is to make equality use method calls in as # many Ruby implementations as possible. If method calls are used, # then equality operations using dataflow variaables becomes seemless # I realize overriding core classes is a pretty nasty hack, but if you # have a better idea that also passes the ...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/dataflow/actor.rb
dataflow/actor.rb
module Dataflow class Actor < Thread def initialize(&block) @stream = Variable.new @port = Port.new(@stream) # Run this block in a new thread super { instance_eval &block } end def send message @port.send message end private def receive result = @stream...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/dataflow/enumerable.rb
dataflow/enumerable.rb
module Dataflow code = <<-RUBY def map_later map do |x| Dataflow.need_later { yield x } end end def map_barrier(&blk) result = map_later(&blk) Dataflow.barrier *result result end def map_needed map do |x| Dataflow.by_need { yield x } end end RUBY module_eval "module Enumerable\n#{code}\n en...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/spec/port_spec.rb
spec/port_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper" describe 'Syncronously sending to a Port' do it 'extends the length of the stream and preserves order' do local do |port, stream| unify port, Dataflow::Port.new(stream) port.send 1 port.send 2 stream.take(2).should == [1, 2] port.send ...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/spec/inspect_spec.rb
spec/inspect_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper" describe "An unbound variable" do it "should be inspectable for debugging purposes" do local do |unbound| unbound.inspect.should =~ /#<Dataflow::Variable:-?\d+ unbound>/ end end end describe "An bound variable" do it "should proxy inspect" do loc...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/spec/need_later_spec.rb
spec/need_later_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper" describe 'A need_later expression' do it 'returns a future to be calculated later' do local do |x, y, z| unify y, need_later { 4 } unify z, need_later { x + y } unify x, need_later { 3 } z.should == 7 end end end
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/spec/future_queue_spec.rb
spec/future_queue_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper" describe 'A future queue' do it 'accepts synchronous pushes and pops' do local do |queue, first, second, third| unify queue, Dataflow::FutureQueue.new queue.pop first queue.pop second queue.push 1 queue.push 2 queue.push 3 ...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/spec/forker_spec.rb
spec/forker_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper" describe 'Setting a customer forker' do before(:all) do @original_forker = Dataflow.forker Dataflow.forker = Class.new do def self.synchronous_forker(&block) block.call end end.method(:synchronous_forker) end after(:all) do Data...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/spec/anonymous_variables_spec.rb
spec/anonymous_variables_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper" describe 'Using an anonymous variable' do it 'works with Variable instances' do container = [Dataflow::Variable.new] unify container.first, 1337 container.first.should == 1337 end it 'works with Dataflow.local' do container = [Dataflow.local] u...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/spec/barrier_spec.rb
spec/barrier_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper" describe 'A barrier' do it 'waits for variables to be bound before continuing' do local do |x, y, barrier_broken| Thread.new do barrier x, y unify barrier_broken, true end Thread.new { unify x, :x } Thread.new { unify y, :y ...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/spec/flow_spec.rb
spec/flow_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper" describe 'Using flow without a parameter' do it 'works like normal threads' do local do |big_cat, small_cat| flow { unify big_cat, small_cat.upcase } unify small_cat, 'cat' big_cat.should == 'CAT' end end end describe 'Using flow with a par...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/spec/enumerable_spec.rb
spec/enumerable_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper" describe Dataflow::Enumerable do it '#map_later combines map & need_later' do [1, 2, 3].map_later do |x| x.succ end.should == [2, 3, 4] end it '#map_barrier combines map, need_later, & barrier' do [1, 2, 3].map_barrier do |x| x.succ end...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/spec/equality_spec.rb
spec/equality_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper" describe 'Unifying a bound value' do [nil, true, false, :sym, "str", /regex/, 3, 2.0, Object.new, Class.new.new, [], {}].each do |type| describe "for #{type.class} instances" do it 'passes unification for an object of equal value' do local...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/spec/actor_spec.rb
spec/actor_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper" describe 'Syncronously sending to an Actor' do it 'passes in each message received and preserves order' do local do |port, stream, actor| unify port, Dataflow::Port.new(stream) unify actor, Dataflow::Actor.new { 3.times { port.send receive } } a...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/spec/dataflow_spec.rb
spec/dataflow_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper" context 'Using "local" for local variables' do describe 'An unbound Variable' do it 'suspends if an unbound variable has a method called on it until it is bound' do local do |big_cat, small_cat| Thread.new { unify big_cat, small_cat.upcase } u...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/spec/by_need_spec.rb
spec/by_need_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper" describe 'A by_need expression' do describe 'when a method is called on it' do it 'binds its variable' do local do |x, y, z| Thread.new { unify y, by_need { 4 } } Thread.new { unify z, x + y } Thread.new { unify x, by_need { 3 } } ...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/spec/spec_helper.rb
spec/spec_helper.rb
require 'rubygems' require 'spec' require "#{File.dirname(__FILE__)}/../dataflow" require "#{File.dirname(__FILE__)}/../dataflow/equality" Thread.abort_on_exception = true Spec::Runner.configure do |config| config.include Dataflow end Dataflow.enumerable!
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/examples/future_queue.rb
examples/future_queue.rb
require "#{File.dirname(__FILE__)}/../dataflow" include Dataflow local do |queue, first, second| unify queue, Dataflow::FutureQueue.new queue.pop first queue.push 1 queue.push 2 queue.pop second puts "first: #{first}, second: #{second}" end
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/examples/local_variables.rb
examples/local_variables.rb
require "#{File.dirname(__FILE__)}/../dataflow" include Dataflow local do |x, y, z| # notice how the order automatically gets resolved Thread.new { unify y, x + 2 } Thread.new { unify z, y + 3 } Thread.new { unify x, 1 } puts z end
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/examples/instance_variables.rb
examples/instance_variables.rb
require "#{File.dirname(__FILE__)}/../dataflow" class AnimalHouse include Dataflow declare :small_cat, :big_cat def fetch_big_cat Thread.new { unify big_cat, small_cat.upcase } unify small_cat, 'cat' big_cat end end puts AnimalHouse.new.fetch_big_cat
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/examples/connection_protector.rb
examples/connection_protector.rb
require "#{File.dirname(__FILE__)}/../dataflow" class ThreadUnsafeConnection def initialize() @used = 0 end def value @used += 1 end end class ConnectionProtector def initialize @queue = Dataflow::FutureQueue.new @queue.push ThreadUnsafeConnection.new end def protect(&block) Dataflow.loc...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/examples/port_http_gets.rb
examples/port_http_gets.rb
require "#{File.dirname(__FILE__)}/../dataflow" require 'net/http' include Dataflow # Be gentle running this one Thread.abort_on_exception = true local do |port, stream, branding_occurences, number_of_mentions| unify port, Dataflow::Port.new(stream) 10.times { Thread.new(port) {|p| p.send Net::HTTP.get_response(UR...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/examples/data_driven.rb
examples/data_driven.rb
require "#{File.dirname(__FILE__)}/../dataflow" include Dataflow local do |stream, doubles, triples, squares| unify stream, Array.new(5) { Dataflow::Variable.new } Thread.new { unify doubles, stream.map {|n| n*2 } } Thread.new { unify triples, stream.map {|n| n*3 } } Thread.new { unify squares, stream.map {...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/examples/ring.rb
examples/ring.rb
require "#{File.dirname(__FILE__)}/../dataflow" include Dataflow # Send M messages each along a ring of N nodes N = 4 M = 2 actors = Array.new(N) { Dataflow::Variable.new } N.times do |n| unify actors[n], Actor.new { M.times do |m| receive puts "[#{n} #{m}]" actors[(n+1) % N].send :msg end...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/examples/port_send.rb
examples/port_send.rb
require "#{File.dirname(__FILE__)}/../dataflow" include Dataflow local do |port, stream| unify port, Dataflow::Port.new(stream) Thread.new {port.send 2} Thread.new {port.send 8} Thread.new {port.send 1024} puts stream.take(3).sort.inspect end
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/examples/flow.rb
examples/flow.rb
require "#{File.dirname(__FILE__)}/../dataflow" include Dataflow # flow without parameters local do |x| flow do # other stuff unify x, 1337 end puts x end # flow with an output parameter local do |x| flow(x) do # other stuff 1337 end puts x end
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/examples/laziness.rb
examples/laziness.rb
require "#{File.dirname(__FILE__)}/../dataflow" include Dataflow local do |x, y, z| Thread.new { unify y, by_need { 4 } } Thread.new { unify z, x + y } Thread.new { unify x, by_need { 3 } } puts z end
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/examples/dataflow_http_gets.rb
examples/dataflow_http_gets.rb
require "#{File.dirname(__FILE__)}/../dataflow" require 'net/http' include Dataflow # Be gentle running this one Thread.abort_on_exception = true local do |stream, branding_occurences, number_of_mentions| unify stream, Array.new(10) { Dataflow::Variable.new } stream.each {|s| Thread.new(s) {|v| unify v, Net::HTTP....
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/examples/future_http_gets.rb
examples/future_http_gets.rb
require "#{File.dirname(__FILE__)}/../dataflow" require 'net/http' include Dataflow # Be gentle running this one Thread.abort_on_exception = true local do |stream, branding_occurences, number_of_mentions| unify stream, Array.new(10) { need_later { Net::HTTP.get_response(URI.parse("http://www.cuil.com/search?q=#{rand...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/examples/messages.rb
examples/messages.rb
require "#{File.dirname(__FILE__)}/../dataflow" include Dataflow Ping = Actor.new { 3.times { case receive when "Ping" puts "Ping" Pong.send "Pong" end } } Pong = Actor.new { 3.times { case receive when "Pong" puts "Pong" Ping.send "Ping" end } } Ping.send "Pin...
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
larrytheliquid/dataflow
https://github.com/larrytheliquid/dataflow/blob/c856552bbc0fc9e64b2b13a08239cba985874eaf/examples/barrier.rb
examples/barrier.rb
require "#{File.dirname(__FILE__)}/../dataflow" include Dataflow local do |lock1, lock2| flow { unify lock1, :unlocked } flow { unify lock2, :unlocked } barrier lock1, lock2 puts "Barrier broken!" end
ruby
MIT
c856552bbc0fc9e64b2b13a08239cba985874eaf
2026-01-04T17:54:36.790117Z
false
harryw/raft
https://github.com/harryw/raft/blob/2ffe2b10a7a548fd2d5fb1e8c3cc25af38fb776c/features/support/env.rb
features/support/env.rb
require 'raft' require 'raft/goliath' require 'rspec' require 'em-synchrony/em-http' Around do |_, block| EM.synchrony {block.call} end
ruby
MIT
2ffe2b10a7a548fd2d5fb1e8c3cc25af38fb776c
2026-01-04T17:54:42.497228Z
false
harryw/raft
https://github.com/harryw/raft/blob/2ffe2b10a7a548fd2d5fb1e8c3cc25af38fb776c/features/step_definitions/node_steps.rb
features/step_definitions/node_steps.rb
Before do @goliaths = {} @config = Raft::Config.new( Raft::Goliath.rpc_provider(Proc.new {|node_id, message| URI("http://localhost:#{node_id}/#{message}")}), Raft::Goliath.async_provider, 1.5, #election_timeout seconds 1.0, #election_splay seconds 0.2, #update_interval seconds 1....
ruby
MIT
2ffe2b10a7a548fd2d5fb1e8c3cc25af38fb776c
2026-01-04T17:54:42.497228Z
false
harryw/raft
https://github.com/harryw/raft/blob/2ffe2b10a7a548fd2d5fb1e8c3cc25af38fb776c/lib/raft.rb
lib/raft.rb
require 'delegate' module Raft Config = Struct.new(:rpc_provider, :async_provider, :election_timeout, :election_splay, :update_interval, :heartbeat_interval) class Cluster attr_reader :node_ids def initialize(*node_ids) @node_ids = node_ids end def quorum @node_ids.count / 2 + 1 # in...
ruby
MIT
2ffe2b10a7a548fd2d5fb1e8c3cc25af38fb776c
2026-01-04T17:54:42.497228Z
false
harryw/raft
https://github.com/harryw/raft/blob/2ffe2b10a7a548fd2d5fb1e8c3cc25af38fb776c/lib/raft/goliath.rb
lib/raft/goliath.rb
require_relative '../raft' require 'goliath' module Raft class Goliath def self.log(message) #STDOUT.write("\n\n") #STDOUT.write(message) #STDOUT.write("\n\n") end class HttpJsonRpcResponder < ::Goliath::API use ::Goliath::Rack::Render, 'json' use ::Goliath::Rack::Validat...
ruby
MIT
2ffe2b10a7a548fd2d5fb1e8c3cc25af38fb776c
2026-01-04T17:54:42.497228Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/autotest/discover.rb
autotest/discover.rb
Autotest.add_discovery { "rspec2" }
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/spec_helper.rb
spec/spec_helper.rb
require 'bundler' Bundler.setup require File.join(File.dirname(__FILE__), '/../lib/highrise') Highrise::Base.user = ENV['HIGHRISE_USER'] || 'x' Highrise::Base.oauth_token = ENV['HIGHRISE_TOKEN'] || 'TOKEN' Highrise::Base.site = ENV['HIGHRISE_SITE'] || 'https://www.example.com' require 'highrise...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/taggable_behavior.rb
spec/highrise/taggable_behavior.rb
shared_examples_for "a taggable class" do before(:each) do (@tags = []).tap do @tags << Highrise::Tag.new(:name => "cliente", :id => 414578) @tags << Highrise::Tag.new(:name => "ged", :id => 414580) @tags << Highrise::Tag.new(:name => "iepc", :id => 414579) end end it { subject.class.in...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/group_spec.rb
spec/highrise/group_spec.rb
require 'spec_helper' describe Highrise::Group do it { should be_a_kind_of Highrise::Base } end
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/searchable_spec.rb
spec/highrise/searchable_spec.rb
require 'spec_helper' describe Highrise::Searchable do class TestClass < Highrise::Base; include Highrise::Searchable; end subject { TestClass.new } it_should_behave_like "a searchable class" end
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/task_category_spec.rb
spec/highrise/task_category_spec.rb
require 'spec_helper' describe Highrise::TaskCategory do subject { Highrise::TaskCategory.new(:id => 1, :name => "Task Category") } it { should be_a_kind_of Highrise::Base } it ".find_by_name" do task_category = Highrise::TaskCategory.new(:id => 2, :name => "Another Task Category") Highrise::TaskCa...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/searchable_behavior.rb
spec/highrise/searchable_behavior.rb
shared_examples_for "a searchable class" do it { subject.class.included_modules.should include(Highrise::Searchable) } it ".search" do find_args = {:from => "/#{subject.class.collection_name}/search.xml", :params => {"criteria[email]" => "john.doe@example.com", "criteria[zip]" => "90210"}} if subject.class...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/email_spec.rb
spec/highrise/email_spec.rb
require 'spec_helper' describe Highrise::Email do it { should be_a_kind_of Highrise::Base } it_should_behave_like "a paginated class" it "#comments" do subject.should_receive(:id).and_return(1) Highrise::Comment.should_receive(:find).with(:all, {:from=>"/emails/1/comments.xml"}).and_return("comments"...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/pagination_behavior.rb
spec/highrise/pagination_behavior.rb
shared_examples_for "a paginated class" do it { subject.class.included_modules.should include(Highrise::Pagination) } it ".find_all_across_pages" do subject.class.should_receive(:find).with(:all,{:params=>{:n=>0}}).and_return(["things"]) subject.class.should_receive(:find).with(:all,{:params=>{:n=>1}}).and...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/membership_spec.rb
spec/highrise/membership_spec.rb
require 'spec_helper' describe Highrise::Membership do it { should be_a_kind_of Highrise::Base } end
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/deal_spec.rb
spec/highrise/deal_spec.rb
require 'spec_helper' describe Highrise::Deal do subject { Highrise::Deal.new(:id => 1) } it { should be_a_kind_of Highrise::Subject } it ".add_note" do Highrise::Note.should_receive(:create).with({:body=>"body", :subject_id=>1, :subject_type=>'Deal'}).and_return(mock('note')) subject.add_note :b...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/party_spec.rb
spec/highrise/party_spec.rb
require 'spec_helper' describe Highrise::Party do it { should be_a_kind_of Highrise::Base } it ".recently_viewed" do Highrise::Party.should_receive(:find).with(:all, {:from => '/parties/recently_viewed.xml'}) Highrise::Party.recently_viewed end it ".deletions_since" do time = Time.parse("Wed Ja...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/recording_spec.rb
spec/highrise/recording_spec.rb
require 'spec_helper' describe Highrise::Recording do it { should be_a_kind_of Highrise::Base } it_should_behave_like "a paginated class" end
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/pagination_spec.rb
spec/highrise/pagination_spec.rb
require 'spec_helper' describe Highrise::Pagination do class TestClass < Highrise::Base; include Highrise::Pagination; end subject { TestClass.new } it_should_behave_like "a paginated class" end
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/task_spec.rb
spec/highrise/task_spec.rb
require 'spec_helper' describe Highrise::Task do it { should be_a_kind_of Highrise::Base } it "#complete!" do subject.should_receive(:load_attributes_from_response).with("post") subject.should_receive(:post).with(:complete).and_return("post") subject.complete! end end
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/person_spec.rb
spec/highrise/person_spec.rb
# encoding: utf-8 require 'spec_helper' describe Highrise::Person do subject { Highrise::Person.new(:id => 1) } it { should be_a_kind_of Highrise::Subject } it_should_behave_like "a paginated class" it_should_behave_like "a taggable class" it_should_behave_like "a searchable class" describe "#company" d...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/company_spec.rb
spec/highrise/company_spec.rb
require 'spec_helper' describe Highrise::Company do subject { Highrise::Company.new(:id => 1) } it { should be_a_kind_of Highrise::Base } it_should_behave_like "a paginated class" it_should_behave_like "a taggable class" it_should_behave_like "a searchable class" it "#people" do Highrise::Person.sh...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/base_spec.rb
spec/highrise/base_spec.rb
require 'spec_helper' describe Highrise::Base do it { subject.should be_a_kind_of ActiveResource::Base } describe "dynamic finder methods" do context "without pagination" do before do @deal_one = Highrise::Base.new(:id => 1, :name => "A deal") @deal_two = Highrise::Base.new(:id => 2,...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/tag_spec.rb
spec/highrise/tag_spec.rb
require 'spec_helper' describe Highrise::Tag do subject { Highrise::Tag.new(:id => 1, :name => "Name") } it { should be_a_kind_of Highrise::Base } it "supports equality" do tag = Highrise::Tag.new(:id => 1, :name => "Name") subject.should == tag end it ".find_by_name" do tag = Highrise::Ta...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/taggable_spec.rb
spec/highrise/taggable_spec.rb
require 'spec_helper' describe Highrise::Taggable do class TestClass < Highrise::Base; include Highrise::Taggable; end subject { TestClass.new } it_should_behave_like "a taggable class" end
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/kase_spec.rb
spec/highrise/kase_spec.rb
require 'spec_helper' describe Highrise::Kase do it { should be_a_kind_of Highrise::Subject } it_should_behave_like "a paginated class" it "#close!" do mocked_now = Time.parse("Wed Jan 14 15:43:11 -0200 2009") Time.should_receive(:now).and_return(mocked_now) subject.should_receive(:update_attribute...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/subject_spec.rb
spec/highrise/subject_spec.rb
require 'spec_helper' describe Highrise::Subject do subject { Highrise::Subject.new(:id => 1) } it { should be_a_kind_of Highrise::Base } it "#notes" do Highrise::Note.should_receive(:find_all_across_pages).with({:from=>"/subjects/1/notes.xml"}).and_return("notes") subject.notes.should == "notes" end...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/account_spec.rb
spec/highrise/account_spec.rb
require 'spec_helper' describe Highrise::Account do it { should be_a_kind_of Highrise::Base } it ".me" do Highrise::Account.should_receive(:find).with(:one, {:from => "/account.xml"}).and_return(subject) Highrise::Account.me.should == subject end end
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/subject_field_spec.rb
spec/highrise/subject_field_spec.rb
require 'spec_helper' describe Highrise::SubjectField do it { should be_a_kind_of Highrise::Base } let(:two_subject_fields){ [ Highrise::SubjectField.new({:id => 1, :label => "Cabbage"}), Highrise::SubjectField.new({:id => 2, :label => "Chicken"})] } let(:four_subject_fields){ [ two_subject_fields,...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false
tapajos/highrise
https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/deal_category_spec.rb
spec/highrise/deal_category_spec.rb
require 'spec_helper' describe Highrise::DealCategory do subject { Highrise::DealCategory.new(:id => 1, :name => "Deal Category") } it { should be_a_kind_of Highrise::Base } it ".find_by_name" do deal_category = Highrise::DealCategory.new(:id => 2, :name => "Another Deal Category") Highrise::DealCa...
ruby
MIT
1a1d4a2ea38dce8aa7ade974604f81d829d9c359
2026-01-04T17:54:47.038387Z
false