ajax 1.0.6 → 1.0.7

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 (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/rack-ajax.rb +9 -1
  3. data/spec/spec_helper.rb +1 -1
  4. metadata +6 -6
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.6
1
+ 1.0.7
data/lib/rack-ajax.rb CHANGED
@@ -52,7 +52,7 @@ module Rack
52
52
  # The Ajax::Spec::Helpers module includes a helper
53
53
  # method to test the result of a rewrite.
54
54
  if ::Ajax.is_mocked?
55
- rack_response.nil? ? Rack::Ajax::Parser.rack_response(env.to_yaml(:Encoding => :Utf8)) : rack_response
55
+ rack_response.nil? ? Rack::Ajax::Parser.rack_response(encode_env(env)) : rack_response
56
56
  elsif !rack_response.nil?
57
57
  rack_response
58
58
  else
@@ -60,5 +60,13 @@ module Rack
60
60
  @app.call(env)
61
61
  end
62
62
  end
63
+
64
+ protected
65
+
66
+ # Convert the environment hash to yaml so it can be unserialized later
67
+ def encode_env(env)
68
+ env['rack.session'] = env['rack.session'].to_hash if env['rack.session'].is_a?(Hash)
69
+ env.to_yaml(:Encoding => :Utf8)
70
+ end
63
71
  end
64
72
  end
data/spec/spec_helper.rb CHANGED
@@ -7,7 +7,7 @@ require 'ajax/spec/extension'
7
7
  require 'ruby-debug'
8
8
 
9
9
  # Rails dependencies
10
- gem 'actionpack', '2.3.5'
10
+ gem 'actionpack', '2.3.11'
11
11
  require 'action_controller'
12
12
  require 'active_support/core_ext'
13
13
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ajax
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
4
+ hash: 25
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 6
10
- version: 1.0.6
9
+ - 7
10
+ version: 1.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Karl Varga
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-08 00:00:00 -08:00
18
+ date: 2011-03-14 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  requirements: []
121
121
 
122
122
  rubyforge_project:
123
- rubygems_version: 1.3.7
123
+ rubygems_version: 1.6.2
124
124
  signing_key:
125
125
  specification_version: 3
126
126
  summary: A framework to augment a traditional Rails application with a completely AJAX frontend.