webmachine 0.4.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/README.md +70 -7
  2. data/Rakefile +19 -0
  3. data/examples/debugger.rb +32 -0
  4. data/examples/webrick.rb +6 -2
  5. data/lib/webmachine.rb +2 -0
  6. data/lib/webmachine/adapters/rack.rb +16 -3
  7. data/lib/webmachine/adapters/webrick.rb +7 -1
  8. data/lib/webmachine/application.rb +10 -10
  9. data/lib/webmachine/cookie.rb +168 -0
  10. data/lib/webmachine/decision/conneg.rb +1 -1
  11. data/lib/webmachine/decision/flow.rb +1 -1
  12. data/lib/webmachine/decision/fsm.rb +19 -12
  13. data/lib/webmachine/decision/helpers.rb +25 -1
  14. data/lib/webmachine/dispatcher.rb +34 -5
  15. data/lib/webmachine/dispatcher/route.rb +2 -0
  16. data/lib/webmachine/media_type.rb +3 -3
  17. data/lib/webmachine/request.rb +11 -0
  18. data/lib/webmachine/resource.rb +3 -1
  19. data/lib/webmachine/resource/authentication.rb +1 -1
  20. data/lib/webmachine/resource/callbacks.rb +16 -0
  21. data/lib/webmachine/resource/tracing.rb +20 -0
  22. data/lib/webmachine/response.rb +38 -8
  23. data/lib/webmachine/trace.rb +74 -0
  24. data/lib/webmachine/trace/fsm.rb +60 -0
  25. data/lib/webmachine/trace/pstore_trace_store.rb +39 -0
  26. data/lib/webmachine/trace/resource_proxy.rb +107 -0
  27. data/lib/webmachine/trace/static/http-headers-status-v3.png +0 -0
  28. data/lib/webmachine/trace/static/trace.erb +54 -0
  29. data/lib/webmachine/trace/static/tracelist.erb +14 -0
  30. data/lib/webmachine/trace/static/wmtrace.css +123 -0
  31. data/lib/webmachine/trace/static/wmtrace.js +725 -0
  32. data/lib/webmachine/trace/trace_resource.rb +129 -0
  33. data/lib/webmachine/version.rb +1 -1
  34. data/spec/spec_helper.rb +19 -0
  35. data/spec/webmachine/adapters/rack_spec.rb +77 -41
  36. data/spec/webmachine/configuration_spec.rb +1 -1
  37. data/spec/webmachine/cookie_spec.rb +99 -0
  38. data/spec/webmachine/decision/conneg_spec.rb +9 -8
  39. data/spec/webmachine/decision/flow_spec.rb +52 -4
  40. data/spec/webmachine/decision/helpers_spec.rb +36 -6
  41. data/spec/webmachine/dispatcher_spec.rb +1 -1
  42. data/spec/webmachine/headers_spec.rb +1 -1
  43. data/spec/webmachine/media_type_spec.rb +1 -1
  44. data/spec/webmachine/request_spec.rb +10 -0
  45. data/spec/webmachine/resource/authentication_spec.rb +3 -3
  46. data/spec/webmachine/response_spec.rb +45 -0
  47. data/spec/webmachine/trace/fsm_spec.rb +32 -0
  48. data/spec/webmachine/trace/resource_proxy_spec.rb +36 -0
  49. data/spec/webmachine/trace/trace_store_spec.rb +29 -0
  50. data/spec/webmachine/trace_spec.rb +17 -0
  51. data/webmachine.gemspec +2 -0
  52. metadata +130 -15
@@ -1,13 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Webmachine::Decision::Conneg do
4
- let(:request) { Webmachine::Request.new("GET", URI.parse("http://localhost:8080/"), Webmachine::Headers["accept" => "*/*"], "") }
5
- let(:response) { Webmachine::Response.new }
6
- let(:resource) do
7
- Class.new(Webmachine::Resource) do
8
- def to_html; "hello world!"; end
9
- end
10
- end
4
+ include_context "default resource"
11
5
 
12
6
  subject do
13
7
  Webmachine::Decision::FSM.new(resource, request, response)
@@ -33,7 +27,7 @@ describe Webmachine::Decision::Conneg do
33
27
  "text/html;charset=iso8859-1, application/xml").
34
28
  should == "text/html;charset=iso8859-1"
