juicer 1.0.9 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ == 1.0.10 / 2011-05-11
2
+ * Fix downloading of Rhino jar. Add mechanism for scraping out the
3
+ latest version.
4
+
1
5
  == 1.0.9 / 2010-12-07
2
6
  * Emergency fix: Crockford took down the Rhino version of JsLint,
3
7
  bundle it for now.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.9
1
+ 1.0.10
@@ -3,7 +3,7 @@ require "logger"
3
3
  module Juicer
4
4
 
5
5
  # :stopdoc:
6
- VERSION = '1.0.9'
6
+ VERSION = '1.0.10'
7
7
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
8
8
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
9
9
  LOGGER = Logger.new(STDOUT)
@@ -8,11 +8,9 @@ module Juicer
8
8
  # Install and uninstall routines for the Mozilla Rhino jar.
9
9
  #
10
10
  class RhinoInstaller < Base
11
- attr_reader :latest
12
-
13
11
  def initialize(install_dir = Juicer.home)
14
12
  super(install_dir)
15
- @latest = "1_7R2-RC1"
13
+ @latest = nil
16
14
  @website = "http://ftp.mozilla.org/pub/mozilla.org/js/"
17
15
  end
18
16
 
@@ -48,6 +46,13 @@ module Juicer
48
46
  File.delete(File.join(dir, "bin/", "#{base}.jar"))
49
47
  end
50
48
  end
49
+
50
+ def latest
51
+ return @latest if @latest
52
+ webpage = Nokogiri::HTML(open(@website))
53
+ versions = (webpage / "td a").to_a.find_all { |a| a.attr("href") =~ /rhino\d_/ }
54
+ @latest = versions.collect { |n| n.attr("href") }.sort.last.match(/rhino(\d_.*)\.zip/)[1]
55
+ end
51
56
  end
52
57
  end
53
58
  end
@@ -62,7 +62,6 @@ module Juicer
62
62
  webpage = Nokogiri::HTML(open(@website))
63
63
  @latest = (webpage / "h3#yuicompressor + ul li a:last").text.match(/(\d\.\d\.\d)/)[1]
64
64
  end
65
-
66
65
  end
67
66
  end
68
67
  end
