soaring 0.1.15 → 0.1.16

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: c9e52500d96e4706122352e56896c7342da4e705
4
- data.tar.gz: 1d395974c499a8e8a58ff1854d9883374002901c
3
+ metadata.gz: 1d31f6669ec3757d257c9845fab4f46e039e710d
4
+ data.tar.gz: 4749fd927aeaf5fe5a78bdee99318dcf458ce1cc
5
5
  SHA512:
6
- metadata.gz: 90fd7401206e4cd91524560dfa32c9ca455e9ea32db7c30ba1707151699667f0a71c3db7850cb1f870d3be0e8a36536f1481517c6a21e03a53ce7b9b2ab29d9a
7
- data.tar.gz: e17b2b30f1d5a6339dd10ee7217c3e5db928ce2426c249e523719580a089f23cea57618805c6a846c1e509e0b40f13a49ba3818d5aeee67a49e7c41a5ceb75ae
6
+ metadata.gz: 59e487dca3574f49203801896f310a71eda6ddaa4d86a9aa4561952c90cd50e6add65501615007d86a2ba47c67a17a14dd33c75b5f943118a33b5c2ac189d209
7
+ data.tar.gz: 69c56b91db45ff69ef6fb4b02d031b28b84d9c5818967dc9002a02eca2e0637abcbcc76d1e23cd48b3615905992f493e43046866cdbdb946ec32f4fad06c7e8c
data/lib/soaring/cli.rb CHANGED
@@ -46,5 +46,14 @@ module Soaring
46
46
  packager = Packager.new(options)
47
47
  packager.package
48
48
  end
49
+
50
+ desc "detail [OPTIONS]", "provide detailed status of a running service component with OPTIONS"
51
+ option :verbose, :aliases => '-v', :desc => 'Verbose logging'
52
+ option :url, :aliases => '-u', :default => 'http://localhost:9393/status-detail', :desc => 'URL of the status endpoint to hit'
53
+ option :format, :aliases => '-f', :default => 'yaml', :desc => 'The format of the output (yaml,json), defaults to yaml'
54
+ def detail
55
+ detailer = Detailer.new(options)
56
+ detailer.detail
57
+ end
49
58
  end
50
59
  end
@@ -0,0 +1,32 @@
1
+ require 'net/http'
2
+ require 'json'
3
+ require 'yaml'
4
+
5
+ module Soaring
6
+ class Detailer
7
+ def initialize(options)
8
+ @options = options
9
+ end
10
+
11
+ def detail
12
+ url = URI.parse(@options[:url])
13
+ req = Net::HTTP::Get.new(url.to_s)
14
+ res = Net::HTTP.start(url.host, url.port) {|http|
15
+ http.request(req)
16
+ }
17
+
18
+ if '200' != res.code
19
+ $stderr.puts "Failed to connect with http error code #{res.code}"
20
+ exit 1
21
+ end
22
+
23
+ puts JSON.parse(res.body) if 'json' == @options[:format]
24
+ print JSON.parse(res.body).to_yaml if 'yaml' == @options[:format]
25
+
26
+ rescue StandardError => exception
27
+ message = "#{exception.class}: #{exception.message}"
28
+ $stderr.puts "#{message}"
29
+ exit 1
30
+ end
31
+ end
32
+ end
@@ -1,3 +1,3 @@
1
1
  module Soaring
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.16"
3
3
  end
data/lib/soaring.rb CHANGED
@@ -3,6 +3,7 @@ require 'soaring/tools'
3
3
  require 'soaring/initializer'
4
4
  require 'soaring/runner'
5
5
  require 'soaring/packager'
6
+ require 'soaring/detailer'
6
7
  require 'soaring/cli'
7
8
 
8
9
  module Soaring
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soaring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Barney de Villiers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-06 00:00:00.000000000 Z
11
+ date: 2016-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -97,6 +97,7 @@ files:
97
97
  - bin/soaring
98
98
  - lib/soaring.rb
99
99
  - lib/soaring/cli.rb
100
+ - lib/soaring/detailer.rb
100
101
  - lib/soaring/initializer.rb
101
102
  - lib/soaring/packager.rb
102
103
  - lib/soaring/runner.rb
@@ -128,4 +129,3 @@ signing_key:
128
129
  specification_version: 4
129
130
  summary: Tooling for soaring with the soar architecture
130
131
  test_files: []
131
- has_rdoc: