yuicompressor 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -0,0 +1,6 @@
1
+ .a-class {
2
+ background-color: red;
3
+ background-position: 0;
4
+ }
5
+
6
+ div#an-id { color: #FFFFFF; }
@@ -0,0 +1,13 @@
1
+ // here's a comment
2
+ var Foo = { "a": 1 };
3
+ Foo["bar"] = (function(baz) {
4
+ /* here's a
5
+ multiline comment */
6
+ if (false) {
7
+ doSomething();
8
+ } else {
9
+ for (var index = 0; index < baz.length; index++) {
10
+ doSomething(baz[index]);
11
+ }
12
+ }
13
+ })("hello");
data/test/css_test.rb CHANGED
@@ -1,14 +1,8 @@
1
1
  require File.expand_path('../helper', __FILE__)
2
2
 
3
3
  class CSSTest < Test::Unit::TestCase
4
- FIXTURE = <<'CODE'
5
- .a-class {
6
- background-color: red;
7
- background-position: 0;
8
- }
9
-
10
- div#an-id { color: #FFFFFF; }
11
- CODE
4
+ FILE = File.expand_path('../_files/test.css', __FILE__)
5
+ CODE = File.read(FILE)
12
6
 
13
7
  def test_default_command_arguments
14
8
  args = command_arguments(default_css_options)
@@ -43,15 +37,21 @@ CODE
43
37
  end
44
38
 
45
39
  def test_default_options
46
- assert_equal (<<'CODE').chomp, compress_css(FIXTURE)
40
+ assert_equal (<<'CODE').chomp, compress_css(CODE)
47
41
  .a-class{background-color:red;background-position:0 0;}div#an-id{color:#FFF;}
48
42
  CODE
49
43
  end
50
44
 
51
45
  def test_line_break_option
52
- assert_equal (<<'CODE').chomp, compress_css(FIXTURE, :line_break => 0)
46
+ assert_equal (<<'CODE').chomp, compress_css(CODE, :line_break => 0)
53
47
  .a-class{background-color:red;background-position:0 0;}
54
48
  div#an-id{color:#FFF;}
49
+ CODE
50
+ end
51
+
52
+ def test_stream
53
+ assert_equal (<<'CODE').chomp, compress_css(File.new(FILE, 'r'))
54
+ .a-class{background-color:red;background-position:0 0;}div#an-id{color:#FFF;}
55
55
  CODE
56
56
  end
57
57
  end
data/test/js_test.rb CHANGED
@@ -1,21 +1,8 @@
1
1
  require File.expand_path('../helper', __FILE__)
2
2
 
3
3
  class JSTest < Test::Unit::TestCase
4
- FIXTURE = <<'CODE'
5
- // here's a comment
6
- var Foo = { "a": 1 };
7
- Foo["bar"] = (function(baz) {
8
- /* here's a
9
- multiline comment */
10
- if (false) {
11
- doSomething();
12
- } else {
13
- for (var index = 0; index < baz.length; index++) {
14
- doSomething(baz[index]);
15
- }
16
- }
17
- })("hello");
18
- CODE
4
+ FILE = File.expand_path('../_files/test.js', __FILE__)
5
+ CODE = File.read(FILE)
19
6
 
20
7
  def test_default_command_arguments
21
8
  args = command_arguments(default_js_options)
@@ -56,13 +43,13 @@ CODE
56
43
  end
57
44
 
58
45
  def test_default_options
59
- assert_equal (<<'CODE').chomp, compress_js(FIXTURE)
46
+ assert_equal (<<'CODE').chomp, compress_js(CODE)
60
47
  var Foo={a:1};Foo.bar=(function(baz){if(false){doSomething()}else{for(var index=0;index<baz.length;index++){doSomething(baz[index])}}})("hello");
61
48
  CODE
62
49
  end
63
50
 
64
51
  def test_line_break_option
65
- assert_equal (<<'CODE').chomp, compress_js(FIXTURE, :line_break => 0)
52
+ assert_equal (<<'CODE').chomp, compress_js(CODE, :line_break => 0)
66
53
  var Foo={a:1};