Binary file
Binary file
@@ -0,0 +1,42 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2
+ <html>
3
+ <head>
4
+ <title>Index of /pub/mozilla.org/js</title>
5
+ </head>
6
+ <body>
7
+ <h1>Index of /pub/mozilla.org/js</h1>
8
+ <table><tr><th><img src="/icons/blank.gif" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">Description</a></th></tr><tr><th colspan="5"><hr></th></tr>
9
+
10
+ <tr><td valign="top"><img src="/icons/back.gif" alt="[DIR]"></td><td><a href="/pub/mozilla.org/">Parent Directory</a></td><td>&nbsp;</td><td align="right"> - </td></tr>
11
+ <tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="eclipse/">eclipse/</a></td><td align="right">23-Feb-2006 08:54 </td><td align="right"> - </td></tr>
12
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="js-1.7.0.tar.gz">js-1.7.0.tar.gz</a></td><td align="right">19-Oct-2007 12:15 </td><td align="right">1.1M</td></tr>
13
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="js-1.8.0-rc1.tar.gz">js-1.8.0-rc1.tar.gz</a></td><td align="right">09-Mar-2009 12:35 </td><td align="right">1.2M</td></tr>
14
+
15
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="js-1.60.tar.gz">js-1.60.tar.gz</a></td><td align="right">22-Dec-2006 07:57 </td><td align="right">1.0M</td></tr>
16
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="js185-1.0.0.tar.gz">js185-1.0.0.tar.gz</a></td><td align="right">31-Mar-2011 13:03 </td><td align="right">5.9M</td></tr>
17
+ <tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="older-packages/">older-packages/</a></td><td align="right">08-Jan-2007 06:54 </td><td align="right"> - </td></tr>
18
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="rhino1_5R5.zip">rhino1_5R5.zip</a></td><td align="right">25-Mar-2004 12:57 </td><td align="right">1.5M</td></tr>
19
+
20
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="rhino1_6R1.zip">rhino1_6R1.zip</a></td><td align="right">30-Nov-2004 19:13 </td><td align="right">1.7M</td></tr>
21
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="rhino1_6R2.zip">rhino1_6R2.zip</a></td><td align="right">19-Sep-2005 04:26 </td><td align="right">1.7M</td></tr>
22
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="rhino1_6R3.zip">rhino1_6R3.zip</a></td><td align="right">24-Jul-2006 05:37 </td><td align="right">1.7M</td></tr>
23
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="rhino1_6R4.zip">rhino1_6R4.zip</a></td><td align="right">09-Sep-2006 10:15 </td><td align="right">1.7M</td></tr>
24
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="rhino1_6R5.zip">rhino1_6R5.zip</a></td><td align="right">18-Nov-2006 13:24 </td><td align="right">1.7M</td></tr>
25
+
26
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="rhino1_6R6.zip">rhino1_6R6.zip</a></td><td align="right">26-Jul-2007 10:27 </td><td align="right">1.7M</td></tr>
27
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="rhino1_6R7.zip">rhino1_6R7.zip</a></td><td align="right">19-Aug-2007 19:26 </td><td align="right">1.7M</td></tr>
28
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="rhino1_7R1.zip">rhino1_7R1.zip</a></td><td align="right">06-Mar-2008 17:44 </td><td align="right">2.5M</td></tr>
29
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="rhino1_7R2.zip">rhino1_7R2.zip</a></td><td align="right">22-Mar-2009 11:49 </td><td align="right">2.9M</td></tr>
30
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="rhino1_7R3.zip">rhino1_7R3.zip</a></td><td align="right">09-May-2011 18:26 </td><td align="right">4.4M</td></tr>
31
+
32
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="rhino15R3.zip">rhino15R3.zip</a></td><td align="right">27-Jan-2002 16:59 </td><td align="right">1.2M</td></tr>
33
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="rhino15R4.zip">rhino15R4.zip</a></td><td align="right">11-Feb-2003 07:15 </td><td align="right">1.4M</td></tr>
34
+ <tr><td valign="top"><img src="/icons/compressed.gif" alt="[ ]"></td><td><a href="rhino15R41.zip">rhino15R41.zip</a></td><td align="right">21-Apr-2003 10:27 </td><td align="right">1.4M</td></tr>
35
+ <tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="tamarin/">tamarin/</a></td><td align="right">06-Apr-2009 13:32 </td><td align="right"> - </td></tr>
36
+
37
+ <tr><th colspan="5"><hr></th></tr>
38
+ </table>
39
+ <pre>
40
+ dm-ftp01.mozilla.org in the Pacific Time Zone (PST/PDT)
41
+ </pre>
42
+ </body></html>
@@ -1,3 +1,5 @@
1
+
2
+ require "rubygems"
1
3
  require 'fileutils'
2
4
  require 'test/unit'
3
5
  require 'shoulda'
@@ -56,6 +58,8 @@ module Kernel
56
58
  name = File.join($data_dir, "..", "bin", "jslint.js")
57
59
  elsif name =~ /ftp.+rhino(.+)\.zip/
58
60
  name = File.join($data_dir, "..", "bin", "rhino#{$1}.zip")
61
+ elsif name =~ /ftp\.mozilla.+/
62
+ name = File.join($data_dir, "../fixtures/rhino-download.html")
59
63
  end
60
64
 
61
65
  juicer_original_open(File.expand_path(name), *rest, &block)
@@ -50,7 +50,7 @@ class TestRhinoInstaller < Test::Unit::TestCase
50
50
  assert File.exists?(path(".juicer/lib/rhino/bin"))
51
51
  assert_equal 3, Dir.glob(path(".juicer/lib/rhino/**/*")).find_all { |f| File.file?(f) }.length
52
52
 
