glow 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/lib/glow/filter.rb +2 -0
- data/lib/glow/version.rb +1 -1
- data/test/rails3/app/controllers/flash_controller.rb +1 -0
- data/test/rails3/spec/controllers/flash_controller_spec.rb +5 -0
- data/test/rails31/Gemfile.lock +1 -1
- data/test/rails31/app/controllers/flash_controller.rb +1 -0
- data/test/rails31/spec/controllers/flash_controller_spec.rb +5 -0
- data/test/rails32/app/controllers/flash_controller.rb +1 -0
- data/test/rails32/spec/controllers/flash_controller_spec.rb +5 -0
- metadata +18 -18
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/glow/filter.rb
CHANGED
@@ -9,6 +9,8 @@ module Glow
|
|
9
9
|
|
10
10
|
def flash_to_headers
|
11
11
|
return unless flash.any? && request.xhr?
|
12
|
+
return if flash[:skip_glow] and flash.delete(:skip_glow)
|
13
|
+
|
12
14
|
type, message = flash.first
|
13
15
|
response.headers['X-Message'] = message.to_s.unpack('U*').map{ |i| "&##{i};" }.join
|
14
16
|
response.headers['X-Message-Type'] = type.to_s
|
data/lib/glow/version.rb
CHANGED
@@ -30,4 +30,9 @@ describe FlashController do
|
|
30
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
|
+
|
34
|
+
it "should not display flash message on xhr when skip_glow is set" do
|
35
|
+
xhr :get, :ajax, type: :notice, message: 'utf8: ✓', skip_glow: true
|
36
|
+
@response.headers.should_not have_key 'X-Message-Type'
|
37
|
+
end
|
33
38
|
end
|
data/test/rails31/Gemfile.lock
CHANGED
@@ -30,4 +30,9 @@ describe FlashController do
|
|
30
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
|
+
|
34
|
+
it "should not display flash message on xhr when skip_glow is set" do
|
35
|
+
xhr :get, :ajax, type: :notice, message: 'utf8: ✓', skip_glow: true
|
36
|
+
@response.headers.should_not have_key 'X-Message-Type'
|
37
|
+
end
|
33
38
|
end
|
@@ -30,4 +30,9 @@ describe FlashController do
|
|
30
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
|
+
|
34
|
+
it "should not display flash message on xhr when skip_glow is set" do
|
35
|
+
xhr :get, :ajax, type: :notice, message: 'utf8: ✓', skip_glow: true
|
36
|
+
@response.headers.should_not have_key 'X-Message-Type'
|
37
|
+
end
|
33
38
|
end
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.11
|
5
4
|
prerelease:
|
5
|
+
version: 0.0.12
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Daniel Kirsch
|
@@ -10,12 +10,10 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-12-
|
13
|
+
date: 2012-12-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
17
|
requirements:
|
20
18
|
- - ! '>='
|
21
19
|
- !ruby/object:Gem::Version
|
@@ -23,10 +21,10 @@ dependencies:
|
|
23
21
|
- - <
|
24
22
|
- !ruby/object:Gem::Version
|
25
23
|
version: 4.0.0
|
26
|
-
type: :runtime
|
27
|
-
prerelease: false
|
28
|
-
version_requirements: !ruby/object:Gem::Requirement
|
29
24
|
none: false
|
25
|
+
prerelease: false
|
26
|
+
name: rails
|
27
|
+
requirement: !ruby/object:Gem::Requirement
|
30
28
|
requirements:
|
31
29
|
- - ! '>='
|
32
30
|
- !ruby/object:Gem::Version
|
@@ -34,22 +32,24 @@ dependencies:
|
|
34
32
|
- - <
|
35
33
|
- !ruby/object:Gem::Version
|
36
34
|
version: 4.0.0
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: jquery-rails
|
39
|
-
requirement: !ruby/object:Gem::Requirement
|
40
35
|
none: false
|
36
|
+
type: :runtime
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
39
|
requirements:
|
42
40
|
- - ! '>='
|
43
41
|
- !ruby/object:Gem::Version
|
44
42
|
version: '0'
|
45
|
-
type: :runtime
|
46
|
-
prerelease: false
|
47
|
-
version_requirements: !ruby/object:Gem::Requirement
|
48
43
|
none: false
|
44
|
+
prerelease: false
|
45
|
+
name: jquery-rails
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
49
47
|
requirements:
|
50
48
|
- - ! '>='
|
51
49
|
- !ruby/object:Gem::Version
|
52
50
|
version: '0'
|
51
|
+
none: false
|
52
|
+
type: :runtime
|
53
53
|
description: ! ' Handles Flash messages in Javascript for Rails xhr-responses.
|
54
54
|
Fires a dom event when flash messages are present.
|
55
55
|
|
@@ -204,23 +204,23 @@ rdoc_options:
|
|
204
204
|
require_paths:
|
205
205
|
- lib
|
206
206
|
required_ruby_version: !ruby/object:Gem::Requirement
|
207
|
-
none: false
|
208
207
|
requirements:
|
209
208
|
- - ! '>='
|
210
209
|
- !ruby/object:Gem::Version
|
211
210
|
version: '0'
|
212
211
|
segments:
|
213
212
|
- 0
|
214
|
-
hash:
|
215
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
|
+
hash: 3382820471934454932
|
216
214
|
none: false
|
215
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
217
216
|
requirements:
|
218
217
|
- - ! '>='
|
219
218
|
- !ruby/object:Gem::Version
|
220
219
|
version: '0'
|
221
220
|
segments:
|
222
221
|
- 0
|
223
|
-
hash:
|
222
|
+
hash: 3382820471934454932
|
223
|
+
none: false
|
224
224
|
requirements: []
|
225
225
|
rubyforge_project:
|
226
226
|
rubygems_version: 1.8.24
|