public
Description: A Gitk-like application written in RubyCocoa that looks like it belongs on a Mac. See the wiki for downloads and screenshots.
Homepage: http://alternateidea.com
Clone URL: git://github.com/Caged/gitnub.git
Search Repo:
Click here to lend your support to: gitnub and make a donation at www.pledgie.com !
Implement a wrapper around LH for now until I figure out exactly what I 
want to do with this
Caged (author)
Sun Apr 27 22:49:02 -0700 2008
commit  58057aee4abc5c0e9557397bb791faac2de03ace
tree    e512be8cfaf3fffe81e1cb48fb1c16106ea5257b
parent  edc1379638847f09d2637509e8ed29bb9ba7621c
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
0
@@ -1 +1,19 @@
0
+#
0
+# BrowserToolbarView.rb
0
+# GitNub
0
+#
0
+# Created by Justin Palmer on 4/27/08.
0
+# Copyright (c) 2008 Active Reload, LLC. All rights reserved.
0
+#
0
+
0
+require 'osx/cocoa'
0
+
0
+class BrowserToolbarView < OSX::NSView
0
+
0
+ def drawRect(rect)
0
+ gradient = NSGradient.alloc.initWithStartingColor_endingColor(NSColor.darkGrayColor, NSColor.controlShadowColor)
0
+ gradient.drawInRect_angle(bounds, 90.0)
0
+ end
0
+
0
+end
...
8
9
10
11
12
 
13
14
15
16
17
...
430
431
432
433
 
434
435
 
436
437
438
439
440
441
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
442
443
444
445
...
459
460
461
462
463
 
 
464
465
466
467
 
468
469
470
471
...
494
495
496
497
 
498
499
500
501
502
503
 
504
505
506
...
983
984
985
986
 
987
988
989
...
995
996
997
998
 
999
1000
1001
1002
1003
1004
...
1397
1398
1399
1400
1401
 
 
1402
1403
1404
1405
1406
1407
1408
1409
 
 
1410
1411
1412
1413
1414
1415
1416
1417
 
 
1418
1419
1420
1421
1422
1423
1424
 
1425
1426
1427
...
1915
1916
1917
1918
 
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
...
2035
2036
2037
2038
 
2039
2040
2041
 
2042
2043
2044
2045
2046
2047
 
2048
2049
2050
 
 
2051
2052
 
2053
2054
2055
2056
2057
 
 
2058
2059
2060
2061
 
2062
2063
2064
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2065
2066
2067
...
2187
2188
2189
 
 
 
 
 
 
2190
2191
2192
2193
...
2225
2226
2227
2228
 
2229
2230
 
2231
2232
2233
...
2352
2353
2354
 
 
 
 
 
 
2355
2356
2357
...
2381
2382
2383
2384
 
2385
2386
2387
...
2438
2439
2440
 
 
 
 
 
 
 
 
2441
2442
2443
...
8
9
10
 
11
12
13
14
15
16
17
...
430
431
432
 
433
434
 
435
436
437
438
439
 
 
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
...
499
500
501
 
 
502
503
504
505
506
 
507
508
509
510
511
...
534
535
536
 
537
538
539
540
541
542
 
543
544
545
546
...
1023
1024
1025
 
1026
1027
1028
1029
...
1035
1036
1037
 
1038
1039
1040
1041
1042
1043
1044
...
1437
1438
1439
 
 
1440
1441
1442
1443
1444
1445
1446
1447
 
 
1448
1449
1450
1451
1452
1453
1454
1455
 
 
1456
1457
1458
1459
1460
1461
1462
1463
 
1464
1465
1466
1467
...
1955
1956
1957
 
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
...
2075
2076
2077
 
2078
2079
2080
 
2081
2082
2083
2084
2085
2086
 
2087
2088
2089
 
2090
2091
2092
 
2093
2094
2095
2096
 
 
2097
2098
2099
2100
2101
 
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
...
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
...
2286
2287
2288
 