53
- @installer.uninstall("1.7R2-RC1")
53
+ @installer.uninstall("1.7R3")
54
54
  assert File.exists?(path(".juicer/lib/rhino"))
55
55
  assert_equal 1, Dir.glob(path(".juicer/lib/rhino/**/*")).find_all { |f| File.file?(f) }.length
56
56
  end
@@ -19,7 +19,7 @@ class TestJsLint < Test::Unit::TestCase
19
19
  context "verifying file with jslint" do
20
20
  should "shell out to rhino/jslint" do
21
21
  jslint = Juicer::JsLint.new(:bin_path => @path)
22
- jslint.expects(:execute).with("-jar \"#{@path}/rhino1_7R2-RC1.jar\" \"#{@path}/jslint-1.0.js\" \"#{@file}\"").returns("jslint: No problems")
22
+ jslint.expects(:execute).with("-jar \"#{@path}/rhino1_7R3.jar\" \"#{@path}/jslint-1.0.js\" \"#{@file}\"").returns("jslint: No problems")
23
23
 
24
24
  assert jslint.check(@file).ok?
25
25
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: juicer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 9
10
- version: 1.0.9
9
+ - 10
10
+ version: 1.0.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Christian Johansen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-07 00:00:00 +01:00
18
+ date: 2011-05-11 00:00:00 +02:00
19
19
  default_executable: juicer
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -83,9 +83,25 @@ dependencies:
83
83
  type: :development
84
84
  version_requirements: *id004
85
85
  - !ruby/object:Gem::Dependency
86
- name: cmdparse
86
+ name: redgreen
87
87
  prerelease: false
88
88
  requirement: &id005 !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ hash: 27
94
+ segments:
95
+ - 1
96
+ - 2
97
+ - 2
98
+ version: 1.2.2
99
+ type: :development
100
+ version_requirements: *id005
101
+ - !ruby/object:Gem::Dependency
102
+ name: cmdparse
103
+ prerelease: false
104
+ requirement: &id006 !ruby/object:Gem::Requirement
89
105
  none: false
90
106
  requirements:
91
107
  - - ">="
@@ -95,11 +111,11 @@ dependencies:
95
111
  - 0
96
112
  version: "0"
97
113
  type: :runtime
98
- version_requirements: *id005
114
+ version_requirements: *id006
99
115
  - !ruby/object:Gem::Dependency
100
116
  name: nokogiri
101
117
  prerelease: false
102
- requirement: &id006 !ruby/object:Gem::Requirement
118
+ requirement: &id007 !ruby/object:Gem::Requirement
103
119
  none: false
104
120
  requirements:
105
121
  - - ">="
@@ -109,11 +125,11 @@ dependencies:
109
125
  - 0
110
126
  version: "0"
111
127
  type: :runtime
112
- version_requirements: *id006
128
+ version_requirements: *id007
113
129
  - !ruby/object:Gem::Dependency
114
130
  name: rubyzip
115
131
  prerelease: false
116
- requirement: &id007 !ruby/object:Gem::Requirement
132
+ requirement: &id008 !ruby/object:Gem::Requirement
117
133
  none: false
118
134
  requirements:
119
135
  - - ">="
@@ -123,7 +139,7 @@ dependencies:
123
139
  - 0
124
140
  version: "0"
125
141
  type: :runtime
126
- version_requirements: *id007
142
+ version_requirements: *id008
127
143
  description: Resolve dependencies, merge and minify CSS and JavaScript files with Juicer - the command line tool for frontend engineers
128
144
  email: christian@cjohansen.no
129
145
  executables:
@@ -179,6 +195,8 @@ files:
179
195
  - test/bin/rhino1_7R1.zip
180
196
  - test/bin/rhino1_7R2-RC1.jar
181
197
  - test/bin/rhino1_7R2-RC1.zip
198
+ - test/bin/rhino1_7R3.jar
199
+ - test/bin/rhino1_7R3.zip
182
200
  - test/bin/yuicompressor
