flyer 1.0.0 → 1.1.0
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.
- checksums.yaml +4 -4
- data/README.md +9 -2
- data/lib/flyer.rb +1 -0
- data/lib/flyer/configure.rb +12 -0
- data/lib/flyer/controller_additions.rb +5 -0
- data/lib/flyer/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a7568cd9041ad77ced29000063f89ef9c815b0b
|
4
|
+
data.tar.gz: 24e968c8a2f0739f595476775ac26e1b5540e915
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd8a855af7c0f95eecdfc2e061eecee65a8cf3dedfb93c93ed5fc364289cc0ba7bd0066940776d107191446817facf65c5d7fdc4107ea7e765b1b57cff61962c
|
7
|
+
data.tar.gz: 154b49afab88694817a2ae3ff154f310fd77209a30d1f59c16130582dac91bde41c42ed1d731391b8d925b0a465f8d0ab6640ac7c638f2262941f30fc3ece028
|
data/README.md
CHANGED
@@ -10,15 +10,16 @@ Display user notifications in Rails programmatically.
|
|
10
10
|
|
11
11
|
``` ruby
|
12
12
|
# config/initializers/flyer.rb
|
13
|
+
# Use one init block for each notification
|
13
14
|
Flyer::Notification.init do |config|
|
14
15
|
# Unique id. Used to uniquely identify a notification.
|
15
16
|
config.id = "new-user"
|
16
17
|
|
17
18
|
# Message to be passed to view. Is evaluated in the view context.
|
18
|
-
config.message { "Your nickname is #{current_user.nickname}" + icon
|
19
|
+
config.message { "Your nickname is #{current_user.nickname}" + icon("flash") }
|
19
20
|
|
20
21
|
# Optional. Path to be pssed to view. Is evaluated in the controller context.
|
21
|
-
config.path {
|
22
|
+
config.path { root_path }
|
22
23
|
|
23
24
|
# Optional. Only display notification if this blocks evaluates to true
|
24
25
|
# The block is evaluated in the controller context.
|
@@ -34,6 +35,12 @@ Flyer::Notification.init do |config|
|
|
34
35
|
# Optional. Arbitrary data to be passed to view.
|
35
36
|
config.params = { timeout: 10 }
|
36
37
|
end
|
38
|
+
|
39
|
+
# Global configuration
|
40
|
+
Flyer.configure do |config|
|
41
|
+
# Only display one notification at the time
|
42
|
+
config.max_notifications = 1
|
43
|
+
end
|
37
44
|
```
|
38
45
|
|
39
46
|
``` erb
|
data/lib/flyer.rb
CHANGED
data/lib/flyer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flyer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Linus Oleander
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sqlite3
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- README.md
|
92
92
|
- Rakefile
|
93
93
|
- lib/flyer.rb
|
94
|
+
- lib/flyer/configure.rb
|
94
95
|
- lib/flyer/controller_additions.rb
|
95
96
|
- lib/flyer/errors.rb
|
96
97
|
- lib/flyer/notification.rb
|