nakajima-rack-flash 0.0.7 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -35,8 +35,14 @@ module Rack
35
35
  # Implements bracket accessors for storing and retrieving flash entries.
36
36
  class FlashHash
37
37
  attr_reader :flagged
38
+
39
+ def self.default_store
40
+ nil
41
+ end
38
42
 
39
43
  def initialize(store, opts={})
44
+ store ||= FlashHash.default_store
45
+
40
46
  raise Rack::Flash::SessionUnavailable \
41
47
  .new('Rack::Flash depends on session middleware.') unless store
42
48
 
@@ -0,0 +1,14 @@
1
+ module Rack
2
+ class Flash
3
+ def self.fake_session
4
+ @fake_session ||= {}
5
+ end
6
+
7
+ alias_method :old_call, :call
8
+ def new_call(env)
9
+ env['rack.session'] ||= Rack::Flash.fake_session
10
+ old_call(env)
11
+ end
12
+ alias_method :call, :new_call
13
+ end
14
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nakajima-rack-flash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Nakajima
@@ -33,8 +33,10 @@ extra_rdoc_files: []
33
33
  files:
34
34
  - lib/rack-flash.rb
35
35
  - lib/rack/flash.rb
36
+ - lib/rack/flash/test.rb
36
37
  has_rdoc: false
37
38
  homepage:
39
+ licenses:
38
40
  post_install_message:
39
41
  rdoc_options: []
40
42
 
@@ -55,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
57
  requirements: []
56
58
 
57
59
  rubyforge_project:
58
- rubygems_version: 1.2.0
60
+ rubygems_version: 1.3.5
59
61
  signing_key:
60
62
  specification_version: 2
61
63
  summary: Flash hash implementation for Rack apps.