holoserve 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/holoserve/interface.rb +49 -25
- data/lib/holoserve/interface/control/pair.rb +1 -1
- data/lib/holoserve/interface/control/state.rb +2 -1
- data/lib/holoserve/interface/fake.rb +3 -1
- data/lib/holoserve/request.rb +1 -0
- data/lib/holoserve/request/router.rb +57 -0
- data/lib/holoserve/response/selector.rb +2 -2
- data/lib/holoserve/tool/hash/matcher.rb +11 -0
- data/spec/lib/holoserve/request/router_spec.rb +68 -0
- data/spec/lib/holoserve/tool/hash/matcher_spec.rb +48 -1
- metadata +116 -59
- data/bin/test.log +0 -4
data/lib/holoserve/interface.rb
CHANGED
@@ -8,32 +8,56 @@ class Holoserve::Interface < Goliath::API
|
|
8
8
|
|
9
9
|
ROOT = File.expand_path(File.join(File.dirname(__FILE__), "..", "..")).freeze unless defined?(ROOT)
|
10
10
|
|
11
|
-
use Rack::
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
use Goliath::Rack::Params
|
12
|
+
|
13
|
+
def initialize
|
14
|
+
@router = Holoserve::Request::Router.new [
|
15
|
+
{
|
16
|
+
:method => :get,
|
17
|
+
:path => "/_control/bucket",
|
18
|
+
:handler => Control::Bucket::Fetch.new
|
19
|
+
}, {
|
20
|
+
:method => :delete,
|
21
|
+
:path => "/_control/bucket",
|
22
|
+
:handler => Control::Bucket::Delete.new
|
23
|
+
}, {
|
24
|
+
:method => :get,
|
25
|
+
:path => "/_control/history",
|
26
|
+
:handler => Control::History::Fetch.new
|
27
|
+
}, {
|
28
|
+
:method => :delete,
|
29
|
+
:path => "/_control/history",
|
30
|
+
:handler => Control::History::Delete.new
|
31
|
+
}, {
|
32
|
+
:method => :get,
|
33
|
+
:path => "/_control/pairs",
|
34
|
+
:handler => Control::Pair::Index.new
|
35
|
+
}, {
|
36
|
+
:method => :get,
|
37
|
+
:path => "/_control/pairs/:id",
|
38
|
+
:handler => Control::Pair::Fetch.new
|
39
|
+
}, {
|
40
|
+
:method => :put,
|
41
|
+
:path => "/_control/state",
|
42
|
+
:handler => Control::State::Update.new
|
43
|
+
}, {
|
44
|
+
:method => :get,
|
45
|
+
:path => "/_control/state",
|
46
|
+
:handler => Control::State::Fetch.new
|
47
|
+
}, {
|
48
|
+
:method => :delete,
|
49
|
+
:path => "/_control/state",
|
50
|
+
:handler => Control::State::Delete.new
|
51
|
+
}, {
|
52
|
+
:path => /^\//,
|
53
|
+
:handler => Fake.new
|
18
54
|
}
|
55
|
+
]
|
56
|
+
end
|
19
57
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
get "/_control/history", Control::History::Fetch
|
26
|
-
delete "/_control/history", Control::History::Delete
|
27
|
-
|
28
|
-
get "/_control/pairs", Control::Pair::Index
|
29
|
-
get "/_control/pairs/:id", Control::Pair::Fetch
|
30
|
-
|
31
|
-
put "/_control/state", Control::State::Update
|
32
|
-
get "/_control/state", Control::State::Fetch
|
33
|
-
delete "/_control/state", Control::State::Delete
|
34
|
-
|
35
|
-
get "/_control*", Control::Index::Fetch
|
36
|
-
|
37
|
-
map "/*", Fake
|
58
|
+
def response(environment)
|
59
|
+
environment["parameters"] = environment.params
|
60
|
+
@router.dispatch environment
|
61
|
+
end
|
38
62
|
|
39
63
|
end
|
@@ -4,11 +4,12 @@ module Holoserve::Interface::Control::State
|
|
4
4
|
|
5
5
|
class Update < Goliath::API
|
6
6
|
include Holoserve::Interface::Control::Helper
|
7
|
+
include Goliath::Rack::Types
|
7
8
|
|
8
9
|
use Goliath::Rack::Params
|
9
10
|
|
10
11
|
def response(environment)
|
11
|
-
state.merge!
|
12
|
+
state.merge! environment.parameters
|
12
13
|
logger.info "set state to '#{state.inspect}'"
|
13
14
|
respond_json_acknowledgement
|
14
15
|
end
|
@@ -17,7 +17,7 @@ class Holoserve::Interface::Fake < Goliath::API
|
|
17
17
|
use Goliath::Rack::Params
|
18
18
|
|
19
19
|
def response(env)
|
20
|
-
request = Holoserve::Request::Decomposer.new(env,
|
20
|
+
request = Holoserve::Request::Decomposer.new(env, env["parameters"]).hash
|
21
21
|
finder = Holoserve::Pair::Finder.new(pairs, request)
|
22
22
|
pair = finder.pair
|
23
23
|
if pair
|
@@ -49,6 +49,8 @@ class Holoserve::Interface::Fake < Goliath::API
|
|
49
49
|
end
|
50
50
|
rescue NoResponseError => error
|
51
51
|
logger.warn "could not select any response for request [#{error.id}] with request variant [#{error.request_variant}]"
|
52
|
+
rescue Object => error
|
53
|
+
p error
|
52
54
|
end
|
53
55
|
|
54
56
|
private
|
data/lib/holoserve/request.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
module Holoserve::Request
|
3
3
|
|
4
4
|
autoload :Decomposer, File.join(File.dirname(__FILE__), "request", "decomposer")
|
5
|
+
autoload :Router, File.join(File.dirname(__FILE__), "request", "router")
|
5
6
|
autoload :Selector, File.join(File.dirname(__FILE__), "request", "selector")
|
6
7
|
|
7
8
|
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
|
2
|
+
class Holoserve::Request::Router
|
3
|
+
|
4
|
+
def initialize(routes)
|
5
|
+
@routes = routes
|
6
|
+
substitute_paths
|
7
|
+
end
|
8
|
+
|
9
|
+
def dispatch(environment)
|
10
|
+
route = find_route environment["REQUEST_METHOD"].downcase.to_sym,
|
11
|
+
environment["PATH_INFO"]
|
12
|
+
|
13
|
+
if route
|
14
|
+
if @parameters
|
15
|
+
environment["parameters"] ||= { }
|
16
|
+
environment["parameters"].merge! @parameters
|
17
|
+
end
|
18
|
+
route[:handler].response environment
|
19
|
+
else
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def substitute_paths
|
27
|
+
@routes.each do |route|
|
28
|
+
path = route[:path]
|
29
|
+
if path.is_a?(String) && path =~ /:\w+/
|
30
|
+
pattern = path.gsub(/:\w+/) do |match|
|
31
|
+
name = match[1..-1]
|
32
|
+
"(?<#{name}>.+)"
|
33
|
+
end
|
34
|
+
route[:path] = Regexp.new(pattern)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def find_route(method, path)
|
40
|
+
@routes.detect do |route|
|
41
|
+
(route.has_key?(:method) ? route[:method] == method : true) &&
|
42
|
+
(route[:path].is_a?(Regexp) ? begin
|
43
|
+
match = route[:path].match path
|
44
|
+
if match
|
45
|
+
@parameters = match.names.inject({ }) do |result, name|
|
46
|
+
result[name.to_sym] = match[name]
|
47
|
+
result
|
48
|
+
end
|
49
|
+
true
|
50
|
+
else
|
51
|
+
false
|
52
|
+
end
|
53
|
+
end : route[:path] == path)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
@@ -26,14 +26,14 @@ class Holoserve::Response::Selector
|
|
26
26
|
|
27
27
|
def selection
|
28
28
|
@responses.each do |key, response|
|
29
|
-
next if key.to_sym == :default
|
29
|
+
next if key.to_sym == :default || !response.has_key?(:condition)
|
30
30
|
begin
|
31
31
|
match = @sandbox.instance_eval do
|
32
32
|
eval response[:condition]
|
33
33
|
end
|
34
34
|
return key.to_sym if match
|
35
35
|
rescue Object => error
|
36
|
-
@logger.error error.inspect
|
36
|
+
@logger.error "error evaluating condition: [#{response[:condition]}] #{error.inspect}"
|
37
37
|
end
|
38
38
|
end
|
39
39
|
@responses.has_key?(:default) ? :default : nil
|
@@ -27,6 +27,10 @@ class Holoserve::Tool::Hash::Matcher
|
|
27
27
|
return false unless match_hash?(value_one, value_two)
|
28
28
|
elsif value_one.is_a?(Array) && value_two.is_a?(Array)
|
29
29
|
return false unless match_array?(value_one, value_two)
|
30
|
+
elsif value_one.is_a?(TrueClass) || value_one.is_a?(FalseClass)
|
31
|
+
return false unless match_boolean?(value_one, value_two)
|
32
|
+
elsif value_two.is_a?(TrueClass) || value_two.is_a?(FalseClass)
|
33
|
+
return false unless match_boolean?(value_two, value_one)
|
30
34
|
else
|
31
35
|
return false unless value_one == value_two
|
32
36
|
end
|
@@ -50,4 +54,11 @@ class Holoserve::Tool::Hash::Matcher
|
|
50
54
|
end
|
51
55
|
true
|
52
56
|
end
|
57
|
+
|
58
|
+
def match_boolean?(boolean, value)
|
59
|
+
(return true if boolean.to_s.downcase == value.downcase) if value.is_a?(String)
|
60
|
+
return true if (boolean ? 1 : 0) == value
|
61
|
+
false
|
62
|
+
end
|
63
|
+
|
53
64
|
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "helper"))
|
2
|
+
|
3
|
+
describe Holoserve::Request::Router do
|
4
|
+
|
5
|
+
let(:test_handler_one) { Object.new }
|
6
|
+
let(:test_handler_two) { Object.new }
|
7
|
+
let(:test_handler_three) { Object.new }
|
8
|
+
|
9
|
+
let(:routes) do
|
10
|
+
[
|
11
|
+
{
|
12
|
+
:method => :get,
|
13
|
+
:path => "/test",
|
14
|
+
:handler => test_handler_one
|
15
|
+
}, {
|
16
|
+
:method => :get,
|
17
|
+
:path => /\/test\/\d+/,
|
18
|
+
:handler => test_handler_two
|
19
|
+
}, {
|
20
|
+
:method => :get,
|
21
|
+
:path => "/test/:id_one/path/:id_two",
|
22
|
+
:handler => test_handler_three
|
23
|
+
}
|
24
|
+
]
|
25
|
+
end
|
26
|
+
|
27
|
+
subject { described_class.new routes }
|
28
|
+
|
29
|
+
before :each do
|
30
|
+
test_handler_one.stub(:response).and_return(:test_response_one)
|
31
|
+
test_handler_two.stub(:response).and_return(:test_response_two)
|
32
|
+
test_handler_three.stub(:response).and_return(:test_response_three)
|
33
|
+
end
|
34
|
+
|
35
|
+
def environment(method, path)
|
36
|
+
{
|
37
|
+
"REQUEST_METHOD" => method.to_s.upcase,
|
38
|
+
"PATH_INFO" => path
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "#dispatch" do
|
43
|
+
|
44
|
+
it "should return the handler response if the given environment matches a route" do
|
45
|
+
result = subject.dispatch environment(:get, "/test")
|
46
|
+
result.should == :test_response_one
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should match routes that defined via regular expressions" do
|
50
|
+
result = subject.dispatch environment(:get, "/test/123")
|
51
|
+
result.should == :test_response_two
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should extract parameters from the route path and place it in the environment" do
|
55
|
+
test_handler_three.should_receive(:response).with(
|
56
|
+
hash_including("parameters" => { :id_one => "abc", :id_two => "def" }))
|
57
|
+
result = subject.dispatch environment(:get, "/test/abc/path/def")
|
58
|
+
result.should == :test_response_three
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should return nil if the no route are matched" do
|
62
|
+
result = subject.dispatch environment(:get, "/unhandled")
|
63
|
+
result.should be_nil
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
@@ -5,12 +5,13 @@ describe Holoserve::Tool::Hash::Matcher do
|
|
5
5
|
let(:hash) do
|
6
6
|
{
|
7
7
|
:test => "value",
|
8
|
+
:boolean => "true",
|
8
9
|
:nested => {
|
9
10
|
:unspecified => "value",
|
10
11
|
:another => "test value"
|
11
12
|
},
|
12
13
|
:unspecified => "value",
|
13
|
-
:nested_array => [{:hash => "value", :unspecified => "value", :morehash => {:test => "value", :unspecified => "value", :array => [{:test => "value"}]}}]
|
14
|
+
:nested_array => [{:hash => "value", :unspecified => "value", :morehash => {:test => "value", :unspecified => "value", :array => [{:test => "value", :boolean => 0}]}}]
|
14
15
|
}
|
15
16
|
end
|
16
17
|
|
@@ -78,6 +79,32 @@ describe Holoserve::Tool::Hash::Matcher do
|
|
78
79
|
}
|
79
80
|
end
|
80
81
|
|
82
|
+
let(:matching_subset_with_nested_array_and_nested_hash_and_nested_array_and_boolean) do
|
83
|
+
{
|
84
|
+
:nested_array => [{:hash => "value", :morehash => {:test => "value", :array => [{:test => "value", :boolean => false}]}}]
|
85
|
+
}
|
86
|
+
end
|
87
|
+
|
88
|
+
let(:mismatching_subset_with_nested_array_and_nested_hash_and_nested_array_and_boolean) do
|
89
|
+
{
|
90
|
+
:nested_array => [{:hash => "value", :morehash => {:test => "value", :array => [{:test => "other value", :boolean => true}]}}]
|
91
|
+
}
|
92
|
+
end
|
93
|
+
|
94
|
+
let(:matching_subset_with_boolean_value) do
|
95
|
+
{
|
96
|
+
:test => "value",
|
97
|
+
:boolean => true
|
98
|
+
}
|
99
|
+
end
|
100
|
+
|
101
|
+
let(:mismatching_subset_with_boolean_value) do
|
102
|
+
{
|
103
|
+
:test => "value",
|
104
|
+
:boolean => false
|
105
|
+
}
|
106
|
+
end
|
107
|
+
|
81
108
|
subject { described_class.new hash, matching_subset }
|
82
109
|
|
83
110
|
describe "#match?" do
|
@@ -131,6 +158,26 @@ describe Holoserve::Tool::Hash::Matcher do
|
|
131
158
|
subject.match?.should be_false
|
132
159
|
end
|
133
160
|
|
161
|
+
it "should return true if a matching subset with a boolean value is provided" do
|
162
|
+
subject.subset = matching_subset_with_boolean_value
|
163
|
+
subject.match?.should be_true
|
164
|
+
end
|
165
|
+
|
166
|
+
it "should return false if a mismatching subset with a boolean value is provided" do
|
167
|
+
subject.subset = mismatching_subset_with_boolean_value
|
168
|
+
subject.match?.should be_false
|
169
|
+
end
|
170
|
+
|
171
|
+
it "should return true if a matching subset with nested array and nested hash and nested array and a boolean is provided" do
|
172
|
+
subject.subset = matching_subset_with_nested_array_and_nested_hash_and_nested_array_and_boolean
|
173
|
+
subject.match?.should be_true
|
174
|
+
end
|
175
|
+
|
176
|
+
it "should return false if a mismatching subset with nested array and nested hash and nested array and a boolean is provided" do
|
177
|
+
subject.subset = mismatching_subset_with_nested_array_and_nested_hash_and_nested_array_and_boolean
|
178
|
+
subject.match?.should be_false
|
179
|
+
end
|
180
|
+
|
134
181
|
end
|
135
182
|
|
136
183
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: holoserve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2013-02-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: goliath
|
17
|
-
requirement:
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,15 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements:
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0'
|
26
31
|
- !ruby/object:Gem::Dependency
|
27
32
|
name: slim
|
28
|
-
requirement:
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
29
34
|
none: false
|
30
35
|
requirements:
|
31
36
|
- - ! '>='
|
@@ -33,10 +38,15 @@ dependencies:
|
|
33
38
|
version: '0'
|
34
39
|
type: :runtime
|
35
40
|
prerelease: false
|
36
|
-
version_requirements:
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
37
47
|
- !ruby/object:Gem::Dependency
|
38
48
|
name: sass
|
39
|
-
requirement:
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
40
50
|
none: false
|
41
51
|
requirements:
|
42
52
|
- - ! '>='
|
@@ -44,10 +54,15 @@ dependencies:
|
|
44
54
|
version: '0'
|
45
55
|
type: :runtime
|
46
56
|
prerelease: false
|
47
|
-
version_requirements:
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
48
63
|
- !ruby/object:Gem::Dependency
|
49
64
|
name: coffee-script
|
50
|
-
requirement:
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
51
66
|
none: false
|
52
67
|
requirements:
|
53
68
|
- - ! '>='
|
@@ -55,10 +70,15 @@ dependencies:
|
|
55
70
|
version: '0'
|
56
71
|
type: :runtime
|
57
72
|
prerelease: false
|
58
|
-
version_requirements:
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
59
79
|
- !ruby/object:Gem::Dependency
|
60
80
|
name: kwalify
|
61
|
-
requirement:
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
62
82
|
none: false
|
63
83
|
requirements:
|
64
84
|
- - ! '>='
|
@@ -66,10 +86,15 @@ dependencies:
|
|
66
86
|
version: '0'
|
67
87
|
type: :runtime
|
68
88
|
prerelease: false
|
69
|
-
version_requirements:
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
70
95
|
- !ruby/object:Gem::Dependency
|
71
96
|
name: rake
|
72
|
-
requirement:
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
73
98
|
none: false
|
74
99
|
requirements:
|
75
100
|
- - ! '>='
|
@@ -77,10 +102,15 @@ dependencies:
|
|
77
102
|
version: '0'
|
78
103
|
type: :development
|
79
104
|
prerelease: false
|
80
|
-
version_requirements:
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
81
111
|
- !ruby/object:Gem::Dependency
|
82
112
|
name: rdoc
|
83
|
-
requirement:
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
84
114
|
none: false
|
85
115
|
requirements:
|
86
116
|
- - ! '>='
|
@@ -88,10 +118,15 @@ dependencies:
|
|
88
118
|
version: '0'
|
89
119
|
type: :development
|
90
120
|
prerelease: false
|
91
|
-
version_requirements:
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ! '>='
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
92
127
|
- !ruby/object:Gem::Dependency
|
93
128
|
name: cucumber
|
94
|
-
requirement:
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
95
130
|
none: false
|
96
131
|
requirements:
|
97
132
|
- - ! '>='
|
@@ -99,10 +134,15 @@ dependencies:
|
|
99
134
|
version: '0'
|
100
135
|
type: :development
|
101
136
|
prerelease: false
|
102
|
-
version_requirements:
|
137
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
103
143
|
- !ruby/object:Gem::Dependency
|
104
144
|
name: rspec
|
105
|
-
requirement:
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
106
146
|
none: false
|
107
147
|
requirements:
|
108
148
|
- - ! '>='
|
@@ -110,10 +150,15 @@ dependencies:
|
|
110
150
|
version: '0'
|
111
151
|
type: :development
|
112
152
|
prerelease: false
|
113
|
-
version_requirements:
|
153
|
+
version_requirements: !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ! '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
114
159
|
- !ruby/object:Gem::Dependency
|
115
160
|
name: transport
|
116
|
-
requirement:
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
117
162
|
none: false
|
118
163
|
requirements:
|
119
164
|
- - ! '>='
|
@@ -121,10 +166,15 @@ dependencies:
|
|
121
166
|
version: '0'
|
122
167
|
type: :development
|
123
168
|
prerelease: false
|
124
|
-
version_requirements:
|
169
|
+
version_requirements: !ruby/object:Gem::Requirement
|
170
|
+
none: false
|
171
|
+
requirements:
|
172
|
+
- - ! '>='
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '0'
|
125
175
|
- !ruby/object:Gem::Dependency
|
126
176
|
name: oauth
|
127
|
-
requirement:
|
177
|
+
requirement: !ruby/object:Gem::Requirement
|
128
178
|
none: false
|
129
179
|
requirements:
|
130
180
|
- - ! '>='
|
@@ -132,9 +182,14 @@ dependencies:
|
|
132
182
|
version: '0'
|
133
183
|
type: :development
|
134
184
|
prerelease: false
|
135
|
-
version_requirements:
|
185
|
+
version_requirements: !ruby/object:Gem::Requirement
|
186
|
+
none: false
|
187
|
+
requirements:
|
188
|
+
- - ! '>='
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '0'
|
136
191
|
description: This tool can be used to fake webservice APIs for testing proposals.
|
137
|
-
email:
|
192
|
+
email: b.phifty@gmail.com
|
138
193
|
executables:
|
139
194
|
- holoserve
|
140
195
|
extensions: []
|
@@ -145,49 +200,50 @@ files:
|
|
145
200
|
- LICENSE
|
146
201
|
- Rakefile
|
147
202
|
- bin/holoserve
|
148
|
-
-
|
149
|
-
- lib/holoserve/
|
150
|
-
- lib/holoserve/
|
203
|
+
- lib/holoserve.rb
|
204
|
+
- lib/holoserve/tool.rb
|
205
|
+
- lib/holoserve/interface.rb
|
206
|
+
- lib/holoserve/interface/fake.rb
|
207
|
+
- lib/holoserve/interface/control.rb
|
151
208
|
- lib/holoserve/interface/control/bucket.rb
|
152
|
-
- lib/holoserve/interface/control/history.rb
|
153
209
|
- lib/holoserve/interface/control/index.rb
|
154
210
|
- lib/holoserve/interface/control/pair.rb
|
211
|
+
- lib/holoserve/interface/control/history.rb
|
155
212
|
- lib/holoserve/interface/control/state.rb
|
156
|
-
- lib/holoserve/interface/control.rb
|
157
213
|
- lib/holoserve/interface/event.rb
|
158
|
-
- lib/holoserve/interface/fake.rb
|
159
|
-
- lib/holoserve/interface.rb
|
160
|
-
- lib/holoserve/pair/finder.rb
|
161
|
-
- lib/holoserve/pair/loader.rb
|
162
|
-
- lib/holoserve/pair/validator.rb
|
163
|
-
- lib/holoserve/pair.rb
|
164
|
-
- lib/holoserve/request/decomposer.rb
|
165
|
-
- lib/holoserve/request/selector.rb
|
166
|
-
- lib/holoserve/request.rb
|
167
|
-
- lib/holoserve/response/combiner.rb
|
168
|
-
- lib/holoserve/response/composer.rb
|
169
|
-
- lib/holoserve/response/selector.rb
|
170
|
-
- lib/holoserve/response.rb
|
171
214
|
- lib/holoserve/state/updater.rb
|
172
|
-
- lib/holoserve/
|
173
|
-
- lib/holoserve/
|
215
|
+
- lib/holoserve/fixture/importer.rb
|
216
|
+
- lib/holoserve/response.rb
|
174
217
|
- lib/holoserve/tool/hash/key_symbolizer.rb
|
175
218
|
- lib/holoserve/tool/hash/matcher.rb
|
176
|
-
- lib/holoserve/tool/hash.rb
|
177
219
|
- lib/holoserve/tool/merger.rb
|
220
|
+
- lib/holoserve/tool/data_path.rb
|
221
|
+
- lib/holoserve/tool/hash.rb
|
178
222
|
- lib/holoserve/tool/uploader.rb
|
179
|
-
- lib/holoserve/
|
180
|
-
- lib/holoserve.rb
|
223
|
+
- lib/holoserve/response/composer.rb
|
224
|
+
- lib/holoserve/response/combiner.rb
|
225
|
+
- lib/holoserve/response/selector.rb
|
226
|
+
- lib/holoserve/fixture.rb
|
227
|
+
- lib/holoserve/pair/loader.rb
|
228
|
+
- lib/holoserve/pair/validator.rb
|
229
|
+
- lib/holoserve/pair/finder.rb
|
230
|
+
- lib/holoserve/request/selector.rb
|
231
|
+
- lib/holoserve/request/decomposer.rb
|
232
|
+
- lib/holoserve/request/router.rb
|
233
|
+
- lib/holoserve/pair.rb
|
234
|
+
- lib/holoserve/request.rb
|
235
|
+
- lib/holoserve/state.rb
|
181
236
|
- spec/helper.rb
|
237
|
+
- spec/lib/holoserve_spec.rb
|
182
238
|
- spec/lib/holoserve/fixture/importer_spec.rb
|
183
|
-
- spec/lib/holoserve/pair/validator_spec.rb
|
184
|
-
- spec/lib/holoserve/request/selector_spec.rb
|
185
|
-
- spec/lib/holoserve/tool/data_path_spec.rb
|
186
239
|
- spec/lib/holoserve/tool/hash/matcher_spec.rb
|
187
240
|
- spec/lib/holoserve/tool/merger_spec.rb
|
188
|
-
- spec/lib/
|
241
|
+
- spec/lib/holoserve/tool/data_path_spec.rb
|
242
|
+
- spec/lib/holoserve/pair/validator_spec.rb
|
243
|
+
- spec/lib/holoserve/request/selector_spec.rb
|
244
|
+
- spec/lib/holoserve/request/router_spec.rb
|
189
245
|
- schema/schema.yaml
|
190
|
-
homepage: http://github.com/
|
246
|
+
homepage: http://github.com/phifty/holoserve
|
191
247
|
licenses: []
|
192
248
|
post_install_message:
|
193
249
|
rdoc_options: []
|
@@ -201,7 +257,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
201
257
|
version: '0'
|
202
258
|
segments:
|
203
259
|
- 0
|
204
|
-
hash:
|
260
|
+
hash: 1715739372282684694
|
205
261
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
262
|
none: false
|
207
263
|
requirements:
|
@@ -210,15 +266,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
266
|
version: '0'
|
211
267
|
requirements: []
|
212
268
|
rubyforge_project: holoserve
|
213
|
-
rubygems_version: 1.8.
|
269
|
+
rubygems_version: 1.8.25
|
214
270
|
signing_key:
|
215
271
|
specification_version: 3
|
216
272
|
summary: Tool to fake HTTP APIs.
|
217
273
|
test_files:
|
274
|
+
- spec/lib/holoserve_spec.rb
|
218
275
|
- spec/lib/holoserve/fixture/importer_spec.rb
|
219
|
-
- spec/lib/holoserve/pair/validator_spec.rb
|
220
|
-
- spec/lib/holoserve/request/selector_spec.rb
|
221
|
-
- spec/lib/holoserve/tool/data_path_spec.rb
|
222
276
|
- spec/lib/holoserve/tool/hash/matcher_spec.rb
|
223
277
|
- spec/lib/holoserve/tool/merger_spec.rb
|
224
|
-
- spec/lib/
|
278
|
+
- spec/lib/holoserve/tool/data_path_spec.rb
|
279
|
+
- spec/lib/holoserve/pair/validator_spec.rb
|
280
|
+
- spec/lib/holoserve/request/selector_spec.rb
|
281
|
+
- spec/lib/holoserve/request/router_spec.rb
|
data/bin/test.log
DELETED
@@ -1,4 +0,0 @@
|
|
1
|
-
[690:INFO] 2012-04-02 21:19:51 :: Starting server on 0.0.0.0:4250 in production mode. Watch out for stones.
|
2
|
-
[708:INFO] 2012-04-02 21:20:17 :: Starting server on 0.0.0.0:4250 in production mode. Watch out for stones.
|
3
|
-
[712:INFO] 2012-04-02 21:20:24 :: Starting server on 0.0.0.0:4250 in production mode. Watch out for stones.
|
4
|
-
[724:INFO] 2012-04-02 21:20:33 :: Starting server on 0.0.0.0:4250 in production mode. Watch out for stones.
|