flash-messenger 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 63c140f3c764215c635dedda6f450cddb3a1267f
4
- data.tar.gz: 65305fe364e9ec851d34c73867a1ec6f6e252248
3
+ metadata.gz: f0c66e2822f9909e4378b685105f345e61008482
4
+ data.tar.gz: 151bb26cb6515143114804decca7a2baeecac8cf
5
5
  SHA512:
6
- metadata.gz: c63bafeb3e0fbf08b7bb30c5ece99b44909ba05738802948b2d4abbd679ac600ee9f61b4a891b848a83ef8c090aad5eb0236c06e2ffced49cf176be0f0716856
7
- data.tar.gz: c8099d599b5769ab103f2820ca089a4d4da51ab8283a40f9de887bed660d9a665c0ee493a1e1e8e3c1424a632db6e9a3e088e7952b2999288f4868e6ae0be9f7
6
+ metadata.gz: 8b7545dce58acc4f89dd44ee88685372bc56ee497f4d5b432748f17d47f97a9b5992b9f2011397505821692237666aeb2c6fbf081f52a4a31654ab3ecd6c172e
7
+ data.tar.gz: c85764f309429ad1537a4055f00596713f6bb7dc61248ea8a634770e1da977281e034c8d1c858960adc7b0c0e3ea5f479f076852bdc23499e28053be77ba42c5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.1.3 / 2016-05-05
2
+
3
+ Added all helpers to view
4
+
1
5
  # v0.1.2 / 2016-05-02
2
6
 
3
7
  Update flash-messenger to 0.1.1
@@ -6,7 +6,7 @@ if defined?(::Rails::Engine)
6
6
  include FlashMessenger::ViewHelper
7
7
  end
8
8
  ActiveSupport.on_load(:action_controller) do
9
- include FlashMessenger::ControllerHelper
9
+ include FlashMessenger::Helper
10
10
  end
11
11
  end
12
12
  end
@@ -1,5 +1,28 @@
1
+ require "request_store"
2
+
1
3
  module FlashMessenger
2
4
  module Helper
5
+ def flash_message(message, options = nil)
6
+ push_flash(message, options)
7
+ end
8
+
9
+ def flash_notice(message, options = nil)
10
+ push_flash(message, options, 'notice')
11
+ end
12
+
13
+ def flash_alert(message, options = nil)
14
+ push_flash(message, options, 'alert')
15
+ end
16
+
17
+ def flash_error(message, options = nil)
18
+ push_flash(message, options, 'error')
19
+ end
20
+
21
+ def flash_model_error(errors, options = nil)
22
+ errors = errors.errors if errors.is_a? ActiveRecord::Base
23
+ push_flash(errors.as_json, options, 'modelError')
24
+ end
25
+
3
26
  def flash_messenger
4
27
  RequestStore.store[:flash_messenger] ||= []
5
28
  end
@@ -1,3 +1,3 @@
1
1
  module FlashMessenger
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -1,3 +1,5 @@
1
+ require "flash-messenger/helper"
2
+
1
3
  module FlashMessenger
2
4
  module ViewHelper
3
5
  include FlashMessenger::Helper
@@ -1,8 +1,5 @@
1
- require "request_store"
2
1
  require "flash-messenger/version"
3
- require "flash-messenger/helper"
4
2
  require "flash-messenger/view_helper"
5
- require "flash-messenger/controller_helper"
6
3
  require "flash-messenger/engine"
7
4
 
8
5
  module FlashMessenger
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flash-messenger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chen, Yi-Cyuan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-02 00:00:00.000000000 Z
11
+ date: 2016-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: request_store
@@ -175,7 +175,6 @@ files:
175
175
  - bin/setup
176
176
  - flash-messenger.gemspec
177
177
  - lib/flash-messenger.rb
178
- - lib/flash-messenger/controller_helper.rb
179
178
  - lib/flash-messenger/engine.rb
180
179
  - lib/flash-messenger/helper.rb
181
180
  - lib/flash-messenger/version.rb
@@ -1,26 +0,0 @@
1
- module FlashMessenger
2
- module ControllerHelper
3
- include FlashMessenger::Helper
4
-
5
- def flash_message(message, options = nil)
6
- push_flash(message, options)
7
- end
8
-
9
- def flash_notice(message, options = nil)
10
- push_flash(message, options, 'notice')
11
- end
12
-
13
- def flash_alert(message, options = nil)
14
- push_flash(message, options, 'alert')
15
- end
16
-
17
- def flash_error(message, options = nil)
18
- push_flash(message, options, 'error')
19
- end
20
-
21
- def flash_model_error(errors, options = nil)
22
- errors = errors.errors if errors.is_a? ActiveRecord::Base
23
- push_flash(errors.as_json, options, 'modelError')
24
- end
25
- end
26
- end