35
29
  end
36
-
30
+
37
31
  it "should choose a type more specific than requested when an exact match is not present" do
38
32
  subject.choose_media_type(["application/json;v=3;foo=bar", "application/json;v=2"],
39
33
  "text/html, application/json").
@@ -74,6 +68,13 @@ describe Webmachine::Decision::Conneg do
74
68
  response.headers['Content-Encoding'].should == 'gzip'
75
69
  end
76
70
 
71
+ it "should choose the first acceptable encoding" \
72
+ ", even when no white space after comma" do
73
+ subject.choose_encoding({"gzip" => :encode_gzip}, "identity,gzip")
74
+ subject.metadata['Content-Encoding'].should == 'gzip'
75
+ response.headers['Content-Encoding'].should == 'gzip'
76
+ end
77
+
77
78
  it "should choose the preferred encoding over less-preferred encodings" do
78
79
  subject.choose_encoding({"gzip" => :encode_gzip, "identity" => :encode_identity}, "gzip, identity;q=0.7")
79
80
  subject.metadata['Content-Encoding'].should == 'gzip'
@@ -922,7 +922,7 @@ describe Webmachine::Decision::Flow do
922
922
  # commented for now.
923
923
  # describe "#n16 (POST?)" do it; end
924
924
  # describe "#o16 (PUT?)" do it; end
925
-
925
+
926
926
  describe "#o18 (Multiple representations?)" do
927
927
  let(:resource) do
928
928
  resource_with do
@@ -947,7 +947,7 @@ describe Webmachine::Decision::Flow do
947
947
  end
948
948
  end
949
949
  end
950
-
950
+
951
951
  [["GET", true],["HEAD", true],["PUT", true],["PUT", false],["POST",true],["POST",false],
952
952
  ["DELETE", true]].each do |m, e|
953
953
  context "when the method is #{m} and the resource #{e ? 'exists' : 'does not exist' }" do
@@ -970,7 +970,7 @@ describe Webmachine::Decision::Flow do
970
970
  end
971
971
  end
972
972
  end
973
-
973
+
974
974
  describe "#o20 (Response has entity?)" do
975
975
  let(:resource) do
976
976
  resource_with do
@@ -1024,9 +1024,57 @@ describe Webmachine::Decision::Flow do
1024
1024
  resource.exist = e
1025
1025
  subject.run
1026
1026
  response.code.should == 204
1027
- response.trace.last.should == :o20
1028
1027
  end
1029
1028
  end
1030
1029
  end
1031
1030
  end
1031
+
1032
+ describe "On exception" do
1033
+ context "handle_exception is inherited." do
1034
+ let :resource do
1035
+ resource_with do
1036
+ def to_html
1037
+ raise
1038
+ end
1039
+ end
1040
+ end
1041
+
1042
+ it "calls handle_exception" do
1043
+ resource.should_receive(:handle_exception).with instance_of(RuntimeError)
1044
+ subject.run
1045
+ end
1046
+
1047
+ it "sets the response code to 500" do
1048
+ subject.run
1049
+ response.code.should == 500
1050
+ end
1051
+ end
1052
+
1053
+ context "handle_exception is defined" do
1054
+ let :resource do
1055
+ resource_with do
1056
+ def handle_exception(e)
1057
+ response.body = "error"
1058
+ 501
1059
+ end
1060
+
1061
+ def to_html
1062
+ raise
1063
+ end
1064
+ end
1065
+ end
1066
+
1067
+ it "can define a response body" do
1068
+ subject.run
1069
+ response.body.should == "error"
1070
+ end
1071
+
1072
+ it "uses the return value as a response code." do
1073
+ subject.run
1074
+ response.code.should == 501
1075
+ end
1076
+ end
1077
+ end
1078
+
1079
+
1032
1080
  end
@@ -1,13 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Webmachine::Decision::Helpers do
4
+ include_context "default resource"
4
5
  subject { Webmachine::Decision::FSM.new(resource, request, response) }
5
- let(:method) { 'GET' }
6
- let(:uri) { URI.parse('http://localhost/') }
7
- let(:headers) { Webmachine::Headers.new }
8
- let(:body) { '' }
9
- let(:request) { Webmachine::Request.new(method, uri, headers, body) }
10
- let(:response) { Webmachine::Response.new }
11
6
 