183
201
  - test/bin/yuicompressor-2.3.5.zip
184
202
  - test/bin/yuicompressor-2.4.2.jar
@@ -206,6 +224,7 @@ files:
206
224
  - test/data/pkg/module/moda.js
207
225
  - test/data/pkg/module/modb.js
208
226
  - test/data/pkg/pkg.js
227
+ - test/fixtures/rhino-download.html
209
228
  - test/fixtures/yui-download.html
210
229
  - test/test_helper.rb
211
230
  - test/unit/juicer/asset/path_resolver_test.rb
@@ -248,8 +267,8 @@ post_install_message: |
248
267
 
249
268
  Happy juicing!
250
269
 
251
- rdoc_options:
252
- - --charset=UTF-8
270
+ rdoc_options: []
271
+
253
272
  require_paths:
254
273
  - lib
255
274
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -278,31 +297,31 @@ signing_key:
278
297
  specification_version: 3
279
298
  summary: Command line tool for CSS and JavaScript developers
280
299
  test_files:
281
- - test/unit/juicer/css_cache_buster_test.rb
282
- - test/unit/juicer/asset/path_test.rb
300
+ - test/test_helper.rb
283
301
  - test/unit/juicer/asset/path_resolver_test.rb
302
+ - test/unit/juicer/asset/path_test.rb
284
303
  - test/unit/juicer/cache_buster_test.rb
304
+ - test/unit/juicer/chainable_test.rb
305
+ - test/unit/juicer/command/install_test.rb
306
+ - test/unit/juicer/command/list_test.rb
307
+ - test/unit/juicer/command/merge_test.rb
308
+ - test/unit/juicer/command/util_test.rb
309
+ - test/unit/juicer/command/verify_test.rb
310
+ - test/unit/juicer/css_cache_buster_test.rb
311
+ - test/unit/juicer/datafy_test.rb
312
+ - test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
313
+ - test/unit/juicer/dependency_resolver/javascript_dependency_resolver_test.rb
314
+ - test/unit/juicer/ext/string_test.rb
315
+ - test/unit/juicer/ext/symbol_test.rb
285
316
  - test/unit/juicer/image_embed_test.rb
286
- - test/unit/juicer/install/yui_compressor_test.rb
287
317
  - test/unit/juicer/install/installer_base_test.rb
288
- - test/unit/juicer/install/rhino_installer_test.rb
289
318
  - test/unit/juicer/install/jslint_installer_test.rb
290
- - test/unit/juicer/datafy_test.rb
291
- - test/unit/juicer/ext/symbol_test.rb
292
- - test/unit/juicer/ext/string_test.rb
293
- - test/unit/juicer/dependency_resolver/javascript_dependency_resolver_test.rb
294
- - test/unit/juicer/dependency_resolver/css_dependency_resolver_test.rb
295
- - test/unit/juicer/command/merge_test.rb
296
- - test/unit/juicer/command/install_test.rb
297
- - test/unit/juicer/command/verify_test.rb
298
- - test/unit/juicer/command/util_test.rb
299
- - test/unit/juicer/command/list_test.rb
319
+ - test/unit/juicer/install/rhino_installer_test.rb
320
+ - test/unit/juicer/install/yui_compressor_test.rb
300
321
  - test/unit/juicer/jslint_test.rb
322
+ - test/unit/juicer/merger/base_test.rb
323
+ - test/unit/juicer/merger/javascript_merger_test.rb
324
+ - test/unit/juicer/merger/stylesheet_merger_test.rb
301
325
  - test/unit/juicer/minifyer/closure_compressor_test.rb
302
326
  - test/unit/juicer/minifyer/yui_compressor_test.rb
303
- - test/unit/juicer/chainable_test.rb
304
- - test/unit/juicer/merger/stylesheet_merger_test.rb
305
- - test/unit/juicer/merger/javascript_merger_test.rb
306
- - test/unit/juicer/merger/base_test.rb
307
327
  - test/unit/juicer_test.rb
308
- - test/test_helper.rb