sbsm 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/lib/sbsm/index.rb +1 -1
- data/lib/sbsm/redefine_19_cookie.rb +4 -4
- data/lib/sbsm/trans_handler.rb +31 -3
- metadata +5 -12
data/History.txt
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
=== 1.0.4 / 16.01.2012
|
2
|
+
|
3
|
+
* Updated trans_handler.rb. If rockit library is not found, then simple_parse_uri method is used to parse uri.
|
4
|
+
|
1
5
|
=== 1.0.3 / 22.12.2011
|
2
6
|
|
3
7
|
* Fix Date object loading error. Without this active agents and sequence data will not be saved in ch.oddb.org
|
data/lib/sbsm/index.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
class CGI
|
2
|
+
remove_const 'Cookie'
|
3
|
+
end
|
4
|
+
load '/usr/lib/ruby19/1.9.1/cgi/cookie.rb'
|
data/lib/sbsm/trans_handler.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# TransHandler -- sbsm --
|
2
|
+
# SBSM::TransHandler -- sbsm -- 16.01.2012 -- mhatakeyama@ywesee.com
|
3
|
+
# SBSM::TransHandler -- sbsm -- 23.09.2004 -- hwyss@ywesee.com
|
3
4
|
|
4
5
|
$USING_STRSCAN = true
|
5
|
-
require 'rockit/rockit'
|
6
6
|
require 'cgi'
|
7
7
|
require 'singleton'
|
8
8
|
require 'yaml'
|
@@ -46,6 +46,30 @@ module SBSM
|
|
46
46
|
request.uri = HANDLER_URI
|
47
47
|
end
|
48
48
|
end
|
49
|
+
def simple_parse(uri)
|
50
|
+
# /language/flavor/event/key/value/key/value/...
|
51
|
+
items = uri.split('/')
|
52
|
+
items.shift
|
53
|
+
values = {}
|
54
|
+
lang = items.shift
|
55
|
+
values.store(:language, lang) if lang
|
56
|
+
flavor = items.shift
|
57
|
+
values.store(:flavor, flavor) if flavor
|
58
|
+
event = items.shift
|
59
|
+
values.store(:event, event) if event
|
60
|
+
until items.empty?
|
61
|
+
key = items.shift
|
62
|
+
value = items.shift
|
63
|
+
values.store(key, value)
|
64
|
+
end
|
65
|
+
values
|
66
|
+
end
|
67
|
+
def simple_parse_uri(request)
|
68
|
+
values = request.notes
|
69
|
+
simple_parse(request.uri).each do |key, value|
|
70
|
+
values.add(key.to_s, CGI.unescape(value.to_s))
|
71
|
+
end
|
72
|
+
end
|
49
73
|
def parse_uri(request)
|
50
74
|
@uri_parser ||= self.uri_parser
|
51
75
|
ast = @uri_parser.parse(request.uri)
|
@@ -77,7 +101,11 @@ module SBSM
|
|
77
101
|
when @@empty_check
|
78
102
|
request.uri = config['redirect']['/'] || HANDLER_URI
|
79
103
|
when @@lang_check
|
80
|
-
|
104
|
+
begin
|
105
|
+
self.parse_uri(request)
|
106
|
+
rescue LoadError
|
107
|
+
simple_parse_uri(request)
|
108
|
+
end
|
81
109
|
request.uri = HANDLER_URI
|
82
110
|
end
|
83
111
|
Apache::DECLINED
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sbsm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 1
|
8
7
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
8
|
+
- 4
|
9
|
+
version: 1.0.4
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Masaomi Hatakeyama, Zeno R.R. Davatz
|
@@ -15,18 +14,16 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date:
|
17
|
+
date: 2012-01-16 00:00:00 +01:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: hoe
|
23
22
|
prerelease: false
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
24
|
requirements:
|
27
25
|
- - ">="
|
28
26
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 41
|
30
27
|
segments:
|
31
28
|
- 2
|
32
29
|
- 9
|
@@ -109,27 +106,23 @@ rdoc_options:
|
|
109
106
|
require_paths:
|
110
107
|
- lib
|
111
108
|
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
-
none: false
|
113
109
|
requirements:
|
114
110
|
- - ">="
|
115
111
|
- !ruby/object:Gem::Version
|
116
|
-
hash: 3
|
117
112
|
segments:
|
118
113
|
- 0
|
119
114
|
version: "0"
|
120
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
116
|
requirements:
|
123
117
|
- - ">="
|
124
118
|
- !ruby/object:Gem::Version
|
125
|
-
hash: 3
|
126
119
|
segments:
|
127
120
|
- 0
|
128
121
|
version: "0"
|
129
122
|
requirements: []
|
130
123
|
|
131
124
|
rubyforge_project: sbsm
|
132
|
-
rubygems_version: 1.
|
125
|
+
rubygems_version: 1.3.6
|
133
126
|
signing_key:
|
134
127
|
specification_version: 3
|
135
128
|
summary: Application framework for state based session management
|