meshchat 0.6.9 → 0.6.10
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/lib/meshchat/cli.rb +3 -2
- data/lib/meshchat/command/online.rb +1 -6
- data/lib/meshchat/net/listener/server.rb +32 -3
- data/lib/meshchat/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b522eab95998e41879706751143d6be2547f56f
|
4
|
+
data.tar.gz: a522f7911c68596e205f700a077b49ab68e6effb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56c862960a4e1985fd7d6e55ebc5757d2c3eb58c51be40ab2d8762ec0ceb080697e216f5280b0b72a9cbfa737d0caf624f3fc314f65d243723e8bce67461816f
|
7
|
+
data.tar.gz: 232bb3f936d3bbbbe49bfeebdb5985baaa05b535f2025d6e1759786f1aed5a89a5c3f77701bbb055cc3f2d41dc906bcbd1f0b28173b659b7233613ca0d30a1ef
|
data/lib/meshchat/cli.rb
CHANGED
@@ -40,8 +40,8 @@ module MeshChat
|
|
40
40
|
MeshChat::Command::Base::SHARE => MeshChat::Command::Share,
|
41
41
|
MeshChat::Command::Base::IMPORT => MeshChat::Command::Import,
|
42
42
|
MeshChat::Command::Base::EXPORT => MeshChat::Command::Share,
|
43
|
-
MeshChat::Command::Base::ONLINE => MeshChat::Command::
|
44
|
-
MeshChat::Command::Base::OFFLINE => MeshChat::Command::
|
43
|
+
MeshChat::Command::Base::ONLINE => MeshChat::Command::Online,
|
44
|
+
MeshChat::Command::Base::OFFLINE => MeshChat::Command::Offline,
|
45
45
|
MeshChat::Command::Base::HELP => MeshChat::Command::Help,
|
46
46
|
MeshChat::Command::Base::BIND => MeshChat::Command::Bind
|
47
47
|
}
|
@@ -130,6 +130,7 @@ module MeshChat
|
|
130
130
|
Thin::Logging.silent = true
|
131
131
|
|
132
132
|
Thread.new do
|
133
|
+
# boot sinatra
|
133
134
|
MeshChat::Net::Listener::Server.run!(
|
134
135
|
port: MeshChat::Settings['port'],
|
135
136
|
# logger: MeshChat::Display,
|
@@ -6,12 +6,7 @@ module MeshChat
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def handle
|
9
|
-
|
10
|
-
msg = if list.present?
|
11
|
-
list.join(", ")
|
12
|
-
else
|
13
|
-
'no one is online'
|
14
|
-
end
|
9
|
+
msg = Node.online.map(&:as_info).join(", ").presence || 'no one is online'
|
15
10
|
|
16
11
|
Display.info msg
|
17
12
|
end
|
@@ -22,11 +22,12 @@ module MeshChat
|
|
22
22
|
# we can't decrypt?
|
23
23
|
|
24
24
|
def self.run!(*)
|
25
|
+
# any code that should be ran
|
26
|
+
# before sintra starts should go here
|
27
|
+
|
25
28
|
# start the server
|
26
29
|
super
|
27
|
-
|
28
|
-
# send a pingall to see who's online
|
29
|
-
MeshChat::Command::PingAll.new.handle
|
30
|
+
# code after here will not run
|
30
31
|
end
|
31
32
|
|
32
33
|
get '/' do
|
@@ -78,6 +79,34 @@ module MeshChat
|
|
78
79
|
status s
|
79
80
|
body ''
|
80
81
|
end
|
82
|
+
|
83
|
+
# Hack away our problems
|
84
|
+
# don't show the Sinatra has taken the stage message
|
85
|
+
#
|
86
|
+
# https://github.com/sinatra/sinatra/blob/master/lib/sinatra/base.rb#L1504
|
87
|
+
def self.start_server(handler, server_settings, handler_name)
|
88
|
+
handler.run(self, server_settings) do |server|
|
89
|
+
|
90
|
+
setup_traps
|
91
|
+
set :running_server, server
|
92
|
+
set :handler_name, handler_name
|
93
|
+
server.threaded = settings.threaded if server.respond_to? :threaded=
|
94
|
+
|
95
|
+
yield server if block_given?
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# Hack away our problems
|
100
|
+
# Don't show the Sinatra quit message
|
101
|
+
#
|
102
|
+
# https://github.com/sinatra/sinatra/blob/master/lib/sinatra/base.rb#L1420
|
103
|
+
def self.quit!
|
104
|
+
return unless running?
|
105
|
+
# Use Thin's hard #stop! if available, otherwise just #stop.
|
106
|
+
running_server.respond_to?(:stop!) ? running_server.stop! : running_server.stop
|
107
|
+
set :running_server, nil
|
108
|
+
set :handler_name, nil
|
109
|
+
end
|
81
110
|
end
|
82
111
|
end
|
83
112
|
end
|
data/lib/meshchat/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meshchat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- L. Preston Sego III
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqlite3
|
@@ -261,5 +261,5 @@ rubyforge_project:
|
|
261
261
|
rubygems_version: 2.4.8
|
262
262
|
signing_key:
|
263
263
|
specification_version: 4
|
264
|
-
summary: MeshChat-0.6.
|
264
|
+
summary: MeshChat-0.6.10
|
265
265
|
test_files: []
|