soaring 0.1.16 → 0.1.17

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: 1d31f6669ec3757d257c9845fab4f46e039e710d
4
- data.tar.gz: 4749fd927aeaf5fe5a78bdee99318dcf458ce1cc
3
+ metadata.gz: 2553d9d3ceadf27c748db47a4f8d0f87cd2932fc
4
+ data.tar.gz: 60c92e246cc64e156d9b30760ad55973cac8a896
5
5
  SHA512:
6
- metadata.gz: 59e487dca3574f49203801896f310a71eda6ddaa4d86a9aa4561952c90cd50e6add65501615007d86a2ba47c67a17a14dd33c75b5f943118a33b5c2ac189d209
7
- data.tar.gz: 69c56b91db45ff69ef6fb4b02d031b28b84d9c5818967dc9002a02eca2e0637abcbcc76d1e23cd48b3615905992f493e43046866cdbdb946ec32f4fad06c7e8c
6
+ metadata.gz: 698c7400bb38cf1288c42f7d5a537c882d70dbd8ad79e6f730a0af676f585d638a3345fe482ce5afd0e093683a86b6493026936b25145127ce6c586c1bb5b01d
7
+ data.tar.gz: da121f079abfa2b9ee2c6a192a3b55213212dba9e1c3a5915c66fa2758c30067621fa130fe5d514fd7dae2c12c27566147871d70ce08fb3418a3f7521c63efe5
@@ -9,19 +9,21 @@ module Soaring
9
9
  end
10
10
 
11
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
- }
12
+ uri = URI.parse(@options[:url])
13
+ args = {}
14
+ uri.query = URI.encode_www_form(args)
15
+ http = Net::HTTP.new(uri.host, uri.port)
16
+ http.use_ssl = true if uri.is_a?(URI::HTTPS)
17
+ request = Net::HTTP::Get.new(uri.request_uri)
18
+ response = http.request(request)
17
19
 
18
- if '200' != res.code
19
- $stderr.puts "Failed to connect with http error code #{res.code}"
20
+ if '200' != response.code
21
+ $stderr.puts "Failed to connect with http error code #{response.code}"
20
22
  exit 1
21
23
  end
22
24
 
23
- puts JSON.parse(res.body) if 'json' == @options[:format]
24
- print JSON.parse(res.body).to_yaml if 'yaml' == @options[:format]
25
+ puts JSON.parse(response.body) if 'json' == @options[:format]
26
+ print JSON.parse(response.body).to_yaml if 'yaml' == @options[:format]
25
27
 
26
28
  rescue StandardError => exception
27
29
  message = "#{exception.class}: #{exception.message}"
@@ -1,3 +1,3 @@
1
1
  module Soaring
2
- VERSION = "0.1.16"
2
+ VERSION = "0.1.17"
3
3
  end
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.16
4
+ version: 0.1.17
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-10 00:00:00.000000000 Z
11
+ date: 2016-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler