righttp 0.1.4 → 0.1.5

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -2,8 +2,8 @@ module Rig
2
2
  class HTTPHeader < Hash
3
3
 
4
4
  def initialize options
5
- http_method = options[:http_method]
6
- path = options[:path]
5
+ http_method = options[:http_method] || "GET"
6
+ path = options[:path] || "/"
7
7
 
8
8
  header = {
9
9
  "" => "#{http_method} #{path} HTTP/1.1",
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{righttp}
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["hukl"]
12
- s.date = %q{2010-08-15}
12
+ s.date = %q{2010-08-16}
13
13
  s.description = %q{A HTTP client library written from scratch that is easy to use and offers full flexibility}
14
14
  s.email = %q{contact@smyck.org}
15
15
  s.extra_rdoc_files = [
@@ -223,6 +223,17 @@ class TestHttp < Test::Unit::TestCase
223
223
  assert_equal false, request.body.multipart?
224
224
  end
225
225
 
226
+ test "simple request in full manual mode" do
227
+ request = Rig::HTTP.new( "http://github.com:80/hukl" )
228
+ expected = "GET /hukl HTTP/1.1\r\n" \
229
+ "Host: github.com\r\n" \
230
+ "Origin: localhost\r\n" \
231
+ "Content-Length: 0\r\n" \
232
+ "Content-Type: text/plain\r\n" \
233
+ "Connection: close\r\n\r\n"
234
+ assert_equal expected, request.header.to_s
235
+ end
236
+
226
237
  #test "multipart body gets properly created" do
227
238
  # post = HTTP.new(
228
239
  # :host => "localhost",
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 4
9
- version: 0.1.4
8
+ - 5
9
+ version: 0.1.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - hukl
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-15 00:00:00 +02:00
17
+ date: 2010-08-16 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20