12
7
  def resource_with(&block)
13
8
  klass = Class.new(Webmachine::Resource) do
@@ -51,6 +46,41 @@ describe Webmachine::Decision::Helpers do
51
46
  end
52
47
  end
53
48
 
49
+ context "setting the Content-Length header when responding" do
50
+ [204, 304].each do |code|
51
+ it "removes the header for entity-less response code #{code}" do
52
+ response.headers['Content-Length'] = '0'
53
+ response.body = nil
54
+ subject.send :respond, code
55
+ response.headers.should_not include 'Content-Length'
56
+ end
57
+ end
58
+
59
+ (200..599).each do |code|
60
+ # 204 and 304 have no bodies, 404 is set to a default non-zero
61
+ # response by Webmachine
62
+ next if code == 204 || code == 304 || code == 404
63
+
64
+ it "adds the header for response code #{code} that should include an entity but has an empty body" do
65
+ response.code = code
66
+ response.body = nil
67
+ subject.send :respond, code
68
+ response.headers['Content-Length'].should == '0'
69
+ end
70
+ end
71
+
72
+ (200..599).each do |code|
73
+ next if code == 204 || code == 304
74
+
75
+ it "does not add the header when Transfer-Encoding is set on code #{code}" do
76
+ response.headers['Transfer-Encoding'] = 'chunked'
77
+ response.body = []
78
+ subject.send :respond, code
79
+ response.headers.should_not include 'Content-Length'
80
+ end
81
+ end
82
+ end
83
+
54
84
  describe "#encode_body" do
55
85
  before { subject.run }
56
86
 
@@ -48,7 +48,7 @@ describe Webmachine::Dispatcher do
48
48
  it "should apply route to request before creating the resource" do
49
49
  route = dispatcher.add_route ["*"], resource
50
50
  applied = false
51
-
51
+
52
52
  route.should_receive(:apply) { applied = true }
53
53
  resource.should_receive(:new) do
54
54
  applied.should be_true
@@ -13,7 +13,7 @@ describe Webmachine::Headers do
13
13
  headers["content-length"].should == 14
14
14
  end
15
15
  end
16
-
16
+
17
17
  context "filtering with #grep" do
18
18
  subject { described_class["content-type" => "text/plain", "etag" => '"abcdef1234567890"'] }
19
19
  it "should filter keys by the given pattern" do
@@ -62,7 +62,7 @@ describe Webmachine::MediaType do
62
62
  it { should_not be_exact_match("text/xml") }
63
63
  it { should_not be_exact_match("application/xml") }
64
64
  it { should_not be_exact_match("application/xml;version=1") }
65
-
65
+
66
66
  it { should be_type_matches("application/xml") }
67
67
  it { should be_type_matches("application/*") }
68
68
  it { should be_type_matches("*/*") }
@@ -14,6 +14,16 @@ describe Webmachine::Request do
14
14
  subject["accept"].should == "*/*"
15
15
  end
16
16
 
17
+ it "should provide access to the cookies" do
18
+ subject.headers['Cookie'] = 'name=value;name2=value2';
19
+ subject.cookies.should == { 'name' => 'value', 'name2' => 'value2' }
20
+ end
21
+
22
+ it "should handle cookies with extra whitespace" do
23
+ subject.headers['Cookie'] = 'name = value; name2 = value2';
24
+ subject.cookies.should == { 'name' => 'value', 'name2' => 'value2' }
25
+ end
26
+
17
27
  it "should provide access to the headers via underscored methods" do
18
28
  subject.headers["Accept-Encoding"] = "identity"
19
29
  subject.accept_encoding.should == "identity"
@@ -27,7 +27,7 @@ describe Webmachine::Resource::Authentication do
27
27
  end
28
28
  end
29
29
  end
30
-
30
+
31
31
  context "when no authorization is sent by the client" do
32
32
  it "should reply with a 401 Unauthorized and a WWW-Authenticate header using Basic" do
33
33
  subject.run
@@ -46,12 +46,12 @@ describe Webmachine::Resource::Authentication do
46
46
  before do
47
47
  headers['Authorization'] = "Basic " + ["invalid:auth"].pack('m*').chomp
48
48
  end
49
-
49
+
50
50
  it "should reply with a 401 Unauthorized and a WWW-Authenticate header using Basic" do
