flash_rails_messages 1.0.2 → 2.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d34e51cefa9bf03973968aa55f0ec71f09d6a8ecc4af77de92b8951225e4fb7
4
- data.tar.gz: 4ed93fa14bff5142a6793e34a70824d16281452c7873b632dd0b057b8d994246
3
+ metadata.gz: 50dcc71888ef680be0e9596e6ffdc4009288abe1a9f9112e67de48a261e0512b
4
+ data.tar.gz: cb30d724c044b9ccdb90409bc0885eef49ea9f65c4507cf7195393ec9364d0f3
5
5
  SHA512:
6
- metadata.gz: 711cea756ca82aec6d54f63eb1f027b7b51d0d8aa2fa4735f1e7902afc0ff43eb351f9b7f3dc9181007bc293d6e9e9afd2f660bdea6c2e52605648bfbe67a6f2
7
- data.tar.gz: dc7daa65ffbf606f1e8d774677c30c7d9239ce29d0b146ac82a595855767ee3fc2a94c1baa3a42dd7d3850f29b944471502bf61c88fdedec79cbe4912ae30d53
6
+ metadata.gz: 9f1f08a2b0048cc522d363a2cce87da735a6a38225faa004000734265ce9d75376238ba2528dbbf768fa03afc20a46bee392a2ff3aa91f7888fb3d97d9f3c635
7
+ data.tar.gz: 8d04a2aceb162909dad3e1f55312c093c1536a2500ddf30f309cea66ed5038951150c9dbc1b4861d363c6deed1a32d4c25dc3828e5522a4a9a21aef4bd6f52c9
data/.travis.yml CHANGED
@@ -1,14 +1,15 @@
1
- sudo: false
2
1
  cache: bundler
3
2
  language: ruby
4
3
 
5
4
  rvm:
6
- - 2.5.5
7
- - 2.6.3
5
+ - 2.6.6
6
+ - 2.7.2
7
+ - 3.0.0
8
8
 
9
9
  before_install:
10
- - gem install bundler -v 2.0.2
10
+ - gem install bundler -v 2.2.3
11
11
 
12
12
  gemfile:
13
13
  - gemfiles/rails_5.2.gemfile
14
14
  - gemfiles/rails_6.0.gemfile
15
+ - gemfiles/rails_6.1.gemfile
data/Appraisals CHANGED
@@ -1,7 +1,11 @@
1
1
  appraise 'rails-5.2' do
2
- gem 'rails', '~> 5.2'
2
+ gem 'rails', '~> 5.2.0'
3
3
  end
4
4
 
5
5
  appraise 'rails-6.0' do
