client-api 0.1.5 → 0.1.6

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
  SHA256:
3
- metadata.gz: 77c83db2883e03b3b6a6de5d6eb07db603337c563d2b08842582e95e2362c790
4
- data.tar.gz: 729484b7b410265cf267edf2905621a7dfb014e1df7f61f3d6ecb019d2cedec6
3
+ metadata.gz: 56cea28cdde5dcef7b6e8868da9742c210a1a27bb49b10776dd91933add2b074
4
+ data.tar.gz: 0c8faf1fdca359218fda52efdc662fc0792462781b3f95b5eddeec8812b17e7a
5
5
  SHA512:
6
- metadata.gz: c34f8816762c247a2dbf39bc3fcb7ef2679802dbfcb64a1d760f82098f300e1f56f7a9bb6cb2dd08584de21ebc52efb4102745bea6e9560c90e1eaaa90519b40
7
- data.tar.gz: eceaf429045524b5a7495a93013ff986d68ecab690dcafa3b124aaab982e244729ad689fe2b6a8be616a034807714ba667d67341547b2da1003872a53355dacd
6
+ metadata.gz: 0f3e0d21191728013ce77b7707c26ee3db2428e9541eccece5b257b9e5bdbe7d727d2aad785adca2273892cfb6ab768a6aa6084c87d2c545d80090b8a02a625d
7
+ data.tar.gz: be941d838436bba64364b0b23fd5a305ba45cd89dfaea2714b32fb56742d6fcc2ff1b41cdbd1b8b1b21fad7ab5e283edc7af6ec64a8c86263a336a32229f99fe
@@ -6,6 +6,10 @@ module ClientApi
6
6
 
7
7
  include ClientApi
8
8
 
9
+ def initialize
10
+ ((FileUtils.rm Dir.glob("./#{json_output['Dirname']}/*.json"); $roo = true)) if json_output && $roo == nil
11
+ end
12
+
9
13
  def get(url, headers = nil)
10
14
  @output = get_request(url, :headers => headers)
11
15
  post_logger if $logger
@@ -39,7 +43,8 @@ module ClientApi
39
43
  unless @output.body == "" || @output.body.nil? || @output.body == "{}"
40
44
  unless json_output['Dirname'] == nil
41
45
  FileUtils.mkdir_p "#{json_output['Dirname']}"
42
- File.open("./output/#{json_output['Filename']}.json", "wb") {|file| file.puts JSON.pretty_generate(JSON.parse(@output.body))}
46
+ time_now = (Time.now.to_f).to_s.gsub('.','')
47
+ File.open("./#{json_output['Dirname']}/#{json_output['Filename']+"_"+time_now}""#{time_now}"".json", "wb") {|file| file.puts JSON.pretty_generate(JSON.parse(@output.body))}
43
48
  end
44
49
  JSON.parse(@output.body)
45
50
  end
@@ -1,3 +1,3 @@
1
1
  module ClientApi
2
- VERSION = "0.1.5".freeze
2
+ VERSION = "0.1.6".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: client-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
- - prashanth-sams
7
+ - Prashanth Sams
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-11 00:00:00.000000000 Z
11
+ date: 2019-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler