This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "eventmachine" | |
require "mq" | |
require "amqp" | |
#PUBLISH_MODE = :one_to_n | |
PUBLISH_MODE = :one_to_one_of_n | |
START_TIME = Time.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "eventmachine" | |
require "mq" | |
require "amqp" | |
#PUBLISH_MODE = :one_to_n | |
PUBLISH_MODE = :one_to_one_of_n | |
START_TIME = Time.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "eventmachine" | |
require "mq" | |
require "amqp" | |
require "bunny" | |
#PUBLISH_MODE = :one_to_n | |
PUBLISH_MODE = :one_to_one_of_n | |
START_TIME = Time.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):001:0> class A | |
irb(main):002:1> def foo | |
irb(main):003:2> puts "class A's foo is a bar" | |
irb(main):004:2> end | |
irb(main):005:1> end | |
=> nil | |
irb(main):006:0> module B | |
irb(main):007:1> def foo | |
irb(main):008:2> puts "mod B's foo is a baz" | |
irb(main):009:2> end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Updated: This works for every "setter method". I've been using the ivars this whole time (4 YEARS!) | |
# so I never noticed. But it seems dirty to access ivars you didn't create... | |
module AccessorDefinition | |
attr_accessor :foo | |
end | |
class Includer | |
include AccessorDefinition | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
Kernel.system("rabbitmq-server -detached") | |
sleep 4 | |
require "rubygems" | |
require "eventmachine" | |
require "mq" | |
class Borker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A | |
def test | |
p "whatup from A" | |
end | |
end | |
# => nil | |
module B | |
def test | |
p "whatup from B" | |
super |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this in a file named Gemfile | |
# Install wycats/bundler (http://github.com/wycats/bundler/tree/master) | |
# cd to the directory where this file is | |
# run gem_bundle | |
gem "chef" | |
# bundler gets dependencies automagically... | |
source "http://gems.opscode.com/" | |
disable_rubygems |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bundler creates files like this in bin/ | |
###### | |
#!/usr/bin/env ruby1.8 | |
require "/home/ddeleo/ruby/travelling-chef/vendor/gems/environments/default" | |
load "/home/ddeleo/ruby/travelling-chef/vendor/gems/gems/chef-0.7.4/bin/chef-solo" | |
###### | |
# Any reason it couldn't be this?: | |
#!/usr/bin/env ruby1.8 | |
require File.dirname(__FILE__) + "/../vendor/gems/environments/default" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Schrodinger:~/ruby/rubyspec danieldeleo$ mspec -t j core/array/pack_spec.rb | |
jruby 1.3.1 (ruby 1.8.6p287) (2009-08-17 6586) (Java HotSpot(TM) Client VM 1.5.0_19) [ppc-java] | |
........................................................................................................................................................................................................................................................................................................................................................................................................F...............F...............F.............F.............F...............F................................................................................ | |
1) | |
Array#pack with format 'f' accepts a NaN FAILED | |
Expected "\177\300\000\000" | |
to match /\xFF(?:[\x81-\xFF]..|\x80[\x01-\xFF].|\x80.[\x01-\xFF])/n | |
/Users/danieldeleo/jruby-1.3.1/lib/ruby/gems/1.8/gems/mspec-1.5.12/lib/mspec/expectations/expectations.rb:15:in `fail_with' |
OlderNewer