galapagos_mobile 0.0.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.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ pkg/*
2
+ *.gem
3
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 [name of plugin creator]
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,13 @@
1
+ GalapagosMobile
2
+ ===============
3
+
4
+ Introduction goes here.
5
+
6
+
7
+ Example
8
+ =======
9
+
10
+ Example goes here.
11
+
12
+
13
+ Copyright (c) 2011 [name of plugin creator], released under the MIT license
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "galapagos_mobile/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "galapagos_mobile"
7
+ s.version = GalapagosMobile::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Kosuke Matsuda"]
10
+ s.email = ["hi@matsuda.me"]
11
+ s.homepage = "http://github.com/matsuda/galapagos_mobile"
12
+ s.summary = %q{A Ruby on Rails plugin to patch jpmobile}
13
+ s.description = %q{A Ruby on Rails plugin to patch jpmobile}
14
+
15
+ s.rubyforge_project = "galapagos_mobile"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+
22
+ s.date = %q{2011-02-04}
23
+ end
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require File.expand_path('../lib/galapagos_mobile', __FILE__)
data/install.rb ADDED
@@ -0,0 +1 @@
1
+ # Install hook code here
@@ -0,0 +1,11 @@
1
+ begin
2
+ require 'jpmobile'
3
+ rescue LoadError, NameError => e
4
+ $stderr.puts "You don't have jpmobile installed in your application. " +
5
+ "Please add it to your Gemfile and run bundle install or rails plugin install from github's repository"
6
+ raise e
7
+ end
8
+
9
+ ActiveSupport.on_load(:action_controller) do
10
+ require 'galapagos_mobile/trans_sid'
11
+ end
@@ -0,0 +1,15 @@
1
+ # -*- coding: utf-8 -*-
2
+ class ActionDispatch::Request
3
+ def reset_session_with_jpmobile
4
+ reset_session_without_jpmobile
5
+ # DocomoでSSLを使用するとsession_idが変更されるため、
6
+ # Cookie非対応の携帯でもsession_idをパラメータで引き回す。
7
+ if self.mobile? # && !self.mobile.supports_cookie?
8
+ self.session_options[:id] = ActiveSupport::SecureRandom.hex(16)
9
+ if Rails.application.config.session_store == ActiveRecord::SessionStore
10
+ @env[ActiveRecord::SessionStore::SESSION_RECORD_KEY] = nil
11
+ end
12
+ end
13
+ end
14
+ alias_method_chain :reset_session, :jpmobile
15
+ end
@@ -0,0 +1,3 @@
1
+ module GalapagosMobile
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,9 @@
1
+ $:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) ||
2
+ $:.include?(File.expand_path(File.dirname(__FILE__)))
3
+
4
+ module GalapagosMobile
5
+ end
6
+
7
+ if defined?(Rails)
8
+ require 'galapagos_mobile/rails'
9
+ end
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class GalapagosMobileTest < ActiveSupport::TestCase
4
+ # Replace this with your real tests.
5
+ test "the truth" do
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'active_support'
data/uninstall.rb ADDED
@@ -0,0 +1 @@
1
+ # Uninstall hook code here
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: galapagos_mobile
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Kosuke Matsuda
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-02-04 00:00:00 +09:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: A Ruby on Rails plugin to patch jpmobile
23
+ email:
24
+ - hi@matsuda.me
25
+ executables: []
26
+
27
+ extensions: []
28
+
29
+ extra_rdoc_files: []
30
+
31
+ files:
32
+ - .gitignore
33
+ - Gemfile
34
+ - MIT-LICENSE
35
+ - README
36
+ - Rakefile
37
+ - galapagos_mobile.gemspec
38
+ - init.rb
39
+ - install.rb
40
+ - lib/galapagos_mobile.rb
41
+ - lib/galapagos_mobile/rails.rb
42
+ - lib/galapagos_mobile/trans_sid.rb
43
+ - lib/galapagos_mobile/version.rb
44
+ - test/galapagos_mobile_test.rb
45
+ - test/test_helper.rb
46
+ - uninstall.rb
47
+ has_rdoc: true
48
+ homepage: http://github.com/matsuda/galapagos_mobile
49
+ licenses: []
50
+
51
+ post_install_message:
52
+ rdoc_options: []
53
+
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ hash: 3
71
+ segments:
72
+ - 0
73
+ version: "0"
74
+ requirements: []
75
+
76
+ rubyforge_project: galapagos_mobile
77
+ rubygems_version: 1.5.0
78
+ signing_key:
79
+ specification_version: 3
80
+ summary: A Ruby on Rails plugin to patch jpmobile
81
+ test_files:
82
+ - test/galapagos_mobile_test.rb
83
+ - test/test_helper.rb