sova 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/sova/http.rb +8 -4
  2. data/sova.gemspec +7 -2
  3. metadata +64 -5
data/lib/sova/http.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "httpi"
2
+ require "uri"
2
3
  require "forwardable"
3
4
 
4
5
  module Sova
@@ -21,13 +22,16 @@ module Sova
21
22
  attr_accessor :adapter
22
23
 
23
24
  def request method, uri, doc=nil, headers={}
25
+ uri = URI.parse(uri)
24
26
  request = HTTPI::Request.new
25
- request.url = uri
26
- request.proxy = Sova.proxy if Sova.proxy
27
- request.body = doc if doc
27
+ request.url = uri
28
+ request.auth.basic uri.user, uri.password if uri.user && uri.password
29
+ request.proxy = Sova.proxy if Sova.proxy
30
+ request.body = doc if doc
31
+ request.read_timeout = 1
28
32
  request.headers = {
29
33
  "Content-Type" => "application/json",
30
- "Accept" => "application/json"
34
+ "Accept" => "application/json"
31
35
  }.merge(headers)
32
36
 
33
37
  response = HTTPI.request(method, request, adapter)
data/sova.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "sova"
3
- s.version = "0.0.1"
4
- s.date = "2011-02-16"
3
+ s.version = "0.0.2"
4
+ s.date = "2011-02-17"
5
5
  s.summary = "CouchDB library"
6
6
  s.email = "harry@vangberg.name"
7
7
  s.homepage = "http://github.com/ichverstehe/sova"
@@ -15,5 +15,10 @@ Gem::Specification.new do |s|
15
15
  "lib/sova/http.rb",
16
16
  "lib/sova/server.rb"
17
17
  ]
18
+
19
+ s.add_dependency "httpi", "~> 0.7.9"
20
+ s.add_development_dependency "rspec-core", "~> 2.5.1"
21
+ s.add_development_dependency "rspec-mocks", "~> 2.5.0"
22
+ s.add_development_dependency "rspec-expectations", "~> 2.5.0"
18
23
  end
19
24
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Harry Vangberg
@@ -14,10 +14,69 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-02-16 00:00:00 -03:00
17
+ date: 2011-02-17 00:00:00 -03:00
18
18
  default_executable:
19
- dependencies: []
20
-
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: httpi
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ - 7
31
+ - 9
32
+ version: 0.7.9
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: rspec-core
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ segments:
44
+ - 2
45
+ - 5
46
+ - 1
47
+ version: 2.5.1
48
+ type: :development
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: rspec-mocks
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ~>
57
+ - !ruby/object:Gem::Version
58
+ segments:
59
+ - 2
60
+ - 5
61
+ - 0
62
+ version: 2.5.0
63
+ type: :development
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: rspec-expectations
67
+ prerelease: false
68
+ requirement: &id004 !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ~>
72
+ - !ruby/object:Gem::Version
73
+ segments:
74
+ - 2
75
+ - 5
76
+ - 0
77
+ version: 2.5.0
78
+ type: :development
79
+ version_requirements: *id004
21
80
  description:
22
81
  email: harry@vangberg.name
23
82
  executables: []