meshchat 0.6.9 → 0.6.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f2e0fe21e401d973ec504f6fe5c2eeb5d4acff0
4
- data.tar.gz: ca8adc64e30b1b166b1a55844b7bd8c9bdcd164e
3
+ metadata.gz: 1b522eab95998e41879706751143d6be2547f56f
4
+ data.tar.gz: a522f7911c68596e205f700a077b49ab68e6effb
5
5
  SHA512:
6
- metadata.gz: f2cbab8677c041a77df0628a5337e2aa9b7d7344ce711dbfde64ef38a546ab0707e91e4ba323bd20a81050ea2dc4be008bf23ab612a871739bb886b408795fc9
7
- data.tar.gz: 6d7b7dbbffd5836b1b92ea245a8256197d18eb3bd1c09a94d057e82c0ec641a0a3c1b4c2af301789cf6840d1c88a824e8314b095b44fc4ba14cdc7e393b75f90
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::Offline,
44
- MeshChat::Command::Base::OFFLINE => MeshChat::Command::Online,
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
- list = Node.online.map(&:as_info)
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
@@ -1,3 +1,3 @@
1
1
  module MeshChat
2
- VERSION = '0.6.9'
2
+ VERSION = '0.6.10'
3
3
  end
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.9
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-14 00:00:00.000000000 Z
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.9
264
+ summary: MeshChat-0.6.10
265
265
  test_files: []