meshchat 0.6.7 → 0.6.8

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: b7d8d8d4b7f7900d40c67f3abbd06a4165e8b5c4
4
- data.tar.gz: ba4e6f5e887a564baf24d70dea89938787d99570
3
+ metadata.gz: ceaf7ddcf414efc04b3a345133c273dc444c9448
4
+ data.tar.gz: f09b11286a5b9cf649da3f550b3c1449a33dbba3
5
5
  SHA512:
6
- metadata.gz: a08bb6a68534c357f4c95db9b2849f3e174a944adb66cc41df356bf2c910f1e4618a7b6c623dfa7737a2f288a0d47709e4f61803fd17e890dcc1b78bdd7f6050
7
- data.tar.gz: 741af34bce7faef140f4bb99b26c18c6159bbd73ac9bafde471653361221e6a2c0a7ebe4927aab42ad3fe2576a3a7e2f892420746a6a2651211998fe43bc3d05
6
+ metadata.gz: d0f60f33e20677a01decb769243b9f74d7eb485f97ff87c1eeb091e1f743f675f6a111042bb63f9eeafb624336cb476c155515d397933c015bf1248b03629cd8
7
+ data.tar.gz: d75beae12aba45a0b2680f61b35d43d9ab2b4518759fd274533e474359474196c3001bbeaf5ea05b229c5b22e3ed43ef8bdde4050b94e64537add2edb63d109c
@@ -11,7 +11,9 @@ require 'meshchat/command/whisper'
11
11
  require 'meshchat/command/exit'
12
12
  require 'meshchat/command/listen'
13
13
  require 'meshchat/command/stop_listening'
14
- require 'meshchat/command/who'
14
+ require 'meshchat/command/help'
15
+ require 'meshchat/command/online'
16
+ require 'meshchat/command/offline'
15
17
  require 'meshchat/command/init'
16
18
  require 'meshchat/command/share'
17
19
  require 'meshchat/command/import'
@@ -31,13 +33,15 @@ module MeshChat
31
33
  MeshChat::Command::Base::EXIT => MeshChat::Command::Exit,
32
34
  MeshChat::Command::Base::QUIT => MeshChat::Command::Exit,
33
35
  MeshChat::Command::Base::LISTEN => MeshChat::Command::Listen,
34
- MeshChat::Command::Base::WHO => MeshChat::Command::Who,
35
36
  MeshChat::Command::Base::IDENTITY => MeshChat::Command::Identity,
36
37
  MeshChat::Command::Base::IRB => MeshChat::Command::IRB,
37
38
  MeshChat::Command::Base::INIT => MeshChat::Command::Init,
38
39
  MeshChat::Command::Base::SHARE => MeshChat::Command::Share,
39
40
  MeshChat::Command::Base::IMPORT => MeshChat::Command::Import,
40
- MeshChat::Command::Base::EXPORT => MeshChat::Command::Share
41
+ MeshChat::Command::Base::EXPORT => MeshChat::Command::Share,
42
+ MeshChat::Command::Base::ONLINE => MeshChat::Command::Offline,
43
+ MeshChat::Command::Base::OFFLINE => MeshChat::Command::Online,
44
+ MeshChat::Command::Base::HELP => MeshChat::Command::Help
41
45
  }
42
46
 
43
47
 
@@ -27,6 +27,9 @@ module MeshChat
27
27
  SHARE = 'share'
28
28
  IMPORT = 'import'
29
29
  EXPORT = 'export'
30
+ ONLINE = 'online'
31
+ OFFLINE = 'offline'
32
+ HELP = 'help'
30
33
 
31
34
  def handle
32
35
  klass = CLI::COMMAND_MAP[command]
@@ -1,6 +1,10 @@
1
1
  module MeshChat
2
2
  class Command
3
3
  class Config < Command::Base
4
+ def self.description
5
+ 'interface for setting and displaying various config options'
6
+ end
7
+
4
8
  def handle
5
9
  case sub_command
6
10
  when SET
@@ -1,6 +1,10 @@
1
1
  module MeshChat
2
2
  class Command
3
3
  class Exit < Command::Base
4
+ def self.description
5
+ 'exits the program'
6
+ end
7
+
4
8
  def handle
5
9
  CLI.shutdown
6
10
  end
@@ -0,0 +1,15 @@
1
+ module MeshChat
2
+ class Command
3
+ class Help < Command::Base
4
+ def self.description
5
+ 'displays this help message'
6
+ end
7
+
8
+ def handle
9
+ MeshChat::CLI::COMMAND_MAP.each do |key, klass|
10
+ Display.info "/#{key}\t\t" + klass.description
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,6 +1,10 @@
1
1
  module MeshChat
2
2
  class Command
3
3
  class Identity < Command::Base
4
+ def self.description
5
+ 'displays your identity'
6
+ end
7
+
4
8
  def handle
5
9
  Display.success Settings.identity
6
10
  end
@@ -1,6 +1,10 @@
1
1
  module MeshChat
2
2
  class Command
3
3
  class Import < Command::Base
4
+ def self.description
5
+ 'imports an identity file (formatted as json)'
6
+ end
7
+
4
8
  def handle
5
9
  if command_valid?
6
10
  node = Models::Entry.import_from_file(filename)
@@ -1,5 +1,9 @@
1
1
  module MeshChat
2
2
  class Command
3
+ def self.description
4
+ 'runs ruby commands (useful for debugging)'
5
+ end
6
+
3
7
  # TODO: only include this and awesome_print when booted with
