yuicompressor 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -51,6 +51,8 @@ When compressing CSS, the following option is available:
51
51
  single line of compressed code. Defaults to no maximum
52
52
  length. If set to 0 each line will be the minimum length
53
53
  possible.
54
+ :charset Sests the carset in which to read the input file. Passed
55
+ through to the YUICompressor Java library. Default: utf8
54
56
 
55
57
  When compressing JavaScript, these additional options are available:
56
58
 
@@ -2,7 +2,7 @@ require 'stringio'
2
2
 
3
3
  module YUICompressor
4
4
  # The path to the YUI Compressor jar file.
5
- JAR_FILE = File.expand_path('../yuicompressor-2.4.4.jar', __FILE__)
5
+ JAR_FILE = File.expand_path('../yuicompressor-2.4.8.jar', __FILE__)
6
6
 
7
7
  module_function
8
8
 
@@ -18,6 +18,7 @@ module YUICompressor
18
18
  # single line of compressed code. Defaults to no maximum
19
19
  # length. If set to 0 each line will be the minimum length
20
20
  # possible.
21
+ # +:charset+:: Charset. Default is utf8.
21
22
  def compress_css(stream_or_string, options={}, &block)
22
23
  compress(stream_or_string, options.merge(:type => 'css'), &block)
23
24
  end
@@ -35,20 +36,22 @@ module YUICompressor
35
36
  # all semicolons in the code. Defaults to +false+.
36
37
  # +:optimize+:: Should be +true+ if the compressor should enable all
37
38
  # micro optimizations. Defaults to +true+.
39
+ # +:charset+:: Charset. Default is utf8.
38
40
  def compress_js(stream_or_string, options={}, &block)
39
41
  compress(stream_or_string, options.merge(:type => 'js'), &block)
40
42
  end
41
43
 
42
44
  def default_css_options #:nodoc:
43
- { :line_break => nil }
45
+ { :line_break => nil, :charset => 'utf8' }
44
46
  end
45
47
 
46
48
  def default_js_options #:nodoc:
47
- default_css_options.merge(
49
+ { :line_break => nil,
50
+ :charset => 'utf8',
48
51
  :munge => false,
49
52
  :preserve_semicolons => false,
50
53
  :optimize => true
51
- )
54
+ }
52
55
  end
53
56
 
54
57
  def streamify(stream_or_string) #:nodoc:
@@ -13,6 +13,7 @@ module YUICompressor
13
13
  args = []
14
14
  args.concat(['--type', options[:type].to_s]) if options[:type]
15
15
  args.concat(['--line-break', options[:line_break].to_s]) if options[:line_break]
16
+ args.concat(['--charset', options[:charset].to_s]) if options[:charset]
16
17
 
17
18
  if options[:type].to_s == 'js'
18
19
  args << '--nomunge' unless options[:munge]
@@ -10,7 +10,7 @@ class CSSTest < Test::Unit::TestCase
10
10
  if jruby?
11
11
  assert_equal([-1], args)
12
12
  else
13
- assert_equal([], args)
13
+ assert_equal(['--charset', 'utf8'], args)
14
14
  end
15
15
  end
16
16
 
@@ -10,7 +10,7 @@ class JSTest < Test::Unit::TestCase
10
10
  if jruby?
11
11
  assert_equal([-1], args)
12
12
  else
13
- assert_equal([], args)
13
+ assert_equal(['--charset', 'utf8'], args)
14
14
  end
15
15
  end
16
16
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'yuicompressor'
3
- s.version = '1.2.1'
4
- s.date = '2010-08-04'
3
+ s.version = '1.3.0'
4
+ s.date = '2014-01-22'
5
5
 
6
6
  s.summary = 'A YUI JavaScript and CSS compressor for Ruby and JRuby'
7
7
  s.description = 'A YUI JavaScript and CSS compressor for Ruby and JRuby'
metadata CHANGED
@@ -1,46 +1,42 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: yuicompressor
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 2
8
- - 1
9
- version: 1.2.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.0
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Michael Jackson
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2010-08-04 00:00:00 -07:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2014-01-22 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  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"
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
30
22
  type: :development
31
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
32
30
  description: A YUI JavaScript and CSS compressor for Ruby and JRuby
33
31
  email: mjijackson@gmail.com
34
32
  executables: []
35
-
36
33
  extensions: []
37
-
38
- extra_rdoc_files:
34
+ extra_rdoc_files:
39
35
  - README
40
- files:
36
+ files:
41
37
  - lib/yuicompressor/jruby.rb
42
38
  - lib/yuicompressor/shell.rb
43
- - lib/yuicompressor-2.4.4.jar
39
+ - lib/yuicompressor-2.4.8.jar
44
40
  - lib/yuicompressor.rb
45
41
  - test/_files/jquery-1.4.2.js
46
42
  - test/_files/test.css
@@ -51,41 +47,36 @@ files:
51
47
  - yuicompressor.gemspec
52
48
  - Rakefile
53
49
  - README
54
- has_rdoc: true
55
50
  homepage: http://github.com/mjijackson/yuicompressor
56
51
  licenses: []
57
-
58
52
  post_install_message:
59
- rdoc_options:
53
+ rdoc_options:
60
54
  - --line-numbers
61
55
  - --inline-source
62
56
  - --title
63
57
  - YUICompressor
64
58
  - --main
65
59
  - YUICompressor
66
- require_paths:
60
+ require_paths:
67
61
  - lib
68
- required_ruby_version: !ruby/object:Gem::Requirement
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- segments:
73
- - 0
74
- version: "0"
75
- required_rubygems_version: !ruby/object:Gem::Requirement
76
- requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- segments:
80
- - 0
81
- version: "0"
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ! '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
82
74
  requirements: []
83
-
84
75
  rubyforge_project:
85
- rubygems_version: 1.3.6
76
+ rubygems_version: 1.8.23
86
77
  signing_key:
87
78
  specification_version: 3
88
79
  summary: A YUI JavaScript and CSS compressor for Ruby and JRuby
89
- test_files:
80
+ test_files:
90
81
  - test/css_test.rb
91
82
  - test/js_test.rb
Binary file