Skip to content

Instantly share code, notes, and snippets.

@hitode909
Created February 22, 2010 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hitode909/310741 to your computer and use it in GitHub Desktop.
Save hitode909/310741 to your computer and use it in GitHub Desktop.
#! /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