smart_asset 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/bin/{yui_compressor.jar → yuicompressor-2.4.6.jar} +0 -0
- data/lib/smart_asset.rb +3 -5
- data/smart_asset.gemspec +1 -1
- metadata +9 -11
- data/bin/closure_compiler.jar +0 -0
data/README.md
CHANGED
@@ -9,7 +9,7 @@ Features
|
|
9
9
|
Similar to <code>AssetPackager</code>, but with the following changes:
|
10
10
|
|
11
11
|
* Git modified date/time for package version (only re-packages files that have been modified)
|
12
|
-
*
|
12
|
+
* [UglifyJS](https://github.com/mishoo/UglifyJS) for javascript compression
|
13
13
|
* Framework agnostic (adapters provided for Rails 2, Rails 3, and Sinatra)
|
14
14
|
|
15
15
|
<a name="installation"></a>
|
@@ -146,7 +146,7 @@ You may use environment variables with the <code>smart\_asset</code> command to
|
|
146
146
|
|
147
147
|
<code>MODIFIED='12/1/2010 12:00'</code><br/>Use a default modified time other than Time.now for non-version controlled files
|
148
148
|
|
149
|
-
<code>WARN=1</code><br/>Get compression warnings from
|
149
|
+
<code>WARN=1</code><br/>Get compression warnings from UglifyJS and YUI Compressor
|
150
150
|
|
151
151
|
#### Example:
|
152
152
|
|
Binary file
|
data/lib/smart_asset.rb
CHANGED
@@ -13,8 +13,7 @@ class SmartAsset
|
|
13
13
|
attr_accessor :append_random, :asset_host, :asset_counter, :cache, :config, :dest, :env, :envs, :pub, :root, :sources
|
14
14
|
|
15
15
|
BIN = File.expand_path(File.dirname(__FILE__) + '/../bin')
|
16
|
-
|
17
|
-
YUI_COMPRESSOR = BIN + '/yui_compressor.jar'
|
16
|
+
YUI_COMPRESSOR = BIN + '/yuicompressor-2.4.6.jar'
|
18
17
|
|
19
18
|
def binary(root, relative_config=nil)
|
20
19
|
load_config root, relative_config
|
@@ -86,11 +85,10 @@ class SmartAsset
|
|
86
85
|
tmp = "#{dest}/tmp.#{ext}"
|
87
86
|
File.open(tmp, 'w') { |f| f.write(data) }
|
88
87
|
puts "\nCreating #{package}..."
|
88
|
+
warning = ENV['WARN'] ? " -v" : nil
|
89
89
|
if ext == 'js'
|
90
|
-
|
91
|
-
cmd = "java -jar #{CLOSURE_COMPILER} --js #{tmp} --js_output_file #{package}#{warning}"
|
90
|
+
cmd = "uglifyjs --output #{package}#{warning} -nc #{tmp}"
|
92
91
|
elsif ext == 'css'
|
93
|
-
warning = ENV['WARN'] ? " -v" : nil
|
94
92
|
cmd = "java -jar #{YUI_COMPRESSOR} #{tmp} -o #{package}#{warning}"
|
95
93
|
end
|
96
94
|
puts cmd if ENV['DEBUG']
|
data/smart_asset.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_asset
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-11-07 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: framework_fixture
|
16
|
-
requirement: &
|
16
|
+
requirement: &70342656217080 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70342656217080
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rack-test
|
27
|
-
requirement: &
|
27
|
+
requirement: &70342656216480 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70342656216480
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70342656215780 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,14 +43,13 @@ dependencies:
|
|
43
43
|
version: '1.0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70342656215780
|
47
47
|
description: Smart asset packaging for Rails, Sinatra, and Stasis.
|
48
48
|
email:
|
49
49
|
- mail@wintoni.us
|
50
50
|
executables:
|
51
|
-
- closure_compiler.jar
|
52
51
|
- smart_asset
|
53
|
-
-
|
52
|
+
- yuicompressor-2.4.6.jar
|
54
53
|
extensions: []
|
55
54
|
extra_rdoc_files: []
|
56
55
|
files:
|
@@ -59,9 +58,8 @@ files:
|
|
59
58
|
- LICENSE
|
60
59
|
- README.md
|
61
60
|
- Rakefile
|
62
|
-
- bin/closure_compiler.jar
|
63
61
|
- bin/smart_asset
|
64
|
-
- bin/
|
62
|
+
- bin/yuicompressor-2.4.6.jar
|
65
63
|
- lib/smart_asset.rb
|
66
64
|
- lib/smart_asset/adapters/rails2.rb
|
67
65
|
- lib/smart_asset/adapters/rails3.rb
|
data/bin/closure_compiler.jar
DELETED
Binary file
|