51
51
  subject.run
52
52
  response.code.should == 401
53
53
  response.headers['WWW-Authenticate'].should == 'Basic realm="Webmachine"'
54
- end
54
+ end
55
55
  end
56
56
 
57
57
  context "when the client sends valid authorization" do
@@ -0,0 +1,45 @@
1
+ require 'spec_helper'
2
+
3
+ describe Webmachine::Response do
4
+
5
+ it "should have sane default values" do
6
+ subject.code.should == 200
7
+ subject.is_redirect?.should be_false
8
+ subject.headers.should be_empty
9
+ end
10
+
11
+ describe "a redirected response" do
12
+ let(:redirect_url) { "/" }
13
+
14
+ before(:all) { subject.redirect_to redirect_url }
15
+
16
+ its(:is_redirect?) { should be_true }
17
+
18
+ it "should have a proper Location header" do
19
+ subject.headers["Location"].should == redirect_url
20
+ end
21
+ end
22
+
23
+ describe "setting a cookie" do
24
+ let(:cookie) { "monster" }
25
+ let(:cookie_value) { "mash" }
26
+
27
+ before(:all) { subject.set_cookie(cookie, cookie_value) }
28
+
29
+ it "should have a proper Set-Cookie header" do
30
+ subject.headers["Set-Cookie"].should include "monster=mash";
31
+ end
32
+
33
+ describe "setting multiple cookies" do
34
+ let(:cookie2) { "rodeo" }
35
+ let(:cookie2_value) { "clown" }
36
+ before(:all) { subject.set_cookie(cookie2, cookie2_value) }
37
+
38
+ it "should have a proper Set-Cookie header" do
39
+ subject.headers["Set-Cookie"].should be_a Array
40
+ subject.headers["Set-Cookie"].should include "rodeo=clown"
41
+ subject.headers["Set-Cookie"].should include "monster=mash"
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+
3
+ describe Webmachine::Trace::FSM do
4
+ include_context "default resource"
5
+
6
+ subject { Webmachine::Decision::FSM.new(resource, request, response) }
7
+ before { Webmachine::Trace.trace_store = :memory }
8
+
9
+ context "when tracing is enabled" do
10
+ before { Webmachine::Trace.stub!(:trace?).and_return(true) }
11
+
12
+ it "proxies the resource" do
13
+ subject.resource.should be_kind_of(Webmachine::Trace::ResourceProxy)
14
+ end
15
+
16
+ it "records a trace" do
17
+ subject.run
18
+ response.trace.should_not be_empty
19
+ Webmachine::Trace.traces.should have(1).item
20
+ end
21
+ end
22
+
23
+ context "when tracing is disabled" do
24
+ before { Webmachine::Trace.stub!(:trace?).and_return(false) }
25
+
26
+ it "leaves no trace" do
27
+ subject.run
28
+ response.trace.should be_empty
29
+ Webmachine::Trace.traces.should be_empty
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,36 @@
1
+ require 'spec_helper'
2
+ require 'webmachine/trace/resource_proxy'
3
+
4
+ describe Webmachine::Trace::ResourceProxy do
5
+ include_context "default resource"
6
+ subject { described_class.new(resource) }
7
+
8
+ it "duck-types all callback methods" do
9
+ Webmachine::Resource::Callbacks.instance_methods(false).each do |m|
10
+ subject.should respond_to(m)
11
+ end
12
+ end
13
+
14
+ it "logs invocations of callbacks" do
15
+ subject.generate_etag
16
+ response.trace.should == [{:type => :attempt, :name => "(default)#generate_etag"},
17
+ {:type => :result, :value => nil}]
18
+
19
+ end
20
+
21
+ it "logs invocations of body-producing methods" do
22
+ subject.content_types_provided.should == [["text/html", :to_html]]
23
+ subject.to_html
24
+ response.trace[-2][:type].should == :attempt
25
+ response.trace[-2][:name].should =~ /to_html$/
26
+ response.trace[-2][:source].should include("spec_helper.rb") if response.trace[-2][:source]
27
+ response.trace[-1].should == {:type => :result, :value => "<html><body>Hello, world!</body></html>"}
28
+ end
29
+
30
+ it "commits the trace to separate storage when the request has finished processing" do
31
+ Webmachine::Trace.should_receive(:record).with(subject.object_id.to_s, [{:type=>:attempt, :name=>"(default)#finish_request"},
32
+ {:type=>:result, :value=>nil}]).and_return(true)
33
+ subject.finish_request
34
+ response.headers["X-Webmachine-Trace-Id"].should == subject.object_id.to_s
35
+ end
36
+ end
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+ require 'fileutils'
3
+
4
+ shared_examples_for "trace storage" do
5
+ it { should respond_to(:[]=) }
6
+ it { should respond_to(:keys) }
7
+ it { should respond_to(:fetch) }
8
+
9
+ it "stores a trace" do
10
+ subject["foo"] = [:bar]
11
+ subject.fetch("foo").should == [:bar]
12
+ end
13
+
14
+ it "lists a stored trace in the keys" do
15
+ subject["foo"] = [:bar]
16
+ subject.keys.should == ["foo"]
17
+ end
18
+ end
19
+
20
+ describe Webmachine::Trace::PStoreTraceStore do
21
+ subject { described_class.new("./wmtrace") }
22
+ after { FileUtils.rm_rf("./wmtrace") }
23
+ it_behaves_like "trace storage"
24
+ end
25
+
26
+ describe "Webmachine::Trace :memory Trace Store (Hash)" do
27
+ subject { Hash.new }
28
+ it_behaves_like "trace storage"
29
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe Webmachine::Trace do
4
+ subject { described_class }
5
+
6
+ context "determining whether the resource should be traced" do
7
+ include_context "default resource"
8
+ it "does not trace by default" do
9
+ subject.trace?(resource).should be_false
10
+ end
11
+
12
+ it "traces when the resource enables tracing" do
13
+ resource.should_receive(:trace?).and_return(true)
14
+ subject.trace?(resource).should be_true
15
+ end
16
+ end
17
+ end
@@ -15,11 +15,13 @@ Gem::Specification.new do |gem|
15
15
  gem.email = ["sean@basho.com"]