4
8
  # debug=true in the config
5
9
  class IRB < Command::Base
@@ -1,6 +1,10 @@
1
1
  module MeshChat
2
2
  class Command
3
3
  class Listen < Command::Base
4
+ def self.description
5
+ 'starts listening for messages'
6
+ end
7
+
4
8
  def handle
5
9
  CLI.start_server
6
10
  end
@@ -0,0 +1,20 @@
1
+ module MeshChat
2
+ class Command
3
+ class Offline < Command::Base
4
+ def self.description
5
+ 'shows offline users'
6
+ end
7
+
8
+ def handle
9
+ list = Node.offline.map(&:as_info)
10
+ msg = if list.present?
11
+ list.join(", ")
12
+ else
13
+ 'no one is offline'
14
+ end
15
+
16
+ Display.info msg
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ module MeshChat
2
+ class Command
3
+ class Online < Command::Base
4
+ def self.description
5
+ 'shows online users'
6
+ end
7
+
8
+ def handle
9
+ list = Node.online.map(&:as_info)
10
+ msg = if list.present?
11
+ list.join(", ")
12
+ else
13
+ 'no one is offline'
14
+ end
15
+
16
+ Display.info msg
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,6 +1,10 @@
1
1
  module MeshChat
2
2
  class Command
3
3
  class Ping < Command::Base
4
+ def self.description
5
+ 'pings a particular user'
6
+ end
7
+
4
8
  def handle
5
9
  if command_valid?
6
10
  msg = Message::Ping.new
@@ -1,6 +1,10 @@
1
1
  module MeshChat
2
2
  class Command
3
3
  class PingAll < Command::Base
4
+ def self.description
5
+ 'pings all known users'
6
+ end
7
+
4
8
  def handle
5
9
  Node.all.each do |n|
6
10
  Net::Client.send(node: n, message: Message::Ping.new)
@@ -2,6 +2,10 @@ module MeshChat
2
2
  class Command
3
3
  class Server < Command::Base
4
4
  ONLINE = 'online'
5
+ def self.description
6
+ 'known server statuses'
7
+ end
8
+
5
9
 
6
10
  def handle
7
11
  case sub_command
@@ -1,6 +1,10 @@
1
1
  module MeshChat
2
2
  class Command
3
3
  class Share < Command::Base
4
+ def self.description
5
+ 'exports your identity to a json file to give to another user'
6
+ end
7
+
4
8
  def handle
5
9
  Settings.share
6
10
  end
@@ -1,6 +1,10 @@
1
1
  module MeshChat
2
2
  class Command
3
3
  class StopListening < Command::Base
4
+ def self.description
5
+ 'prevents incoming messages'
6
+ end
7
+
4
8
  def handle
5
9
  CLI.close_server
6
10
  end
@@ -1,6 +1,10 @@
1
1
  module MeshChat
2
2
  class Command
3
3
  class Whisper < Command::Base
4
+ def self.description
5
+ 'sends a private message to a spepcific person'
6
+ end
7
+
4
8
  def target
5
9
  # get first arg
6
10
  command
@@ -38,7 +38,7 @@ module MeshChat
38
38
  end
39
39
 
40
40
  rescue => e
41
- Display.info "Public key encryption for #{node.alias_name} failed"
41
+ Display.info "Public key encryption for #{node.try(:alias_name) || 'unknown'} failed"
42
42
  end
43
43
  end
44
44
  end
@@ -1,3 +1,3 @@
1
1
  module MeshChat
2
- VERSION = '0.6.7'
2
+ VERSION = '0.6.8'
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.7
4
+ version: 0.6.8
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-11-16 00:00:00.000000000 Z
11
+ date: 2015-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3
@@ -193,18 +193,20 @@ files:
193
193
  - lib/meshchat/command/base.rb
194
194
  - lib/meshchat/command/config.rb
195
195
  - lib/meshchat/command/exit.rb
196
+ - lib/meshchat/command/help.rb
196
197
  - lib/meshchat/command/identity.rb
197
198
  - lib/meshchat/command/import.rb
198
199
  - lib/meshchat/command/init.rb
199
200
  - lib/meshchat/command/irb.rb
200
201
  - lib/meshchat/command/listen.rb
202
+ - lib/meshchat/command/offline.rb
203
+ - lib/meshchat/command/online.rb
201
204
  - lib/meshchat/command/ping.rb
202
205
  - lib/meshchat/command/ping_all.rb
203
206
  - lib/meshchat/command/server.rb
204
207
  - lib/meshchat/command/share.rb
205
208
  - lib/meshchat/command/stop_listening.rb
206
209
  - lib/meshchat/command/whisper.rb
207
- - lib/meshchat/command/who.rb
208
210
  - lib/meshchat/config/hash_file.rb
209
211
  - lib/meshchat/config/settings.rb
210
212
  - lib/meshchat/database.rb
@@ -258,5 +260,5 @@ rubyforge_project:
258
260
  rubygems_version: 2.4.8
259
261
  signing_key:
260
262
  specification_version: 4
261
- summary: MeshChat-0.6.7
263
+ summary: MeshChat-0.6.8
262
264
  test_files: []
@@ -1,9 +0,0 @@
1
- module MeshChat
2
- class Command
3
- class Who < Command::Base
4
- def handle
5
- Display.info Node.online.map(&:as_info) || 'no one is online'
6
- end
7
- end
8
- end
9
- end