public
Description: Watches the ether for the handy *jour scripts.
Homepage:
Clone URL: git://github.com/lachie/starjour.git
Click here to lend your support to: starjour and make a donation at www.pledgie.com !
starjour / AppJour.rb
100644 35 lines (26 sloc) 0.535 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#
# AppJour.rb
# starjour
#
# Created by Lachie Cox on 21/06/08.
# Copyright (c) 2008 __MyCompanyName__. All rights reserved.
#
 
require 'osx/cocoa'
require 'Jour'
 
class AppJour < OSX::NSObject
  include Jour
  
  service_name 'app'
  nib_name 'AppJour'
  
  kvc_accessor :url
  
  def setup
    @text = @service.name
    @url = 'resolving'
  end
  
  def resolved!
    self.url = "http://#{@service.hostName}:#{@service.port}"
    
  end
  
  def open(sender)
    return unless self.url
    system "open '#{self.url}'"
  end
end