glow 0.0.1 → 0.0.2
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/lib/glow/filter.rb
CHANGED
@@ -10,8 +10,8 @@ module Glow
|
|
10
10
|
def flash_to_headers
|
11
11
|
return unless flash.any? && request.xhr?
|
12
12
|
type, message = flash.first
|
13
|
-
response.headers['X-Message'] = message.unpack('U*').map{ |i| "&##{i};" }.join
|
14
|
-
response.headers['X-Message-Type'] = type
|
13
|
+
response.headers['X-Message'] = message.to_s.unpack('U*').map{ |i| "&##{i};" }.join
|
14
|
+
response.headers['X-Message-Type'] = type.to_s
|
15
15
|
flash.discard # don't want the flash to appear when you reload page
|
16
16
|
end
|
17
17
|
end
|
data/lib/glow/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -1033,3 +1033,79 @@ Started GET "/javascripts/controls.js" for 127.0.0.1 at 2011-08-29 16:05:13 +020
|
|
1033
1033
|
|
1034
1034
|
|
1035
1035
|
Started GET "/javascripts/rails.js" for 127.0.0.1 at 2011-08-29 16:05:13 +0200
|
1036
|
+
Processing by FlashController#redirect as HTML
|
1037
|
+
Parameters: {"message"=>"Glow!", "type"=>:notice}
|
1038
|
+
Redirected to http://test.host/flash
|
1039
|
+
Completed 302 Found in 2ms
|
1040
|
+
Processing by FlashController#ajax as JS
|
1041
|
+
Parameters: {"message"=>"Glow!", "type"=>:notice}
|
1042
|
+
Completed 200 OK in 90ms (Views: 89.3ms)
|
1043
|
+
Processing by FlashController#ajax as JS
|
1044
|
+
Parameters: {"message"=>"utf8: ✓", "type"=>:notice}
|
1045
|
+
Completed 200 OK in 3ms (Views: 2.2ms)
|
1046
|
+
|
1047
|
+
|
1048
|
+
Started GET "/" for 127.0.0.1 at 2011-08-30 16:08:32 +0200
|
1049
|
+
Processing by FlashController#show as HTML
|
1050
|
+
Completed 200 OK in 27ms (Views: 26.5ms)
|
1051
|
+
|
1052
|
+
|
1053
|
+
Started GET "/flash/notice?message=utf8%3A+%E2%9C%93+" for 127.0.0.1 at 2011-08-30 16:08:32 +0200
|
1054
|
+
Processing by FlashController#redirect as HTML
|
1055
|
+
Parameters: {"message"=>"utf8: ✓ ", "type"=>"notice"}
|
1056
|
+
Redirected to http://127.0.0.1:62426/flash
|
1057
|
+
Completed 302 Found in 3ms
|
1058
|
+
|
1059
|
+
|
1060
|
+
Started GET "/flash" for 127.0.0.1 at 2011-08-30 16:08:32 +0200
|
1061
|
+
Processing by FlashController#show as HTML
|
1062
|
+
Completed 200 OK in 5ms (Views: 5.2ms)
|
1063
|
+
|
1064
|
+
|
1065
|
+
Started GET "/" for 127.0.0.1 at 2011-08-30 16:08:46 +0200
|
1066
|
+
Processing by FlashController#show as HTML
|
1067
|
+
Completed 200 OK in 7ms (Views: 6.3ms)
|
1068
|
+
|
1069
|
+
|
1070
|
+
Started GET "/flashajax/notice.js?message=jquery+utf8%3A+%E2%9C%93" for 127.0.0.1 at 2011-08-30 16:08:46 +0200
|
1071
|
+
Processing by FlashController#ajax as JS
|
1072
|
+
Parameters: {"message"=>"jquery utf8: ✓", "type"=>"notice"}
|
1073
|
+
Completed 200 OK in 3ms (Views: 2.3ms)
|
1074
|
+
Processing by FlashController#redirect as HTML
|
1075
|
+
Parameters: {"message"=>"Glow!", "type"=>:notice}
|
1076
|
+
Redirected to http://test.host/flash
|
1077
|
+
Completed 302 Found in 2ms
|
1078
|
+
Processing by FlashController#ajax as JS
|
1079
|
+
Parameters: {"message"=>"Glow!", "type"=>:notice}
|
1080
|
+
Completed 200 OK in 62ms (Views: 60.8ms)
|
1081
|
+
Processing by FlashController#ajax as JS
|
1082
|
+
Parameters: {"message"=>"utf8: ✓", "type"=>:notice}
|
1083
|
+
Completed 200 OK in 3ms (Views: 2.2ms)
|
1084
|
+
|
1085
|
+
|
1086
|
+
Started GET "/" for 127.0.0.1 at 2011-08-30 16:10:41 +0200
|
1087
|
+
Processing by FlashController#show as HTML
|
1088
|
+
Completed 200 OK in 14ms (Views: 13.3ms)
|
1089
|
+
|
1090
|
+
|
1091
|
+
Started GET "/flash/notice?message=utf8%3A+%E2%9C%93+" for 127.0.0.1 at 2011-08-30 16:10:42 +0200
|
1092
|
+
Processing by FlashController#redirect as HTML
|
1093
|
+
Parameters: {"message"=>"utf8: ✓ ", "type"=>"notice"}
|
1094
|
+
Redirected to http://127.0.0.1:62518/flash
|
1095
|
+
Completed 302 Found in 2ms
|
1096
|
+
|
1097
|
+
|
1098
|
+
Started GET "/flash" for 127.0.0.1 at 2011-08-30 16:10:42 +0200
|
1099
|
+
Processing by FlashController#show as HTML
|
1100
|
+
Completed 200 OK in 5ms (Views: 5.3ms)
|
1101
|
+
|
1102
|
+
|
1103
|
+
Started GET "/" for 127.0.0.1 at 2011-08-30 16:10:44 +0200
|
1104
|
+
Processing by FlashController#show as HTML
|
1105
|
+
Completed 200 OK in 6ms (Views: 6.0ms)
|
1106
|
+
|
1107
|
+
|
1108
|
+
Started GET "/flashajax/notice.js?message=jquery+utf8%3A+%E2%9C%93" for 127.0.0.1 at 2011-08-30 16:10:44 +0200
|
1109
|
+
Processing by FlashController#ajax as JS
|
1110
|
+
Parameters: {"message"=>"jquery utf8: ✓", "type"=>"notice"}
|
1111
|
+
Completed 200 OK in 3ms (Views: 2.3ms)
|
@@ -21,13 +21,13 @@ describe FlashController do
|
|
21
21
|
flash[:notice].should be == 'Glow!'
|
22
22
|
flash.discard?(:notice).should be true
|
23
23
|
|
24
|
-
@response.headers['X-Message-Type'].should be
|
24
|
+
@response.headers['X-Message-Type'].should be == 'notice'
|
25
25
|
HTMLEntities.new.decode(@response.headers['X-Message']).should be == 'Glow!'
|
26
26
|
end
|
27
27
|
|
28
28
|
it "should handle unicode on xhr" do
|
29
29
|
xhr :get, :ajax, type: :notice, message: 'utf8: ✓'
|
30
|
-
@response.headers['X-Message-Type'].should be
|
30
|
+
@response.headers['X-Message-Type'].should be == 'notice'
|
31
31
|
HTMLEntities.new.decode(@response.headers['X-Message']).should be == 'utf8: ✓'
|
32
32
|
end
|
33
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ date: 2011-08-30 00:00:00.000000000Z
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
|
-
requirement: &
|
17
|
+
requirement: &70198322186500 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 3.0.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70198322186500
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: jquery-rails
|
28
|
-
requirement: &
|
28
|
+
requirement: &70198322168060 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70198322168060
|
37
37
|
description: ! ' Handles Flash messages in Javascript for Rails xhr-responses.
|
38
38
|
Fires a dom event when flash messages are present.
|
39
39
|
|
@@ -99,7 +99,6 @@ files:
|
|
99
99
|
- test/dummy/spec/controllers/flash_controller_spec.rb
|
100
100
|
- test/dummy/spec/integration/flash_spec.rb
|
101
101
|
- test/dummy/spec/spec_helper.rb
|
102
|
-
- test/dummy/tmp/pids/server.pid
|
103
102
|
homepage: https://github.com/zweitag/glow
|
104
103
|
licenses: []
|
105
104
|
post_install_message:
|
@@ -117,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
116
|
version: '0'
|
118
117
|
segments:
|
119
118
|
- 0
|
120
|
-
hash:
|
119
|
+
hash: -4216336577198390940
|
121
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
121
|
none: false
|
123
122
|
requirements:
|
@@ -126,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
125
|
version: '0'
|
127
126
|
segments:
|
128
127
|
- 0
|
129
|
-
hash:
|
128
|
+
hash: -4216336577198390940
|
130
129
|
requirements: []
|
131
130
|
rubyforge_project:
|
132
131
|
rubygems_version: 1.8.9
|
@@ -177,4 +176,3 @@ test_files:
|
|
177
176
|
- test/dummy/spec/controllers/flash_controller_spec.rb
|
178
177
|
- test/dummy/spec/integration/flash_spec.rb
|
179
178
|
- test/dummy/spec/spec_helper.rb
|
180
|
-
- test/dummy/tmp/pids/server.pid
|
@@ -1 +0,0 @@
|
|
1
|
-
4820
|