Skip to content

Instantly share code, notes, and snippets.

@jugyo

jugyo/gist:619977

Created Oct 11, 2010
Embed
What would you like to do?
#!/usr/bin/env ruby
##
# script/spec_server_irb
require 'drb'
require 'irb'
begin
begin
DRb.start_service("druby://localhost:0")
rescue SocketError, Errno::EADDRNOTAVAIL
DRb.start_service("druby://:0")
end
$spec_server = DRbObject.new_with_uri("druby://127.0.0.1:8989")
rescue DRb::DRbConnError
err.puts "No DRb server is running. Running in local process instead ..."
end
def rspec(file)
$spec_server.run(["--color", "--format", "s", file], STDERR, STDOUT)
end
puts <<DESC
Example:
> rspec 'spec/models/user_spec.rb'
DESC
IRB.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.