2289
2290
 
2291
2292
2293
2294
...
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
...
2448
2449
2450
 
2451
2452
2453
2454
...
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
0
@@ -8,8 +8,8 @@
0
     <string key="IBDocument.HIToolboxVersion">352.00</string>
0
     <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
0
       <bool key="EncodedWithXMLCoder">YES</bool>
0
- <integer value="344"/>
0
       <integer value="508"/>
0
+ <integer value="344"/>
0
     </object>
0
     <object class="NSArray" key="IBDocument.PluginDependencies">
0
       <bool key="EncodedWithXMLCoder">YES</bool>
0
0
0
@@ -430,15 +430,55 @@
0
                   <reference key="NSColor" ref="227031787"/>
0
                   <reference key="NSTabView" ref="1049027428"/>
0
                 </object>
0
- <object class="NSTabViewItem" id="874674076">
0
+ <object class="NSTabViewItem" id="33602067">
0
                   <string key="NSIdentifier">lighthouse</string>
0
- <object class="NSView" key="NSView" id="258092279">
0
+ <object class="NSView" key="NSView" id="1070808129">
0
                     <reference key="NSNextResponder" ref="1049027428"/>
0
                     <int key="NSvFlags">274</int>
0
                     <object class="NSMutableArray" key="NSSubviews">
0
                       <bool key="EncodedWithXMLCoder">YES</bool>
0
- <object class="WebView" id="572810394">
0
- <reference key="NSNextResponder" ref="258092279"/>
0
+ <object class="NSCustomView" id="419550031">
0
+ <reference key="NSNextResponder" ref="1070808129"/>
0
+ <int key="NSvFlags">4386</int>
0
+ <object class="NSMutableArray" key="NSSubviews">
0
+ <bool key="EncodedWithXMLCoder">YES</bool>
0
+ <object class="NSBox" id="1038082058">
0
+ <reference key="NSNextResponder" ref="419550031"/>
0
+ <int key="NSvFlags">10</int>
0
+ <string key="NSFrame">{{0, 29}, {990, 5}}</string>
0
+ <reference key="NSSuperview" ref="419550031"/>
0
+ <string key="NSOffsets">{0, 0}</string>
0
+ <object class="NSTextFieldCell" key="NSTitleCell">
0
+ <int key="NSCellFlags">67239424</int>
0
+ <int key="NSCellFlags2">0</int>
0
+ <string key="NSContents">Box</string>
0
+ <reference key="NSSupport" ref="98627494"/>
0
+ <object class="NSColor" key="NSBackgroundColor">
0
+ <int key="NSColorSpace">6</int>
0
+ <string key="NSCatalogName">System</string>
0
+ <string key="NSColorName">textBackgroundColor</string>
0
+ <object class="NSColor" key="NSColor">
0
+ <int key="NSColorSpace">3</int>
0
+ <bytes key="NSWhite">MQA</bytes>
0
+ </object>
0
+ </object>
0
+ <object class="NSColor" key="NSTextColor">
0
+ <int key="NSColorSpace">3</int>
0
+ <bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes>
0
+ </object>
0
+ </object>
0
+ <int key="NSBorderType">3</int>
0
+ <int key="NSBoxType">2</int>
0
+ <int key="NSTitlePosition">0</int>
0
+ <bool key="NSTransparent">NO</bool>
0
+ </object>
0
+ </object>
0
+ <string key="NSFrameSize">{990, 32}</string>
0
+ <reference key="NSSuperview" ref="1070808129"/>
0
+ <string key="NSClassName">BrowserToolbarView</string>
0
+ </object>
0
+ <object class="WebView" id="271822742">
0
+ <reference key="NSNextResponder" ref="1070808129"/>
0
                         <int key="NSvFlags">274</int>
0
                         <object class="NSMutableSet" key="NSDragTypes">
0
                           <bool key="EncodedWithXMLCoder">YES</bool>
0
0
@@ -459,12 +499,12 @@
0
                             <string>public.url-name</string>
