yuicompressor 1.2.0 → 1.2.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.
- data/README +2 -2
- data/lib/yuicompressor/jruby.rb +10 -12
- data/lib/yuicompressor/shell.rb +8 -10
- data/yuicompressor.gemspec +1 -1
- metadata +51 -51
data/README
CHANGED
@@ -94,7 +94,7 @@ CSS compression:
|
|
94
94
|
}
|
95
95
|
CODE
|
96
96
|
YUICompressor.compress_css(css)
|
97
|
-
=> "div.main{background-position:0 0
|
97
|
+
=> "div.main{background-position:0 0}h1#title{color:#fff}"
|
98
98
|
|
99
99
|
CSS compression with every statement on a separate line:
|
100
100
|
|
@@ -108,7 +108,7 @@ CSS compression with every statement on a separate line:
|
|
108
108
|
}
|
109
109
|
CODE
|
110
110
|
YUICompressor.compress_css(css, :line_break => 0)
|
111
|
-
=> "div.main{background-position:0 0
|
111
|
+
=> "div.main{background-position:0 0}\nh1#title{color:#fff}"
|
112
112
|
|
113
113
|
Including in another module:
|
114
114
|
|
data/lib/yuicompressor/jruby.rb
CHANGED
@@ -7,10 +7,10 @@ module YUICompressor
|
|
7
7
|
|
8
8
|
require JAR_FILE
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
java_import java.io.InputStreamReader
|
11
|
+
java_import java.io.OutputStreamWriter
|
12
|
+
java_import com.yahoo.platform.yui.compressor.JavaScriptCompressor
|
13
|
+
java_import com.yahoo.platform.yui.compressor.CssCompressor
|
14
14
|
|
15
15
|
class ErrorReporter #:nodoc:
|
16
16
|
def error(message, source_name, line, line_source, line_offset)
|
@@ -43,14 +43,12 @@ module YUICompressor
|
|
43
43
|
args
|
44
44
|
end
|
45
45
|
|
46
|
-
#
|
47
|
-
# When using this method directly, at least the
|
48
|
-
# specified, and should be one of <tt>"css"</tt>
|
49
|
-
# YUICompressor#compress_css and
|
50
|
-
# which options are acceptable for
|
51
|
-
#
|
52
|
-
# If a block is given, it will receive the IO output object. Otherwise the
|
53
|
-
# output will be returned as a string.
|
46
|
+
# Returns a compressed version of the given +stream_or_string+ of code using
|
47
|
+
# the given +options+. When using this method directly, at least the
|
48
|
+
# <tt>:type</tt> option must be specified, and should be one of <tt>"css"</tt>
|
49
|
+
# or <tt>"js"</tt>. See YUICompressor#compress_css and
|
50
|
+
# YUICompressor#compress_js for details about which options are acceptable for
|
51
|
+
# each type of compressor.
|
54
52
|
def compress(stream_or_string, options={})
|
55
53
|
raise ArgumentError, 'Option :type required' unless options.key?(:type)
|
56
54
|
|
data/lib/yuicompressor/shell.rb
CHANGED
@@ -23,19 +23,17 @@ module YUICompressor
|
|
23
23
|
args
|
24
24
|
end
|
25
25
|
|
26
|
-
#
|
27
|
-
# When using this method directly, at least the
|
28
|
-
# specified, and should be one of <tt>"css"</tt>
|
29
|
-
# YUICompressor#compress_css and
|
30
|
-
# which options are acceptable for
|
26
|
+
# Returns a compressed version of the given +stream_or_string+ of code using
|
27
|
+
# the given +options+. When using this method directly, at least the
|
28
|
+
# <tt>:type</tt> option must be specified, and should be one of <tt>"css"</tt>
|
29
|
+
# or <tt>"js"</tt>. See YUICompressor#compress_css and
|
30
|
+
# YUICompressor#compress_js for details about which options are acceptable for
|
31
|
+
# each type of compressor.
|
31
32
|
#
|
32
33
|
# In addition to the standard options, this method also accepts a
|
33
34
|
# <tt>:java</tt> option that can be used to specify the location of the Java
|
34
|
-
#
|
35
|
-
# specified.
|
36
|
-
#
|
37
|
-
# If a block is given, it will receive the IO output object. Otherwise the
|
38
|
-
# output will be returned as a string.
|
35
|
+
# executable. This option will default to using <tt>"java"</tt> unless
|
36
|
+
# otherwise specified.
|
39
37
|
def compress(stream_or_string, options={})
|
40
38
|
raise ArgumentError, 'Option :type required' unless options.key?(:type)
|
41
39
|
|
data/yuicompressor.gemspec
CHANGED
metadata
CHANGED
@@ -3,32 +3,32 @@ name: yuicompressor
|
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
version: 1.2.
|
6
|
+
- 1
|
7
|
+
- 2
|
8
|
+
- 1
|
9
|
+
version: 1.2.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
|
-
|
12
|
+
- Michael Jackson
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-08-04 00:00:00 -
|
17
|
+
date: 2010-08-04 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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
|
32
32
|
description: A YUI JavaScript and CSS compressor for Ruby and JRuby
|
33
33
|
email: mjijackson@gmail.com
|
34
34
|
executables: []
|
@@ -36,49 +36,49 @@ executables: []
|
|
36
36
|
extensions: []
|
37
37
|
|
38
38
|
extra_rdoc_files:
|
39
|
-
|
39
|
+
- README
|
40
40
|
files:
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
41
|
+
- lib/yuicompressor/jruby.rb
|
42
|
+
- lib/yuicompressor/shell.rb
|
43
|
+
- lib/yuicompressor-2.4.4.jar
|
44
|
+
- lib/yuicompressor.rb
|
45
|
+
- test/_files/jquery-1.4.2.js
|
46
|
+
- test/_files/test.css
|
47
|
+
- test/_files/test.js
|
48
|
+
- test/css_test.rb
|
49
|
+
- test/helper.rb
|
50
|
+
- test/js_test.rb
|
51
|
+
- yuicompressor.gemspec
|
52
|
+
- Rakefile
|
53
|
+
- README
|
54
54
|
has_rdoc: true
|
55
55
|
homepage: http://github.com/mjijackson/yuicompressor
|
56
56
|
licenses: []
|
57
57
|
|
58
58
|
post_install_message:
|
59
59
|
rdoc_options:
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
60
|
+
- --line-numbers
|
61
|
+
- --inline-source
|
62
|
+
- --title
|
63
|
+
- YUICompressor
|
64
|
+
- --main
|
65
|
+
- YUICompressor
|
66
66
|
require_paths:
|
67
|
-
|
67
|
+
- lib
|
68
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
75
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
segments:
|
80
|
+
- 0
|
81
|
+
version: "0"
|
82
82
|
requirements: []
|
83
83
|
|
84
84
|
rubyforge_project:
|
@@ -87,5 +87,5 @@ signing_key:
|
|
87
87
|
specification_version: 3
|
88
88
|
summary: A YUI JavaScript and CSS compressor for Ruby and JRuby
|
89
89
|
test_files:
|
90
|
-
|
91
|
-
|
90
|
+
- test/css_test.rb
|
91
|
+
- test/js_test.rb
|