actionpack 3.1.0.rc3 → 3.1.0.rc4
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.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
- data/CHANGELOG +2 -0
- data/lib/action_pack/version.rb +1 -1
- data/lib/action_view/helpers/javascript_helper.rb +2 -1
- data/lib/sprockets/railtie.rb +38 -33
- metadata +10 -10
data/CHANGELOG
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
*Rails 3.1.0 (unreleased)*
|
2
2
|
|
3
|
+
* Make sure escape_js returns SafeBuffer string if it receives SafeBuffer string [Prem Sichanugrist]
|
4
|
+
|
3
5
|
* Fix escape_js to work correctly with the new SafeBuffer restriction [Paul Gallagher]
|
4
6
|
|
5
7
|
* Brought back alternative convention for namespaced models in i18n [thoefer]
|
data/lib/action_pack/version.rb
CHANGED
@@ -18,7 +18,8 @@ module ActionView
|
|
18
18
|
# $('some_element').replaceWith('<%=j render 'some/element_template' %>');
|
19
19
|
def escape_javascript(javascript)
|
20
20
|
if javascript
|
21
|
-
javascript.gsub(/(\\|<\/|\r\n|[\n\r"'])/) {|match| JS_ESCAPE_MAP[match] }
|
21
|
+
result = javascript.gsub(/(\\|<\/|\r\n|[\n\r"'])/) {|match| JS_ESCAPE_MAP[match] }
|
22
|
+
javascript.html_safe? ? result.html_safe : result
|
22
23
|
else
|
23
24
|
''
|
24
25
|
end
|
data/lib/sprockets/railtie.rb
CHANGED
@@ -46,43 +46,48 @@ module Sprockets
|
|
46
46
|
end
|
47
47
|
|
48
48
|
protected
|
49
|
+
def asset_environment(app)
|
50
|
+
require "sprockets"
|
49
51
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
52
|
+
assets = app.config.assets
|
53
|
+
|
54
|
+
env = Sprockets::Environment.new(app.root.to_s)
|
55
|
+
|
56
|
+
env.static_root = File.join(app.root.join("public"), assets.prefix)
|
57
|
+
env.paths.concat assets.paths
|
58
|
+
|
59
|
+
env.logger = Rails.logger
|
60
|
+
|
61
|
+
env.js_compressor = expand_js_compressor(assets.js_compressor)
|
62
|
+
env.css_compressor = expand_css_compressor(assets.css_compressor)
|
61
63
|
|
62
|
-
|
63
|
-
case sym
|
64
|
-
when :closure
|
65
|
-
require 'closure-compiler'
|
66
|
-
Closure::Compiler.new
|
67
|
-
when :uglifier
|
68
|
-
require 'uglifier'
|
69
|
-
Uglifier.new
|
70
|
-
when :yui
|
71
|
-
require 'yui/compressor'
|
72
|
-
YUI::JavaScriptCompressor.new
|
73
|
-
else
|
74
|
-
sym
|
64
|
+
env
|
75
65
|
end
|
76
|
-
end
|
77
66
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
67
|
+
def expand_js_compressor(sym)
|
68
|
+
case sym
|
69
|
+
when :closure
|
70
|
+
require 'closure-compiler'
|
71
|
+
Closure::Compiler.new
|
72
|
+
when :uglifier
|
73
|
+
require 'uglifier'
|
74
|
+
Uglifier.new
|
75
|
+
when :yui
|
76
|
+
require 'yui/compressor'
|
77
|
+
YUI::JavaScriptCompressor.new
|
78
|
+
else
|
79
|
+
sym
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def expand_css_compressor(sym)
|
84
|
+
case sym
|
85
|
+
when :yui
|
86
|
+
require 'yui/compressor'
|
87
|
+
YUI::CssCompressor.new
|
88
|
+
else
|
89
|
+
sym
|
90
|
+
end
|
85
91
|
end
|
86
|
-
end
|
87
92
|
end
|
88
93
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15424109
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
9
|
- 0
|
10
10
|
- rc
|
11
|
-
-
|
12
|
-
version: 3.1.0.
|
11
|
+
- 4
|
12
|
+
version: 3.1.0.rc4
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- David Heinemeier Hansson
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-06-
|
20
|
+
date: 2011-06-09 00:00:00 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: activesupport
|
@@ -27,14 +27,14 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - "="
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
hash:
|
30
|
+
hash: 15424109
|
31
31
|
segments:
|
32
32
|
- 3
|
33
33
|
- 1
|
34
34
|
- 0
|
35
35
|
- rc
|
36
|
-
-
|
37
|
-
version: 3.1.0.
|
36
|
+
- 4
|
37
|
+
version: 3.1.0.rc4
|
38
38
|
type: :runtime
|
39
39
|
version_requirements: *id001
|
40
40
|
- !ruby/object:Gem::Dependency
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
hash:
|
48
|
+
hash: 15424109
|
49
49
|
segments:
|
50
50
|
- 3
|
51
51
|
- 1
|
52
52
|
- 0
|
53
53
|
- rc
|
54
|
-
-
|
55
|
-
version: 3.1.0.
|
54
|
+
- 4
|
55
|
+
version: 3.1.0.rc4
|
56
56
|
type: :runtime
|
57
57
|
version_requirements: *id002
|
58
58
|
- !ruby/object:Gem::Dependency
|