requirejs_optimizer 0.2.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +2 -1
- data/Gemfile +0 -1
- data/README.md +3 -1
- data/lib/requirejs_optimizer/step/optimize.rb +11 -1
- data/lib/requirejs_optimizer/version.rb +1 -1
- data/spec/lib/requirejs_optimizer/step/optimize_spec.rb +10 -0
- metadata +9 -15
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cc3b30b24b7c0017959f27256d9d72dc8ab1fd95
|
4
|
+
data.tar.gz: e843ddd9b04970ffe5f5f08ed8b6ffd2dd29351b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 214f5e8cf5905ef3acd401bfa3f7f8f83971389f3c7b3434213dbe7500715088734525bb3242ffd3572ed9e1400e41427ea8043452c5dacc632db0a6b866491c
|
7
|
+
data.tar.gz: 08a3777c998016ba718413000f30cb1dc48d6daf0df28e9d817c2d04c3ea72d10ba95cbdfa5e1d29b3da42d16a6d405ff61b293f5bab677e9622920d0c4d9ea2
|
data/CHANGELOG
CHANGED
@@ -1,2 +1,3 @@
|
|
1
1
|
0.1.0: Upgrades r.js from 1.0.7 to 2.0.6
|
2
|
-
0.2.0: Adds Rhino support for R.js optimization (was just Node previously)
|
2
|
+
0.2.0: Adds Rhino support for R.js optimization (was just Node previously) (@hawknewton, @leachryanb)
|
3
|
+
0.3.0: Adds requirejs_optimizer_java_opts option for specifying Java Runtime options (only when using Rhino) (@hawknewton)
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -87,7 +87,9 @@ After running `rake assets:precompile`, modules `foo` and `bar` will be compiled
|
|
87
87
|
|
88
88
|
The rake task will use either node or rhino during optimization. By default, node will be used if found followed by rhino if java is available.
|
89
89
|
|
90
|
-
If you have a preference, set Rails.configuration.requirejs_optimizer_runtime to either `:node` or `:rhino`
|
90
|
+
If you have a preference, set `Rails.configuration.requirejs_optimizer_runtime` to either `:node` or `:rhino`
|
91
|
+
|
92
|
+
If you're using rhino, you may use the configuration parameter `Rails.configuration.requirejs_optimizer_java_opts` to include java opts (like `-Xmx`) when invoking rhino.
|
91
93
|
|
92
94
|
## Contributing
|
93
95
|
|
@@ -38,7 +38,7 @@ module RequirejsOptimizer
|
|
38
38
|
js = RequirejsOptimizer.root.join 'lib', 'rhino', 'js.jar'
|
39
39
|
compiler = RequirejsOptimizer.root.join 'lib', 'closure', 'compiler.jar'
|
40
40
|
|
41
|
-
"java -classpath #{js}:#{compiler} org.mozilla.javascript.tools.shell.Main"
|
41
|
+
"java #{java_opts} -classpath #{js}:#{compiler} org.mozilla.javascript.tools.shell.Main"
|
42
42
|
end
|
43
43
|
|
44
44
|
end
|
@@ -63,6 +63,16 @@ module RequirejsOptimizer
|
|
63
63
|
runtime
|
64
64
|
end
|
65
65
|
|
66
|
+
def java_opts
|
67
|
+
if Rails.configuration.respond_to? :requirejs_optimizer_java_opts
|
68
|
+
opts = Rails.configuration.requirejs_optimizer_java_opts
|
69
|
+
else
|
70
|
+
opts = ''
|
71
|
+
end
|
72
|
+
|
73
|
+
opts
|
74
|
+
end
|
75
|
+
|
66
76
|
end
|
67
77
|
|
68
78
|
end
|
@@ -49,6 +49,16 @@ module RequirejsOptimizer
|
|
49
49
|
subject.perform
|
50
50
|
end
|
51
51
|
|
52
|
+
it "uses java opts if given and we're using rhino" do
|
53
|
+
Rails.configuration.stub(:requirejs_optimizer_runtime).and_return(:rhino)
|
54
|
+
Rails.configuration.stub(:requirejs_optimizer_java_opts).and_return('-Xmx1024m')
|
55
|
+
|
56
|
+
subject.should_receive(:system).with(/^java -Xmx1024m/).and_return(true)
|
57
|
+
|
58
|
+
subject.perform
|
59
|
+
end
|
60
|
+
|
61
|
+
|
52
62
|
it "raises an error if misconfigured" do
|
53
63
|
Rails.configuration.stub(:requirejs_optimizer_runtime).and_return(:asdfasdf)
|
54
64
|
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: requirejs_optimizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jesse Trimble
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-09-13 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,17 +27,15 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rspec
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
description: A tool for optimizing Require.js modules using r.js under the asset pipeline.
|
@@ -151,27 +146,26 @@ files:
|
|
151
146
|
- spec/spec_helper.rb
|
152
147
|
homepage: ''
|
153
148
|
licenses: []
|
149
|
+
metadata: {}
|
154
150
|
post_install_message:
|
155
151
|
rdoc_options: []
|
156
152
|
require_paths:
|
157
153
|
- lib
|
158
154
|
required_ruby_version: !ruby/object:Gem::Requirement
|
159
|
-
none: false
|
160
155
|
requirements:
|
161
|
-
- -
|
156
|
+
- - '>='
|
162
157
|
- !ruby/object:Gem::Version
|
163
158
|
version: '0'
|
164
159
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
|
-
none: false
|
166
160
|
requirements:
|
167
|
-
- -
|
161
|
+
- - '>='
|
168
162
|
- !ruby/object:Gem::Version
|
169
163
|
version: '0'
|
170
164
|
requirements: []
|
171
165
|
rubyforge_project:
|
172
|
-
rubygems_version:
|
166
|
+
rubygems_version: 2.0.3
|
173
167
|
signing_key:
|
174
|
-
specification_version:
|
168
|
+
specification_version: 4
|
175
169
|
summary: A tool for optimizing Require.js modules using r.js under the asset pipeline.
|
176
170
|
test_files:
|
177
171
|
- spec/integrations/rake_task_spec.rb
|