16
16
 
17
17
  gem.add_runtime_dependency(%q<i18n>, [">= 0.4.0"])
18
+ gem.add_runtime_dependency(%q<multi_json>)
18
19
  gem.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
19
20
  gem.add_development_dependency(%q<yard>, ["~> 0.7.3"])
20
21
  gem.add_development_dependency(%q<rake>)
21
22
  gem.add_development_dependency(%q<mongrel>, ['~>1.2.beta'])
22
23
  gem.add_development_dependency(%q<rack>)
24
+ gem.add_development_dependency(%q<rack-test>)
23
25
 
24
26
  ignores = File.read(".gitignore").split(/\r?\n/).reject{ |f| f =~ /^(#.+|\s*)$/ }.map {|f| Dir[f] }.flatten
25
27
  gem.files = (Dir['**/*','.gitignore'] - ignores).reject {|f| !File.file?(f) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webmachine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-22 00:00:00.000000000 Z
12
+ date: 2012-07-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
16
- requirement: &2152611180 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,31 @@ dependencies:
21
21
  version: 0.4.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152611180
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.4.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: multi_json
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
25
46
  - !ruby/object:Gem::Dependency
26
47
  name: rspec
27
- requirement: &2152610340 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
28
49
  none: false
29
50
  requirements:
30
51
  - - ~>
@@ -32,10 +53,15 @@ dependencies:
32
53
  version: 2.8.0
33
54
  type: :development
34
55
  prerelease: false
35
- version_requirements: *2152610340
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 2.8.0
36
62
  - !ruby/object:Gem::Dependency
37
63
  name: yard
38
- requirement: &2152609740 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
39
65
  none: false
40
66
  requirements:
41
67
  - - ~>
@@ -43,10 +69,15 @@ dependencies:
43
69
  version: 0.7.3
44
70
  type: :development
45
71
  prerelease: false
46
- version_requirements: *2152609740
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 0.7.3
47
78
  - !ruby/object:Gem::Dependency
48
79
  name: rake
49
- requirement: &2152609320 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
50
81
  none: false
51
82
  requirements:
52
83
  - - ! '>='
@@ -54,10 +85,15 @@ dependencies:
54
85
  version: '0'
55
86
  type: :development
56
87
  prerelease: false
57
- version_requirements: *2152609320
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
58
94
  - !ruby/object:Gem::Dependency
59
95
  name: mongrel
60
- requirement: &2152608660 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
61
97
  none: false
62
98
  requirements:
63
99
  - - ~>
@@ -65,10 +101,31 @@ dependencies:
65
101
  version: 1.2.beta
66
102
  type: :development
67
103
  prerelease: false
68
- version_requirements: *2152608660
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 1.2.beta
69
110
  - !ruby/object:Gem::Dependency
70
111
  name: rack
71
- requirement: &2152608080 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: rack-test
128
+ requirement: !ruby/object:Gem::Requirement
72
129
  none: false
73
130
  requirements:
74
131
  - - ! '>='
@@ -76,7 +133,12 @@ dependencies:
76
133
  version: '0'
77
134
  type: :development
78
135
  prerelease: false
79
- version_requirements: *2152608080
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
80
142
  description: ! ' webmachine is a toolkit for building HTTP applications in a declarative
81
143
  fashion, that avoids the confusion of going through a CGI-style interface like Rack.
82
144
  It is strongly influenced by the original Erlang project of the same name and shares
@@ -100,12 +162,30 @@ files:
100
162
  - doc/js/full_list.js
101
163
  - doc/js/jquery.js
102
164
  - doc/method_list.html
165
+ - doc/top-level-namespace.html
103
166
  - doc/Webmachine/Adapter.html
167
+ - doc/Webmachine/Adapters/Mongrel/Handler.html
168
+ - doc/Webmachine/Adapters/Mongrel/RequestBody.html
169
+ - doc/Webmachine/Adapters/Mongrel.html
170
+ - doc/Webmachine/Adapters/Rack/RequestBody.html
171
+ - doc/Webmachine/Adapters/Rack.html
172
+ - doc/Webmachine/Adapters/WEBrick/RequestBody.html
173
+ - doc/Webmachine/Adapters/WEBrick/Server.html
174
+ - doc/Webmachine/Adapters/WEBrick.html
104
175
  - doc/Webmachine/Adapters.html
105
176
  - doc/Webmachine/Application.html
106
177
  - doc/Webmachine/CallableEncoder.html
107
178
  - doc/Webmachine/ChunkedBody.html
179
+ - doc/Webmachine/Configuration.html
180
+ - doc/Webmachine/Cookie.html
181
+ - doc/Webmachine/Decision/Conneg/MediaTypeList.html
182
+ - doc/Webmachine/Decision/Conneg/PriorityList.html
183
+ - doc/Webmachine/Decision/Conneg.html
184
+ - doc/Webmachine/Decision/Flow.html
185
+ - doc/Webmachine/Decision/FSM.html
186
+ - doc/Webmachine/Decision/Helpers.html
108
187
  - doc/Webmachine/Decision.html
188
+ - doc/Webmachine/Dispatcher/Route.html
109
189
  - doc/Webmachine/Dispatcher.html
110
190
  - doc/Webmachine/EnumerableEncoder.html
111
191
  - doc/Webmachine/Error.html
@@ -115,12 +195,23 @@ files:
115
195
  - doc/Webmachine/MalformedRequest.html
116
196
  - doc/Webmachine/MediaType.html
117
197
  - doc/Webmachine/Request.html
198
+ - doc/Webmachine/Resource/Authentication.html
199
+ - doc/Webmachine/Resource/Callbacks.html
200
+ - doc/Webmachine/Resource/Encodings.html
118
201
  - doc/Webmachine/Resource.html
202
+ - doc/Webmachine/Response/HeaderHash.html
119
203
  - doc/Webmachine/Response.html
120
204
  - doc/Webmachine/StreamingEncoder.html
205
+ - doc/Webmachine/Trace/Call.html
206
+ - doc/Webmachine/Trace/PStoreTraceStore.html
207
+ - doc/Webmachine/Trace/ResourceProxy.html
208
+ - doc/Webmachine/Trace/TraceResource.html
209
+ - doc/Webmachine/Trace/Wrapper.html
210
+ - doc/Webmachine/Trace.html
121
211
  - doc/Webmachine/Translation.html
122
212
  - doc/Webmachine.html
123
213
  - examples/application.rb
214
+ - examples/debugger.rb
124
215
  - examples/webrick.rb
125
216
  - Gemfile
126
217
  - Guardfile
@@ -132,6 +223,7 @@ files:
132
223
  - lib/webmachine/application.rb
133
224
  - lib/webmachine/chunked_body.rb
134
225
  - lib/webmachine/configuration.rb
226
+ - lib/webmachine/cookie.rb
135
227
  - lib/webmachine/decision/conneg.rb
136
228
  - lib/webmachine/decision/flow.rb
137
229
  - lib/webmachine/decision/fsm.rb
@@ -148,9 +240,20 @@ files:
148
240
  - lib/webmachine/resource/authentication.rb
149
241
  - lib/webmachine/resource/callbacks.rb
150
242
  - lib/webmachine/resource/encodings.rb
243
+ - lib/webmachine/resource/tracing.rb
151
244
  - lib/webmachine/resource.rb
152
245
  - lib/webmachine/response.rb
153
246
  - lib/webmachine/streaming.rb
247
+ - lib/webmachine/trace/fsm.rb
248
+ - lib/webmachine/trace/pstore_trace_store.rb
249
+ - lib/webmachine/trace/resource_proxy.rb
250
+ - lib/webmachine/trace/static/http-headers-status-v3.png
251
+ - lib/webmachine/trace/static/trace.erb
252
+ - lib/webmachine/trace/static/tracelist.erb
253
+ - lib/webmachine/trace/static/wmtrace.css
254
+ - lib/webmachine/trace/static/wmtrace.js
255
+ - lib/webmachine/trace/trace_resource.rb
256
+ - lib/webmachine/trace.rb
154
257
  - lib/webmachine/translation.rb
155
258
  - lib/webmachine/version.rb
156
259
  - lib/webmachine.rb
@@ -165,6 +268,7 @@ files:
165
268
  - spec/webmachine/application_spec.rb
166
269
  - spec/webmachine/chunked_body_spec.rb
167
270
  - spec/webmachine/configuration_spec.rb
271
+ - spec/webmachine/cookie_spec.rb
168
272
  - spec/webmachine/decision/conneg_spec.rb
169
273
  - spec/webmachine/decision/flow_spec.rb
170
274
  - spec/webmachine/decision/helpers_spec.rb
@@ -175,6 +279,11 @@ files:
175
279
  - spec/webmachine/media_type_spec.rb
176
280
  - spec/webmachine/request_spec.rb
177
281
  - spec/webmachine/resource/authentication_spec.rb
282
+ - spec/webmachine/response_spec.rb
283
+ - spec/webmachine/trace/fsm_spec.rb
284
+ - spec/webmachine/trace/resource_proxy_spec.rb
285
+ - spec/webmachine/trace/trace_store_spec.rb
286
+ - spec/webmachine/trace_spec.rb
178
287
  - webmachine.gemspec
179
288
  - .gitignore
180
289
  homepage: http://github.com/seancribbs/webmachine-ruby
@@ -197,7 +306,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
306
  version: '0'
198
307
  requirements: []
199
308
  rubyforge_project:
200
- rubygems_version: 1.8.15
309
+ rubygems_version: 1.8.23
201
310
  signing_key:
202
311
  specification_version: 3
203
312
  summary: webmachine is a toolkit for building HTTP applications,
@@ -210,6 +319,7 @@ test_files:
210
319
  - spec/webmachine/application_spec.rb
211
320
  - spec/webmachine/chunked_body_spec.rb
212
321
  - spec/webmachine/configuration_spec.rb
322
+ - spec/webmachine/cookie_spec.rb
213
323
  - spec/webmachine/decision/conneg_spec.rb
214
324
  - spec/webmachine/decision/flow_spec.rb
215
325
  - spec/webmachine/decision/helpers_spec.rb
@@ -220,4 +330,9 @@ test_files:
220
330
  - spec/webmachine/media_type_spec.rb
221
331
  - spec/webmachine/request_spec.rb
222
332
  - spec/webmachine/resource/authentication_spec.rb
333
+ - spec/webmachine/response_spec.rb
334
+ - spec/webmachine/trace/fsm_spec.rb
335
+ - spec/webmachine/trace/resource_proxy_spec.rb
336
+ - spec/webmachine/trace/trace_store_spec.rb
337
+ - spec/webmachine/trace_spec.rb
223
338
  - .gitignore