0
                           </object>
0
                         </object>
0
- <string key="NSFrameSize">{990, 638}</string>
0
- <reference key="NSSuperview" ref="258092279"/>
0
+ <string key="NSFrame">{{0, 32}, {990, 606}}</string>
0
+ <reference key="NSSuperview" ref="1070808129"/>
0
                         <reference key="NSNextKeyView"/>
0
                         <string key="FrameName"/>
0
                         <string key="GroupName"/>
0
- <object class="WebPreferences" key="Preferences" id="972667462">
0
+ <object class="WebPreferences" key="Preferences" id="428830525">
0
                           <string key="Identifier"/>
0
                           <object class="NSMutableDictionary" key="Values">
0
                             <bool key="EncodedWithXMLCoder">YES</bool>
0
0
@@ -494,13 +534,13 @@
0
                   <reference key="NSTabView" ref="1049027428"/>
0
                 </object>
0
               </object>
0
- <reference key="NSSelectedTabViewItem" ref="874674076"/>
0
+ <reference key="NSSelectedTabViewItem" ref="33602067"/>
0
               <reference key="NSFont" ref="98627494"/>
0
               <int key="NSTvFlags">6</int>
0
               <bool key="NSAllowTruncatedLabels">YES</bool>
0
               <object class="NSMutableArray" key="NSSubviews">
0
                 <bool key="EncodedWithXMLCoder">YES</bool>
0
- <reference ref="258092279"/>
0
+ <reference ref="1070808129"/>
0
               </object>
0
             </object>
0
             <object class="NSSegmentedControl" id="637722390">
0
@@ -983,7 +1023,7 @@
0
             <reference key="NSNextKeyView"/>
0
             <string key="FrameName"/>
0
             <string key="GroupName"/>
0
- <reference key="Preferences" ref="972667462"/>
0
+ <reference key="Preferences" ref="428830525"/>
0
             <bool key="UseBackForwardList">YES</bool>
0
             <bool key="AllowsUndo">YES</bool>
0
           </object>
0
@@ -995,7 +1035,7 @@
0
       <object class="NSCustomObject" id="498734212">
0
         <string key="NSClassName">SUUpdater</string>
0
       </object>
0
- <object class="NSCustomObject" id="222261688">
0
+ <object class="NSCustomObject" id="872304428">
0
         <string key="NSClassName">LighthouseController</string>
0
       </object>
0
     </object>
0
0
0
0
@@ -1397,31 +1437,31 @@
0
         <object class="IBConnectionRecord">
0
           <object class="IBOutletConnection" key="connection">
0
             <string key="label">frameLoadDelegate</string>
0
- <reference key="source" ref="572810394"/>
0
- <reference key="destination" ref="222261688"/>
0
+ <reference key="source" ref="271822742"/>
0
+ <reference key="destination" ref="872304428"/>
0
           </object>
0
           <int key="connectionID">511</int>
0
         </object>
0
         <object class="IBConnectionRecord">
0
           <object class="IBOutletConnection" key="connection">
0
             <string key="label">UIDelegate</string>
0
- <reference key="source" ref="572810394"/>
0
- <reference key="destination" ref="222261688"/>
0
+ <reference key="source" ref="271822742"/>
0
+ <reference key="destination" ref="872304428"/>
0
           </object>
0
           <int key="connectionID">512</int>
0
         </object>
0
         <object class="IBConnectionRecord">
0
           <object class="IBOutletConnection" key="connection">
0
             <string key="label">lighthouse_view</string>
0
- <reference key="source" ref="222261688"/>
0
- <reference key="destination" ref="572810394"/>
0
+ <reference key="source" ref="872304428"/>
0
+ <reference key="destination" ref="271822742"/>
0
           </object>
0
           <int key="connectionID">513</int>
0
         </object>
0
         <object class="IBConnectionRecord">
0
           <object class="IBOutletConnection" key="connection">
0
             <string key="label">application_controller</string>
0
- <reference key="source" ref="222261688"/>
0
+ <reference key="source" ref="872304428"/>
0
             <reference key="destination" ref="620275248"/>
0
           </object>
0
           <int key="connectionID">515</int>
0
@@ -1915,7 +1955,7 @@
0
               <bool key="EncodedWithXMLCoder">YES</bool>
0
               <reference ref="22598373"/>
0
               <reference ref="210041055"/>
0
- <reference ref="874674076"/>
0
+ <reference ref="33602067"/>
0
             </object>
0
             <reference key="parent" ref="831824449"/>
0
           </object>
0
0
0
0
0
0
0
0
@@ -2035,33 +2075,48 @@
0
           </object>
0
           <object class="IBObjectRecord">
0
             <int key="objectID">507</int>
0
- <reference key="object" ref="874674076"/>
0
+ <reference key="object" ref="33602067"/>
0
             <object class="NSMutableArray" key="children">
0
               <bool key="EncodedWithXMLCoder">YES</bool>
0
- <reference ref="258092279"/>
0
+ <reference ref="1070808129"/>
0
             </object>
0
             <reference key="parent" ref="1049027428"/>
0
           </object>
0
           <object class="IBObjectRecord">
0
             <int key="objectID">508</int>
0
- <reference key="object" ref="258092279"/>
0
+ <reference key="object" ref="1070808129"/>
0
             <object class="NSMutableArray" key="children">
0
               <bool key="EncodedWithXMLCoder">YES</bool>
0
- <reference ref="572810394"/>
0
+ <reference ref="419550031"/>
0
+ <reference ref="271822742"/>
0
             </object>
0
- <reference key="parent" ref="874674076"/>
0
+ <reference key="parent" ref="33602067"/>
0
           </object>
0
           <object class="IBObjectRecord">
0
             <int key="objectID">509</int>
0
- <reference key="object" ref="572810394"/>
0
- <reference key="parent" ref="258092279"/>
0
+ <reference key="object" ref="271822742"/>
0
+ <reference key="parent" ref="1070808129"/>
0
           </object>
0
           <object class="IBObjectRecord">
0
             <int key="objectID">510</int>
0
- <reference key="object" ref="222261688"/>
0
+ <reference key="object" ref="872304428"/>
0
             <reference key="parent" ref="269908025"/>
0
             <string key="objectName">LighthouseController</string>
0
           </object>
0
+ <object class="IBObjectRecord">
0
+ <int key="objectID">516</int>
0
+ <reference key="object" ref="419550031"/>
0
+ <object class="NSMutableArray" key="children">
0
+ <bool key="EncodedWithXMLCoder">YES</bool>
0
+ <reference ref="1038082058"/>
0
+ </object>
0
+ <reference key="parent" ref="1070808129"/>
0
+ </object>
0
+ <object class="IBObjectRecord">
0
+ <int key="objectID">520</int>
0
+ <reference key="object" ref="1038082058"/>
0
+ <reference key="parent" ref="419550031"/>
0
+ </object>
0
         </object>
0
       </object>
0
       <object class="NSMutableDictionary" key="flattenedProperties">
0
@@ -2187,6 +2242,12 @@
0
           <string>505.IBPluginDependency</string>
0
           <string>509.IBPluginDependency</string>
0
           <string>510.IBPluginDependency</string>
0
+ <string>516.IBPluginDependency</string>
0
+ <string>516.IBViewIntegration.shadowBlurRadius</string>
0
+ <string>516.IBViewIntegration.shadowColor</string>
0
+ <string>516.IBViewIntegration.shadowOffsetHeight</string>
0
+ <string>516.IBViewIntegration.shadowOffsetWidth</string>
0
+ <string>520.IBPluginDependency</string>
0
           <string>56.IBPluginDependency</string>
0
           <string>56.ImportedFromIB2</string>
0
           <string>57.IBEditorWindowLastContentRect</string>
