gopher2000 0.5.3 → 0.7.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.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +19 -0
- data/.gitignore +3 -0
- data/.ruby-version +1 -1
- data/Dockerfile +17 -0
- data/LICENSE.txt +669 -9
- data/README.markdown +30 -3
- data/bin/gopher2000 +1 -1
- data/examples/simple.rb +4 -2
- data/lib/gopher2000/base.rb +63 -21
- data/lib/gopher2000/dispatcher.rb +10 -4
- data/lib/gopher2000/rendering/base.rb +17 -2
- data/lib/gopher2000/request.rb +12 -3
- data/lib/gopher2000/server.rb +10 -3
- data/lib/gopher2000/version.rb +1 -1
- data/spec/dispatching_spec.rb +21 -0
- data/spec/dsl_spec.rb +76 -67
- data/spec/rendering/base_spec.rb +14 -2
- data/spec/rendering/menu_spec.rb +19 -3
- data/spec/request_spec.rb +6 -0
- data/spec/server_spec.rb +17 -1
- metadata +8 -23
- data/.travis.yml +0 -8
data/spec/server_spec.rb
CHANGED
@@ -18,17 +18,33 @@ if ENV["WITH_SERVER_SPECS"].to_i == 1
|
|
18
18
|
|
19
19
|
@host = "0.0.0.0"
|
20
20
|
@port = 12345
|
21
|
+
@environment = 'test'
|
21
22
|
|
22
23
|
@application.config[:host] = @host
|
23
24
|
@application.config[:port] = @port
|
25
|
+
@application.config[:env] = @environment
|
24
26
|
|
25
27
|
@request = Gopher::Request.new("foo", "bar")
|
26
28
|
|
27
|
-
@response = Gopher::Response.new
|
29
|
+
@response = Gopher::Response.new
|
28
30
|
@response.code = :success
|
29
31
|
@response.body = "hi"
|
30
32
|
end
|
31
33
|
|
34
|
+
it "returns host" do
|
35
|
+
@application.config[:host] = 'gopher-site.test'
|
36
|
+
expect(@application.host).to eql('gopher-site.test')
|
37
|
+
end
|
38
|
+
|
39
|
+
it "returns port" do
|
40
|
+
expect(@application.port).to eql(@port)
|
41
|
+
end
|
42
|
+
|
43
|
+
it "returns environment" do
|
44
|
+
expect(@application.env).to eql(@environment)
|
45
|
+
end
|
46
|
+
|
47
|
+
|
32
48
|
it "should work in non-blocking mode" do
|
33
49
|
@application.fake_response = @response
|
34
50
|
allow(@application).to receive(:non_blocking?).and_return(false)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gopher2000
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin Mitchell
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -173,9 +173,10 @@ executables:
|
|
173
173
|
extensions: []
|
174
174
|
extra_rdoc_files: []
|
175
175
|
files:
|
176
|
+
- ".github/workflows/ci.yml"
|
176
177
|
- ".gitignore"
|
177
178
|
- ".ruby-version"
|
178
|
-
-
|
179
|
+
- Dockerfile
|
179
180
|
- Gemfile
|
180
181
|
- LICENSE.txt
|
181
182
|
- README.markdown
|
@@ -225,7 +226,7 @@ homepage: https://github.com/muffinista/gopher2000
|
|
225
226
|
licenses:
|
226
227
|
- WTFPL
|
227
228
|
metadata: {}
|
228
|
-
post_install_message:
|
229
|
+
post_install_message:
|
229
230
|
rdoc_options: []
|
230
231
|
require_paths:
|
231
232
|
- lib
|
@@ -241,23 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
241
242
|
version: '0'
|
242
243
|
requirements: []
|
243
244
|
rubygems_version: 3.0.3
|
244
|
-
signing_key:
|
245
|
+
signing_key:
|
245
246
|
specification_version: 4
|
246
247
|
summary: Gopher2000 - A Gopher server for the next millenium
|
247
|
-
test_files:
|
248
|
-
- spec/application_spec.rb
|
249
|
-
- spec/dispatching_spec.rb
|
250
|
-
- spec/dsl_spec.rb
|
251
|
-
- spec/gopher_spec.rb
|
252
|
-
- spec/handlers/directory_handler_spec.rb
|
253
|
-
- spec/helpers_spec.rb
|
254
|
-
- spec/rendering/base_spec.rb
|
255
|
-
- spec/rendering/menu_spec.rb
|
256
|
-
- spec/rendering_spec.rb
|
257
|
-
- spec/request_spec.rb
|
258
|
-
- spec/response_spec.rb
|
259
|
-
- spec/routing_spec.rb
|
260
|
-
- spec/sandbox/old/socks.txt
|
261
|
-
- spec/sandbox/socks.txt
|
262
|
-
- spec/server_spec.rb
|
263
|
-
- spec/spec_helper.rb
|
248
|
+
test_files: []
|