cache-with-yuicompressor 0.1.0 → 0.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.
- data/README.rdoc +8 -1
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/cache-with-yuicompressor.gemspec +5 -5
- data/lib/cache-with-yuicompressor.rb +11 -3
- data/lib/jargs-1.0.jar +0 -0
- data/lib/rhino-1.6R7.jar +0 -0
- data/lib/yuicompressor-2.4.2.jar +0 -0
- metadata +5 -9
data/README.rdoc
CHANGED
@@ -18,7 +18,14 @@ cache-with-yuicompressor is provided as a gem. Simply include it in your environ
|
|
18
18
|
Alternatively it can be installed as a plugin.
|
19
19
|
|
20
20
|
script/plugin install git://github.com/amolk/cache-with-yuicompressor.git
|
21
|
+
|
22
|
+
=== Install JAVA
|
23
|
+
The YUI compressor requires JAVA runtime to be installed. Install JRE as per your platform.
|
24
|
+
|
25
|
+
For Ubuntu, you can follow instructions at
|
26
|
+
http://blog.amolkelkar.info/technotes/2010/06/solved-how-to-install-java-jre-on-ubuntu/.
|
21
27
|
|
22
28
|
== And that's it!
|
23
29
|
|
24
|
-
All generated javascript and css files will be automatically compressed using YUI Compressor.
|
30
|
+
All generated javascript and css files will be automatically compressed using YUI Compressor.
|
31
|
+
Also all console.* calls (such as console.log, console.trace) will be removed from javascript.
|
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ begin
|
|
5
5
|
require 'jeweler'
|
6
6
|
Jeweler::Tasks.new do |gem|
|
7
7
|
gem.name = "cache-with-yuicompressor"
|
8
|
-
gem.summary = %Q{
|
8
|
+
gem.summary = %Q{Automatically compress javascript and CSS bundles using YUI Compressor}
|
9
9
|
gem.description = %Q{"This gem sets up javascript and CSS bundle file compression using the YUI Compressor. For example, using [javascript_include_tag \"prototype\", \"cart\", \"checkout\", :cache => \"shop\"] creates a combined javascript file named shop.js. With this gem, YUI compressor will also be run on shop.js, resulting in a smaller, obfuscated file."}
|
10
10
|
gem.email = "kelkar.amol@gmail.com"
|
11
11
|
gem.homepage = "http://github.com/amolk/cache-with-yuicompressor"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cache-with-yuicompressor}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Amol Kelkar"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-08-26}
|
13
13
|
s.description = %q{"This gem sets up javascript and CSS bundle file compression using the YUI Compressor. For example, using [javascript_include_tag "prototype", "cart", "checkout", :cache => "shop"] creates a combined javascript file named shop.js. With this gem, YUI compressor will also be run on shop.js, resulting in a smaller, obfuscated file."}
|
14
14
|
s.email = %q{kelkar.amol@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -35,10 +35,10 @@ Gem::Specification.new do |s|
|
|
35
35
|
s.rdoc_options = ["--charset=UTF-8"]
|
36
36
|
s.require_paths = ["lib"]
|
37
37
|
s.rubygems_version = %q{1.3.7}
|
38
|
-
s.summary = %q{
|
38
|
+
s.summary = %q{Automatically compress javascript and CSS bundles using YUI Compressor}
|
39
39
|
s.test_files = [
|
40
|
-
"test/
|
41
|
-
"test/
|
40
|
+
"test/test_cache-with-yuicompressor.rb",
|
41
|
+
"test/helper.rb"
|
42
42
|
]
|
43
43
|
|
44
44
|
if s.respond_to? :specification_version then
|
@@ -7,10 +7,18 @@ module ActionView
|
|
7
7
|
File.atomic_write(joined_asset_path) { |cache| cache.write(join_asset_file_contents(asset_paths)) }
|
8
8
|
|
9
9
|
begin
|
10
|
-
|
10
|
+
# remove console.log calls
|
11
|
+
f = File.open(joined_asset_path)
|
12
|
+
fo = File.new("temp_" + joined_asset_path, "w")
|
13
|
+
f.each {|line|
|
14
|
+
fo.puts line.gsub(/console.(log|debug|info|warn|error|assert|dir|dirxml|trace|group|groupEnd|time|timeEnd|profile|profileEnd|count)\((.*)\);?/,"");
|
15
|
+
}
|
16
|
+
fo.close
|
17
|
+
f.close
|
18
|
+
|
11
19
|
jarpath = File.dirname(__FILE__) + "/yuicompressor-2.4.2.jar";
|
12
20
|
#puts "JAR Path : #{jarpath}"
|
13
|
-
cmd = "java -jar #{jarpath} #{
|
21
|
+
cmd = "java -jar #{jarpath} temp_#{joined_asset_path} -o #{joined_asset_path}"
|
14
22
|
ret = system(cmd)
|
15
23
|
rescue
|
16
24
|
end
|
@@ -22,4 +30,4 @@ module ActionView
|
|
22
30
|
end
|
23
31
|
end
|
24
32
|
end
|
25
|
-
end
|
33
|
+
end
|
data/lib/jargs-1.0.jar
CHANGED
File without changes
|
data/lib/rhino-1.6R7.jar
CHANGED
File without changes
|
data/lib/yuicompressor-2.4.2.jar
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cache-with-yuicompressor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 27
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Amol Kelkar
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-08-26 00:00:00 -07:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -26,7 +25,6 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
28
|
segments:
|
31
29
|
- 0
|
32
30
|
version: "0"
|
@@ -69,7 +67,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
67
|
requirements:
|
70
68
|
- - ">="
|
71
69
|
- !ruby/object:Gem::Version
|
72
|
-
hash: 3
|
73
70
|
segments:
|
74
71
|
- 0
|
75
72
|
version: "0"
|
@@ -78,7 +75,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
75
|
requirements:
|
79
76
|
- - ">="
|
80
77
|
- !ruby/object:Gem::Version
|
81
|
-
hash: 3
|
82
78
|
segments:
|
83
79
|
- 0
|
84
80
|
version: "0"
|
@@ -88,7 +84,7 @@ rubyforge_project:
|
|
88
84
|
rubygems_version: 1.3.7
|
89
85
|
signing_key:
|
90
86
|
specification_version: 3
|
91
|
-
summary:
|
87
|
+
summary: Automatically compress javascript and CSS bundles using YUI Compressor
|
92
88
|
test_files:
|
93
|
-
- test/helper.rb
|
94
89
|
- test/test_cache-with-yuicompressor.rb
|
90
|
+
- test/helper.rb
|