padrino-contrib 0.1.7 → 0.1.8

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.

Potentially problematic release.


This version of padrino-contrib might be problematic. Click here for more details.

@@ -11,27 +11,29 @@ module Padrino
11
11
  #
12
12
  # ==== Usage
13
13
  #
14
- # use Padrino::Contrib::FlashSession, settings.session_id
14
+ # register Padrino::Contrib::FlashSession
15
15
  #
16
- class FlashSession
16
+ module FlashSession
17
17
 
18
18
  def self.registered(app)
19
- app.use Padrino::Contrib::FlashSession, app.session_id
19
+ app.use Padrino::Contrib::FlashSession::Middleware, app.session_id
20
20
  end
21
21
 
22
- def initialize(app, session_key = 'session_id')
23
- @app = app
24
- @session_key = session_key.to_s
25
- end
22
+ module Middleware
23
+ def initialize(app, session_key = 'session_id')
24
+ @app = app
25
+ @session_key = session_key.to_s
26
+ end
26
27
 
27
- def call(env)
28
- if env['HTTP_USER_AGENT'] =~ /^(Adobe|Shockwave) Flash/
29
- params = ::Rack::Request.new(env).params
30
- env['rack.session'] ||= {}
31
- env['rack.session'][@session_key.to_sym] = params[@session_key] if params[@session_key].present?
28
+ def call(env)
29
+ if env['HTTP_USER_AGENT'] =~ /^(Adobe|Shockwave) Flash/
30
+ params = ::Rack::Request.new(env).params
31
+ env['rack.session'] ||= {}
32
+ env['rack.session'][@session_key.to_sym] = params[@session_key] if params[@session_key].present?
33
+ end
34
+ @app.call(env)
32
35
  end
33
- @app.call(env)
34
- end
36
+ end # Middleware
35
37
  end # FlashSession
36
38
  end # Contrib
37
39
  end # Padrino
@@ -1,5 +1,5 @@
1
1
  module Padrino
2
2
  module Contrib
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-contrib
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 7
10
- version: 0.1.7
9
+ - 8
10
+ version: 0.1.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Davide D'Agostino