67
54
  Foo.bar=(function(baz){if(false){doSomething()
68
55
  }else{for(var index=0;
@@ -73,19 +60,19 @@ CODE
73
60
  end
74
61
 
75
62
  def test_munge_option
76
- assert_equal (<<'CODE').chomp, compress_js(FIXTURE, :munge => true)
63
+ assert_equal (<<'CODE').chomp, compress_js(CODE, :munge => true)
77
64
  var Foo={a:1};Foo.bar=(function(b){if(false){doSomething()}else{for(var a=0;a<b.length;a++){doSomething(b[a])}}})("hello");
78
65
  CODE
79
66
  end
80
67
 
81
68
  def test_optimize_option
82
- assert_equal (<<'CODE').chomp, compress_js(FIXTURE, :optimize => false)
69
+ assert_equal (<<'CODE').chomp, compress_js(CODE, :optimize => false)
83
70
  var Foo={"a":1};Foo["bar"]=(function(baz){if(false){doSomething()}else{for(var index=0;index<baz.length;index++){doSomething(baz[index])}}})("hello");
84
71
  CODE
85
72
  end
86
73
 
87
74
  def test_preserve_semicolons_option
88
- assert_equal (<<'CODE').chomp, compress_js(FIXTURE, :preserve_semicolons => true)
75
+ assert_equal (<<'CODE').chomp, compress_js(CODE, :preserve_semicolons => true)
89
76
  var Foo={a:1};Foo.bar=(function(baz){if(false){doSomething();}else{for(var index=0;index<baz.length;index++){doSomething(baz[index]);}}})("hello");
90
77
  CODE
91
78
  end
@@ -96,4 +83,10 @@ CODE
96
83
  compress_js('var a = function(){;')
97
84
  end
98
85
  end
86
+
87
+ def test_stream
88
+ assert_equal (<<'CODE').chomp, compress_js(File.new(FILE, 'r'))
89
+ var Foo={a:1};Foo.bar=(function(baz){if(false){doSomething()}else{for(var index=0;index<baz.length;index++){doSomething(baz[index])}}})("hello");
90
+ CODE
91
+ end
99
92
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'yuicompressor'
3
- s.version = '1.1.0'
3
+ s.version = '1.1.1'
4
4
  s.date = '2010-08-04'
5
5
 
6
6
  s.summary = 'A YUI JavaScript and CSS compressor for Ruby and JRuby'
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
11
11
 
12
12
  s.require_paths = %w< lib >
13
13
 
14
- s.files = Dir['lib/**/*.rb'] +
15
- Dir['test/*.rb'] +
14
+ s.files = Dir['lib/**/*'] +
15
+ Dir['test/**/*'] +
16
16
  %w< yuicompressor.gemspec Rakefile README >
17
17
 
18
18
  s.test_files = s.files.select {|path| path =~ /^test\/.*_test.rb/ }
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yuicompressor
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
5
4
  prerelease: false
6
5
  segments:
7
- - 1
8
- - 1
9
- - 0
10
- version: 1.1.0
6
+ - 1
7
+ - 1
8
+ - 1
9
+ version: 1.1.1
11
10
  platform: ruby
12
11
  authors:
13
- - Michael Jackson
12
+ - Michael Jackson
14
13
  autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
@@ -18,20 +17,18 @@ cert_chain: []
18
17
  date: 2010-08-04 00:00:00 -06:00
19
18
  default_executable:
20
19
  dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: rake
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
33
- type: :development
34
- version_requirements: *id001
20
+ - !ruby/object:Gem::Dependency
21
+ name: rake
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ version: "0"
30
+ type: :development
31
+ version_requirements: *id001
35
32
  description: A YUI JavaScript and CSS compressor for Ruby and JRuby
36
33
  email: mjijackson@gmail.com
37
34
  executables: []
@@ -39,56 +36,55 @@ executables: []
39
36
  extensions: []
40
37
 
41
38
  extra_rdoc_files:
42
- - README
39
+ - README
43
40
  files:
44
- - lib/yuicompressor/jruby.rb
45
- - lib/yuicompressor/shell.rb
46
- - lib/yuicompressor.rb
47
- - test/css_test.rb
48
- - test/helper.rb
49
- - test/js_test.rb
50
- - yuicompressor.gemspec
51
- - Rakefile
52
- - README
41
+ - lib/yuicompressor-2.4.2.jar
42
+ - lib/yuicompressor.rb
43
+ - lib/yuicompressor/jruby.rb
44
+ - lib/yuicompressor/shell.rb
45
+ - test/css_test.rb
46
+ - test/helper.rb
47
+ - test/js_test.rb
48
+ - test/_files/test.css
49
+ - test/_files/test.js
50
+ - yuicompressor.gemspec
51
+ - Rakefile
52
+ - README
53
53
  has_rdoc: true
54
54
  homepage: http://github.com/mjijackson/yuicompressor
55
55
  licenses: []
56
56
 
57
57
  post_install_message:
58
58
  rdoc_options:
59
- - --line-numbers
60
- - --inline-source
61
- - --title
62
- - YUICompressor
63
- - --main
64
- - YUICompressor
59
+ - --line-numbers
60
+ - --inline-source
61
+ - --title
62
+ - YUICompressor
63
+ - --main
64
+ - YUICompressor
65
65
  require_paths:
66
- - lib
66
+ - lib
67
67
  required_ruby_version: !ruby/object:Gem::Requirement
68
- none: false
69
68
  requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- hash: 3
73
- segments:
74
- - 0
75
- version: "0"
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ segments:
72
+ - 0
73
+ version: "0"
76
74
  required_rubygems_version: !ruby/object:Gem::Requirement
77
- none: false
78
75
  requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- hash: 3
82
- segments:
83
- - 0
84
- version: "0"
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ segments:
79
+ - 0
80
+ version: "0"
85
81
  requirements: []
86
82
 
87
83
  rubyforge_project:
88
- rubygems_version: 1.3.7
84
+ rubygems_version: 1.3.6
89
85
  signing_key:
90
86
  specification_version: 3
91
87
  summary: A YUI JavaScript and CSS compressor for Ruby and JRuby
92
88
  test_files:
93
- - test/css_test.rb
94
- - test/js_test.rb
89
+ - test/css_test.rb
90
+ - test/js_test.rb