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
diff --git a/lib/rspec/mocks/clean_caller.rb b/lib/rspec/mocks/clean_caller.rb | |
index dc52c87..ed2a72d 100644 | |
--- a/lib/rspec/mocks/clean_caller.rb | |
+++ b/lib/rspec/mocks/clean_caller.rb | |
@@ -6,21 +6,10 @@ module RSpec | |
# the code using the library, which is far more useful than the particular | |
# internal method that raised an error. | |
class CleanCaller | |
- | |
- # This list is an unfortunate dependency on other RSpec core libraries. |
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 ValueObject < Struct | |
def self.[](*args) | |
if args.length > 0 | |
new(*args) | |
else | |
new(:null) | |
end | |
end | |
def [](*args) |
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
true | |
repro.rb:16:in `block in <main>': uninitialized constant B (NameError) | |
from repro.rb:13:in `initialize' | |
from repro.rb:13:in `new' | |
from repro.rb:13:in `<main>' |
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
diff --git a/code/1_sos.rb b/code/1_sos.rb | |
index 03bd37e..8de6d9b 100644 | |
--- a/code/1_sos.rb | |
+++ b/code/1_sos.rb | |
@@ -34,7 +34,8 @@ end | |
Number = Struct.new(:value) do | |
def to_s; value.to_s end | |
def inspect; "«#{self}»" end | |
- def reducible?; false end | |
+ def ==(other); other.is_a?(Number) && value == other.value 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
months = { | |
'Jan' => 6, | |
'Feb' => 2, | |
'Mar' => 2, | |
'Apr' => 5, | |
'May' => 0, | |
'Jun' => 3, | |
'Jul' => 5, | |
'Aug' => 1, | |
'Sep' => 4, |
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 | |
# url rewriter for rubygems squid proxy | |
STDOUT.sync = true | |
while line = gets | |
url = line.split(' ')[0] | |
# Cargo-culted this conditional, not sure if it is necessary | |
response = if url |
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
diff --git a/lib/ruby/shared/jruby/core_ext/class.rb b/lib/ruby/shared/jruby/core_ext/class.rb | |
index eca4b54..39c88d6 100644 | |
--- a/lib/ruby/shared/jruby/core_ext/class.rb | |
+++ b/lib/ruby/shared/jruby/core_ext/class.rb | |
@@ -140,7 +140,7 @@ class Class | |
annotations.each_with_index do |param_annos, i| | |
for cls, params in param_annos | |
params ||= {} | |
- self_r.add_parameter_annotation(name, i, _anno_class(cls)) | |
+ self_r.add_parameter_annotation(name, i, _anno_class(cls), params) |
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 RegistrationsController < ApplicationController | |
include Injector::ControllerMethods | |
provided_by Controller::Registration | |
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
class ControllerSource | |
Response = Struct.new(:controller, :injector) do | |
def redirect_to(path, *args) | |
controller.redirect_to(controller.send("#{path}_path", *args)) | |
end | |
def render(*args) | |
ivars = {} | |
if args.last.is_a?(Hash) && args.last.has_key?(:ivars) | |
ivars = args.last.delete(:ivars) |
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 ServiceService | |
def initialize(options) | |
@queue = TorqueBox::Messaging::Queue.new( '/queues/service_request' ) | |
@running = true | |
end | |
def start() | |
Thread.new do | |
while @running |