Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#! /opt/local/bin/ruby
require 'rubygems'
require 'drb/drb'
require 'git'
require 'g'
class Service
def git_status(path)
Thread.new {
path = File.expand_path path
git = Git.open(path) rescue return
g git.current_branch
changed = git.status.changed.length
g "#{changed} changes" if changed > 0
local = git.log.between('origin', 'HEAD').count
g "#{local} local commits" if local > 0
}
end
end
uri = ARGV.shift || 'druby://localhost:12345'
DRb.start_service(uri, Service.new)
puts DRb.uri
sleep
#! /opt/local/bin/ruby
require 'rubygems'
require 'drb/drb'
there = DRbObject.new_with_uri('druby://localhost:12345')
there.git_status(Dir.pwd)
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.