psyho_juicer 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/History.txt +58 -0
  2. data/Manifest.txt +58 -0
  3. data/Rakefile +96 -0
  4. data/Readme.rdoc +313 -0
  5. data/VERSION +1 -0
  6. data/bin/juicer +6 -0
  7. data/lib/juicer.rb +69 -0
  8. data/lib/juicer/asset/path.rb +275 -0
  9. data/lib/juicer/asset/path_resolver.rb +79 -0
  10. data/lib/juicer/binary.rb +171 -0
  11. data/lib/juicer/cache_buster.rb +131 -0
  12. data/lib/juicer/chainable.rb +106 -0
  13. data/lib/juicer/cli.rb +56 -0
  14. data/lib/juicer/command/install.rb +61 -0
  15. data/lib/juicer/command/list.rb +57 -0
  16. data/lib/juicer/command/merge.rb +205 -0
  17. data/lib/juicer/command/util.rb +32 -0
  18. data/lib/juicer/command/verify.rb +60 -0
  19. data/lib/juicer/css_cache_buster.rb +90 -0
  20. data/lib/juicer/datafy/datafy.rb +20 -0
  21. data/lib/juicer/dependency_resolver/css_dependency_resolver.rb +29 -0
  22. data/lib/juicer/dependency_resolver/dependency_resolver.rb +101 -0
  23. data/lib/juicer/dependency_resolver/javascript_dependency_resolver.rb +23 -0
  24. data/lib/juicer/ext/logger.rb +5 -0
  25. data/lib/juicer/ext/string.rb +47 -0
  26. data/lib/juicer/ext/symbol.rb +15 -0
  27. data/lib/juicer/image_embed.rb +129 -0
  28. data/lib/juicer/install/base.rb +186 -0
  29. data/lib/juicer/install/closure_compiler_installer.rb +69 -0
  30. data/lib/juicer/install/jslint_installer.rb +51 -0
  31. data/lib/juicer/install/rhino_installer.rb +53 -0
  32. data/lib/juicer/install/yui_compressor_installer.rb +67 -0
  33. data/lib/juicer/jslint.rb +90 -0
  34. data/lib/juicer/merger/base.rb +74 -0
  35. data/lib/juicer/merger/javascript_merger.rb +29 -0
  36. data/lib/juicer/merger/stylesheet_merger.rb +110 -0
  37. data/lib/juicer/minifyer/closure_compiler.rb +90 -0
  38. data/lib/juicer/minifyer/java_base.rb +77 -0
  39. data/lib/juicer/minifyer/yui_compressor.rb +96 -0
  40. data/test/bin/jslint-1.0.js +523 -0
  41. data/test/bin/jslint.js +523 -0
  42. data/test/bin/rhino1_7R1.zip +0 -0
  43. data/test/bin/rhino1_7R2-RC1.jar +0 -0
  44. data/test/bin/rhino1_7R2-RC1.zip +0 -0
  45. data/test/bin/yuicompressor +0 -0
  46. data/test/bin/yuicompressor-2.3.5.zip +0 -0
  47. data/test/bin/yuicompressor-2.4.2.jar +0 -0
  48. data/test/bin/yuicompressor-2.4.2.zip +0 -0
  49. data/test/fixtures/yui-download.html +425 -0
  50. data/test/test_helper.rb +175 -0
  51. data/test/unit/juicer/asset/path_resolver_test.rb +76 -0
  52. data/test/unit/juicer/asset/path_test.rb +370 -0
  53. data/test/unit/juicer/cache_buster_test.rb +104 -0
  54. data/test/unit/juicer/chainable_test.rb +94 -0
  55. data/test/unit/juicer/command/install_test.rb +58 -0
  56. data/test/unit/juicer/command/list_test.rb +81 -0
  57. data/test/unit/juicer/command/merge_test.rb +162 -0
  58. data/test/unit/juicer/command/util_test.rb +58 -0
  59. data/test/unit/juicer/command/verify_test.rb +48 -0
  60. data/test/unit/juicer/css_cache_buster_test.rb +71 -0
  61. data/test/unit/juicer/datafy_test.rb +37 -0
  62. data/test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb +36 -0
  63. data/test/unit/juicer/dependency_resolver/javascript_dependency_resolver_test.rb +50 -0
  64. data/test/unit/juicer/ext/string_test.rb +59 -0
  65. data/test/unit/juicer/ext/symbol_test.rb +27 -0
  66. data/test/unit/juicer/image_embed_test.rb +271 -0
  67. data/test/unit/juicer/install/installer_base_test.rb +214 -0
  68. data/test/unit/juicer/install/jslint_installer_test.rb +54 -0
  69. data/test/unit/juicer/install/rhino_installer_test.rb +57 -0
  70. data/test/unit/juicer/install/yui_compressor_test.rb +56 -0
  71. data/test/unit/juicer/jslint_test.rb +60 -0
  72. data/test/unit/juicer/merger/base_test.rb +122 -0
  73. data/test/unit/juicer/merger/javascript_merger_test.rb +74 -0
  74. data/test/unit/juicer/merger/stylesheet_merger_test.rb +180 -0
  75. data/test/unit/juicer/minifyer/closure_compressor_test.rb +107 -0
  76. data/test/unit/juicer/minifyer/yui_compressor_test.rb +116 -0
  77. data/test/unit/juicer_test.rb +1 -0
  78. metadata +278 -0
Binary file
File without changes
@@ -0,0 +1,425 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html>
3
+ <head>
4
+ <title>YUI Library :: Downloads</title>
5
+ <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://feeds.feedburner.com/YuiDownloads">
6
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
7
+ <meta http-equiv="X-XRDS-Location" content="http://yuilibrary.com/xrds.xml">
8
+ <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
9
+ <link rel="icon" href="/favicon.ico" type="image/x-icon">
10
+ <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.0/build/reset-fonts-grids/reset-fonts-grids.css">
11
+ <link rel="stylesheet" type="text/css" href="/assets/skin/yuilib-11.30.2009.css">
12
+ <script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.0r4/build/yuiloader-dom-event/yuiloader-dom-event.js&3.0.0/build/yui/yui-min.js&3.0.0/build/loader/loader-min.js&3.0.0/build/oop/oop-min.js&3.0.0/build/dom/dom-min.js&3.0.0/build/event-custom/event-custom-base-min.js&3.0.0/build/event/event-base-min.js&3.0.0/build/pluginhost/pluginhost-min.js&3.0.0/build/node/node-min.js&3.0.0/build/event/event-delegate-min.js"></script>
13
+ <script>
14
+ var YUIConfig = {
15
+ baseyui2: 'http://yui.yahooapis.com/2.8.0r4/build/',
16
+ base: 'http://yui.yahooapis.com/3.0.0/build/',
17
+ debug: false,
18
+ //filter: 'DEBUG',
19
+ combine: true
20
+ };
21
+ </script>
22
+ <style>
23
+ #downloads tr.hide {
24
+ display: none;
25
+ }
26
+ </style>
27
+ </head>
28
+ <body>
29
+ <div id="wrap">
30
+ <div id="doc3" class="yui-t5 home static">
31
+ <a name="top"></a>
32
+
33
+ <div id="hd">
34
+ <a href="/"><img src="/assets/skin/assets/yuilibrary-masthead-new.png" alt="YUILibrary - Open source JavaScript and CSS for building richly interactive software." /></a>
35
+ <form id="sitesearch" class="clearfix" action="http://search.yahoo.com/search" method="get">
36
+ <input name="vs" type="hidden" value="developer.yahoo.com">
37
+ <input name="vs" type="hidden" value="yuiblog.com">
38
+ <input name="vs" type="hidden" value="yuilibrary.com">
39
+ <input type="text" id="sitesearchbox" name="p">
40
+ <input type="submit" name="some_name" value="Search" id="sitesearchbutton">
41
+ </form>
42
+ <a id="gitribbon" href="http://github.com/yui" title="Fork YUI on GitHub"><img src="/assets/skin/assets/github-ribbon-yui-purple-right-png8.png" alt="Fork YUI on GitHub" /></a>
43
+
44
+ </div>
45
+
46
+ <div id="navbar">
47
+ <ul id="projects" class="clearfix">
48
+ <li><a href="/" title="Home">Home</a></li>
49
+ <li><a href="/gallery" title="Gallery">Gallery</a></li>
50
+ <li><a href="/forum" title="Forums">Forums</a></li>
51
+ <li><a href="/projects/yui2/wiki">YUI 2.x</a></li>
52
+ <li><a href="/projects/yui3/wiki">YUI 3.x</a></li>
53
+ <li><a href="/projects/yuicompressor/wiki">YUICompressor</a></li>
54
+ <li><a href="/projects/yuidoc/wiki">YUIDoc</a></li>
55
+ <li><a href="/projects" class="more">More</a></li>
56
+ </ul>
57
+
58
+ <div id="sections" class="clearfix">
59
+ <ul class="clearfix">
60
+
61
+ <!-- <div id="subnav" class="navtabs clearfix">
62
+ <ul> -->
63
+ <li><a href="/forum/ucp.php?mode=register">Register</a></li>
64
+ <li><a href="/forum/ucp.php?mode=login&redirect=/downloads/">Login</a></li>
65
+ <!-- </ul>
66
+ </div> -->
67
+ </ul>
68
+ </div>
69
+ </div>
70
+ <div id="bd">
71
+ <div id="yui-main">
72
+ <div class="yui-b main">
73
+
74
+
75
+
76
+
77
+
78
+ <h1><a href="http://feeds.feedburner.com/YuiDownloads"><img src="/assets/rss.png"></a> YUI Downloads</h1>
79
+
80
+ <div id="downloads">
81
+ <table id="yui2_downloads">
82
+ <thead>
83
+ <tr class="odd">
84
+ <th class="release"><h2 id="yui2">YUI 2.x</h2></th>
85
+ <th class="date">Date</th>
86
+ <th class="md5">MD5</th>
87
+ </tr>
88
+ </thead>
89
+ <tbody>
90
+ <tr class="even">
91
+ <td><a href="yui2/yui_2.8.0r4.zip" title="Version 2.8.0r4">Version 2.8.0r4</a></td>
92
+ <td>09/14/2009</td>
93
+ <td><em class="md5">9528eeab1bc4291eea329bccc9caa5de</em></td>
94
+ </tr>
95
+ <tr class="odd">
96
+ <td><a href="yui2/yui_2.7.0b.zip" title="Version 2.7.0b">Version 2.7.0b</a></td>
97
+ <td>02/19/2009</td>
98
+ <td><em class="md5">90778a161ce9108a23a590e5198b8116</em></td>
99
+ </tr>
100
+ <tr class="even">
101
+ <td><a href="yui2/yui_2.6.0.zip" title="Version 2.6.0">Version 2.6.0</a></td>
102
+ <td>10/01/2008</td>
103
+ <td><em class="md5">41bed4b882c9148cebff5dd1a0dd8727</em></td>
104
+ </tr>
105
+ <tr class="odd hide">
106
+ <td><a href="yui2/yui_2.5.2.zip" title="Version 2.5.2">Version 2.5.2</a></td>
107
+ <td>05/28/2008</td>
108
+ <td><em class="md5">eaadfcbcb651c50092bb679266aa3c20</em></td>
109
+ </tr>
110
+ <tr class="even hide">
111
+ <td><a href="yui2/yui_2.5.1.zip" title="Version 2.5.1">Version 2.5.1</a></td>
112
+ <td>03/19/2008</td>
113
+ <td><em class="md5">7416914904daa7d953583483db67609c</em></td>
114
+ </tr>
115
+ <tr class="odd hide">
116
+ <td><a href="yui2/yui_2.5.0.zip" title="Version 2.5.0">Version 2.5.0</a></td>
117
+ <td>02/20/2008</td>
118
+ <td><em class="md5">85d26357f8413de437318a9e2333dfce</em></td>
119
+ </tr>
120
+ <tr class="even hide">
121
+ <td><a href="yui2/yui_2.4.1.zip" title="Version 2.4.1">Version 2.4.1</a></td>
122
+ <td>12/19/2007</td>
123
+ <td><em class="md5">2a4b302cd94a6612b2799717eecdbfdb</em></td>
124
+ </tr>
125
+ <tr class="odd hide">
126
+ <td><a href="yui2/yui_2.4.0.zip" title="Version 2.4.0">Version 2.4.0</a></td>
127
+ <td>12/04/2007</td>
128
+ <td><em class="md5">749ff89f77b4cf9e5ec330e60b507776</em></td>
129
+ </tr>
130
+ <tr class="even hide">
131
+ <td><a href="yui2/yui_2.3.1.zip" title="Version 2.3.1">Version 2.3.1</a></td>
132
+ <td>09/19/2007</td>
133
+ <td><em class="md5">172ad5e3fa4c3e9424b29fb2fd854fb6</em></td>
134
+ </tr>
135
+ <tr class="odd hide">
136
+ <td><a href="yui2/yui_2.3.0.zip" title="Version 2.3.0">Version 2.3.0</a></td>
137
+ <td>07/30/2007</td>
138
+ <td><em class="md5">d085f77a00c4b4e30c0c748dd4680f60</em></td>
139
+ </tr>
140
+ <tr class="even hide">
141
+ <td><a href="yui2/yui_2.2.2.zip" title="Version 2.2.2">Version 2.2.2</a></td>
142
+ <td>04/18/2007</td>
143
+ <td><em class="md5">79483d2f16f597d46f92257744b46406</em></td>
144
+ </tr>
145
+ <tr class="odd hide">
146
+ <td><a href="yui2/yui_2.2.0a.zip" title="Version 2.2.0a">Version 2.2.0a</a></td>
147
+ <td>02/22/2007</td>
148
+ <td><em class="md5">a4ebf4e3c8413079edd0abaca99d8cb3</em></td>
149
+ </tr>
150
+ <tr class="even hide">
151
+ <td><a href="yui2/yui_0.12.2.zip" title="Version 0.12.2">Version 0.12.2</a></td>
152
+ <td>01/08/2007</td>
153
+ <td><em class="md5">312c580eb5368b5cae11cba6c1d325bb</em></td>
154
+ </tr>
155
+ <tr class="odd hide">
156
+ <td><a href="yui2/yui_0.11.4.zip" title="Version 0.11.4">Version 0.11.4</a></td>
157
+ <td>09/26/2006</td>
158
+ <td><em class="md5">8c8e7a3d9c770b82d57546d5fb60ef34</em></td>
159
+ </tr>
160
+ <tr class="even hide">
161
+ <td><a href="yui2/yui_0.10.0.zip" title="Version 0.10.0">Version 0.10.0</a></td>
162
+ <td>06/27/2006</td>
163
+ <td><em class="md5">4a631c55506e0814b174af3e81f8c94b</em></td>
164
+ </tr>
165
+ <tr class="show_more_yui2"><td colspan="3"><a href="?show=yui2" class="show_hidden" id="yui2_show_hidden">[Show older files]</a></td></tr> </tbody>
166
+ </table>
167
+ <table>
168
+ <thead>
169
+ <tr class="odd">
170
+ <th class="release"><h2 id="yui3">YUI 3.x</h2></th>
171
+ <th class="date">Date</th>
172
+ <th class="md5">MD5</th>
173
+ </tr>
174
+ </thead>
175
+ <tbody>
176
+ <tr class="even">
177
+ <td><a href="yui3/yui_3.0.0.zip">3.0.0</a></td><td>09/29/2009</td><td><em class="md5">da4b9cd0e92204a2b7c27a3a3686cec5</em></td>
178
+ </tr>
179
+ <tr class="odd">
180
+ <td><a href="yui3/yui_3.0.0b1.zip">3.0.0 Beta 1</a></td><td>06/24/2009</td><td><em class="md5">36921bfc07adce63dd3c9cb62dceb4fd</em></td>
181
+ </tr>
182
+ <tr class="even">
183
+ <td><a href="yui3/yui_3.0.0pr2.zip">Preview Release 2</a></td><td>12/09/2008</td><td><em class="md5">9e5d0fe289454ca11586d904142530d1</em></td>
184
+ </tr>
185
+ <tr class="odd">
186
+ <td><a href="yui3/yui_3.0.0pr1.zip">Preview Release 1</a></td><td>08/13/2008</td><td><em class="md5">a7f6c1237d89ca7d85afaf0978e55bfb</em></td>
187
+ </tr>
188
+ </tbody>
189
+ </table>
190
+ <table>
191
+ <thead>
192
+ <tr class="odd">
193
+ <th class="release"><h2 id="yuidoc">YUI Doc</h2></th>
194
+ <th class="date">Date</th>
195
+ <th class="md5">MD5</th>
196
+ </tr>
197
+ </thead>
198
+ <tbody>
199
+ <tr class="even">
200
+ <td><a href="yuidoc/yuidoc_1.0.0b1.zip">1.0.0b1</a></td><td>12/08/2008</td><td><em class="md5">cd5545d2dec8f7afe3d18e793538162c</em></td>
201
+ </tr>
202
+ </tbody>
203
+ </table>
204
+ <table>
205
+ <thead>
206
+ <tr class="odd">
207
+ <th class="release"><h2 id="builder">YUI Builder</h2></th>
208
+ <th class="date">Date</th>
209
+ <th class="md5">MD5</th>
210
+ </tr>
211
+ </thead>
212
+ <tbody>
213
+ <tr class="even">
214
+ <td><a href="builder/builder_1.0.0b1.zip">1.0.0b1</a></td><td>03/10/2009</td><td><em class="md5">aa21f55cffd83ea2f02f2c0fb87265ae</em></td>
215
+ </tr>
216
+ </tbody>
217
+ </table>
218
+ <table>
219
+ <thead>
220
+ <tr class="odd">
221
+ <th class="release"><h2 id="yuicompressor">YUI Compressor</h2></th>
222
+ <th class="date">Date</th>
223
+ <th class="md5">MD5</th>
224
+ </tr>
225
+ </thead>
226
+ <tbody>
227
+ <tr class="even">
228
+ <td><a href="yuicompressor/yuicompressor-2.4.2.zip">2.4.2</a></td><td>06/10/2009</td><td><em class="md5">2a526a9aedfe2affceed1e1c3f9c0579</em></td>
229
+ </tr>
230
+ </tbody>
231
+ </table>
232
+ <table>
233
+ <thead>
234
+ <tr class="odd">
235
+ <th class="release"><h2 id="phploader">YUI PHP Loader</h2></th>
236
+ <th class="date">Date</th>
237
+ <th class="md5">MD5</th>
238
+ </tr>
239
+ </thead>
240
+ <tbody>
241
+ <tr class="even">
242
+ <td><a href="phploader/yuiphploader-1.0.0b2.zip">1.0.0b2</a></td><td>12/02/2009</td><td><em class="md5">963292134958e2a60aa5473cb148db3b</em></td>
243
+ </tr>
244
+ <tr class="odd">
245
+ <td><a href="phploader/yuiphploader-1.0.0b1.zip">1.0.0b1</a></td><td>09/09/2009</td><td><em class="md5">f141af403d076abaf98be362658a61e1</em></td>
246
+ </tr>
247
+ </tbody>
248
+ </table>
249
+ </div>
250
+
251
+ </div>
252
+ </div>
253
+ <div class="yui-b secondary sidebar">
254
+ <div class="mod">
255
+ <div class="hd"><h4><a href="/forum/recent.php">Recent Forums Posts</a></h4></div>
256
+ <div class="bd">
257
+ <ul>
258
+ <li>
259
+ <h5><a href="/forum/viewtopic.php?p=8069#p8069">Tooltips on Hover over TabView Tabs</a></h5>
260
+ <cite class="author">Craig Cassata</cite> <cite class="date">Jan 20th</cite>
261
+ </li>
262
+ <li>
263
+ <h5><a href="/forum/viewtopic.php?p=8068#p8068">TreeView - configure setDynamicLoad()</a></h5>
264
+ <cite class="author">koalabruder</cite> <cite class="date">Jan 20th</cite>
265
+ </li>
266
+ <li>
267
+ <h5><a href="/forum/viewtopic.php?p=8067#p8067">Re: Prevent onclick from inside mousedown event?</a></h5>
268
+ <cite class="author">Adam Moore</cite> <cite class="date">Jan 20th</cite>
269
+ </li>
270
+ <li>
271
+ <h5><a href="/forum/viewtopic.php?p=8066#p8066">Re: Datatable &quot;grays out&quot; after updating a column's data.</a></h5>
272
+ <cite class="author">Satyam</cite> <cite class="date">Jan 20th</cite>
273
+ </li>
274
+ <li>
275
+ <h5><a href="/forum/viewtopic.php?p=8065#p8065">Re: Datatable &quot;grays out&quot; after updating a column's data.</a></h5>
276
+ <cite class="author">Lonnie Broadnax</cite> <cite class="date">Jan 20th</cite>
277
+ </li>
278
+ <li>
279
+ <h5><a href="/forum/viewtopic.php?p=8064#p8064">Re: Datatable &quot;grays out&quot; after updating a column's data.</a></h5>
280
+ <cite class="author">Lonnie Broadnax</cite> <cite class="date">Jan 20th</cite>
281
+ </li>
282
+ <li>
283
+ <h5><a href="/forum/viewtopic.php?p=8063#p8063">Re: AutoComplete doesn't ignore keydown events for shift keys</a></h5>
284
+ <cite class="author">Luke Smith</cite> <cite class="date">Jan 20th</cite>
285
+ </li>
286
+ <li>
287
+ <h5><a href="/forum/viewtopic.php?p=8062#p8062">Re: Cross domain file upload issue</a></h5>
288
+ <cite class="author">Alex Led</cite> <cite class="date">Jan 20th</cite>
289
+ </li>
290
+ </ul>
291
+
292
+ </div>
293
+ </div>
294
+ <div class="mod">
295
+ <div class="hd"><h4>Recent <a href="http://yuiblog.com">YUI Blog</a> Posts</h4></div>
296
+ <div class="bd">
297
+
298
+ <!-- Auto-generated Sidebar (Wed, 20 Jan 2010 23:03:01 +0000) -->
299
+ <ul>
300
+ <li>
301
+ <h5><a href="http://www.yuiblog.com/blog/2010/01/19/in-the-wild-for-january-19-2010/">In the Wild for January 19, 2010</a></h5>
302
+ <cite class="author">Eric Miraglia</cite> <cite class="date">Jan 19th</cite>
303
+ </li>
304
+ <li>
305
+ <h5><a href="http://www.yuiblog.com/blog/2010/01/08/in-the-wild-for-january-10-2010/">In the Wild for January 10, 2010</a></h5>
306
+ <cite class="author">Eric Miraglia</cite> <cite class="date">Jan 8th</cite>
307
+ </li>
308
+ <li>
309
+ <h5><a href="http://www.yuiblog.com/blog/2010/01/07/more-code-reuse-patterns-in-yui3/">More code reuse patterns in YUI3</a></h5>
310
+ <cite class="author">Stoyan Stefanov</cite> <cite class="date">Jan 7th</cite>
311
+ </li>
312
+ <li>
313
+ <h5><a href="http://www.yuiblog.com/blog/2010/01/06/inheritance-patterns-in-yui-3/">Inheritance Patterns in YUI 3</a></h5>
314
+ <cite class="author">Stoyan Stefanov</cite> <cite class="date">Jan 6th</cite>
315
+ </li>
316
+ <li>
317
+ <h5><a href="http://www.yuiblog.com/blog/2010/01/05/crockford-at-accu/">Crockford delivering “State and Future of JavaScript” talk at ACCU in Mountain View on January 13</a></h5>
318
+ <cite class="author">Eric Miraglia</cite> <cite class="date">Jan 5th</cite>
319
+ </li>
320
+ <li>
321
+ <h5><a href="http://www.yuiblog.com/blog/2010/01/05/enterprise-web-developer/">Implementation Focus: Enterprise Web Developer, a Python/YUI Framework</a></h5>
322
+ <cite class="author">Rob Tweed</cite> <cite class="date">Jan 5th</cite>
323
+ </li>
324
+ </ul>
325
+
326
+ <!-- End Auto-generated Sidebar -->
327
+
328
+ </div>
329
+ </div>
330
+ <div class="mod">
331
+ <div class="hd"><h4>Online Users</h4></div>
332
+ <div class="bd">
333
+ <ul>
334
+ <li>
335
+ <h5><a href="/forum/memberlist.php?mode=viewprofile&amp;u=906">paolo nesti poggi</a></h5>
336
+ </li>
337
+ <li>
338
+ <h5><a href="/forum/memberlist.php?mode=viewprofile&amp;u=5327">FiZ</a></h5>
339
+ </li>
340
+ <li>
341
+ <h5><a href="/forum/memberlist.php?mode=viewprofile&amp;u=54">Dav Glass</a></h5>
342
+ </li>
343
+ <li>
344
+ <h5><a href="/forum/memberlist.php?mode=viewprofile&amp;u=58">Adam Moore</a></h5>
345
+ </li>
346
+ </ul>
347
+
348
+ </div>
349
+ </div>
350
+ </div>
351
+ </div>
352
+ <div id="ft">
353
+
354
+ <div id="trough">
355
+ <div class="yui-g">
356
+ <div class="yui-g first">
357
+ <div class="yui-u first">
358
+ <h5>YUI Projects</h5>
359
+ <ul>
360
+ <li><a href="/downloads">All YUI Downloads</a></li>
361
+ <li><a href="/projects/yui2">YUI 2.x</a></li>
362
+ <li><a href="/projects/yui3">YUI 3.x</a></li>
363
+ <li><a href="/projects/yuidoc">YUIDoc</a></li>
364
+ <li><a href="/projects/yuicompressor">YUICompressor</a></li>
365
+ <li class="more"><a href="/projects/yuilibrary">YUILibrary.com</a></li>
366
+ <li class="more"><a href="/projects/builder">YUI Build Tool</a></li>
367
+ <li class="more"><a href="/projects/phploader">YUI PHP Loader</a></li>
368
+ </ul>
369
+ </div>
370
+ <div class="yui-u">
371
+ <h5>Pages &amp; Links</h5>
372
+ <ul>
373
+ <li><a href="/downloads">All YUI Downloads</a></li>
374
+ <li><a href="/gitfaq">Git FAQ</a></li>
375
+ <li><a href="http://developer.yahoo.com/yui/articles/gbs" class="ext-link" title="Graded Browser Support"><span class="icon">Graded Browser Support</span></a></li>
376
+ <li><a href="/contrib">Contribute to YUI</a></li>
377
+ <li><a href="/forum/stats">Forum Stats</a></li>
378
+ <li><a href="/gallery/stats">Gallery Stats</a></li>
379
+ </ul>
380
+ </div>
381
+ </div>
382
+ <div class="yui-g">
383
+ <div class="yui-u first">
384
+ <h5>Contribute</h5>
385
+ <ul>
386
+ <li><a href="http://developer.yahoo.com/yui/articles/reportingbugs/" class="ext-link" title="Submit a Bug"><span class="icon">Submit a Bug</span></a></li>
387
+ <li><a href="http://developer.yahoo.com/yui/articles/reportingbugs/" class="ext-link" title="Request a Feature"><span class="icon">Request a Feature</span></a></li>
388
+ <li><a href="http://developer.yahoo.com/yui/community/contribute.html" class="ext-link" title="Write Code"><span class="icon">Write Code</span></a></li>
389
+ <li><a href="/team">Meet the Team</a></li>
390
+ </ul>
391
+ </div>
392
+ <div class="yui-u">
393
+ <h5>Follow YUI</h5>
394
+ <ul>
395
+ <li><a href="http://github.com/yui/" class="ext-link" title="on GitHub"><span class="icon">on GitHub</span></a></li>
396
+ <li><a href="http://twitter.com/yuilibrary" class="ext-link" title="on Twitter"><span class="icon">on Twitter</span></a></li>
397
+ <li><a href="http://friendfeed.com/yuilibrary?subscribe=1" class="ext-link" title="on FriendFeed"><span class="icon">on FriendFeed</span></a></li>
398
+ <li><a href="http://www.facebook.com/pages/Yahoo-User-Interface-Library-YUI/15384729838" class="ext-link" title="on Facebook"><span class="icon">on Facebook</span></a></li>
399
+ <li><a href="/irc">on IRC</a></li>
400
+ <li><a href="http://yuiblog.com" class="ext-link" title="YUI Blog"><span class="icon">YUI Blog</span></a></li>
401
+ <li><a href="http://developer.yahoo.com/yui/theater" class="ext-link" title="YUI Theater"><span class="icon">YUI Theater</span></a></li>
402
+ <li><a href="/forum">YUI Forums</a></li>
403
+ </ul>
404
+ </div>
405
+ </div>
406
+ </div>
407
+ </div>
408
+
409
+ <p>&copy; 2010 YUI Library - <a href="/projects/yuilibrary/wiki/Credits">Site Credits</a></p>
410
+
411
+ </div>
412
+ </div>
413
+ <script type="text/javascript" src="http://track2.mybloglog.com/js/jsserv.php?mblID=2008112513433661"></script>
414
+ <script type="text/javascript" src="/assets/more-09.17.2009.js"></script>
415
+ <script>
416
+ YUI(YUIConfig).use('node', function(Y) {
417
+ Y.on('click', function(e) {
418
+ e.halt();
419
+ Y.all('#yui2_downloads tr').removeClass('hide');
420
+ e.target.get('parentNode.parentNode').setStyle('display', 'none');
421
+ }, '#yui2_show_hidden');
422
+ });
423
+ </script>
424
+ </body>
425
+ </html>
@@ -0,0 +1,175 @@
1
+ require 'fileutils'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+ require 'mocha'
5
+ require 'open-uri'
6
+ require 'juicer'
7
+
8
+ begin
9
+ require 'turn'
10
+ rescue LoadError => err
11
+ puts "Protip: Install turn gem for better test reports. #{err.message}"
12
+ end
13
+
14
+ if RUBY_VERSION < "1.9"
15
+ require 'redgreen' if ENV['TM_DIRECTORY'].nil?
16
+ end
17
+
18
+ $data_dir = File.join(File.expand_path(File.dirname(__FILE__)), "data")
19
+ Juicer.send(:remove_const, :LOGGER)
20
+ Juicer::LOGGER = Logger.new(StringIO.new)
21
+
22
+ # Prefixes paths with the data dir
23
+ def path(path)
24
+ File.join($data_dir, path)
25
+ end
26
+
27
+ # Allow for testing of private methods inside a block:
28
+ #
29
+ # MyClass.publicize_methods do
30
+ # assert MyClass.some_private_method
31
+ # end
32
+ class Class
33
+ def publicize_methods
34
+ saved_private_instance_methods = self.private_instance_methods
35
+ self.class_eval { public(*saved_private_instance_methods) }
36
+ yield
37
+ self.class_eval { private(*saved_private_instance_methods) }
38
+ end
39
+ end
40
+
41
+ #
42
+ # Intercept calls to open, and return local files
43
+ #
44
+ module Kernel
45
+ private
46
+ alias juicer_original_open open # :nodoc:
47
+
48
+ def open(name, *rest, &block)
49
+ if name =~ /http.+yuicompressor-(\d\.\d\.\d)\.zip$/
50
+ name = File.join($data_dir, "..", "bin", "yuicompressor-#{$1}.zip")
51
+ elsif name =~ /http:\/\/yuilibrary\.com\/download/
52
+ name = File.join($data_dir, "../fixtures/yui-download.html")
53
+ elsif name =~ /http.+yuicompressor/
54
+ name = File.join($data_dir, "..", "bin", "yuicompressor")
55
+ elsif name =~ /http.+jslint/
56
+ name = File.join($data_dir, "..", "bin", "jslint.js")
57
+ elsif name =~ /ftp.+rhino(.+)\.zip/
58
+ name = File.join($data_dir, "..", "bin", "rhino#{$1}.zip")
59
+ end
60
+
61
+ juicer_original_open(File.expand_path(name), *rest, &block)
62
+ end
63
+
64
+ module_function :open
65
+ end
66
+
67
+ module Juicer
68
+ module Test
69
+
70
+ # Alot of Juicer functionality are filesystem operations. This class sets up files
71
+ # to work on
72
+ class FileSetup
73
+ attr_reader :file_count
74
+
75
+ def initialize(dir = $data_dir)
76
+ @dir = dir
77
+ @file_count = 0
78
+ end
79
+
80
+ # Recursively deletes the data directory
81
+ def delete
82
+ res = FileUtils.rm_rf(@dir) if File.exist?(@dir)
83
+ end
84
+
85
+ # Set up files for unit tests
86
+ def create(force = false)
87
+ return if File.exist?(@dir) && !force
88
+
89
+ delete if File.exist?(@dir)
90
+ mkdir @dir
91
+ mkfile(@dir, 'a.css', "@import 'b.css';\n\n/* Dette er a.css */")
92
+ mkfile(@dir, 'a.js', "/**\n * @depend b.js\n */\n\n/* Dette er a.js */")
93
+ mkfile(@dir, 'b.css', "/* Dette er b.css */")
94
+ mkfile(@dir, 'b.js', "/**\n * @depends a.js\n */\n\n/* Dette er b.css */")
95
+ mkfile(@dir, 'a1.css', "@import\t'b1.css';\n@import 'c1.css';\nbody {\n width: 800px;\n}\n")
96
+ mkfile(@dir, 'b1.css', "@import url('d1.css');\n\nhtml {\n background: red;\n}\n")
97
+ mkfile(@dir, 'c1.css', "h1 {\n font-size: 12px;\n}\n")
98
+ mkfile(@dir, 'd1.css', "h2 {\n font-size: 10px;\n}\n")
99
+ mkfile(@dir, 'ok.js', "function hey() {\n return \"Hey\";\n}\n")
100
+ mkfile(@dir, 'not-ok.js', "var a = 34\nb = 78;\n")
101
+
102
+ images = mkdir File.join(@dir, "images")
103
+ mkfile(images, '1.png', "")
104
+
105
+ css_dir = mkdir File.join(@dir, "css")
106
+ mkfile(css_dir, '2.gif', "")
107
+
108
+ css = <<-CSS
109
+ body {
110
+ background: url(../images/1.png);
111
+ }
112
+
113
+ h1 {
114
+ background: url(../a1.css) 0 0 no-repeat;
115
+ }
116
+
117
+ h2 {
118
+ background: url(2.gif) no-repeat;
119
+ }
120
+ CSS
121
+
122
+ mkfile(css_dir, 'test.css', css)
123
+ mkfile(css_dir, 'test2.css', "body { background: url(/images/1.png); }")
124
+ mkfile(@dir, 'path_test.css', "@import 'css/test.css';\n\nbody {\n background: url(css/2.gif) no-repeat;\n}\n")
125
+
126
+ css = <<-CSS
127
+ body {
128
+ background: url(/images/1.png);
129
+ }
130
+
131
+ h1 {
132
+ background: url(/css/2.gif);
133
+ background: url(/a1.css) 0 0 no-repeat;
134
+ }
135
+
136
+ h2 {
137
+ background: url(/css/2.gif) no-repeat;
138
+ }
139
+
140
+ p { background: url(/a2.css); }
141
+ CSS
142
+
143
+ mkfile(@dir, 'path_test2.css', css)
144
+
145
+ mkfile(@dir, 'Changelog.txt', "2008.02.09 | stb-base 1.29\n\nFEATURE: Core | Bla bla bla bla bla\nFEATURE: UI: | Bla bla bla bla bla\n\n\n2008.02.09 | stb-base 1.29\n\nFEATURE: Core | Bla bla bla bla bla\nFEATURE: UI: | Bla bla bla bla bla\n")
146
+
147
+ # my_app.js depends on the pkg directory
148
+ mkfile(@dir, "my_app.js", "// @depend pkg\n var myApp = pkg.a;")
149
+
150
+ # package directory contains pkg.js, module/moda.js, and module/modb.js
151
+ # moda.js depends on ../pkg.js
152
+ # modb.js depends on moda.js and ../pkg.js
153
+ pkg_dir = mkdir File.join(@dir, "pkg")
154
+ module_dir = mkdir File.join(pkg_dir, "module")
155
+ mkfile(pkg_dir, "pkg.js", "var pkg = {};")
156
+ mkfile(module_dir, "moda.js", "// @depend ../pkg.js\npkg.a = '';")
157
+ mkfile(module_dir, "modb.js", "// @depend ../pkg.js\n// @depend moda.js\npkg.b = '';")
158
+
159
+ end
160
+
161
+ private
162
+ # Create a file
163
+ def mkfile(parent, name, content)
164
+ file = File.open(File.join(parent, name), 'w+') { |f| f.puts content }
165
+ @file_count += 1
166
+ end
167
+
168
+ def mkdir(dir)
169
+ FileUtils.mkdir(dir)
170
+ @file_count += 1
171
+ dir
172
+ end
173
+ end
174
+ end
175
+ end