glow 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -5
- data/README.md +5 -13
- data/glow.gemspec +2 -2
- data/lib/glow.rb +1 -5
- data/lib/glow/version.rb +1 -1
- data/spec/controllers/flash_controller_spec.rb +8 -12
- data/spec/dummy/Gemfile +1 -1
- data/spec/features/flash_spec.rb +1 -1
- metadata +6 -8
- data/lib/generators/glow/install/install_generator.rb +0 -19
- data/lib/glow/railtie.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df9186c0da8a8d2ccec64c0dcd5309b750abfa13
|
4
|
+
data.tar.gz: 16c654a7a1cfddde426a0ead6e1afcd9590af6e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 633193f5c7abed31cd56cc1de59497f6e4393d6671d6bd6fbcba14246052545ed018ed2b1047daf727b9d9b8474990871db0a648e5a6bcdcfeb4c7a4fa65ea19
|
7
|
+
data.tar.gz: 195ea5b8ed22967a6177ebeebfec1d0de9574444368632b54cef0ccc57df73c653651d42b7ac9c1855de550b422e9f0f3b992e243edbcd8d7d894b9a90ded46c
|
data/.travis.yml
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
+
language: ruby
|
1
2
|
before_install:
|
2
3
|
- "export DISPLAY=:99.0"
|
3
4
|
- "sh -e /etc/init.d/xvfb start"
|
4
5
|
env:
|
5
|
-
- "RAILS_VERSION=
|
6
|
-
- "RAILS_VERSION=5.
|
7
|
-
- "RAILS_VERSION=5.1.1"
|
6
|
+
- "RAILS_VERSION=5.0.6"
|
7
|
+
- "RAILS_VERSION=5.1.5"
|
8
8
|
rvm:
|
9
|
-
- 2.
|
10
|
-
- 2.3
|
9
|
+
- 2.3.6
|
10
|
+
- 2.4.3
|
11
|
+
- 2.5.0
|
data/README.md
CHANGED
@@ -76,19 +76,7 @@ In your gemfile add
|
|
76
76
|
|
77
77
|
.
|
78
78
|
|
79
|
-
### Rails
|
80
|
-
|
81
|
-
Run
|
82
|
-
|
83
|
-
rails generate glow:install
|
84
|
-
|
85
|
-
Then add
|
86
|
-
|
87
|
-
javascipt_include_tag 'glow'
|
88
|
-
|
89
|
-
to your layout.
|
90
|
-
|
91
|
-
### Rails >=3.1 (including Rails 4)
|
79
|
+
### Rails >= 4
|
92
80
|
|
93
81
|
Add
|
94
82
|
|
@@ -96,6 +84,10 @@ Add
|
|
96
84
|
|
97
85
|
to your manifest.
|
98
86
|
|
87
|
+
### Rails 3
|
88
|
+
|
89
|
+
Please use [v0.0.14](https://github.com/zweitag/glow/tree/v0.0.14)
|
90
|
+
|
99
91
|
## License
|
100
92
|
|
101
93
|
See MIT-LICENSE.
|
data/glow.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.rdoc_options = ['--main', 'README.md', '--charset=UTF-8']
|
25
25
|
s.extra_rdoc_files = ['README.md', 'MIT-LICENSE']
|
26
26
|
|
27
|
-
s.add_dependency "railties", ">=
|
28
|
-
s.add_dependency "actionpack", ">=
|
27
|
+
s.add_dependency "railties", ">= 4.0.0"
|
28
|
+
s.add_dependency "actionpack", ">= 4.0.0"
|
29
29
|
s.add_dependency "jquery-rails"
|
30
30
|
end
|
data/lib/glow.rb
CHANGED
data/lib/glow/version.rb
CHANGED
@@ -3,24 +3,20 @@ require 'spec_helper'
|
|
3
3
|
require 'htmlentities'
|
4
4
|
|
5
5
|
ActionDispatch::Flash::FlashHash.class_eval do
|
6
|
-
|
7
|
-
def discard?(key); @used.include?(key); end
|
8
|
-
else
|
9
|
-
def discard?(key); @discard.include?(key); end
|
10
|
-
end
|
6
|
+
def discard?(key); @discard.include?(key.to_s); end
|
11
7
|
def keep?(key); !discard?(key); end
|
12
8
|
end
|
13
9
|
|
14
|
-
describe FlashController do
|
10
|
+
describe FlashController, type: :controller do
|
15
11
|
it "should display flash message on redirect" do
|
16
|
-
post :redirect, type: :notice, message: 'Glow!'
|
12
|
+
post :redirect, params: { type: :notice, message: 'Glow!' }
|
17
13
|
|
18
14
|
flash[:notice].should be == 'Glow!'
|
19
15
|
flash.keep?(:notice).should be true
|
20
16
|
end
|
21
17
|
|
22
18
|
it "should display flash message on xhr" do
|
23
|
-
|
19
|
+
get :ajax, params: { type: :notice, message: 'Glow!' }, xhr: true
|
24
20
|
|
25
21
|
flash[:notice].should be == 'Glow!'
|
26
22
|
flash.discard?(:notice).should be true
|
@@ -30,18 +26,18 @@ describe FlashController do
|
|
30
26
|
end
|
31
27
|
|
32
28
|
it "should handle unicode on xhr" do
|
33
|
-
|
29
|
+
get :ajax, params: { type: :notice, message: 'utf8: ✓' }, xhr: true
|
34
30
|
@response.headers['X-Message-Type'].should be == 'notice'
|
35
31
|
HTMLEntities.new.decode(@response.headers['X-Message']).should be == 'utf8: ✓'
|
36
32
|
end
|
37
33
|
|
38
34
|
it "should not display flash message on xhr when skip_glow is set" do
|
39
|
-
|
35
|
+
get :ajax, params: { type: :notice, message: 'utf8: ✓', skip_glow: true }, xhr: true
|
40
36
|
@response.headers.should_not have_key 'X-Message-Type'
|
41
37
|
end
|
42
38
|
|
43
39
|
it "should pass flash message on JSON requests" do
|
44
|
-
get :ajax, type: :notice, message: 'Glow!', format: :json
|
40
|
+
get :ajax, params: { type: :notice, message: 'Glow!' }, format: :json
|
45
41
|
|
46
42
|
flash[:notice].should be == 'Glow!'
|
47
43
|
flash.discard?(:notice).should be true
|
@@ -51,7 +47,7 @@ describe FlashController do
|
|
51
47
|
end
|
52
48
|
|
53
49
|
it "should not pass flash message on XML requests" do
|
54
|
-
get :ajax, type: :notice, message: 'Glow!', format: :xml
|
50
|
+
get :ajax, params: { type: :notice, message: 'Glow!' }, format: :xml
|
55
51
|
|
56
52
|
@response.headers['X-Message-Type'].should be_nil
|
57
53
|
@response.headers['X-Message'].should be_nil
|
data/spec/dummy/Gemfile
CHANGED
data/spec/features/flash_spec.rb
CHANGED
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.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Kirsch
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-03-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -17,28 +17,28 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 4.0.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 4.0.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: actionpack
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 4.0.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 4.0.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: jquery-rails
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,11 +70,9 @@ files:
|
|
70
70
|
- README.md
|
71
71
|
- Rakefile
|
72
72
|
- glow.gemspec
|
73
|
-
- lib/generators/glow/install/install_generator.rb
|
74
73
|
- lib/glow.rb
|
75
74
|
- lib/glow/engine.rb
|
76
75
|
- lib/glow/filter.rb
|
77
|
-
- lib/glow/railtie.rb
|
78
76
|
- lib/glow/version.rb
|
79
77
|
- spec/controllers/flash_controller_spec.rb
|
80
78
|
- spec/dummy/.rspec
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'rails'
|
2
|
-
|
3
|
-
module Glow
|
4
|
-
module Generators
|
5
|
-
class InstallGenerator < ::Rails::Generators::Base
|
6
|
-
|
7
|
-
desc "This generator installs glow.js. You must inclu"
|
8
|
-
class_option :ui, :type => :boolean, :default => false, :desc => "Include jQueryUI"
|
9
|
-
source_root File.expand_path('../../../../../vendor/assets/javascripts', __FILE__)
|
10
|
-
|
11
|
-
def copy_glow
|
12
|
-
say_status("copying", "glow", :green)
|
13
|
-
copy_file "glow.js", "public/javascripts/glow.js"
|
14
|
-
say("Please include glow.js in your layout")
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end if ::Rails.version < "3.1"
|
data/lib/glow/railtie.rb
DELETED