jminify 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ module JMinify; end
2
+
3
+ require 'java'
4
+ require File.join(File.dirname(__FILE__), 'java', 'yuicompressor-2.4.7.jar')
5
+
6
+ rb = File.join(File.dirname(__FILE__), 'jminify', '*.rb')
7
+ Dir[rb].each { |r| require r }
@@ -0,0 +1,18 @@
1
+ java_import com.yahoo.platform.yui.compressor.CssCompressor
2
+ java_import java.io.FileReader
3
+
4
+ module JMinify
5
+
6
+ class CSS
7
+ def initialize(path)
8
+ @reader = FileReader.new(path)
9
+ @compressor = CssCompressor.new(@reader)
10
+ @reader.close
11
+ end
12
+
13
+ def compress(out)
14
+ @compressor.compress(out, -1)
15
+ end
16
+ end
17
+
18
+ end
@@ -0,0 +1,9 @@
1
+ java_import org.mozilla.javascript.ErrorReporter
2
+
3
+ module JMinify
4
+
5
+ class Error
6
+ include ErrorReporter
7
+ end
8
+
9
+ end
@@ -0,0 +1,17 @@
1
+ java_import com.yahoo.platform.yui.compressor.JavaScriptCompressor
2
+ java_import java.io.FileReader
3
+
4
+ module JMinify
5
+
6
+ class JS
7
+ def initialize(path)
8
+ @reader = FileReader.new(path)
9
+ @compressor = JavaScriptCompressor.new(@reader, Error.new)
10
+ end
11
+
12
+ def compress(out)
13
+ @compressor.compress(out, -1, true, false, true, false)
14
+ end
15
+ end
16
+
17
+ end
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jminify
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Chris Mowforth
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2012-02-22 00:00:00 Z
14
+ dependencies: []
15
+
16
+ description: " A wrapper for the YUI Java compressor: compress JavaScript and CSS, including whitespace removal and munging of variable names.\n"
17
+ email:
18
+ - chris@mowforth.com
19
+ executables: []
20
+
21
+ extensions: []
22
+
23
+ extra_rdoc_files: []
24
+
25
+ files:
26
+ - lib/jminify.rb
27
+ - lib/java/yuicompressor-2.4.7.jar
28
+ - lib/jminify/js.rb
29
+ - lib/jminify/error.rb
30
+ - lib/jminify/css.rb
31
+ homepage: http://github.com/cmowforth/jminify
32
+ licenses: []
33
+
34
+ post_install_message:
35
+ rdoc_options: []
36
+
37
+ require_paths:
38
+ - lib
39
+ required_ruby_version: !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: "0"
45
+ required_rubygems_version: !ruby/object:Gem::Requirement
46
+ none: false
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: "0"
51
+ requirements: []
52
+
53
+ rubyforge_project:
54
+ rubygems_version: 1.8.9
55
+ signing_key:
56
+ specification_version: 3
57
+ summary: YUI JS / CSS compressor for JRuby.
58
+ test_files: []
59
+