0
0
@@ -2225,9 +2286,9 @@
0
           <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
0
           <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
0
           <reference ref="9"/>
0
- <string>{{-57, 112}, {990, 682}}</string>
0
+ <string>{{98, 116}, {990, 682}}</string>
0
           <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
0
- <string>{{-57, 112}, {990, 682}}</string>
0
+ <string>{{98, 116}, {990, 682}}</string>
0
           <reference ref="9"/>
0
           <reference ref="9"/>
0
           <string>{{146, 174}, {990, 682}}</string>
0
@@ -2352,6 +2413,12 @@
0
           <string>com.apple.WebKitIBPlugin</string>
0
           <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
0
           <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
0
+ <real value="3.000000e+00"/>
0
+ <reference ref="96157912"/>
0
+ <real value="2.000000e+00"/>
0
+ <reference ref="8"/>
0
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
0
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
0
           <reference ref="9"/>
0
           <string>{{488, 641}, {218, 193}}</string>
0
           <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
0
@@ -2381,7 +2448,7 @@
0
         </object>
0
       </object>
0
       <nil key="sourceID"/>
0
- <int key="maxID">515</int>
0
+ <int key="maxID">521</int>
0
     </object>
0
     <object class="IBClassDescriber" key="IBDocument.Classes">
0
       <object class="NSMutableArray" key="referencedPartialClassDescriptions">
0
@@ -2438,6 +2505,14 @@
0
           <object class="IBClassDescriptionSource" key="sourceIdentifier">
0
             <string key="majorKey">IBUserSource</string>
0
             <string key="minorKey"/>
0
+ </object>
0
+ </object>
0
+ <object class="IBPartialClassDescription">
0
+ <string key="className">BrowserToolbarView</string>
0
+ <string key="superclassName">NSView</string>
0
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
0
+ <string key="majorKey">IBProjectSource</string>
0
+ <string key="minorKey">BrowserToolbarView.rb</string>
0
           </object>
0
         </object>
0
         <object class="IBPartialClassDescription">
...
11
12
13
 
14
15
16
...
59
60
61
 
62
63
64
...
170
171
172
 
173
174
175
...
277
278
279
 
280
281
282
...
11
12
13
14
15
16
17
...
60
61
62
63
64
65
66
...
172
173
174
175
176
177
178
...
280
281
282
283
284
285
286
0
@@ -11,6 +11,7 @@
0
     0ABA3B1B0D89E53E004B6667 /* nub in Resources */ = {isa = PBXBuildFile; fileRef = 0ABA3B1A0D89E53E004B6667 /* nub */; };
0
     281DD5CB0DC281CD006F106D /* LighthouseController.rb in Resources */ = {isa = PBXBuildFile; fileRef = 281DD5CA0DC281CD006F106D /* LighthouseController.rb */; };
0
     281DD5D70DC284DF006F106D /* lighthouse.html in Resources */ = {isa = PBXBuildFile; fileRef = 281DD5D60DC284DF006F106D /* lighthouse.html */; };
0
+ 281DD6740DC57773006F106D /* BrowserToolbarView.rb in Resources */ = {isa = PBXBuildFile; fileRef = 281DD6730DC57773006F106D /* BrowserToolbarView.rb */; };
0
     283254680D8B792500D99366 /* lib in Resources */ = {isa = PBXBuildFile; fileRef = 283254650D8B792500D99366 /* lib */; };
0
     285BB5320D849C890027980C /* TexturedWindow.rb in Resources */ = {isa = PBXBuildFile; fileRef = 285BB52F0D849C890027980C /* TexturedWindow.rb */; };
0
     285BB53D0D849DD20027980C /* added.png in Resources */ = {isa = PBXBuildFile; fileRef = 285BB5380D849DD20027980C /* added.png */; };
0
@@ -59,6 +60,7 @@
0
     1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
