padrino-flash 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,7 +4,7 @@ Padrino Flash is a plugin for the [Padrino](https://github.com/padrino/padrino-f
4
4
 
5
5
  ### Setup & Installation
6
6
 
7
- Include it in your project's `Gemfile` with Bundler:
7
+ Include it in your project's `Gemfile`:
8
8
 
9
9
  ``` ruby
10
10
  gem 'padrino-flash'
@@ -21,8 +21,8 @@ end
21
21
  ### Dependencies
22
22
 
23
23
  * [Padrino-Core](https://github.com/padrino/padrino-framework) and [Padrino-Helpers](https://github.com/padrino/padrino-framework)
24
- * [Ruby](http://www.ruby-lang.org/en) >= 1.9.2
24
+ * [Ruby](http://www.ruby-lang.org/en) >= 1.8.7
25
25
 
26
26
  ### Copyright
27
27
 
28
- Copyright 2012 Benjamin Bloch (Cirex). See LICENSE for details.
28
+ Copyright © 2012 Benjamin Bloch (Cirex). See LICENSE for details.
@@ -31,7 +31,6 @@ module Padrino
31
31
  flashes = args.extract_options!
32
32
 
33
33
  flashes.each do |type, message|
34
- message = I18n.translate(message) if message.is_a?(Symbol)
35
34
  flash[type] = message
36
35
  end
37
36
 
@@ -22,6 +22,7 @@ module Padrino
22
22
  # @since 0.1.0
23
23
  # @api public
24
24
  def []=(type, message)
25
+ message = I18n.translate(message) if message.is_a?(Symbol)
25
26
  @next[type] = message
26
27
  end
27
28
 
@@ -1,6 +1,6 @@
1
1
  # encoding: UTF-8
2
2
  module Padrino
3
3
  module Flash
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end # Flash
6
6
  end # Padrino
data/spec/storage_spec.rb CHANGED
@@ -28,6 +28,12 @@ describe Padrino::Flash::Storage do
28
28
  it 'should set future flash messages' do
29
29
  flash[:future] = 'Test'
30
30
  flash[:future].should be_nil
31
+ flash.next[:future].should == 'Test'
32
+ end
33
+
34
+ it 'should localize flash messages when a :symbol is used' do
35
+ flash[:localized] = :redirected
36
+ flash.next[:localized].should == 'Redirected'
31
37
  end
32
38
 
33
39
  it 'should allow you to set the present flash' do
@@ -88,7 +94,6 @@ describe Padrino::Flash::Storage do
88
94
 
89
95
  it 'can return the existing flash keys' do
90
96
  flash.keys.should == [:notice, :success]
91
- flash.keys.should_not include(:one, :two)
92
97
  end
93
98
 
94
99
  it 'can tell you if a key is set' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-flash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-22 00:00:00.000000000 Z
12
+ date: 2012-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: padrino-core
16
- requirement: &20219160 !ruby/object:Gem::Requirement
16
+ requirement: &15649596 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *20219160
24
+ version_requirements: *15649596
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: padrino-helpers
27
- requirement: &20218464 !ruby/object:Gem::Requirement
27
+ requirement: &15649284 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *20218464
35
+ version_requirements: *15649284
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &20217960 !ruby/object:Gem::Requirement
38
+ requirement: &15648936 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.0.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *20217960
46
+ version_requirements: *15648936
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec-html-matchers
49
- requirement: &20217492 !ruby/object:Gem::Requirement
49
+ requirement: &15648624 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *20217492
57
+ version_requirements: *15648624
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rack-test
60
- requirement: &20216760 !ruby/object:Gem::Requirement
60
+ requirement: &15648288 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *20216760
68
+ version_requirements: *15648288
69
69
  description: A plugin for the Padrino web framework which adds support for Rails like
70
70
  flash messages
71
71
  email: