steam 0.0.6 → 0.0.7

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.
@@ -40,34 +40,45 @@ module Steam
40
40
  super.merge(headers)
41
41
  end
42
42
 
43
- def method=(method)
44
- @env['REQUEST_METHOD'] = method
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 uri=(uri)
48
- uri = URI.parse(uri)
49
- self.path = uri.path
50
- self.query = uri.query if uri.query
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
@@ -1,3 +1,3 @@
1
1
  module Steam
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 6
9
- version: 0.0.6
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-18 00:00:00 +02:00
17
+ date: 2010-04-19 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency