yuicompressor 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/yuicompressor-2.4.2.jar +0 -0
- data/test/_files/test.css +6 -0
- data/test/_files/test.js +13 -0
- data/test/css_test.rb +10 -10
- data/test/js_test.rb +13 -20
- data/yuicompressor.gemspec +3 -3
- metadata +50 -54
Binary file
|
data/test/_files/test.js
ADDED
@@ -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
|
-
|
5
|
-
.
|
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(
|
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(
|
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
|
-
|
5
|
-
|
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(
|
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(
|
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(
|
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(
|
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(
|
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
|
data/yuicompressor.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'yuicompressor'
|
3
|
-
s.version = '1.1.
|
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
|
15
|
-
Dir['test
|
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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
version: 1.1.
|
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
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
45
|
-
- lib/yuicompressor
|
46
|
-
- lib/yuicompressor.rb
|
47
|
-
-
|
48
|
-
- test/
|
49
|
-
- test/
|
50
|
-
-
|
51
|
-
-
|
52
|
-
-
|
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
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
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
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
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.
|
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
|