steam 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/steam/request.rb +20 -9
- data/lib/steam/version.rb +1 -1
- metadata +3 -3
data/lib/steam/request.rb
CHANGED
@@ -40,34 +40,45 @@ module Steam
|
|
40
40
|
super.merge(headers)
|
41
41
|
end
|
42
42
|
|
43
|
-
def
|
44
|
-
|
43
|
+
def url=(url)
|
44
|
+
url = URI.parse(url)
|
45
|
+
self.path = url.path
|
46
|
+
self.scheme = url.scheme if url.scheme
|
47
|
+
self.host = url.host if url.host
|
48
|
+
self.port = url.port if url.port
|
49
|
+
self.query = url.query if url.query
|
45
50
|
end
|
51
|
+
alias :uri :url
|
52
|
+
alias :uri= :url=
|
46
53
|
|
47
|
-
def
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
self.scheme = uri.scheme if uri.scheme
|
52
|
-
self.port = uri.port if uri.port
|
54
|
+
def method=(method)
|
55
|
+
@env.merge!(
|
56
|
+
'REQUEST_METHOD' => method
|
57
|
+
)
|
53
58
|
end
|
54
|
-
alias url= uri=
|
55
59
|
|
56
60
|
def scheme=(scheme)
|
57
61
|
@env.merge!(
|
58
62
|
'rack.url_scheme' => scheme,
|
59
63
|
'rack.test.scheme' => scheme
|
60
64
|
)
|
65
|
+
self.port = nil # reset the port so we switch according to the protocol
|
61
66
|
end
|
67
|
+
alias :protocol :scheme
|
68
|
+
alias :protocol= :scheme=
|
62
69
|
|
63
70
|
def host=(host)
|
71
|
+
host, self.port = host.split(':')
|
64
72
|
@env.merge!(
|
73
|
+
'HTTP_HOST' => host,
|
65
74
|
'rack.test.host' => host
|
66
75
|
)
|
67
76
|
end
|
68
77
|
|
69
78
|
def port=(port)
|
79
|
+
port ||= protocol == 'https' ? 443 : 80
|
70
80
|
@env.merge!(
|
81
|
+
'SERVER_PORT' => port,
|
71
82
|
'rack.test.port' => port
|
72
83
|
)
|
73
84
|
end
|
data/lib/steam/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 7
|
9
|
+
version: 0.0.7
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Sven Fuchs
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-19 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|