squash_rails 1.1.0 → 1.1.1

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.
Files changed (2) hide show
  1. data/lib/squash/rails/rack.rb +24 -18
  2. metadata +5 -5
@@ -49,25 +49,31 @@ module Squash
49
49
  # middleware gives to `Squash::Ruby.notify`.
50
50
 
51
51
  def squash_rack_data
52
- {
53
- :environment => environment_name,
54
- :root => root_path,
55
-
56
- :headers => filter_for_squash(request_headers, :headers),
57
- :request_method => @env['REQUEST_METHOD'].to_s.upcase,
58
- :schema => @env['rack.url_scheme'],
59
- :host => @env['SERVER_NAME'],
60
- :port => @env['SERVER_PORT'],
61
- :path => @env['PATH_INFO'],
62
- :query => @env['QUERY_STRING'],
63
-
64
- :params => filter_for_squash(@env['action_dispatch.request.parameters'], :params),
65
- :session => filter_for_squash(@env['rack.session'], :session),
66
- :flash => filter_for_squash(@env[ActionDispatch::Flash::KEY], :flash),
67
- :cookies => filter_for_squash(@env['rack.request.cookie_hash'], :cookies),
68
-
69
- :"rack.env" => filter_for_squash(@env, :rack)
52
+ data = {
53
+ :environment => environment_name,
54
+ :root => root_path,
55
+
56
+ :headers => filter_for_squash(request_headers, :headers),
57
+ :request_method => @env['REQUEST_METHOD'].to_s.upcase,
58
+ :schema => @env['rack.url_scheme'],
59
+ :host => @env['SERVER_NAME'],
60
+ :port => @env['SERVER_PORT'],
61
+ :path => @env['PATH_INFO'],
62
+ :query => @env['QUERY_STRING'],
63
+
64
+ :params => filter_for_squash(@env['action_dispatch.request.parameters'], :params),
65
+ :session => filter_for_squash(@env['rack.session'], :session),
66
+ :cookies => filter_for_squash(@env['rack.request.cookie_hash'], :cookies),
67
+
68
+ :"rack.env" => filter_for_squash(@env, :rack)
70
69
  }
70
+
71
+ if data[:session]
72
+ flash_key = defined?(ActionDispatch) ? ActionDispatch::Flash::KEY : 'flash'
73
+ data[:flash] = filter_for_squash(data[:session].delete(flash_key) || {}, :flash)
74
+ end
75
+
76
+ data
71
77
  end
72
78
 
73
79
  private
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: squash_rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 0
10
- version: 1.1.0
9
+ - 1
10
+ version: 1.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tim Morgan
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-02-05 00:00:00 Z
18
+ date: 2013-04-09 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  requirement: &id001 !ruby/object:Gem::Requirement
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  requirements: []
151
151
 
152
152
  rubyforge_project:
153
- rubygems_version: 1.8.24
153
+ rubygems_version: 1.8.25
154
154
  signing_key:
155
155
  specification_version: 3
156
156
  summary: Squash client for Ruby on Rails projects