Permalink
Browse files

Version bump to 1.1.0

  • Loading branch information...
1 parent 3c25cff commit 16d20f95e6a76ca4d245a67acdf1e260ab0e3839 @meetme2meat committed Feb 3, 2012
Showing with 9 additions and 7 deletions.
  1. +3 −3 README.rdoc
  2. +1 −1 VERSION
  3. +5 −3 lib/rack_iphone.rb
View
@@ -13,9 +13,9 @@ Description goes here.
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
= Caveat
-* The Current Version only support ActiveRecord::Base.session_store straight
-* If you are Cookie Store kindly fork the gem and make adequate change to the below script contain
- if (document.cookie.match(/_session_id/)
+* <s> The Current Version only support ActiveRecord::Base.session_store straight </s>
+* <s>If you are Cookie Store kindly fork the gem and make adequate change to the below script contain
+ if (document.cookie.match(/_session_id/)</s>
== Copyright
View
@@ -1 +1 @@
-1.0.0
+1.1.0
View
@@ -12,7 +12,7 @@ class Iphone
if(isFullScreen()){
- if(!document.cookie.match(/_session_id/)){
+ if(!document.cookie.match(/{{REGEX}}/)){
var storedValues = localStorage.getItem('__cookie__');
if(storedValues){
var values = storedValues.split(';');
@@ -63,7 +63,7 @@ def call(env)
response = Rack::Response.new([], status, headers)
cookie = String.new
request.cookies.each_pair do |key,value|
- cookie += "#{key}=#{value};"
+ cookie += "#{key}=#{value};"
end
body.each do |part|
part.gsub!(/<\/head>/, "#{set_cookie(cookie)}</head>")
@@ -79,7 +79,9 @@ def call(env)
protected
def code(resend=false)
- CODE.gsub('{{RESEND}}', resend.to_s)
+ regex = "_session_id"
+ regex = Rails.configuration.session_options[:key] if Rails.configuration.session_store.name == "ActionDispatch::Session::CookieStore"
+ CODE.gsub('{{RESEND}}', resend.to_s).gsub('{{REGEX}}',regex.to_s)
end
def set_cookie(cookie)

0 comments on commit 16d20f9

Please sign in to comment.