spurious 0.1.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 267928e2d8b40c77bc453cc5548d1305e2c5ad35
4
- data.tar.gz: abd8ac6ba42b552cb0539d2ae7a5ddbaac38dff4
3
+ metadata.gz: bdedd43a1cfc7f8e986c49b569d2c31beee13c05
4
+ data.tar.gz: 43c7ec6444583803bef3b08b16cce73c3290f93b
5
5
  SHA512:
6
- metadata.gz: c86e9fd3584e407556de56db6fc09da5bfc5f26560adb0a2b413cc5aa7907c694b383c009d87b8b3644a06624fe46c50504fad21f9efc809b73ef18f03823542
7
- data.tar.gz: a17a5a3204a1fd3e2c923ad0069011001e6ece6b4636b6c32d7970611b04cc232c4ce07e041d2760305c252d818bd996dccd0d8012a71a6a90cf4c0a20be0f1a
6
+ metadata.gz: c2fb5574563f6837b47faaf23d292317287f6da15a96b92de586b6d406ae59bde3a725bbc357a6ff99657bc3db890ef3d0601447c130d7dca85c5b5bd7c82472
7
+ data.tar.gz: 8dea00654be0c4c30ebf579c2133bb809bce38b47d3b68943c774aeca94465c826751a587112be3550dfe83f77eb259c29b7c6e1de464223bd836095064e2f56
data/lib/spurious/app.rb CHANGED
@@ -29,10 +29,14 @@ module Spurious
29
29
 
30
30
  state_methods
31
31
 
32
+ method_option :'json', :type => :boolean, :default => false, :desc => 'Prints out ports as a json string'
32
33
  desc "ports", "List ports for the spurious containers"
33
34
  def ports
34
- EventMachine.run do
35
- EventMachine::connect options[:server_ip], options[:server_port], Spurious::Command::Ports, :ports, self
35
+
36
+ if server_available? then
37
+ EventMachine.run do
38
+ EventMachine::connect options[:server_ip], options[:server_port], Spurious::Command::Ports, :ports, self
39
+ end
36
40
  end
37
41
  end
38
42
 
@@ -19,12 +19,15 @@ module Spurious
19
19
  end
20
20
  end
21
21
 
22
- app.say "\n"
23
-
24
- app.print_table(
25
- build_table(['Service', 'Guest port', 'Host port'], data)
26
- ) unless parsed_data['response'].empty?
22
+ if app.options[:json]
23
+ app.say JSON.generate(parsed_data['response'])
24
+ else
25
+ app.say "\n"
26
+ app.print_table(
27
+ build_table(['Service', 'Guest port', 'Host port'], data)
28
+ ) unless parsed_data['response'].empty?
27
29
 
30
+ end
28
31
  EventMachine.stop_event_loop if parsed_data['close']
29
32
 
30
33
  end
@@ -1,3 +1,3 @@
1
1
  module Spurious
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spurious
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Jack
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  version: '0'
167
167
  requirements: []
168
168
  rubyforge_project:
169
- rubygems_version: 2.2.2
169
+ rubygems_version: 2.0.3
170
170
  signing_key:
171
171
  specification_version: 4
172
172
  summary: Spurious is a cli tool that interacts with the spurious server