0
     281DD5CA0DC281CD006F106D /* LighthouseController.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = LighthouseController.rb; sourceTree = "<group>"; };
0
     281DD5D60DC284DF006F106D /* lighthouse.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = lighthouse.html; sourceTree = "<group>"; };
0
+ 281DD6730DC57773006F106D /* BrowserToolbarView.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = BrowserToolbarView.rb; sourceTree = "<group>"; };
0
     283254650D8B792500D99366 /* lib */ = {isa = PBXFileReference; lastKnownFileType = folder; path = lib; sourceTree = "<group>"; };
0
     285BB52F0D849C890027980C /* TexturedWindow.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = TexturedWindow.rb; sourceTree = "<group>"; };
0
     285BB5380D849DD20027980C /* added.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = added.png; sourceTree = "<group>"; };
0
@@ -170,6 +172,7 @@
0
         285BB52F0D849C890027980C /* TexturedWindow.rb */,
0
         29B97316FDCFA39411CA2CEA /* main.m */,
0
         E8F5E25803AEB7C803A81C6F /* rb_main.rb */,
0
+ 281DD6730DC57773006F106D /* BrowserToolbarView.rb */,
0
       );
0
       name = "Other Sources";
0
       sourceTree = "<group>";
0
@@ -277,6 +280,7 @@
0
         28851B970DB147AA00FA9C7D /* VisualizationView.rb in Resources */,
0
         281DD5CB0DC281CD006F106D /* LighthouseController.rb in Resources */,
0
         281DD5D70DC284DF006F106D /* lighthouse.html in Resources */,
0
+ 281DD6740DC57773006F106D /* BrowserToolbarView.rb in Resources */,
0
       );
0
       runOnlyForDeploymentPostprocessing = 0;
0
     };
...
1
2
3
4
5
6
7
8
 
9
10
11
12
13
 
14
15
16
...
37
38
39
40
41
 
 
 
42
43
44
45
...
50
51
52
 
53
54
55
56
57
58
 
59
60
61
...
71
72
73
74
 
 
 
 
 
 
 
 
 
 
75
76
...
 
 
1
2
3
4
5
 
6
7
8
9
10
 
11
12
13
14
...
35
36
37
 
 
38
39
40
41
42
43
44
...
49
50
51
52
53
54
55
56
 
 
57
58
59
60
...
70
71
72
 
73
74
75
76
77
78
79
80
81
82
83
84
0
@@ -1,16 +1,14 @@
0
-require 'hpricot'
0
-require 'open-uri'
0
 class LighthouseController < OSX::NSObject
0
   ib_outlet :lighthouse_view
0
   ib_outlet :application_controller
0
   
0
   def awakeFromNib
0
- @project_url = "http://%s.lighthouseapp.com/projects/%i"
0
+ @project_url_template = "http://%s.lighthouseapp.com/projects/%i"
0
     @repo = @application_controller.repo
0
     unless @repo.nil?
0
       return unless setup_api_credentials
0
       setup_lighthouse_view
0
- begin_loading_tickets
0
+ #begin_loading_tickets
0
     end
0
   end
0
   
0
@@ -37,8 +35,9 @@
0
   private
0
   
0
   def setup_lighthouse_view
0
- lighthouse_view = File.join(NSBundle.mainBundle.bundlePath, "Contents", "Resources", "lighthouse.html")
0
- @lighthouse_view.mainFrame.loadRequest(NSURLRequest.requestWithURL(NSURL.fileURLWithPath(lighthouse_view)))
0
+ #lighthouse_view = File.join(NSBundle.mainBundle.bundlePath, "Contents", "Resources", "lighthouse.html")
0
+ lighthouse_view = "#{@project_url}/tickets"
0
+ @lighthouse_view.mainFrame.loadRequest(NSURLRequest.requestWithURL(NSURL.URLWithString(lighthouse_view)))
0
   end
0
   
0
   def setup_api_credentials
0
0
@@ -50,12 +49,12 @@
0
     if @lighthouse[:key].nil? || @lighthouse[:project].nil? || @lighthouse[:account].nil?