6
- gem 'rails', '~> 6.0'
6
+ gem 'rails', '~> 6.0.0'
7
+ end
8
+
9
+ appraise 'rails-6.1' do
10
+ gem 'rails', '~> 6.1.0'
7
11
  end
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  [![Build Status](https://travis-ci.com/alejandrodevs/flash_rails_messages.svg?branch=master)](https://travis-ci.org/alejandrodevs/flash_rails_messages) [![Coverage Status](https://coveralls.io/repos/github/alejandrodevs/flash_rails_messages/badge.svg?branch=master)](https://coveralls.io/github/alejandrodevs/flash_rails_messages?branch=master)
3
3
 
4
4
  This gem provides an easy and simple way to display flash rails messages.
5
- This works with [Bootstrap](http://getbootstrap.com/) and [Zurb Foundation 3](http://foundation.zurb.com/) frameworks.
5
+ This works with [Bootstrap 4+](http://getbootstrap.com/) and [Zurb Foundation 6+](http://foundation.zurb.com/) frameworks.
6
6
 
7
7
  ## Installation
8
8
 
@@ -20,22 +20,22 @@ Or install it yourself as:
20
20
 
21
21
  $ gem install flash_rails_messages
22
22
 
23
- ### Bootstrap
23
+ ### Bootstrap 4+
24
24
 
25
25
  To integrate **FlashRailsMessages** with [Bootstrap](http://getbootstrap.com/) run the next:
26
26
 
27
- ```console
27
+ ```
28
28
  rails generate flash_rails_messages:install --bootstrap
29
29
  ```
30
30
 
31
31
  NOTE: Be sure that you added Bootstrap to your application.
32
32
 
33
33
 
34
- ### Zurb Foundation 3
34
+ ### Zurb Foundation 6+
35
35
 
36
36
  To integrate **FlashRailsMessages** with [Zurb Foundation 3](http://foundation.zurb.com/) run the next:
37
37
 
38
- ```console
38
+ ```
39
39
  rails generate flash_rails_messages:install --foundation
40
40
  ```
41
41
 
@@ -49,6 +49,18 @@ You just need to add the line below in your layout:
49
49
  <%= render_flash_messages %>
50
50
  ```
51
51
 
52
+ ### Dismissible alerts
53
+
54
+ ```erb
55
+ <%= render_flash_messages dismissible: true %>
56
+ ```
57
+
58
+ ### Passing other options
59
+
60
+ ```erb
61
+ <%= render_flash_messages dismissible: true, id: 'my-alert', class: 'custom-class' %>
62
+ ```
63
+
52
64
  ## Development
53
65
 
54
66
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -25,11 +25,11 @@ Gem::Specification.new do |spec|
25
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
26
  spec.require_paths = ['lib']
27
27
 
28
- spec.add_development_dependency 'rake', '~> 12.0'
29
- spec.add_development_dependency 'rspec', '~> 3.8'
28
+ spec.add_development_dependency 'rake', '~> 13.0'
29
+ spec.add_development_dependency 'rspec', '~> 3.10'
30
30
  spec.add_development_dependency 'bundler', '~> 2.0'
31
- spec.add_development_dependency 'appraisal', '~> 2.2'
31
+ spec.add_development_dependency 'appraisal', '~> 2.4'
32
32
  spec.add_development_dependency 'coveralls', '~> 0.8'
33
33
 
34
- spec.add_dependency 'rails', '>= 4.2'
34
+ spec.add_dependency 'rails', '>= 5.2'
35
35
  end
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_RETRY: "1"
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 5.2"
5
+ gem "rails", "~> 5.2.0"
6
6
 
7
7
  gemspec path: "../"
@@ -1,165 +1,167 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- flash_rails_messages (1.0.2)
5
- rails (>= 4.2)
4
+ flash_rails_messages (2.2.0)
5
+ rails (>= 5.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (5.2.3)
11
- actionpack (= 5.2.3)
10
+ actioncable (5.2.5)
11
+ actionpack (= 5.2.5)
12
12
  nio4r (~> 2.0)
13
13
  websocket-driver (>= 0.6.1)
14
- actionmailer (5.2.3)
15
- actionpack (= 5.2.3)
16
- actionview (= 5.2.3)
17
- activejob (= 5.2.3)
14
+ actionmailer (5.2.5)
15
+ actionpack (= 5.2.5)
16
+ actionview (= 5.2.5)
17
+ activejob (= 5.2.5)
18
18
  mail (~> 2.5, >= 2.5.4)
19
19
  rails-dom-testing (~> 2.0)
20
- actionpack (5.2.3)
21
- actionview (= 5.2.3)
22
- activesupport (= 5.2.3)
23
- rack (~> 2.0)
20
+ actionpack (5.2.5)
21
+ actionview (= 5.2.5)
22
+ activesupport (= 5.2.5)
23
+ rack (~> 2.0, >= 2.0.8)
24
24
  rack-test (>= 0.6.3)
25
25
  rails-dom-testing (~> 2.0)
26
26
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
- actionview (5.2.3)
28
- activesupport (= 5.2.3)
27
+ actionview (5.2.5)
28
+ activesupport (= 5.2.5)
29
29
  builder (~> 3.1)
30
30
  erubi (~> 1.4)
31
31
  rails-dom-testing (~> 2.0)
32
32
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
- activejob (5.2.3)
34
- activesupport (= 5.2.3)
33
+ activejob (5.2.5)
34
+ activesupport (= 5.2.5)
35
35
  globalid (>= 0.3.6)
36
- activemodel (5.2.3)
37
- activesupport (= 5.2.3)
38
- activerecord (5.2.3)
39
- activemodel (= 5.2.3)
40
- activesupport (= 5.2.3)
36
+ activemodel (5.2.5)
37
+ activesupport (= 5.2.5)
38
+ activerecord (5.2.5)
39
+ activemodel (= 5.2.5)
40
+ activesupport (= 5.2.5)
41
41
  arel (>= 9.0)
42
- activestorage (5.2.3)
43
- actionpack (= 5.2.3)
44
- activerecord (= 5.2.3)
45
- marcel (~> 0.3.1)
46
- activesupport (5.2.3)
42
+ activestorage (5.2.5)
43
+ actionpack (= 5.2.5)
44
+ activerecord (= 5.2.5)
45
+ marcel (~> 1.0.0)
46
+ activesupport (5.2.5)
47
47
  concurrent-ruby (~> 1.0, >= 1.0.2)
48
48
  i18n (>= 0.7, < 2)
49
49
  minitest (~> 5.1)
50
50
  tzinfo (~> 1.1)
51
- appraisal (2.2.0)
51
+ appraisal (2.4.0)
52
52
  bundler
53
53
  rake
54
54
  thor (>= 0.14.0)
55
55
  arel (9.0.0)
56
- builder (3.2.3)
57
- concurrent-ruby (1.1.5)
56
+ builder (3.2.4)
57
+ concurrent-ruby (1.1.8)
58
58
  coveralls (0.8.23)
59
59
  json (>= 1.8, < 3)
60
60
  simplecov (~> 0.16.1)
61
61
  term-ansicolor (~> 1.3)
62
62
  thor (>= 0.19.4, < 2.0)
63
63
  tins (~> 1.6)
64
- crass (1.0.4)
65
- diff-lcs (1.3)
66
- docile (1.3.2)
67
- erubi (1.8.0)
64
+ crass (1.0.6)
65
+ diff-lcs (1.4.4)
66
+ docile (1.3.5)
67
+ erubi (1.10.0)
68
68
  globalid (0.4.2)
69
69
  activesupport (>= 4.2.0)
70
- i18n (1.6.0)
70
+ i18n (1.8.10)
71
71
  concurrent-ruby (~> 1.0)
72
- json (2.2.0)
73
- loofah (2.2.3)
72
+ json (2.5.1)
73
+ loofah (2.9.0)
74
74
  crass (~> 1.0.2)
75
75
  nokogiri (>= 1.5.9)
76
76
  mail (2.7.1)
77
77
  mini_mime (>= 0.1.1)
78
- marcel (0.3.3)
79
- mimemagic (~> 0.3.2)
80
- method_source (0.9.2)
81
- mimemagic (0.3.3)
82
- mini_mime (1.0.2)
83
- mini_portile2 (2.4.0)
84
- minitest (5.11.3)
85
- nio4r (2.4.0)
86
- nokogiri (1.10.4)
87
- mini_portile2 (~> 2.4.0)
88
- rack (2.0.7)
78
+ marcel (1.0.1)
79
+ method_source (1.0.0)
80
+ mini_mime (1.1.0)
81
+ mini_portile2 (2.5.0)
82
+ minitest (5.14.4)
83
+ nio4r (2.5.7)
84
+ nokogiri (1.11.2)
85
+ mini_portile2 (~> 2.5.0)
86
+ racc (~> 1.4)
87
+ racc (1.5.2)
88
+ rack (2.2.3)
89
89
  rack-test (1.1.0)
90
90
  rack (>= 1.0, < 3)
91
- rails (5.2.3)
92
- actioncable (= 5.2.3)
93
- actionmailer (= 5.2.3)
94
- actionpack (= 5.2.3)
95
- actionview (= 5.2.3)
96
- activejob (= 5.2.3)
97
- activemodel (= 5.2.3)
98
- activerecord (= 5.2.3)
99
- activestorage (= 5.2.3)
100
- activesupport (= 5.2.3)
91
+ rails (5.2.5)
92
+ actioncable (= 5.2.5)
93
+ actionmailer (= 5.2.5)
94
+ actionpack (= 5.2.5)
95
+ actionview (= 5.2.5)
96
+ activejob (= 5.2.5)
97
+ activemodel (= 5.2.5)
98
+ activerecord (= 5.2.5)
99
+ activestorage (= 5.2.5)
100
+ activesupport (= 5.2.5)
101
101
  bundler (>= 1.3.0)
102
- railties (= 5.2.3)
102
+ railties (= 5.2.5)
103
103
  sprockets-rails (>= 2.0.0)
104
104
  rails-dom-testing (2.0.3)
105
105
  activesupport (>= 4.2.0)
106
106
  nokogiri (>= 1.6)
107
- rails-html-sanitizer (1.2.0)
108
- loofah (~> 2.2, >= 2.2.2)
109
- railties (5.2.3)
110
- actionpack (= 5.2.3)
111
- activesupport (= 5.2.3)
107
+ rails-html-sanitizer (1.3.0)
108
+ loofah (~> 2.3)
109
+ railties (5.2.5)
110
+ actionpack (= 5.2.5)
111
+ activesupport (= 5.2.5)
112
112
  method_source
113
113
  rake (>= 0.8.7)
114
114
  thor (>= 0.19.0, < 2.0)
115
- rake (12.3.3)
116
- rspec (3.8.0)
117
- rspec-core (~> 3.8.0)
118
- rspec-expectations (~> 3.8.0)
119
- rspec-mocks (~> 3.8.0)
120
- rspec-core (3.8.2)
121
- rspec-support (~> 3.8.0)
122
- rspec-expectations (3.8.4)
115
+ rake (13.0.3)
116
+ rspec (3.10.0)
117
+ rspec-core (~> 3.10.0)
118
+ rspec-expectations (~> 3.10.0)
119
+ rspec-mocks (~> 3.10.0)
120
+ rspec-core (3.10.1)
121
+ rspec-support (~> 3.10.0)
122
+ rspec-expectations (3.10.1)
123
123
  diff-lcs (>= 1.2.0, < 2.0)
124
- rspec-support (~> 3.8.0)
125
- rspec-mocks (3.8.1)
124
+ rspec-support (~> 3.10.0)
125
+ rspec-mocks (3.10.2)
126
126
  diff-lcs (>= 1.2.0, < 2.0)
127
- rspec-support (~> 3.8.0)
128
- rspec-support (3.8.2)
127
+ rspec-support (~> 3.10.0)
128
+ rspec-support (3.10.2)
129
129
  simplecov (0.16.1)
130
130
  docile (~> 1.1)
131
131
  json (>= 1.8, < 3)
132
132
  simplecov-html (~> 0.10.0)
133
133
  simplecov-html (0.10.2)
134
- sprockets (3.7.2)
134
+ sprockets (4.0.2)
135
135
  concurrent-ruby (~> 1.0)
136
136
  rack (> 1, < 3)
137
- sprockets-rails (3.2.1)
137
+ sprockets-rails (3.2.2)
138
138
  actionpack (>= 4.0)
139
139
  activesupport (>= 4.0)
140
140
  sprockets (>= 3.0.0)
141
+ sync (0.5.0)
141
142
  term-ansicolor (1.7.1)
142
143
  tins (~> 1.0)
143
- thor (0.20.3)
144
+ thor (1.1.0)
144
145
  thread_safe (0.3.6)
145
- tins (1.21.1)
146
- tzinfo (1.2.5)
146
+ tins (1.28.0)
147
+ sync
148
+ tzinfo (1.2.9)
147
149
  thread_safe (~> 0.1)
148
- websocket-driver (0.7.1)
150
+ websocket-driver (0.7.3)
149
151
  websocket-extensions (>= 0.1.0)
150
- websocket-extensions (0.1.4)
152
+ websocket-extensions (0.1.5)
151
153
 
152
154
  PLATFORMS
153
155
  ruby
154
156
 
155
157
  DEPENDENCIES
156
- appraisal (~> 2.2)
158
+ appraisal (~> 2.4)
157
159
  bundler (~> 2.0)
158
160
  coveralls (~> 0.8)
159
161
  flash_rails_messages!
160
- rails (~> 5.2)
161
- rake (~> 12.0)
162
- rspec (~> 3.8)
162
+ rails (~> 5.2.0)
163
+ rake (~> 13.0)
164
+ rspec (~> 3.10)
163
165
 
164
166
  BUNDLED WITH
165
- 2.0.2
167
+ 2.2.15
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 6.0"
5
+ gem "rails", "~> 6.0.0"
6
6
 
7
7
  gemspec path: "../"
@@ -1,181 +1,183 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- flash_rails_messages (1.0.2)
5
- rails (>= 4.2)
4
+ flash_rails_messages (2.2.0)
5
+ rails (>= 5.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (6.0.0)
11
- actionpack (= 6.0.0)
10
+ actioncable (6.0.3.6)
11
+ actionpack (= 6.0.3.6)
12
12
  nio4r (~> 2.0)
13
13
  websocket-driver (>= 0.6.1)
14
- actionmailbox (6.0.0)
15
- actionpack (= 6.0.0)
16
- activejob (= 6.0.0)
17
- activerecord (= 6.0.0)
18
- activestorage (= 6.0.0)
19
- activesupport (= 6.0.0)
14
+ actionmailbox (6.0.3.6)
15
+ actionpack (= 6.0.3.6)
16
+ activejob (= 6.0.3.6)
17
+ activerecord (= 6.0.3.6)
18
+ activestorage (= 6.0.3.6)
19
+ activesupport (= 6.0.3.6)
20
20
  mail (>= 2.7.1)
21
- actionmailer (6.0.0)
22
- actionpack (= 6.0.0)
23
- actionview (= 6.0.0)
24
- activejob (= 6.0.0)
21
+ actionmailer (6.0.3.6)
22
+ actionpack (= 6.0.3.6)
23
+ actionview (= 6.0.3.6)
24
+ activejob (= 6.0.3.6)
25
25
  mail (~> 2.5, >= 2.5.4)
26
26
  rails-dom-testing (~> 2.0)
27
- actionpack (6.0.0)
28
- actionview (= 6.0.0)
29
- activesupport (= 6.0.0)
30
- rack (~> 2.0)
27
+ actionpack (6.0.3.6)
28
+ actionview (= 6.0.3.6)
29
+ activesupport (= 6.0.3.6)
30
+ rack (~> 2.0, >= 2.0.8)
31
31
  rack-test (>= 0.6.3)
32
32
  rails-dom-testing (~> 2.0)
33
33
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
34
- actiontext (6.0.0)
35
- actionpack (= 6.0.0)
36
- activerecord (= 6.0.0)
37
- activestorage (= 6.0.0)
38
- activesupport (= 6.0.0)
34
+ actiontext (6.0.3.6)
35
+ actionpack (= 6.0.3.6)
36
+ activerecord (= 6.0.3.6)
37
+ activestorage (= 6.0.3.6)
38
+ activesupport (= 6.0.3.6)
39
39
  nokogiri (>= 1.8.5)
40
- actionview (6.0.0)
41
- activesupport (= 6.0.0)
40
+ actionview (6.0.3.6)
41
+ activesupport (= 6.0.3.6)
42
42
  builder (~> 3.1)
43
43
  erubi (~> 1.4)
44
44
  rails-dom-testing (~> 2.0)
45
45
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
46
- activejob (6.0.0)
47
- activesupport (= 6.0.0)
46
+ activejob (6.0.3.6)
47
+ activesupport (= 6.0.3.6)
48
48
  globalid (>= 0.3.6)
49
- activemodel (6.0.0)
50
- activesupport (= 6.0.0)
51
- activerecord (6.0.0)
52
- activemodel (= 6.0.0)
53
- activesupport (= 6.0.0)
54
- activestorage (6.0.0)
55
- actionpack (= 6.0.0)
56
- activejob (= 6.0.0)
57
- activerecord (= 6.0.0)
58
- marcel (~> 0.3.1)
59
- activesupport (6.0.0)
49
+ activemodel (6.0.3.6)
50
+ activesupport (= 6.0.3.6)
51
+ activerecord (6.0.3.6)
52
+ activemodel (= 6.0.3.6)
53
+ activesupport (= 6.0.3.6)
54
+ activestorage (6.0.3.6)
55
+ actionpack (= 6.0.3.6)
56
+ activejob (= 6.0.3.6)
57
+ activerecord (= 6.0.3.6)
58
+ marcel (~> 1.0.0)
59
+ activesupport (6.0.3.6)
60
60
  concurrent-ruby (~> 1.0, >= 1.0.2)
61
61
  i18n (>= 0.7, < 2)
62
62
  minitest (~> 5.1)
63
63
  tzinfo (~> 1.1)
64
- zeitwerk (~> 2.1, >= 2.1.8)
65
- appraisal (2.2.0)
64
+ zeitwerk (~> 2.2, >= 2.2.2)
65
+ appraisal (2.4.0)
66
66
  bundler
67
67
  rake
68
68
  thor (>= 0.14.0)
69
- builder (3.2.3)
70
- concurrent-ruby (1.1.5)
69
+ builder (3.2.4)
70
+ concurrent-ruby (1.1.8)
71
71
  coveralls (0.8.23)
72
72
  json (>= 1.8, < 3)
73
73
  simplecov (~> 0.16.1)
74
74
  term-ansicolor (~> 1.3)
75
75
  thor (>= 0.19.4, < 2.0)
76
76
  tins (~> 1.6)
77
- crass (1.0.4)
78
- diff-lcs (1.3)
79
- docile (1.3.2)
80
- erubi (1.8.0)
77
+ crass (1.0.6)
78
+ diff-lcs (1.4.4)
79
+ docile (1.3.5)
80
+ erubi (1.10.0)
81
81
  globalid (0.4.2)
82
82
  activesupport (>= 4.2.0)
83
- i18n (1.6.0)
83
+ i18n (1.8.10)
84
84
  concurrent-ruby (~> 1.0)
85
- json (2.2.0)
86
- loofah (2.2.3)
85
+ json (2.5.1)
86
+ loofah (2.9.0)
87
87
  crass (~> 1.0.2)
88
88
  nokogiri (>= 1.5.9)
89
89
  mail (2.7.1)
90
90
  mini_mime (>= 0.1.1)
91
- marcel (0.3.3)
92
- mimemagic (~> 0.3.2)
93
- method_source (0.9.2)
94
- mimemagic (0.3.3)
95
- mini_mime (1.0.2)
96
- mini_portile2 (2.4.0)
97
- minitest (5.11.3)
98
- nio4r (2.4.0)
99
- nokogiri (1.10.4)
100
- mini_portile2 (~> 2.4.0)
101
- rack (2.0.7)
91
+ marcel (1.0.1)
92
+ method_source (1.0.0)
93
+ mini_mime (1.1.0)
94
+ mini_portile2 (2.5.0)
95
+ minitest (5.14.4)
96
+ nio4r (2.5.7)
97
+ nokogiri (1.11.2)
98
+ mini_portile2 (~> 2.5.0)
99
+ racc (~> 1.4)
100
+ racc (1.5.2)
101
+ rack (2.2.3)
102
102
  rack-test (1.1.0)
103
103
  rack (>= 1.0, < 3)
104
- rails (6.0.0)
105
- actioncable (= 6.0.0)
106
- actionmailbox (= 6.0.0)
107
- actionmailer (= 6.0.0)
108
- actionpack (= 6.0.0)
109
- actiontext (= 6.0.0)
110
- actionview (= 6.0.0)
111
- activejob (= 6.0.0)
112
- activemodel (= 6.0.0)
113
- activerecord (= 6.0.0)
114
- activestorage (= 6.0.0)
115
- activesupport (= 6.0.0)
104
+ rails (6.0.3.6)
105
+ actioncable (= 6.0.3.6)
106
+ actionmailbox (= 6.0.3.6)
107
+ actionmailer (= 6.0.3.6)
108
+ actionpack (= 6.0.3.6)
109
+ actiontext (= 6.0.3.6)
110
+ actionview (= 6.0.3.6)
111
+ activejob (= 6.0.3.6)
112
+ activemodel (= 6.0.3.6)
113
+ activerecord (= 6.0.3.6)
114
+ activestorage (= 6.0.3.6)
115
+ activesupport (= 6.0.3.6)
116
116
  bundler (>= 1.3.0)
117
- railties (= 6.0.0)
117
+ railties (= 6.0.3.6)
118
118
  sprockets-rails (>= 2.0.0)
119
119
  rails-dom-testing (2.0.3)
120
120
  activesupport (>= 4.2.0)
121
121
  nokogiri (>= 1.6)
122
- rails-html-sanitizer (1.2.0)
123
- loofah (~> 2.2, >= 2.2.2)
124
- railties (6.0.0)
125
- actionpack (= 6.0.0)
126
- activesupport (= 6.0.0)
122
+ rails-html-sanitizer (1.3.0)
123
+ loofah (~> 2.3)
124
+ railties (6.0.3.6)
125
+ actionpack (= 6.0.3.6)
126
+ activesupport (= 6.0.3.6)
127
127
  method_source
128
128
  rake (>= 0.8.7)
129
129
  thor (>= 0.20.3, < 2.0)
130
- rake (12.3.3)
131
- rspec (3.8.0)
132
- rspec-core (~> 3.8.0)
133
- rspec-expectations (~> 3.8.0)
134
- rspec-mocks (~> 3.8.0)
135
- rspec-core (3.8.2)
136
- rspec-support (~> 3.8.0)
137
- rspec-expectations (3.8.4)
130
+ rake (13.0.3)
131
+ rspec (3.10.0)
132
+ rspec-core (~> 3.10.0)
133
+ rspec-expectations (~> 3.10.0)
134
+ rspec-mocks (~> 3.10.0)
135
+ rspec-core (3.10.1)
136
+ rspec-support (~> 3.10.0)
137
+ rspec-expectations (3.10.1)
138
138
  diff-lcs (>= 1.2.0, < 2.0)
139
- rspec-support (~> 3.8.0)
140
- rspec-mocks (3.8.1)
139
+ rspec-support (~> 3.10.0)
140
+ rspec-mocks (3.10.2)
141
141
  diff-lcs (>= 1.2.0, < 2.0)
142
- rspec-support (~> 3.8.0)
143
- rspec-support (3.8.2)
142
+ rspec-support (~> 3.10.0)
143
+ rspec-support (3.10.2)
144
144
  simplecov (0.16.1)
145
145
  docile (~> 1.1)
146
146
  json (>= 1.8, < 3)
147
147
  simplecov-html (~> 0.10.0)
148
148
  simplecov-html (0.10.2)
149
- sprockets (3.7.2)
149
+ sprockets (4.0.2)
150
150
  concurrent-ruby (~> 1.0)
151
151
  rack (> 1, < 3)
152
- sprockets-rails (3.2.1)
152
+ sprockets-rails (3.2.2)
153
153
  actionpack (>= 4.0)
154
154
  activesupport (>= 4.0)
155
155
  sprockets (>= 3.0.0)
156
+ sync (0.5.0)
156
157
  term-ansicolor (1.7.1)
157
158
  tins (~> 1.0)
158
- thor (0.20.3)
159
+ thor (1.1.0)
159
160
  thread_safe (0.3.6)
160
- tins (1.21.1)
161
- tzinfo (1.2.5)
161
+ tins (1.28.0)
162
+ sync
163
+ tzinfo (1.2.9)
162
164
  thread_safe (~> 0.1)
163
- websocket-driver (0.7.1)
165
+ websocket-driver (0.7.3)
164
166
  websocket-extensions (>= 0.1.0)
165
- websocket-extensions (0.1.4)
166
- zeitwerk (2.1.9)
167
+ websocket-extensions (0.1.5)
168
+ zeitwerk (2.4.2)
167
169
 
168
170
  PLATFORMS
169
171
  ruby
170
172
 
171
173
  DEPENDENCIES
172
- appraisal (~> 2.2)
174
+ appraisal (~> 2.4)
173
175
  bundler (~> 2.0)
174
176
  coveralls (~> 0.8)
175
177
  flash_rails_messages!
176
- rails (~> 6.0)
177
- rake (~> 12.0)
178
- rspec (~> 3.8)
178
+ rails (~> 6.0.0)
179
+ rake (~> 13.0)
180
+ rspec (~> 3.10)
179
181
 
180
182
  BUNDLED WITH
181
- 2.0.2
183
+ 2.2.15
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 6.1.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,186 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ flash_rails_messages (2.2.0)
5
+ rails (>= 5.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (6.1.3.1)
11
+ actionpack (= 6.1.3.1)
12
+ activesupport (= 6.1.3.1)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ actionmailbox (6.1.3.1)
16
+ actionpack (= 6.1.3.1)
17
+ activejob (= 6.1.3.1)
18
+ activerecord (= 6.1.3.1)
19
+ activestorage (= 6.1.3.1)
20
+ activesupport (= 6.1.3.1)
21
+ mail (>= 2.7.1)
22
+ actionmailer (6.1.3.1)
23
+ actionpack (= 6.1.3.1)
24
+ actionview (= 6.1.3.1)
25
+ activejob (= 6.1.3.1)
26
+ activesupport (= 6.1.3.1)
27
+ mail (~> 2.5, >= 2.5.4)
28
+ rails-dom-testing (~> 2.0)
29
+ actionpack (6.1.3.1)
30
+ actionview (= 6.1.3.1)
31
+ activesupport (= 6.1.3.1)
32
+ rack (~> 2.0, >= 2.0.9)
33
+ rack-test (>= 0.6.3)
34
+ rails-dom-testing (~> 2.0)
35
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
+ actiontext (6.1.3.1)
37
+ actionpack (= 6.1.3.1)
38
+ activerecord (= 6.1.3.1)
39
+ activestorage (= 6.1.3.1)
40
+ activesupport (= 6.1.3.1)
41
+ nokogiri (>= 1.8.5)
42
+ actionview (6.1.3.1)
43
+ activesupport (= 6.1.3.1)
44
+ builder (~> 3.1)
45
+ erubi (~> 1.4)
46
+ rails-dom-testing (~> 2.0)
47
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
48
+ activejob (6.1.3.1)
49
+ activesupport (= 6.1.3.1)
50
+ globalid (>= 0.3.6)
51
+ activemodel (6.1.3.1)
52
+ activesupport (= 6.1.3.1)
53
+ activerecord (6.1.3.1)
54
+ activemodel (= 6.1.3.1)
55
+ activesupport (= 6.1.3.1)
56
+ activestorage (6.1.3.1)
57
+ actionpack (= 6.1.3.1)
58
+ activejob (= 6.1.3.1)
59
+ activerecord (= 6.1.3.1)
60
+ activesupport (= 6.1.3.1)
61
+ marcel (~> 1.0.0)
62
+ mini_mime (~> 1.0.2)
63
+ activesupport (6.1.3.1)
64
+ concurrent-ruby (~> 1.0, >= 1.0.2)
65
+ i18n (>= 1.6, < 2)
66
+ minitest (>= 5.1)
67
+ tzinfo (~> 2.0)
68
+ zeitwerk (~> 2.3)
69
+ appraisal (2.4.0)
70
+ bundler
71
+ rake
72
+ thor (>= 0.14.0)
73
+ builder (3.2.4)
74
+ concurrent-ruby (1.1.8)
75
+ coveralls (0.8.23)
76
+ json (>= 1.8, < 3)
77
+ simplecov (~> 0.16.1)
78
+ term-ansicolor (~> 1.3)
79
+ thor (>= 0.19.4, < 2.0)
80
+ tins (~> 1.6)
81
+ crass (1.0.6)
82
+ diff-lcs (1.4.4)
83
+ docile (1.3.5)
84
+ erubi (1.10.0)
85
+ globalid (0.4.2)
86
+ activesupport (>= 4.2.0)
87
+ i18n (1.8.10)
88
+ concurrent-ruby (~> 1.0)
89
+ json (2.5.1)
90
+ loofah (2.9.0)
91
+ crass (~> 1.0.2)
92
+ nokogiri (>= 1.5.9)
93
+ mail (2.7.1)
94
+ mini_mime (>= 0.1.1)
95
+ marcel (1.0.1)
96
+ method_source (1.0.0)
97
+ mini_mime (1.0.3)
98
+ mini_portile2 (2.5.0)
99
+ minitest (5.14.4)
100
+ nio4r (2.5.7)
101
+ nokogiri (1.11.2)
102
+ mini_portile2 (~> 2.5.0)
103
+ racc (~> 1.4)
104
+ racc (1.5.2)
105
+ rack (2.2.3)
106
+ rack-test (1.1.0)
107
+ rack (>= 1.0, < 3)
108
+ rails (6.1.3.1)
109
+ actioncable (= 6.1.3.1)
110
+ actionmailbox (= 6.1.3.1)
111
+ actionmailer (= 6.1.3.1)
112
+ actionpack (= 6.1.3.1)
113
+ actiontext (= 6.1.3.1)
114
+ actionview (= 6.1.3.1)
115
+ activejob (= 6.1.3.1)
116
+ activemodel (= 6.1.3.1)
117
+ activerecord (= 6.1.3.1)
118
+ activestorage (= 6.1.3.1)
119
+ activesupport (= 6.1.3.1)
120
+ bundler (>= 1.15.0)
121
+ railties (= 6.1.3.1)
122
+ sprockets-rails (>= 2.0.0)
123
+ rails-dom-testing (2.0.3)
124
+ activesupport (>= 4.2.0)
125
+ nokogiri (>= 1.6)
126
+ rails-html-sanitizer (1.3.0)
127
+ loofah (~> 2.3)
128
+ railties (6.1.3.1)
129
+ actionpack (= 6.1.3.1)
130
+ activesupport (= 6.1.3.1)
131
+ method_source
132
+ rake (>= 0.8.7)
133
+ thor (~> 1.0)
134
+ rake (13.0.3)
135
+ rspec (3.10.0)
136
+ rspec-core (~> 3.10.0)
137
+ rspec-expectations (~> 3.10.0)
138
+ rspec-mocks (~> 3.10.0)
139
+ rspec-core (3.10.1)
140
+ rspec-support (~> 3.10.0)
141
+ rspec-expectations (3.10.1)
142
+ diff-lcs (>= 1.2.0, < 2.0)
143
+ rspec-support (~> 3.10.0)
144
+ rspec-mocks (3.10.2)
145
+ diff-lcs (>= 1.2.0, < 2.0)
146
+ rspec-support (~> 3.10.0)
147
+ rspec-support (3.10.2)
148
+ simplecov (0.16.1)
149
+ docile (~> 1.1)
150
+ json (>= 1.8, < 3)
151
+ simplecov-html (~> 0.10.0)
152
+ simplecov-html (0.10.2)
153
+ sprockets (4.0.2)
154
+ concurrent-ruby (~> 1.0)
155
+ rack (> 1, < 3)
156
+ sprockets-rails (3.2.2)
157
+ actionpack (>= 4.0)
158
+ activesupport (>= 4.0)
159
+ sprockets (>= 3.0.0)
160
+ sync (0.5.0)
161
+ term-ansicolor (1.7.1)
162
+ tins (~> 1.0)
163
+ thor (1.1.0)
164
+ tins (1.28.0)
165
+ sync
166
+ tzinfo (2.0.4)
167
+ concurrent-ruby (~> 1.0)
168
+ websocket-driver (0.7.3)
169
+ websocket-extensions (>= 0.1.0)
170
+ websocket-extensions (0.1.5)
171
+ zeitwerk (2.4.2)
172
+
173
+ PLATFORMS
174
+ ruby
175
+
176
+ DEPENDENCIES
177
+ appraisal (~> 2.4)
178
+ bundler (~> 2.0)
179
+ coveralls (~> 0.8)
180
+ flash_rails_messages!
181
+ rails (~> 6.1.0)
182
+ rake (~> 13.0)
183
+ rspec (~> 3.10)
184
+
185
+ BUNDLED WITH
186
+ 2.2.15
@@ -1,18 +1,36 @@
1
1
  module FlashRailsMessages
2
2
  class Base
3
- include ActionView::Helpers::TagHelper
4
3
  include ActionView::Context
4
+ include ActionView::Helpers::TagHelper
5
+
6
+ attr_reader :options
7
+
8
+ def initialize(options = {})
9
+ @options = options
10
+ end
5
11
 
6
12
  def render(flash)
7
- flash = Hash[flash].symbolize_keys
8
- flash.map { |message| alert_element(*message) }.join.html_safe
13
+ messages(flash).map do |message|
14
+ alert_element(*message)
15
+ end.join.html_safe
9
16
  end
10
17
 
11
18
  private
12
19
 
20
+ def messages(flash)
21
+ Hash[flash]
22
+ .symbolize_keys
23
+ .keep_if { |key, _| alert_type_classes.include?(key) }
24
+ end
25
+
13
26
  def alert_element(type, message)
14
- content_tag :div, class: alert_classes(type) do
15
- close_element + message.html_safe
27
+ return unless message.respond_to?(:html_safe)
28
+
29
+ content_tag :div, alert_options(type) do
30
+ content = ActiveSupport::SafeBuffer.new
31
+ content += close_element if options.fetch(:dismissible, false)
32
+ content += message.html_safe
33
+ content
16
34
  end
17
35
  end
18
36
 
@@ -22,8 +40,23 @@ module FlashRailsMessages
22
40
  end
23
41
  end
24
42
 
43
+ def alert_options(type)
44
+ default_alert_options
45
+ .merge(options.except(:dismissible))
46
+ .merge(class: alert_classes(type))
47
+ end
48
+
25
49
  def alert_classes(type)
26
- "#{default_alert_classes} #{alert_type_classes[type]} #{custom_alert_classes}".strip
50
+ [
51
+ default_alert_classes,
52
+ alert_type_classes[type],
53
+ custom_alert_classes,
54
+ options[:class]
55
+ ].compact.join(' ').strip
56
+ end
57
+
58
+ def default_alert_options
59
+ {}
27
60
  end
28
61
 
29
62
  def default_alert_classes
@@ -34,7 +67,6 @@ module FlashRailsMessages
34
67
  {}
35
68
  end
36
69
 
37
- def custom_alert_classes
38
- end
70
+ def custom_alert_classes; end
39
71
  end
40
72
  end
@@ -1,7 +1,7 @@
1
1
  module FlashRailsMessages
2
2
  module Helper
3
- def render_flash_messages
4
- FlashRailsMessages::Base.new.render(flash)
3
+ def render_flash_messages(options = {})
4
+ FlashRailsMessages::Base.new(options).render(flash)
5
5
  end
6
6
  end
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module FlashRailsMessages
2
- VERSION = '1.0.2'
2
+ VERSION = '2.3.0'
3
3
  end
@@ -3,11 +3,14 @@ module FlashRailsMessages
3
3
  # BOOTSTRAP FRAMEWORK
4
4
  # =========================================
5
5
 
6
- def alert_element(type, message)
7
- content_tag :div, class: alert_classes(type), role: 'alert' do
8
- close_element + message.html_safe
9
- end
10
- end
6
+ # def alert_element(type, message)
7
+ # content_tag :div, alert_options(type) do
8
+ # content = ActiveSupport::SafeBuffer.new
9
+ # content += close_element if options.fetch(:dismissible, false)
10
+ # content += message.html_safe
11
+ # content
12
+ # end
13
+ # end
11
14
 
12
15
  def close_element
13
16
  content_tag :button, type: 'button', class: 'close', 'data-dismiss': 'alert' do
@@ -16,9 +19,9 @@ module FlashRailsMessages
16
19
  end
17
20
  end
18
21
 
19
- def default_alert_classes
20
- 'alert'
21
- end
22
+ # def default_alert_classes
23
+ # 'alert'
24
+ # end
22
25
 
23
26
  def alert_type_classes
24
27
  {
@@ -30,7 +33,9 @@ module FlashRailsMessages
30
33
  end
31
34
 
32
35
  def custom_alert_classes
33
- 'alert-dismissible'
36
+ if options.fetch(:dismissible, false)
37
+ 'alert-dismissible'
38
+ end
34
39
  end
35
40
  end
36
41
  end
@@ -3,33 +3,41 @@ module FlashRailsMessages
3
3
  # ZURB FOUNDATION FRAMEWORK
4
4
  # =========================================
5
5
 
6
- def alert_element(type, message)
7
- content_tag :div, class: alert_classes(type), 'data-alert': '' do
8
- close_element + message.html_safe
6
+ # def alert_element(type, message)
7
+ # content_tag :div, alert_options(type) do
8
+ # content = ActiveSupport::SafeBuffer.new
9
+ # content += close_element if options.fetch(:dismissible, false)
10
+ # content += message.html_safe
11
+ # content
12
+ # end
13
+ # end
14
+
15
+ def close_element
16
+ content_tag :button, type: 'button', class: 'close-button', 'data-close': '' do
17
+ content_tag(:span, '&times;'.html_safe, 'aria-hidden': 'true')
9
18
  end
10
19
  end
11
20
 
12
- #def close_element
13
- #content_tag :a, class: 'close', href: '#' do
14
- #'&times;'.html_safe
15
- #end
16
- #end
21
+ def default_alert_options
22
+ options.fetch(:dismissible, false) ?
23
+ { 'data-closable': '' } : {}
24
+ end
17
25
 
18
26
  def default_alert_classes
19
- 'alert-box'
27
+ 'callout'
20
28
  end
21
29
 
22
30
  def alert_type_classes
23
31
  {
24
32
  success: 'success',
25
- notice: 'info',
33
+ notice: 'success',
26
34
  alert: 'alert',
27
35
  error: 'alert',
28
36
  }
29
37
  end
30
38
 
31
- #def custom_alert_classes
32
- #Add custom alert classes as a string
33
- #end
39
+ # def custom_alert_classes
40
+ # Add custom alert classes as a string
41
+ # end
34
42
  end
35
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flash_rails_messages
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Gutiérrez
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-26 00:00:00.000000000 Z
11
+ date: 2021-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '12.0'
19
+ version: '13.0'
20
20
  type: :development
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: '12.0'
26
+ version: '13.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.8'
33
+ version: '3.10'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '3.8'
40
+ version: '3.10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.2'
61
+ version: '2.4'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '2.2'
68
+ version: '2.4'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: coveralls
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '4.2'
89
+ version: '5.2'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '4.2'
96
+ version: '5.2'
97
97
  description: This gems provides an easy way to display flash rails messages
98
98
  email:
99
99
  - alejandrodevs@gmail.com
@@ -113,10 +113,13 @@ files:
113
113
  - bin/console
114
114
  - bin/setup
115
115
  - flash_rails_messages.gemspec
116
+ - gemfiles/.bundle/config
116
117
  - gemfiles/rails_5.2.gemfile
117
118
  - gemfiles/rails_5.2.gemfile.lock
118
119
  - gemfiles/rails_6.0.gemfile
119
120
  - gemfiles/rails_6.0.gemfile.lock
121
+ - gemfiles/rails_6.1.gemfile
122
+ - gemfiles/rails_6.1.gemfile.lock
120
123
  - lib/flash_rails_messages.rb
121
124
  - lib/flash_rails_messages/base.rb
122
125
  - lib/flash_rails_messages/helper.rb
@@ -131,7 +134,7 @@ metadata:
131
134
  homepage_uri: https://github.com/alejandrodevs/flash_rails_messages
132
135
  source_code_uri: https://github.com/alejandrodevs/flash_rails_messages
133
136
  changelog_uri: https://github.com/alejandrodevs/flash_rails_messages/blob/master/LICENSE.txt
134
- post_install_message:
137
+ post_install_message:
135
138
  rdoc_options: []
136
139
  require_paths:
137
140
  - lib
@@ -146,8 +149,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
149
  - !ruby/object:Gem::Version
147
150
  version: '0'
148
151
  requirements: []
149
- rubygems_version: 3.0.3
150
- signing_key:
152
+ rubygems_version: 3.2.32
153
+ signing_key:
151
154
  specification_version: 4
152
155
  summary: This gems provides an easy way to display flash rails messages
153
156
  test_files: []