stella 0.7.2 → 0.7.2.002
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/bin/stella +1 -1
- data/lib/stella/client.rb +6 -3
- data/lib/stella/data/http/request.rb +6 -0
- data/lib/stella/engine.rb +1 -1
- data/lib/stella/testplan/usecase.rb +1 -0
- data/lib/stella/version.rb +1 -1
- data/stella.gemspec +1 -1
- metadata +2 -2
data/bin/stella
CHANGED
data/lib/stella/client.rb
CHANGED
@@ -51,14 +51,17 @@ module Stella
|
|
51
51
|
|
52
52
|
uri = build_request_uri req.uri, params, container
|
53
53
|
|
54
|
-
if usecase.http_auth
|
54
|
+
if http_auth = usecase.http_auth || req.http_auth
|
55
55
|
# TODO: The first arg is domain and can include a URI path.
|
56
56
|
# Are there cases where this is important?
|
57
57
|
domain = '%s://%s%s' % [uri.scheme, uri.host, '/'] #File.dirname(uri.path)
|
58
|
-
user, pass =
|
59
|
-
|
58
|
+
user, pass = http_auth.user, http_auth.pass
|
59
|
+
user = container.instance_eval &user if Proc === user
|
60
|
+
pass = container.instance_eval &pass if Proc === pass
|
61
|
+
Stella.li2 " AUTH (#{http_auth.kind}) #{domain} (#{user}/#{pass})"
|
60
62
|
http_client.set_auth(domain, user, pass)
|
61
63
|
end
|
64
|
+
|
62
65
|
raise NoHostDefined, req.uri if uri.host.nil? || uri.host.empty?
|
63
66
|
stella_id = [Time.now, self.digest_cache, req.digest_cache, params, headers, counter].gibbler
|
64
67
|
|
@@ -23,6 +23,7 @@ module Stella::Data::HTTP
|
|
23
23
|
field :http_method
|
24
24
|
field :http_version
|
25
25
|
field :content_type
|
26
|
+
field :http_auth
|
26
27
|
|
27
28
|
def has_body?
|
28
29
|
!@body.nil?
|
@@ -39,6 +40,11 @@ module Stella::Data::HTTP
|
|
39
40
|
instance_eval &definition unless definition.nil?
|
40
41
|
end
|
41
42
|
|
43
|
+
def auth(user=nil, pass=nil, kind=:basic)
|
44
|
+
@http_auth ||= Stella::Testplan::Usecase::Auth.new
|
45
|
+
@http_auth.user, @http_auth.pass, @http_auth.kind = user, pass, kind
|
46
|
+
end
|
47
|
+
|
42
48
|
def desc(*args)
|
43
49
|
@desc = args.first unless args.empty?
|
44
50
|
@desc
|
data/lib/stella/engine.rb
CHANGED
data/lib/stella/version.rb
CHANGED
data/stella.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stella
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.2
|
4
|
+
version: 0.7.2.002
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delano Mandelbaum
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-30 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|