flashee 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -1
- data/lib/flashee/version.rb +1 -1
- data/lib/generators/flashee/install/bootstrap_generator.rb +36 -0
- data/lib/generators/flashee/install/bulma_generator.rb +36 -0
- data/lib/generators/flashee/install/foundation_generator.rb +36 -0
- data/lib/templates/_flash_messages_foundation.html.erb +5 -0
- data/lib/templates/flashee_bootstrap_helper.rb +16 -0
- data/lib/templates/flashee_bulma_helper.rb +16 -0
- data/lib/templates/flashee_foundation_helper.rb +16 -0
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10a3abf3d286902e516703192962bc9c20ab0ace855e77628c0bdce5ec607a9b
|
4
|
+
data.tar.gz: 51fbea15a0f8b04c5dea43c130c9a4c79b86bb2bbbc36f20d8895dc8f29b8e69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3cca6b92c48df5743e395a8b97d6b62088f669ba80cf42cc1e0f4f93ec88e29016e808a1e98f430dc79c2400eefd38706d1b0396b2371b45369db76937e33f6
|
7
|
+
data.tar.gz: 764420fe30a5c2faaea8fd3583777a05dae50b570b17c7a1dc49e7d8008dc2d00ae8949e4d45f0303bdab0310f0725b9c2de7de015f148915c2afabd2dc14c4d
|
data/README.md
CHANGED
@@ -18,17 +18,34 @@ Or install it yourself as:
|
|
18
18
|
```bash
|
19
19
|
$ gem install flashee
|
20
20
|
```
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
21
24
|
Once flashee is installed, run the install generator to setup required files:
|
22
25
|
```bash
|
23
26
|
$ rails g flashee:install
|
24
27
|
```
|
25
28
|
|
29
|
+
There are several sub-generators to use if you are using a CSS framework.
|
30
|
+
|
31
|
+
```bash
|
32
|
+
# bootstrap
|
33
|
+
$ rails g flashee:install:boostrap
|
34
|
+
|
35
|
+
# foundation
|
36
|
+
$ rails g flashee:install:foundation
|
37
|
+
|
38
|
+
# foundation
|
39
|
+
$ rails g flashee:install:bulma
|
40
|
+
```
|
41
|
+
|
26
42
|
After flashee is installed add this line to your application layout:
|
27
43
|
```erb
|
28
44
|
<%= render partial: "partials/flash_messages", flash: flash %>
|
29
45
|
```
|
30
46
|
|
31
|
-
##
|
47
|
+
## Configuration
|
48
|
+
|
32
49
|
Once flashee is installed, open up `app/helpers/flashee_helper.rb`
|
33
50
|
and you can add what CSS classes get rendered for each flash type.
|
34
51
|
you can also append for flash types as you see fit. The aim of flashee
|
data/lib/flashee/version.rb
CHANGED
@@ -0,0 +1,36 @@
|
|
1
|
+
module Flashee
|
2
|
+
module Generators
|
3
|
+
module Install
|
4
|
+
class BootstrapGenerator < Rails::Generators::Base
|
5
|
+
|
6
|
+
desc "install helper file"
|
7
|
+
def copy_helper
|
8
|
+
helper_source = File.join(Gem.loaded_specs["flashee"].full_gem_path, "lib", "templates", "flashee_bootstrap_helper.rb")
|
9
|
+
helper_target = File.join(Rails.root, "app", "helpers", "flashee_helper.rb")
|
10
|
+
|
11
|
+
FileUtils.cp_r helper_source, helper_target
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "install parital"
|
15
|
+
def copy_partial
|
16
|
+
view_partial_source = File.join(Gem.loaded_specs["flashee"].full_gem_path, "lib", "templates", "_flash_messages.html.erb")
|
17
|
+
view_partial_target = File.join(Rails.root, "app", "views", "partials", "_flash_messages.html.erb")
|
18
|
+
|
19
|
+
FileUtils::mkdir_p File.join(Rails.root, "app", "views", "partials")
|
20
|
+
FileUtils.cp_r view_partial_source, view_partial_target
|
21
|
+
end
|
22
|
+
|
23
|
+
# Print post install info
|
24
|
+
def print_post_install_info
|
25
|
+
puts "==================================================================="
|
26
|
+
puts "# One more step to go, To render the #"
|
27
|
+
puts "# flash messages, you will need to add #"
|
28
|
+
puts "# this line to application.html.erb. #"
|
29
|
+
puts "# #"
|
30
|
+
puts '# <%= render partial: "partials/flash_messages", flash: flash %> #'
|
31
|
+
puts "==================================================================="
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Flashee
|
2
|
+
module Generators
|
3
|
+
module Install
|
4
|
+
class BulmaGenerator < Rails::Generators::Base
|
5
|
+
|
6
|
+
desc "install helper file"
|
7
|
+
def copy_helper
|
8
|
+
helper_source = File.join(Gem.loaded_specs["flashee"].full_gem_path, "lib", "templates", "flashee_bulma_helper.rb")
|
9
|
+
helper_target = File.join(Rails.root, "app", "helpers", "flashee_helper.rb")
|
10
|
+
|
11
|
+
FileUtils.cp_r helper_source, helper_target
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "install parital"
|
15
|
+
def copy_partial
|
16
|
+
view_partial_source = File.join(Gem.loaded_specs["flashee"].full_gem_path, "lib", "templates", "_flash_messages.html.erb")
|
17
|
+
view_partial_target = File.join(Rails.root, "app", "views", "partials", "_flash_messages.html.erb")
|
18
|
+
|
19
|
+
FileUtils::mkdir_p File.join(Rails.root, "app", "views", "partials")
|
20
|
+
FileUtils.cp_r view_partial_source, view_partial_target
|
21
|
+
end
|
22
|
+
|
23
|
+
# Print post install info
|
24
|
+
def print_post_install_info
|
25
|
+
puts "==================================================================="
|
26
|
+
puts "# One more step to go, To render the #"
|
27
|
+
puts "# flash messages, you will need to add #"
|
28
|
+
puts "# this line to application.html.erb. #"
|
29
|
+
puts "# #"
|
30
|
+
puts '# <%= render partial: "partials/flash_messages", flash: flash %> #'
|
31
|
+
puts "==================================================================="
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Flashee
|
2
|
+
module Generators
|
3
|
+
module Install
|
4
|
+
class FoundationGenerator < Rails::Generators::Base
|
5
|
+
|
6
|
+
desc "install helper file"
|
7
|
+
def copy_helper
|
8
|
+
helper_source = File.join(Gem.loaded_specs["flashee"].full_gem_path, "lib", "templates", "flashee_foundation_helper.rb")
|
9
|
+
helper_target = File.join(Rails.root, "app", "helpers", "flashee_helper.rb")
|
10
|
+
|
11
|
+
FileUtils.cp_r helper_source, helper_target
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "install parital"
|
15
|
+
def copy_partial
|
16
|
+
view_partial_source = File.join(Gem.loaded_specs["flashee"].full_gem_path, "lib", "templates", "_flash_messages_foundation.html.erb")
|
17
|
+
view_partial_target = File.join(Rails.root, "app", "views", "partials", "_flash_messages.html.erb")
|
18
|
+
|
19
|
+
FileUtils::mkdir_p File.join(Rails.root, "app", "views", "partials")
|
20
|
+
FileUtils.cp_r view_partial_source, view_partial_target
|
21
|
+
end
|
22
|
+
|
23
|
+
# Print post install info
|
24
|
+
def print_post_install_info
|
25
|
+
puts "==================================================================="
|
26
|
+
puts "# One more step to go, To render the #"
|
27
|
+
puts "# flash messages, you will need to add #"
|
28
|
+
puts "# this line to application.html.erb. #"
|
29
|
+
puts "# #"
|
30
|
+
puts '# <%= render partial: "partials/flash_messages", flash: flash %> #'
|
31
|
+
puts "==================================================================="
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module FlasheeHelper
|
2
|
+
def flashee_for flash_type
|
3
|
+
case flash_type.to_s
|
4
|
+
when "success"
|
5
|
+
"alert alert-success"
|
6
|
+
when "error"
|
7
|
+
"alert alert-danger"
|
8
|
+
when "alert"
|
9
|
+
"alert alert-warning"
|
10
|
+
when "info"
|
11
|
+
"alert alert-primary"
|
12
|
+
else
|
13
|
+
flash_type.to_s
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module FlasheeHelper
|
2
|
+
def flashee_for flash_type
|
3
|
+
case flash_type.to_s
|
4
|
+
when "success"
|
5
|
+
"notification is-success"
|
6
|
+
when "error"
|
7
|
+
"notification is-danger"
|
8
|
+
when "alert"
|
9
|
+
"notification is-warning"
|
10
|
+
when "info"
|
11
|
+
"notification is-primary"
|
12
|
+
else
|
13
|
+
flash_type.to_s
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module FlasheeHelper
|
2
|
+
def flashee_for flash_type
|
3
|
+
case flash_type.to_s
|
4
|
+
when "success"
|
5
|
+
"alert-box success"
|
6
|
+
when "error"
|
7
|
+
"alert-box alert"
|
8
|
+
when "alert"
|
9
|
+
"alert-box warning"
|
10
|
+
when "info"
|
11
|
+
"alert-box info"
|
12
|
+
else
|
13
|
+
flash_type.to_s
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flashee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Burns
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -50,8 +50,15 @@ files:
|
|
50
50
|
- lib/flashee.rb
|
51
51
|
- lib/flashee/railtie.rb
|
52
52
|
- lib/flashee/version.rb
|
53
|
+
- lib/generators/flashee/install/bootstrap_generator.rb
|
54
|
+
- lib/generators/flashee/install/bulma_generator.rb
|
55
|
+
- lib/generators/flashee/install/foundation_generator.rb
|
53
56
|
- lib/generators/flashee/install_generator.rb
|
54
57
|
- lib/templates/_flash_messages.html.erb
|
58
|
+
- lib/templates/_flash_messages_foundation.html.erb
|
59
|
+
- lib/templates/flashee_bootstrap_helper.rb
|
60
|
+
- lib/templates/flashee_bulma_helper.rb
|
61
|
+
- lib/templates/flashee_foundation_helper.rb
|
55
62
|
- lib/templates/flashee_helper.rb
|
56
63
|
homepage: https://github.com/jbernsie/flashee
|
57
64
|
licenses:
|