client-api 0.1.6 → 0.1.7
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 +4 -4
- data/lib/client-api/base.rb +5 -1
- data/lib/client-api/request.rb +2 -0
- data/lib/client-api/settings.rb +0 -2
- data/lib/client-api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9d76436428c8aad960531bcab906a0f11c2d9ac6ac6499494b5b2917072b013
|
4
|
+
data.tar.gz: f4445a5374a8f4e5cfad1396cba33f24e186ad62f7dabd5df923f0e3b6a3fd70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a40ac974a88b7d8e7aa519b5eb874dbbf1cc36851587b2cae39e3fadd1932db9da670352e0d282eeae55f46fae56085a80ff9fef8ca3db5fe8c707eba3039390
|
7
|
+
data.tar.gz: ae541e94d6fc22356bf5be72d5bf78d1fbe4e6bfdd186449b0a69f062f09604f49d6c00f772a3ccf675a39196e0db96c1dc7a95afc702706f10a27b86af2639a
|
data/lib/client-api/base.rb
CHANGED
@@ -44,7 +44,11 @@ module ClientApi
|
|
44
44
|
unless json_output['Dirname'] == nil
|
45
45
|
FileUtils.mkdir_p "#{json_output['Dirname']}"
|
46
46
|
time_now = (Time.now.to_f).to_s.gsub('.','')
|
47
|
-
|
47
|
+
begin
|
48
|
+
File.open("./#{json_output['Dirname']}/#{json_output['Filename']+"_"+time_now}""#{time_now}"".json", "wb") {|file| file.puts JSON.pretty_generate(JSON.parse(@output.body))}
|
49
|
+
rescue StandardError => e
|
50
|
+
raise("\n"+" Not a compatible (or) Invalid JSON response => [kindly check the uri & request details]".brown + " \n\n #{e.message}")
|
51
|
+
end
|
48
52
|
end
|
49
53
|
JSON.parse(@output.body)
|
50
54
|
end
|
data/lib/client-api/request.rb
CHANGED
data/lib/client-api/settings.rb
CHANGED
data/lib/client-api/version.rb
CHANGED