- Timestamp:
- 10/28/07 20:31:21 (6 years ago)
- Location:
- lang/ruby/Amalgam
- Files:
-
- 2 modified
-
AppController.rb (modified) (3 diffs)
-
plugins/firefox.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/Amalgam/AppController.rb
r789 r791 105 105 when NilClass 106 106 @icon = NSWorkspace.sharedWorkspace.iconForFileType("unknown") 107 when NSData 108 @icon = NSImage.alloc.initWithData(str) 109 when NSImage 110 @icon = icon 107 111 else 108 112 str = NSData.objc_send :dataWithBytes, icon.to_s, :length … … 166 170 # Tableview 167 171 def numberOfRowsInTableView(table) 168 @now. length172 @now.first(100).length 169 173 end 170 174 … … 175 179 NSWorkspace.sharedWorkspace.iconForFileType('unknown') 176 180 when :name 177 " "181 "#{@now[row].name}\n\t#{@now[row].desc}" 178 182 end 179 183 end -
lang/ruby/Amalgam/plugins/firefox.rb
r789 r791 4 4 def history(text="") 5 5 require "net/telnet" 6 telnet = Net::Telnet.new("Host" => "localhost", "Port" => 4242, "Prompt" => /repl> \z/) {|c| puts c }6 telnet = Net::Telnet.new("Host" => "localhost", "Port" => 4242, "Prompt" => /repl> \z/) 7 7 telnet.cmd("") 8 8 result = "" … … 33 33 end 34 34 35 @candidates << Candidate.new("fx", "Firefox", :sh)do36 37 c = []38 history.eachdo |m|39 c << Candidate.new(m, m, :sh) do35 Thread.start do 36 Thread.abort_on_exception = true 37 icon = NSWorkspace.sharedWorkspace.iconForFileType('unknown') 38 @fx_candidates = history.map do |m| 39 Candidate.new(m, m, icon) do 40 40 system "open", "-a", "Firefox", m 41 41 @candidates.return 42 42 end 43 43 end 44 @candidates.into(c) 44 log :loaded_fx_history 45 end 46 47 48 @candidates << Candidate.new("fx", "Firefox History", :sh) do 49 @candidates.into(@fx_candidates || []) 45 50 @input.stringValue = "" 46 51 filtering ""
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)