agoo 2.5.7 → 2.6.0
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.
Potentially problematic release.
This version of agoo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +38 -0
- data/ext/agoo/agoo.c +11 -2
- data/ext/agoo/bind.c +15 -20
- data/ext/agoo/con.c +32 -25
- data/ext/agoo/debug.c +225 -162
- data/ext/agoo/debug.h +31 -51
- data/ext/agoo/doc.c +278 -5
- data/ext/agoo/doc.h +6 -1
- data/ext/agoo/err.c +1 -0
- data/ext/agoo/err.h +1 -0
- data/ext/agoo/error_stream.c +3 -6
- data/ext/agoo/gqlcobj.c +12 -0
- data/ext/agoo/gqlcobj.h +25 -0
- data/ext/agoo/gqleval.c +520 -0
- data/ext/agoo/gqleval.h +49 -0
- data/ext/agoo/gqlintro.c +1237 -97
- data/ext/agoo/gqlintro.h +8 -0
- data/ext/agoo/gqljson.c +460 -0
- data/ext/agoo/gqljson.h +15 -0
- data/ext/agoo/gqlvalue.c +679 -136
- data/ext/agoo/gqlvalue.h +29 -7
- data/ext/agoo/graphql.c +841 -362
- data/ext/agoo/graphql.h +180 -90
- data/ext/agoo/hook.c +8 -16
- data/ext/agoo/http.c +3 -4
- data/ext/agoo/log.c +22 -25
- data/ext/agoo/log.h +1 -0
- data/ext/agoo/page.c +24 -40
- data/ext/agoo/pub.c +23 -21
- data/ext/agoo/queue.c +2 -4
- data/ext/agoo/ready.c +9 -9
- data/ext/agoo/req.c +80 -5
- data/ext/agoo/req.h +2 -0
- data/ext/agoo/res.c +1 -3
- data/ext/agoo/rgraphql.c +753 -0
- data/ext/agoo/rresponse.c +9 -15
- data/ext/agoo/rserver.c +18 -17
- data/ext/agoo/sdl.c +1264 -120
- data/ext/agoo/sdl.h +8 -1
- data/ext/agoo/sectime.c +136 -0
- data/ext/agoo/sectime.h +19 -0
- data/ext/agoo/server.c +1 -3
- data/ext/agoo/subject.c +2 -4
- data/ext/agoo/text.c +124 -18
- data/ext/agoo/text.h +5 -1
- data/ext/agoo/upgraded.c +2 -4
- data/lib/agoo/version.rb +1 -1
- data/test/base_handler_test.rb +43 -40
- data/test/bind_test.rb +49 -48
- data/test/graphql_test.rb +1019 -0
- data/test/hijack_test.rb +1 -1
- data/test/rack_handler_test.rb +40 -34
- data/test/static_test.rb +33 -32
- metadata +17 -6
data/test/hijack_test.rb
CHANGED
@@ -15,7 +15,6 @@ require 'oj'
|
|
15
15
|
require 'agoo'
|
16
16
|
|
17
17
|
class RackHandlerTest < Minitest::Test
|
18
|
-
|
19
18
|
class HijackHandler
|
20
19
|
def call(env)
|
21
20
|
io = env['rack.hijack'].call
|
@@ -53,6 +52,7 @@ hello world|)
|
|
53
52
|
jack
|
54
53
|
|
55
54
|
ensure
|
55
|
+
GC.start
|
56
56
|
Agoo.shutdown
|
57
57
|
end
|
58
58
|
end
|
data/test/rack_handler_test.rb
CHANGED
@@ -15,7 +15,8 @@ require 'oj'
|
|
15
15
|
require 'agoo'
|
16
16
|
|
17
17
|
class RackHandlerTest < Minitest::Test
|
18
|
-
|
18
|
+
@@server_started = false
|
19
|
+
|
19
20
|
class TellMeHandler
|
20
21
|
def initialize
|
21
22
|
end
|
@@ -40,39 +41,44 @@ class RackHandlerTest < Minitest::Test
|
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
43
|
-
def
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
44
|
+
def start_server
|
45
|
+
Agoo::Log.configure(dir: '',
|
46
|
+
console: true,
|
47
|
+
classic: true,
|
48
|
+
colorize: true,
|
49
|
+
states: {
|
50
|
+
INFO: false,
|
51
|
+
DEBUG: false,
|
52
|
+
connect: false,
|
53
|
+
request: false,
|
54
|
+
response: false,
|
55
|
+
eval: true,
|
56
|
+
})
|
57
|
+
|
58
|
+
Agoo::Server.init(6467, 'root', thread_count: 1)
|
59
|
+
|
60
|
+
handler = TellMeHandler.new
|
61
|
+
Agoo::Server.handle(:GET, "/tellme", handler)
|
62
|
+
Agoo::Server.handle(:POST, "/makeme", handler)
|
63
|
+
Agoo::Server.handle(:PUT, "/makeme", handler)
|
64
|
+
|
65
|
+
Agoo::Server.start()
|
66
|
+
|
67
|
+
@@server_started = true
|
68
|
+
end
|
69
|
+
|
70
|
+
def setup
|
71
|
+
unless @@server_started
|
72
|
+
start_server
|
72
73
|
end
|
73
74
|
end
|
74
|
-
|
75
|
-
|
75
|
+
|
76
|
+
Minitest.after_run {
|
77
|
+
GC.start
|
78
|
+
Agoo::shutdown
|
79
|
+
}
|
80
|
+
|
81
|
+
def test_eval
|
76
82
|
uri = URI('http://localhost:6467/tellme?a=1')
|
77
83
|
req = Net::HTTP::Get.new(uri)
|
78
84
|
# Set the headers the way we want them.
|
@@ -114,7 +120,7 @@ class RackHandlerTest < Minitest::Test
|
|
114
120
|
}
|
115
121
|
end
|
116
122
|
|
117
|
-
def
|
123
|
+
def test_post
|
118
124
|
uri = URI('http://localhost:6467/makeme')
|
119
125
|
req = Net::HTTP::Post.new(uri)
|
120
126
|
# Set the headers the way we want them.
|
@@ -128,7 +134,7 @@ class RackHandlerTest < Minitest::Test
|
|
128
134
|
assert_equal(Net::HTTPNoContent, res.class)
|
129
135
|
end
|
130
136
|
|
131
|
-
def
|
137
|
+
def test_put
|
132
138
|
uri = URI('http://localhost:6467/makeme')
|
133
139
|
req = Net::HTTP::Put.new(uri)
|
134
140
|
# Set the headers the way we want them.
|
data/test/static_test.rb
CHANGED
@@ -13,40 +13,41 @@ require 'net/http'
|
|
13
13
|
require 'agoo'
|
14
14
|
|
15
15
|
class StaticTest < Minitest::Test
|
16
|
+
@@server_started = false
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
eval: true,
|
31
|
-
})
|
18
|
+
def start_server
|
19
|
+
Agoo::Log.configure(dir: '',
|
20
|
+
console: true,
|
21
|
+
classic: true,
|
22
|
+
colorize: true,
|
23
|
+
states: {
|
24
|
+
INFO: false,
|
25
|
+
DEBUG: false,
|
26
|
+
connect: false,
|
27
|
+
request: false,
|
28
|
+
response: false,
|
29
|
+
eval: true,
|
30
|
+
})
|
32
31
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
=
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
ensure
|
44
|
-
Agoo::shutdown
|
32
|
+
Agoo::Server.init(6469, 'root', thread_count: 1)
|
33
|
+
Agoo::Server.add_mime('odd', 'text/odd')
|
34
|
+
Agoo::Server.start()
|
35
|
+
|
36
|
+
@@server_started = true
|
37
|
+
end
|
38
|
+
|
39
|
+
def setup
|
40
|
+
unless @@server_started
|
41
|
+
start_server
|
45
42
|
end
|
46
43
|
end
|
47
44
|
|
45
|
+
Minitest.after_run {
|
46
|
+
GC.start
|
47
|
+
Agoo::shutdown
|
48
|
+
}
|
48
49
|
|
49
|
-
def
|
50
|
+
def test_fetch_index
|
50
51
|
uri = URI('http://localhost:6469/index.html')
|
51
52
|
expect = %|<!DOCTYPE html>
|
52
53
|
<html>
|
@@ -65,7 +66,7 @@ class StaticTest < Minitest::Test
|
|
65
66
|
assert_equal(expect, content)
|
66
67
|
end
|
67
68
|
|
68
|
-
def
|
69
|
+
def test_mime
|
69
70
|
uri = URI('http://localhost:6469/odd.odd')
|
70
71
|
req = Net::HTTP::Get.new(uri)
|
71
72
|
res = Net::HTTP.start(uri.hostname, uri.port) { |h|
|
@@ -74,7 +75,7 @@ class StaticTest < Minitest::Test
|
|
74
75
|
assert_equal('text/odd', res['Content-Type'])
|
75
76
|
end
|
76
77
|
|
77
|
-
def
|
78
|
+
def test_fetch_auto_index
|
78
79
|
uri = URI('http://localhost:6469/')
|
79
80
|
content = Net::HTTP.get(uri)
|
80
81
|
expect = %|<!DOCTYPE html>
|
@@ -86,14 +87,14 @@ class StaticTest < Minitest::Test
|
|
86
87
|
assert_equal(expect, content)
|
87
88
|
end
|
88
89
|
|
89
|
-
def
|
90
|
+
def test_fetch_nested
|
90
91
|
uri = URI('http://localhost:6469/nest/something.txt')
|
91
92
|
content = Net::HTTP.get(uri)
|
92
93
|
assert_equal('Just some text.
|
93
94
|
', content)
|
94
95
|
end
|
95
96
|
|
96
|
-
def
|
97
|
+
def test_fetch_not_found
|
97
98
|
uri = URI('http://localhost:6469/bad.html')
|
98
99
|
res = Net::HTTP.get_response(uri)
|
99
100
|
assert_equal("404", res.code)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|
@@ -64,8 +64,14 @@ files:
|
|
64
64
|
- ext/agoo/error_stream.c
|
65
65
|
- ext/agoo/error_stream.h
|
66
66
|
- ext/agoo/extconf.rb
|
67
|
+
- ext/agoo/gqlcobj.c
|
68
|
+
- ext/agoo/gqlcobj.h
|
69
|
+
- ext/agoo/gqleval.c
|
70
|
+
- ext/agoo/gqleval.h
|
67
71
|
- ext/agoo/gqlintro.c
|
68
72
|
- ext/agoo/gqlintro.h
|
73
|
+
- ext/agoo/gqljson.c
|
74
|
+
- ext/agoo/gqljson.h
|
69
75
|
- ext/agoo/gqlvalue.c
|
70
76
|
- ext/agoo/gqlvalue.h
|
71
77
|
- ext/agoo/graphql.c
|
@@ -96,6 +102,7 @@ files:
|
|
96
102
|
- ext/agoo/res.h
|
97
103
|
- ext/agoo/response.c
|
98
104
|
- ext/agoo/response.h
|
105
|
+
- ext/agoo/rgraphql.c
|
99
106
|
- ext/agoo/rhook.c
|
100
107
|
- ext/agoo/rhook.h
|
101
108
|
- ext/agoo/rlog.c
|
@@ -108,6 +115,8 @@ files:
|
|
108
115
|
- ext/agoo/rupgraded.h
|
109
116
|
- ext/agoo/sdl.c
|
110
117
|
- ext/agoo/sdl.h
|
118
|
+
- ext/agoo/sectime.c
|
119
|
+
- ext/agoo/sectime.h
|
111
120
|
- ext/agoo/seg.h
|
112
121
|
- ext/agoo/server.c
|
113
122
|
- ext/agoo/server.h
|
@@ -128,6 +137,7 @@ files:
|
|
128
137
|
- lib/rack/handler/agoo.rb
|
129
138
|
- test/base_handler_test.rb
|
130
139
|
- test/bind_test.rb
|
140
|
+
- test/graphql_test.rb
|
131
141
|
- test/hijack_test.rb
|
132
142
|
- test/log_test.rb
|
133
143
|
- test/rack_handler_test.rb
|
@@ -163,14 +173,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
173
|
requirements:
|
164
174
|
- Linux or macOS
|
165
175
|
rubyforge_project: agoo
|
166
|
-
rubygems_version: 2.7.
|
176
|
+
rubygems_version: 2.7.6
|
167
177
|
signing_key:
|
168
178
|
specification_version: 4
|
169
179
|
summary: An HTTP server
|
170
180
|
test_files:
|
171
|
-
- test/
|
172
|
-
- test/bind_test.rb
|
181
|
+
- test/graphql_test.rb
|
173
182
|
- test/hijack_test.rb
|
174
|
-
- test/log_test.rb
|
175
183
|
- test/rack_handler_test.rb
|
184
|
+
- test/base_handler_test.rb
|
185
|
+
- test/log_test.rb
|
186
|
+
- test/bind_test.rb
|
176
187
|
- test/static_test.rb
|