gopher 0.7.0 → 0.7.1
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/bin/gopher +4 -2
- data/lib/gopher.rb +5 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c2b222415b52c25732dd818ba6b4b6c298653343a00a97e7615ebee52b48e69
|
4
|
+
data.tar.gz: c9b1357aaa4afa73faf6877a2743ef7dc8826c03f4319ad9a91f91159c77b313
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b0f33d96309d6671ebb8f9faa0422bdc3e12c0a6b384a036e1460a63fd0e824367e56c8aae0d79cf85e268041bd8ef7eb0da0b679591c0014feb583178458e5
|
7
|
+
data.tar.gz: 491b0e7750261308d0fb4372b5ccaf6fae396af17f8831b0870ea0f6ffb017dd4844e2afb85ac92854540115ac7f49cf78dcbcdf49e67efd43ec34ada39ff42b
|
data/bin/gopher
CHANGED
@@ -9,12 +9,14 @@ options = {}
|
|
9
9
|
OptionParser.new do |opts|
|
10
10
|
opts.banner = "usage: gopher [options]"
|
11
11
|
|
12
|
-
opts.on("-
|
12
|
+
opts.on("-b=BINDTO", "bind to address") { |v| options[:bindto] = v }
|
13
|
+
opts.on("-a=ADDRESS", "gopher hostname") { |v| options[:address] = v }
|
13
14
|
opts.on("-p=PORT", "port") { |v| options[:port] = v }
|
14
15
|
end.parse!
|
15
16
|
|
16
17
|
gopher = Gopher.application do
|
17
|
-
|
18
|
+
bindto options[:bindto] || '0.0.0.0'
|
19
|
+
host options[:address] || '127.0.0.1'
|
18
20
|
port options[:port] || 70
|
19
21
|
|
20
22
|
mount '/', '.'
|
data/lib/gopher.rb
CHANGED
@@ -6,10 +6,10 @@ require 'eventmachine'
|
|
6
6
|
require_relative 'ext/module'
|
7
7
|
|
8
8
|
module Gopher
|
9
|
-
VERSION = '0.7.
|
9
|
+
VERSION = '0.7.1'
|
10
10
|
|
11
11
|
class Application
|
12
|
-
dsl_accessor :host, :port
|
12
|
+
dsl_accessor :host, :port, :bindto
|
13
13
|
attr_accessor :selectors, :root
|
14
14
|
|
15
15
|
def initialize(&block)
|
@@ -80,8 +80,9 @@ module Gopher
|
|
80
80
|
self
|
81
81
|
end
|
82
82
|
|
83
|
-
def host; app.respond_to?(:host) ? app.host : '
|
83
|
+
def host; app.respond_to?(:host) ? app.host : 'localhost' end
|
84
84
|
def port; app.respond_to?(:port) ? app.port : 70 end
|
85
|
+
def bindto; app.respond_to?(:bindto) ? app.bindto : '0.0.0.0' end
|
85
86
|
|
86
87
|
def call(*args); end
|
87
88
|
end
|
@@ -292,7 +293,7 @@ module Gopher
|
|
292
293
|
def run
|
293
294
|
return if EM.reactor_running?
|
294
295
|
EM.run do
|
295
|
-
EM.start_server(@app.
|
296
|
+
EM.start_server(@app.bindto, @app.port, Gopher::Connection) do |c|
|
296
297
|
c.app = @app
|
297
298
|
reloadables.each do |f|
|
298
299
|
load f if File.mtime(f) > @last_reload
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gopher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- umeldt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: word_wrap
|