galakei 0.15.1 → 0.15.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ source "http://rubygems.org"
4
4
  gemspec
5
5
 
6
6
  group :development, :test do
7
- gem 'rails', '3.2.3'
7
+ gem 'rails', '3.2.11'
8
8
  gem 'rspec', '>= 2.5.0'
9
9
  gem 'capybara', '~> 1.1.1'
10
10
  gem 'steak'
@@ -6,10 +6,6 @@
6
6
 
7
7
  galakeiは簡単にガラケー対応Rails Gem。「Doorkeeper」という {イベント運営}[http://www.doorkeeper.jp] サービスがこのgemを使っている。
8
8
 
9
- == Documentation
10
-
11
- See {the galakei site}[http://galakei.mobalean.com/] for more details.
12
-
13
9
  == Thanks
14
10
 
15
11
  * To {jpmobile}[https://github.com/jpmobile/jpmobile] for offering the most mature Rails plugin for Rails
@@ -10,6 +10,5 @@ You'll also need to enable this option in galakei
10
10
  =end
11
11
  module SessionIdParameter
12
12
  autoload :InForm, "galakei/session_id_parameter/in_form"
13
- autoload :InUrl, "galakei/session_id_parameter/in_url"
14
13
  end
15
14
  end
@@ -1,5 +1,6 @@
1
- module Galakei::SessionIdParameter::InUrl # :nodoc:
1
+ require 'action_dispatch/routing/url_for'
2
2
 
3
+ ActionDispatch::Routing::UrlFor.class_eval do
3
4
  if Rails::VERSION::MINOR == 0
4
5
  ENV_SESSION_OPTIONS_KEY = ActionDispatch::Session::AbstractStore::ENV_SESSION_OPTIONS_KEY
5
6
  else
@@ -7,8 +8,8 @@ module Galakei::SessionIdParameter::InUrl # :nodoc:
7
8
  ENV_SESSION_OPTIONS_KEY = Rack::Session::Abstract::ENV_SESSION_OPTIONS_KEY
8
9
  end
9
10
 
10
- def url_for(options = {})
11
- return super unless inject_session_id_parameter?(options)
11
+ def url_for_with_session_id(options = {})
12
+ return url_for_without_session_id(options) unless inject_session_id_parameter?(options)
12
13
  session_opts = request.env[ENV_SESSION_OPTIONS_KEY]
13
14
  # if we don't have a session ID yet, create one
14
15
  if session_opts[:id].blank?
@@ -18,8 +19,9 @@ module Galakei::SessionIdParameter::InUrl # :nodoc:
18
19
  # create a new session ID
19
20
  session_opts[:id] = SecureRandom.hex(8)
20
21
  end
21
- super(options.merge(::Rails.application.config.session_options[:key] => session_opts[:id]))
22
+ url_for_without_session_id(options.merge(::Rails.application.config.session_options[:key] => session_opts[:id]))
22
23
  end
24
+ alias_method_chain :url_for, :session_id
23
25
 
24
26
  private
25
27
 
@@ -4,9 +4,7 @@ module Galakei
4
4
  config.galakei.session_id_parameter = false
5
5
  initializer "galakei.session_id_parameter" do |app|
6
6
  if app.config.galakei.session_id_parameter
7
- Rails.application.routes.url_helpers.class_eval do
8
- include Galakei::SessionIdParameter::InUrl
9
- end
7
+ require "galakei/session_id_parameter/in_url"
10
8
  ActiveSupport.on_load :action_view do
11
9
  include Galakei::SessionIdParameter::InForm
12
10
  end
@@ -1,4 +1,4 @@
1
1
  module Galakei
2
2
  # The version of Galakei you are using
3
- VERSION = "0.15.1"
3
+ VERSION = "0.15.2"
4
4
  end
@@ -21,12 +21,12 @@ feature 'emoji table' do
21
21
  page.source.should match("\uEF60")
22
22
  end
23
23
 
24
- scenario 'for au SSL', :driver => :au do
24
+ pending 'for au SSL', :driver => :au do
25
25
  visit 'https://www.example.com/emoji'
26
26
  page.source.should match([0xF660].pack("n").force_encoding("Shift_JIS"))
27
27
  end
28
28
 
29
- scenario 'for au SSL with unicode source', :driver => :au do
29
+ pending 'for au SSL with unicode source', :driver => :au do
30
30
  visit 'https://www.example.com/emoji/with_unicode'
31
31
  expected = "てすと".encode("Shift_JIS") + [0xF660].pack("n").force_encoding("Shift_JIS")
32
32
  page.source.should match(expected)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: galakei
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.15.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-11-16 00:00:00.000000000 Z
14
+ date: 2013-01-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: actionpack
@@ -174,7 +174,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
174
174
  version: '0'
175
175
  segments:
176
176
  - 0
177
- hash: 2410560636642683119
177
+ hash: 4401509877869676688
178
178
  required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  none: false
180
180
  requirements:
@@ -183,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  version: '0'
184
184
  segments:
185
185
  - 0
186
- hash: 2410560636642683119
186
+ hash: 4401509877869676688
187
187
  requirements: []
188
188
  rubyforge_project: galakei
189
189
  rubygems_version: 1.8.24