0
       return false
0
     end
0
+ @project_url = "#{@project_url_template}" % [@lighthouse[:account], @lighthouse[:project]]
0
     return true
0
   end
0
   
0
   def begin_loading_tickets
0
- tickets_url = "#{@project_url}/tickets.xml" % [@lighthouse[:account], @lighthouse[:project]]
0
- request = NSMutableURLRequest.objc_send(:requestWithURL, NSURL.URLWithString(tickets_url),
0
+ request = NSMutableURLRequest.objc_send(:requestWithURL, NSURL.URLWithString("#{@project_url}/tickets.xml"),
0
       :cachePolicy, NSURLRequestUseProtocolCachePolicy,
0
       :timeoutInterval, 60.0)
0
     
0
@@ -71,7 +70,16 @@
0
   def update_main_document(data)
0
     error = nil
0
     tickets = data.xpath("//ticket")
0
- puts tickets[0].xpath("//body-html").to_s
0
+ doc = @lighthouse_view.mainFrame.DOMDocument
0
+ ticket_list = doc.getElementById("ticket-list")
0
+
0
+ tickets.each do |ticket|
0
+ item = doc.createElement('li')
0
+ item.setInnerHTML(%(<a href="#{@project_url}/tickets/#{ticket[:number].stringValue}">#{ticket[:title].stringValue}</a>))
0
+ ticket_list.appendChild(item)
0
+ end
0
+
0
+
0
   end
0
 end
...
1
2
3
4
5
6
 
7
8
9
10
...
12
13
14
15
 
16
17
18
19
20
21
22
23
24
25
 
 
 
 
 
 
 
 
 
 
 
 
 
26
...
1
 
 
 
 
 
2
3
4
5
6
...
8
9
10
 
11
12
13
14
 
 
 
 
 
 
 
15
16
17
18
19
20
21
22
23
24
25
26
27
28
0
@@ -1,9 +1,5 @@
0
 module OSX
0
- class NSXMLDocument
0
- def [](idx)
0
- self.objectAtIndex(idx)
0
- end
0
-
0
+ class NSXMLNode
0
     def xpath(xpath)
0
       error = nil
0
       nodes = self.nodesForXPath_error(xpath, error)
0
0
@@ -12,16 +8,22 @@
0
     end
0
   end
0
   
0
- class NSXMLElement
0
+ class NSXMLDocument
0
     def [](idx)
0
       self.objectAtIndex(idx)
0
     end
0
-
0
- def xpath(xpath)
0
- error = nil
0
- nodes = self.nodesForXPath_error(xpath, error)
0
- raise "Error parsing XML" if error
0
- return nodes
0
- end end
0
+ end
0
+
0
+ class NSXMLElement
0
+ def [](idx)
0
+ if idx.is_a?(Integer)
0
+ return self.children[idx]
0
+ else
0
+ elements = self.elementsForName(idx.to_s)
0
+ return elements.size == 1 ? elements[0] : elements
0
+ end
0
+ end
0
+
0
+ end
0
 end
...
10
11
12
13
 
 
 
14
15
16
...
10
11
12
 
13
14
15
16
17
18
0
@@ -10,7 +10,9 @@
0
 
0
 <body>
0
   <div id="content">
0
- Lighthouse fool
0
+ <ul id="ticket-list">
0
+
0
+ </ul>
0
   </div>
0
 </body>
0
 </html>
...
177
178
179
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
0
@@ -177,4 +177,20 @@
0
 
0
 
0
 /* @end */
0
+
0
+/* @group ticket list */
0
+
0
+#ticket-list a {
0
+ color: #333;
0
+ text-decoration: none;
0
+}
0
+
0
+#ticket-list li {
0
+ display: block;
0
+ list-style: none;
0
+ font-weight: bold;
0
+ padding: 6px;
0
+ border-bottom: 1px solid #eee;
0
+}
0
+/* @end */

Comments

    No one has commented yet.