webmachine 1.6.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +2 -5
- data/documentation/adapters.md +2 -11
- data/examples/debugger.rb +5 -3
- data/examples/logging.rb +2 -2
- data/examples/webrick.rb +2 -2
- data/lib/webmachine/adapter.rb +0 -3
- data/lib/webmachine/adapters/lazy_request_body.rb +1 -1
- data/lib/webmachine/adapters/rack.rb +38 -34
- data/lib/webmachine/adapters/rack_mapped.rb +1 -2
- data/lib/webmachine/adapters/webrick.rb +11 -12
- data/lib/webmachine/adapters.rb +0 -2
- data/lib/webmachine/application.rb +2 -2
- data/lib/webmachine/chunked_body.rb +1 -1
- data/lib/webmachine/configuration.rb +1 -1
- data/lib/webmachine/constants.rb +12 -12
- data/lib/webmachine/cookie.rb +20 -18
- data/lib/webmachine/decision/conneg.rb +24 -24
- data/lib/webmachine/decision/falsey.rb +0 -1
- data/lib/webmachine/decision/flow.rb +19 -20
- data/lib/webmachine/decision/fsm.rb +4 -4
- data/lib/webmachine/decision/helpers.rb +21 -21
- data/lib/webmachine/dispatcher/route.rb +28 -28
- data/lib/webmachine/dispatcher.rb +3 -2
- data/lib/webmachine/errors.rb +7 -8
- data/lib/webmachine/etags.rb +2 -1
- data/lib/webmachine/header_negotiation.rb +5 -6
- data/lib/webmachine/headers.rb +5 -5
- data/lib/webmachine/media_type.rb +5 -5
- data/lib/webmachine/quoted_string.rb +3 -3
- data/lib/webmachine/request.rb +7 -10
- data/lib/webmachine/rescueable_exception.rb +3 -3
- data/lib/webmachine/resource/authentication.rb +3 -4
- data/lib/webmachine/resource/callbacks.rb +3 -3
- data/lib/webmachine/resource/encodings.rb +3 -9
- data/lib/webmachine/resource.rb +1 -1
- data/lib/webmachine/response.rb +7 -9
- data/lib/webmachine/spec/adapter_lint.rb +67 -69
- data/lib/webmachine/spec/test_resource.rb +22 -22
- data/lib/webmachine/streaming/encoder.rb +3 -2
- data/lib/webmachine/streaming/io_encoder.rb +4 -3
- data/lib/webmachine/trace/fsm.rb +25 -18
- data/lib/webmachine/trace/resource_proxy.rb +10 -9
- data/lib/webmachine/trace/static/http-headers-status-v3.png +0 -0
- data/lib/webmachine/trace/trace_resource.rb +22 -24
- data/lib/webmachine/trace.rb +7 -6
- data/lib/webmachine/translation.rb +3 -3
- data/lib/webmachine/version.rb +1 -1
- data/pkg/webmachine-2.0.0.beta.gem +0 -0
- metadata +51 -84
- data/.gitignore +0 -31
- data/Gemfile +0 -46
- data/Guardfile +0 -11
- data/RELEASING.md +0 -21
- data/Rakefile +0 -44
- data/lib/webmachine/adapters/httpkit.rb +0 -74
- data/lib/webmachine/adapters/reel.rb +0 -113
- data/memory_test.rb +0 -37
- data/spec/spec_helper.rb +0 -56
- data/spec/webmachine/adapter_spec.rb +0 -39
- data/spec/webmachine/adapters/httpkit_spec.rb +0 -10
- data/spec/webmachine/adapters/rack_mapped_spec.rb +0 -71
- data/spec/webmachine/adapters/rack_spec.rb +0 -62
- data/spec/webmachine/adapters/reel_spec.rb +0 -76
- data/spec/webmachine/adapters/webrick_spec.rb +0 -12
- data/spec/webmachine/application_spec.rb +0 -74
- data/spec/webmachine/chunked_body_spec.rb +0 -30
- data/spec/webmachine/configuration_spec.rb +0 -27
- data/spec/webmachine/cookie_spec.rb +0 -99
- data/spec/webmachine/decision/conneg_spec.rb +0 -166
- data/spec/webmachine/decision/falsey_spec.rb +0 -8
- data/spec/webmachine/decision/flow_spec.rb +0 -1148
- data/spec/webmachine/decision/fsm_spec.rb +0 -163
- data/spec/webmachine/decision/helpers_spec.rb +0 -216
- data/spec/webmachine/dispatcher/rfc3986_percent_decode_spec.rb +0 -22
- data/spec/webmachine/dispatcher/route_spec.rb +0 -248
- data/spec/webmachine/dispatcher_spec.rb +0 -104
- data/spec/webmachine/errors_spec.rb +0 -13
- data/spec/webmachine/etags_spec.rb +0 -75
- data/spec/webmachine/events_spec.rb +0 -58
- data/spec/webmachine/headers_spec.rb +0 -99
- data/spec/webmachine/media_type_spec.rb +0 -85
- data/spec/webmachine/request_spec.rb +0 -273
- data/spec/webmachine/rescueable_exception_spec.rb +0 -15
- data/spec/webmachine/resource/authentication_spec.rb +0 -68
- data/spec/webmachine/response_spec.rb +0 -51
- data/spec/webmachine/trace/fsm_spec.rb +0 -37
- data/spec/webmachine/trace/resource_proxy_spec.rb +0 -34
- data/spec/webmachine/trace/trace_store_spec.rb +0 -29
- data/spec/webmachine/trace_spec.rb +0 -17
- data/webmachine.gemspec +0 -25
data/lib/webmachine/trace/fsm.rb
CHANGED
@@ -23,39 +23,46 @@ module Webmachine
|
|
23
23
|
# Adds the request to the trace.
|
24
24
|
# @param [Webmachine::Request] request the request to be traced
|
25
25
|
def trace_request(request)
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
if trace?
|
27
|
+
response.trace << {
|
28
|
+
type: :request,
|
29
|
+
method: request.method,
|
30
|
+
path: request.uri.request_uri.to_s,
|
31
|
+
headers: request.headers,
|
32
|
+
body: request.body.to_s
|
33
|
+
}
|
34
|
+
end
|
33
35
|
end
|
34
36
|
|
35
37
|
# Adds the response to the trace and then commits the trace to
|
36
38
|
# separate storage which can be discovered by the debugger.
|
37
39
|
# @param [Webmachine::Response] response the response to be traced
|
38
40
|
def trace_response(response)
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
if trace?
|
42
|
+
response.trace << {
|
43
|
+
type: :response,
|
44
|
+
code: response.code.to_s,
|
45
|
+
headers: response.headers,
|
46
|
+
body: trace_response_body(response.body)
|
47
|
+
}
|
48
|
+
end
|
45
49
|
ensure
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
+
if trace?
|
51
|
+
Webmachine::Events.publish('wm.trace.record', {
|
52
|
+
trace_id: resource.object_id.to_s,
|
53
|
+
trace: response.trace
|
54
|
+
})
|
55
|
+
end
|
50
56
|
end
|
51
57
|
|
52
58
|
# Adds a decision to the trace.
|
53
59
|
# @param [Symbol] decision the decision being processed
|
54
60
|
def trace_decision(decision)
|
55
|
-
response.trace << {:
|
61
|
+
response.trace << {type: :decision, decision: decision} if trace?
|
56
62
|
end
|
57
63
|
|
58
64
|
private
|
65
|
+
|
59
66
|
# Works around streaming encoders where possible
|
60
67
|
def trace_response_body(body)
|
61
68
|
case body
|
@@ -14,7 +14,7 @@ module Webmachine
|
|
14
14
|
# including body-producing or accepting methods, encoders and
|
15
15
|
# charsetters.
|
16
16
|
CALLBACK_REFERRERS = [:content_types_accepted, :content_types_provided,
|
17
|
-
|
17
|
+
:encodings_provided, :charsets_provided]
|
18
18
|
|
19
19
|
# Creates a {ResourceProxy} that decorates the passed
|
20
20
|
# {Webmachine::Resource} such that callbacks invoked by the
|
@@ -46,6 +46,7 @@ module Webmachine
|
|
46
46
|
end
|
47
47
|
|
48
48
|
private
|
49
|
+
|
49
50
|
# Proxy a given callback to the inner resource, decorating with traces
|
50
51
|
def proxy_callback(callback, *args)
|
51
52
|
# Log inputs and attempt
|
@@ -56,20 +57,20 @@ module Webmachine
|
|
56
57
|
resource.response.trace << result(_result)
|
57
58
|
_result
|
58
59
|
rescue => exc
|
59
|
-
exc.backtrace.reject! {|s| s.include?(__FILE__) }
|
60
|
+
exc.backtrace.reject! { |s| s.include?(__FILE__) }
|
60
61
|
resource.response.trace << exception(exc)
|
61
62
|
raise
|
62
63
|
end
|
63
64
|
|
64
65
|
# Creates a log entry for the entry to a resource callback.
|
65
66
|
def attempt(callback, args)
|
66
|
-
log = {:
|
67
|
+
log = {type: :attempt}
|
67
68
|
method = resource.method(callback)
|
68
69
|
if method.owner == ::Webmachine::Resource::Callbacks
|
69
70
|
log[:name] = "(default)##{method.name}"
|
70
71
|
else
|
71
72
|
log[:name] = "#{method.owner.name}##{method.name}"
|
72
|
-
log[:source] = method.source_location.join(
|
73
|
+
log[:source] = method.source_location.join(':') if method.respond_to?(:source_location)
|
73
74
|
end
|
74
75
|
unless args.empty?
|
75
76
|
log[:args] = args
|
@@ -79,15 +80,15 @@ module Webmachine
|
|
79
80
|
|
80
81
|
# Creates a log entry for the result of a resource callback
|
81
82
|
def result(result)
|
82
|
-
{:
|
83
|
+
{type: :result, value: result}
|
83
84
|
end
|
84
85
|
|
85
86
|
# Creates a log entry for an exception that was raised from a callback
|
86
87
|
def exception(e)
|
87
|
-
{:
|
88
|
-
|
89
|
-
|
90
|
-
|
88
|
+
{type: :exception,
|
89
|
+
class: e.class.name,
|
90
|
+
backtrace: e.backtrace,
|
91
|
+
message: e.message}
|
91
92
|
end
|
92
93
|
|
93
94
|
# Adds proxy methods for callbacks that are dynamically referred to.
|
Binary file
|
@@ -7,15 +7,14 @@ module Webmachine
|
|
7
7
|
# includes serving the static files (the PNG flow diagram, CSS and
|
8
8
|
# JS for the UI) and the HTML for the individual traces.
|
9
9
|
class TraceResource < Resource
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
TRACE_ERB = File.expand_path("../static/trace.erb", __FILE__)
|
10
|
+
MAP_EXTERNAL = %w[static map.png]
|
11
|
+
MAP_FILE = File.expand_path('../static/http-headers-status-v3.png', __FILE__)
|
12
|
+
SCRIPT_EXTERNAL = %w[static wmtrace.js]
|
13
|
+
SCRIPT_FILE = File.expand_path("../#{SCRIPT_EXTERNAL.join "/"}", __FILE__)
|
14
|
+
STYLE_EXTERNAL = %w[static wmtrace.css]
|
15
|
+
STYLE_FILE = File.expand_path("../#{STYLE_EXTERNAL.join "/"}", __FILE__)
|
16
|
+
TRACELIST_ERB = File.expand_path('../static/tracelist.erb', __FILE__)
|
17
|
+
TRACE_ERB = File.expand_path('../static/trace.erb', __FILE__)
|
19
18
|
|
20
19
|
# The ERB template for the trace list
|
21
20
|
def self.tracelist
|
@@ -30,15 +29,15 @@ module Webmachine
|
|
30
29
|
def content_types_provided
|
31
30
|
case request.path_tokens
|
32
31
|
when []
|
33
|
-
[[
|
32
|
+
[['text/html', :produce_list]]
|
34
33
|
when MAP_EXTERNAL
|
35
|
-
[[
|
34
|
+
[['image/png', :produce_file]]
|
36
35
|
when SCRIPT_EXTERNAL
|
37
|
-
[[
|
36
|
+
[['text/javascript', :produce_file]]
|
38
37
|
when STYLE_EXTERNAL
|
39
|
-
[[
|
38
|
+
[['text/css', :produce_file]]
|
40
39
|
else
|
41
|
-
[[
|
40
|
+
[['text/html', :produce_trace]]
|
42
41
|
end
|
43
42
|
end
|
44
43
|
|
@@ -73,12 +72,12 @@ module Webmachine
|
|
73
72
|
# TODO: Add support for IO objects as response bodies,
|
74
73
|
# allowing server optimizations like sendfile or chunked
|
75
74
|
# downloads
|
76
|
-
|
75
|
+
File.binread(@file)
|
77
76
|
end
|
78
77
|
|
79
78
|
def produce_list
|
80
|
-
base
|
81
|
-
traces = Trace.traces.map {|t| [
|
79
|
+
base = request.uri.path.chomp('/')
|
80
|
+
traces = Trace.traces.map { |t| [t, "#{base}/#{t}"] }
|
82
81
|
self.class.tracelist.result(binding)
|
83
82
|
end
|
84
83
|
|
@@ -96,22 +95,22 @@ module Webmachine
|
|
96
95
|
tres = data.pop.dup
|
97
96
|
treq.delete :type
|
98
97
|
tres.delete :type
|
99
|
-
[
|
98
|
+
[MultiJson.dump(treq), MultiJson.dump(tres), MultiJson.dump(encode_decisions(data))]
|
100
99
|
end
|
101
100
|
|
102
101
|
def encode_decisions(decisions)
|
103
|
-
decisions.
|
102
|
+
decisions.each_with_object([]) do |event, list|
|
104
103
|
case event[:type]
|
105
104
|
when :decision
|
106
105
|
# Don't produce new decisions for sub-steps in the graph
|
107
|
-
unless event[:decision].to_s
|
106
|
+
unless /[a-z]$/.match?(event[:decision].to_s)
|
108
107
|
list << {'d' => event[:decision], 'calls' => []}
|
109
108
|
end
|
110
109
|
when :attempt
|
111
110
|
list.last['calls'] << {
|
112
|
-
|
113
|
-
|
114
|
-
|
111
|
+
'call' => event[:name],
|
112
|
+
'source' => event[:source],
|
113
|
+
'input' => event[:args] && event[:args].inspect
|
115
114
|
}
|
116
115
|
when :result
|
117
116
|
list.last['calls'].last['output'] = event[:value].inspect
|
@@ -122,7 +121,6 @@ module Webmachine
|
|
122
121
|
'message' => event[:message]
|
123
122
|
}
|
124
123
|
end
|
125
|
-
list
|
126
124
|
end
|
127
125
|
end
|
128
126
|
end
|
data/lib/webmachine/trace.rb
CHANGED
@@ -9,10 +9,11 @@ module Webmachine
|
|
9
9
|
# Contains means to enable the Webmachine visual debugger.
|
10
10
|
module Trace
|
11
11
|
module_function
|
12
|
+
|
12
13
|
# Classes that implement storage for visual debugger traces.
|
13
14
|
TRACE_STORES = {
|
14
|
-
:
|
15
|
-
:
|
15
|
+
memory: Hash,
|
16
|
+
pstore: PStoreTraceStore
|
16
17
|
}
|
17
18
|
|
18
19
|
DEFAULT_TRACE_SUBSCRIBER = Webmachine::Events.subscribe(
|
@@ -71,10 +72,10 @@ module Webmachine
|
|
71
72
|
|
72
73
|
def trace_store
|
73
74
|
@trace_store ||= begin
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
75
|
+
opts = Array(@trace_store_opts).dup
|
76
|
+
type = opts.shift
|
77
|
+
TRACE_STORES[type].new(*opts)
|
78
|
+
end
|
78
79
|
end
|
79
80
|
private :trace_store
|
80
81
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'set'
|
2
2
|
require 'i18n'
|
3
3
|
I18n.enforce_available_locales = true if I18n.respond_to?(:enforce_available_locales)
|
4
|
-
I18n.config.load_path << File.expand_path(
|
4
|
+
I18n.config.load_path << File.expand_path('../locale/en.yml', __FILE__)
|
5
5
|
|
6
6
|
module Webmachine
|
7
7
|
# Provides an interface to the I18n library specifically for
|
@@ -12,8 +12,8 @@ module Webmachine
|
|
12
12
|
# @param [Hash] options options to pass to I18n, including
|
13
13
|
# variables to interpolate.
|
14
14
|
# @return [String] the interpolated string
|
15
|
-
def t(key, options={})
|
16
|
-
::I18n.t(key, options.merge(:
|
15
|
+
def t(key, options = {})
|
16
|
+
::I18n.t(key, **options.merge(scope: :webmachine))
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
data/lib/webmachine/version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webmachine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Cribbs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -42,16 +42,50 @@ dependencies:
|
|
42
42
|
name: as-notifications
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 1.0.2
|
48
|
+
- - "<"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '2.0'
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: 1.0.2
|
58
|
+
- - "<"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '2.0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: webrick
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
51
64
|
requirements:
|
52
65
|
- - "~>"
|
53
66
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
67
|
+
version: 1.7.0
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 1.7.0
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: standard
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '1.21'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '1.21'
|
55
89
|
description: " webmachine is a toolkit for building HTTP applications in a declarative
|
56
90
|
fashion, that avoids the confusion of going through a CGI-style interface like Rack.
|
57
91
|
It is strongly influenced by the original Erlang project of the same name and shares
|
@@ -62,14 +96,9 @@ executables: []
|
|
62
96
|
extensions: []
|
63
97
|
extra_rdoc_files: []
|
64
98
|
files:
|
65
|
-
- ".gitignore"
|
66
99
|
- CHANGELOG.md
|
67
|
-
- Gemfile
|
68
|
-
- Guardfile
|
69
100
|
- LICENSE
|
70
101
|
- README.md
|
71
|
-
- RELEASING.md
|
72
|
-
- Rakefile
|
73
102
|
- documentation/adapters.md
|
74
103
|
- documentation/authentication-and-authorization.md
|
75
104
|
- documentation/configurator.md
|
@@ -87,11 +116,9 @@ files:
|
|
87
116
|
- lib/webmachine.rb
|
88
117
|
- lib/webmachine/adapter.rb
|
89
118
|
- lib/webmachine/adapters.rb
|
90
|
-
- lib/webmachine/adapters/httpkit.rb
|
91
119
|
- lib/webmachine/adapters/lazy_request_body.rb
|
92
120
|
- lib/webmachine/adapters/rack.rb
|
93
121
|
- lib/webmachine/adapters/rack_mapped.rb
|
94
|
-
- lib/webmachine/adapters/reel.rb
|
95
122
|
- lib/webmachine/adapters/webrick.rb
|
96
123
|
- lib/webmachine/application.rb
|
97
124
|
- lib/webmachine/chunked_body.rb
|
@@ -146,44 +173,17 @@ files:
|
|
146
173
|
- lib/webmachine/trace/trace_resource.rb
|
147
174
|
- lib/webmachine/translation.rb
|
148
175
|
- lib/webmachine/version.rb
|
149
|
-
-
|
150
|
-
|
151
|
-
- spec/webmachine/adapter_spec.rb
|
152
|
-
- spec/webmachine/adapters/httpkit_spec.rb
|
153
|
-
- spec/webmachine/adapters/rack_mapped_spec.rb
|
154
|
-
- spec/webmachine/adapters/rack_spec.rb
|
155
|
-
- spec/webmachine/adapters/reel_spec.rb
|
156
|
-
- spec/webmachine/adapters/webrick_spec.rb
|
157
|
-
- spec/webmachine/application_spec.rb
|
158
|
-
- spec/webmachine/chunked_body_spec.rb
|
159
|
-
- spec/webmachine/configuration_spec.rb
|
160
|
-
- spec/webmachine/cookie_spec.rb
|
161
|
-
- spec/webmachine/decision/conneg_spec.rb
|
162
|
-
- spec/webmachine/decision/falsey_spec.rb
|
163
|
-
- spec/webmachine/decision/flow_spec.rb
|
164
|
-
- spec/webmachine/decision/fsm_spec.rb
|
165
|
-
- spec/webmachine/decision/helpers_spec.rb
|
166
|
-
- spec/webmachine/dispatcher/rfc3986_percent_decode_spec.rb
|
167
|
-
- spec/webmachine/dispatcher/route_spec.rb
|
168
|
-
- spec/webmachine/dispatcher_spec.rb
|
169
|
-
- spec/webmachine/errors_spec.rb
|
170
|
-
- spec/webmachine/etags_spec.rb
|
171
|
-
- spec/webmachine/events_spec.rb
|
172
|
-
- spec/webmachine/headers_spec.rb
|
173
|
-
- spec/webmachine/media_type_spec.rb
|
174
|
-
- spec/webmachine/request_spec.rb
|
175
|
-
- spec/webmachine/rescueable_exception_spec.rb
|
176
|
-
- spec/webmachine/resource/authentication_spec.rb
|
177
|
-
- spec/webmachine/response_spec.rb
|
178
|
-
- spec/webmachine/trace/fsm_spec.rb
|
179
|
-
- spec/webmachine/trace/resource_proxy_spec.rb
|
180
|
-
- spec/webmachine/trace/trace_store_spec.rb
|
181
|
-
- spec/webmachine/trace_spec.rb
|
182
|
-
- webmachine.gemspec
|
183
|
-
homepage: http://github.com/seancribbs/webmachine-ruby
|
176
|
+
- pkg/webmachine-2.0.0.beta.gem
|
177
|
+
homepage: https://github.com/webmachine/webmachine-ruby
|
184
178
|
licenses:
|
185
179
|
- Apache-2.0
|
186
|
-
metadata:
|
180
|
+
metadata:
|
181
|
+
bug_tracker_uri: https://github.com/webmachine/webmachine-ruby/issues
|
182
|
+
changelog_uri: https://github.com/webmachine/webmachine-ruby/blob/HEAD/CHANGELOG.md
|
183
|
+
documentation_uri: https://www.rubydoc.info/gems/webmachine/2.0.0
|
184
|
+
homepage_uri: https://github.com/webmachine/webmachine-ruby
|
185
|
+
source_code_uri: https://github.com/webmachine/webmachine-ruby
|
186
|
+
wiki_uri: https://github.com/webmachine/webmachine-ruby/wiki
|
187
187
|
post_install_message:
|
188
188
|
rdoc_options: []
|
189
189
|
require_paths:
|
@@ -192,48 +192,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
192
192
|
requirements:
|
193
193
|
- - ">="
|
194
194
|
- !ruby/object:Gem::Version
|
195
|
-
version:
|
195
|
+
version: 2.6.0
|
196
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
197
|
requirements:
|
198
198
|
- - ">="
|
199
199
|
- !ruby/object:Gem::Version
|
200
200
|
version: '0'
|
201
201
|
requirements: []
|
202
|
-
rubygems_version: 3.
|
202
|
+
rubygems_version: 3.4.9
|
203
203
|
signing_key:
|
204
204
|
specification_version: 4
|
205
205
|
summary: webmachine is a toolkit for building HTTP applications,
|
206
|
-
test_files:
|
207
|
-
- spec/spec_helper.rb
|
208
|
-
- spec/webmachine/trace/fsm_spec.rb
|
209
|
-
- spec/webmachine/trace/resource_proxy_spec.rb
|
210
|
-
- spec/webmachine/trace/trace_store_spec.rb
|
211
|
-
- spec/webmachine/configuration_spec.rb
|
212
|
-
- spec/webmachine/dispatcher/route_spec.rb
|
213
|
-
- spec/webmachine/dispatcher/rfc3986_percent_decode_spec.rb
|
214
|
-
- spec/webmachine/rescueable_exception_spec.rb
|
215
|
-
- spec/webmachine/etags_spec.rb
|
216
|
-
- spec/webmachine/chunked_body_spec.rb
|
217
|
-
- spec/webmachine/adapter_spec.rb
|
218
|
-
- spec/webmachine/headers_spec.rb
|
219
|
-
- spec/webmachine/adapters/reel_spec.rb
|
220
|
-
- spec/webmachine/adapters/rack_spec.rb
|
221
|
-
- spec/webmachine/adapters/httpkit_spec.rb
|
222
|
-
- spec/webmachine/adapters/webrick_spec.rb
|
223
|
-
- spec/webmachine/adapters/rack_mapped_spec.rb
|
224
|
-
- spec/webmachine/request_spec.rb
|
225
|
-
- spec/webmachine/response_spec.rb
|
226
|
-
- spec/webmachine/decision/fsm_spec.rb
|
227
|
-
- spec/webmachine/decision/falsey_spec.rb
|
228
|
-
- spec/webmachine/decision/flow_spec.rb
|
229
|
-
- spec/webmachine/decision/helpers_spec.rb
|
230
|
-
- spec/webmachine/decision/conneg_spec.rb
|
231
|
-
- spec/webmachine/cookie_spec.rb
|
232
|
-
- spec/webmachine/media_type_spec.rb
|
233
|
-
- spec/webmachine/errors_spec.rb
|
234
|
-
- spec/webmachine/resource/authentication_spec.rb
|
235
|
-
- spec/webmachine/trace_spec.rb
|
236
|
-
- spec/webmachine/application_spec.rb
|
237
|
-
- spec/webmachine/events_spec.rb
|
238
|
-
- spec/webmachine/dispatcher_spec.rb
|
239
|
-
- ".gitignore"
|
206
|
+
test_files: []
|
data/.gitignore
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
## MAC OS
|
2
|
-
.DS_Store
|
3
|
-
|
4
|
-
## TEXTMATE
|
5
|
-
*.tmproj
|
6
|
-
tmtags
|
7
|
-
|
8
|
-
## EMACS
|
9
|
-
*~
|
10
|
-
\#*
|
11
|
-
.\#*
|
12
|
-
|
13
|
-
## VIM
|
14
|
-
*.sw[^f]
|
15
|
-
|
16
|
-
## PROJECT::GENERAL
|
17
|
-
coverage
|
18
|
-
rdoc
|
19
|
-
pkg
|
20
|
-
|
21
|
-
## PROJECT::SPECIFIC
|
22
|
-
doc
|
23
|
-
.yardoc
|
24
|
-
.bundle
|
25
|
-
Gemfile.lock
|
26
|
-
**/bin
|
27
|
-
*.rbc
|
28
|
-
.rvmrc
|
29
|
-
.SyncID
|
30
|
-
.SyncIgnore
|
31
|
-
vendor
|
data/Gemfile
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'rbconfig'
|
2
|
-
source 'https://rubygems.org'
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
group :development do
|
6
|
-
gem "yard", "~> 0.9"
|
7
|
-
gem "rake", "~> 12.0"
|
8
|
-
end
|
9
|
-
|
10
|
-
group :test do
|
11
|
-
gem "rspec", "~> 3.0", ">= 3.6.0"
|
12
|
-
gem "rspec-its", "~> 1.2"
|
13
|
-
gem "rack", "~> 2.0"
|
14
|
-
gem "rack-test", "~> 0.7"
|
15
|
-
gem "websocket_parser", "~>1.0"
|
16
|
-
end
|
17
|
-
|
18
|
-
group :webservers do
|
19
|
-
gem 'reel', '~> 0.5.0'
|
20
|
-
gem 'http', '~> 0.6.0'
|
21
|
-
gem 'celluloid', '0.17.4' # Refactors in 0.18.0 break the tests
|
22
|
-
gem 'httpkit', :platform => [:mri, :rbx]
|
23
|
-
end
|
24
|
-
|
25
|
-
group :guard do
|
26
|
-
gem 'guard-rspec', '~> 4.7'
|
27
|
-
case RbConfig::CONFIG['host_os']
|
28
|
-
when /darwin/
|
29
|
-
gem 'rb-fsevent', '~> 0.10'
|
30
|
-
# gem 'growl_notify'
|
31
|
-
gem 'growl', '~> 1.0'
|
32
|
-
when /linux/
|
33
|
-
gem 'rb-inotify'
|
34
|
-
gem 'libnotify'
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
group :docs do
|
39
|
-
platform :mri_19, :mri_20 do
|
40
|
-
gem 'redcarpet', '~> 3.4'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
platforms :jruby do
|
45
|
-
gem 'jruby-openssl'
|
46
|
-
end
|
data/Guardfile
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
gemset = ENV['RVM_GEMSET'] || 'webmachine'
|
2
|
-
gemset = "@#{gemset}" unless gemset.to_s == ''
|
3
|
-
|
4
|
-
rvms = %W[ 1.8.7 1.9.2 1.9.3 jruby rbx ].map {|v| "#{v}#{gemset}" }
|
5
|
-
|
6
|
-
guard 'rspec', :cli => "--color --profile", :growl => true, :rvm => rvms do
|
7
|
-
watch(%r{^lib/webmachine/locale/.+$}) { "spec" }
|
8
|
-
watch(%r{^spec/.+_spec\.rb$})
|
9
|
-
watch(%r{^lib/(.+)\.rb$}){ |m| "spec/#{m[1]}_spec.rb" }
|
10
|
-
watch('spec/spec_helper.rb') { "spec" }
|
11
|
-
end
|
data/RELEASING.md
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
1. Open `CHANGELOG.md` and summarize the changes made since the last release (hopefully better than the individual commit messages). The history can be grabbed with a simple git command (assuming the last version was 1.3.0:
|
2
|
-
|
3
|
-
$ git log --pretty=format:' * %s' v1.3.0..HEAD
|
4
|
-
|
5
|
-
2. Edit the version in `lib/webmachine/version.rb` according to semantic versioning rules.
|
6
|
-
3. Commit both files.
|
7
|
-
|
8
|
-
$ git add CHANGELOG.md lib/webmachine/version.rb
|
9
|
-
$ git commit -m "chore(release): version $(ruby -r ./lib/webmachine/version.rb -e "puts Webmachine::VERSION")" && git push
|
10
|
-
|
11
|
-
4. Release the gem.
|
12
|
-
|
13
|
-
$ bundle exec rake release
|
14
|
-
|
15
|
-
5. If this is a new major or minor release, push a new stable branch, otherwise merge the commit into the stable branch (or master, depending on where you made the commit).
|
16
|
-
|
17
|
-
$ git push origin HEAD:1.3-stable
|
18
|
-
# or
|
19
|
-
$ git checkout 1.3-stable; git merge master; git push origin; git checkout master
|
20
|
-
|
21
|
-
6. YOU'RE DONE!
|
data/Rakefile
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'yard'
|
5
|
-
require 'yard/rake/yardoc_task'
|
6
|
-
YARD::Rake::YardocTask.new do |doc|
|
7
|
-
doc.files = Dir["lib/**/*.rb"] + ['README.md']
|
8
|
-
doc.options = ["-m", "markdown"]
|
9
|
-
end
|
10
|
-
rescue LoadError
|
11
|
-
end
|
12
|
-
|
13
|
-
desc "Validate the gemspec file."
|
14
|
-
task :validate_gemspec do
|
15
|
-
Gem::Specification.load("webmachine.gemspec").validate
|
16
|
-
end
|
17
|
-
|
18
|
-
task :build => :validate_gemspec
|
19
|
-
|
20
|
-
desc "Cleans up white space in source files"
|
21
|
-
task :clean_whitespace do
|
22
|
-
no_file_cleaned = true
|
23
|
-
|
24
|
-
Dir["**/*.rb"].each do |file|
|
25
|
-
contents = File.read(file)
|
26
|
-
cleaned_contents = contents.gsub(/([ \t]+)$/, '')
|
27
|
-
unless cleaned_contents == contents
|
28
|
-
no_file_cleaned = false
|
29
|
-
puts " - Cleaned #{file}"
|
30
|
-
File.open(file, 'w') { |f| f.write(cleaned_contents) }
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
if no_file_cleaned
|
35
|
-
puts "No files with trailing whitespace found"
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
require 'rspec/core/rake_task'
|
40
|
-
|
41
|
-
desc "Run specs"
|
42
|
-
RSpec::Core::RakeTask.new(:spec)
|
43
|
-
|
44
|
-
task :default => :spec
|