calicli 1.0.0 → 1.0.1

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: abdf97de12c5f1f0c7ecac361f8955471f943fb7b5a55e0d34799e5fed316ffe
4
- data.tar.gz: 1a17c026ee300bca76dbe2bfcee1e5d87566f0a784ad5fa859f7ac09cd2b0d59
3
+ metadata.gz: 53dcc55bb0890dc8c600948646c60f29e9e02f02862bd46236ce91e36d28cd3b
4
+ data.tar.gz: 3529400215c076c2e7422f790ac64840fe82d138f539ad7d25fd2332b946876a
5
5
  SHA512:
6
- metadata.gz: 2a62903c8535df9704b13bcd4e42c3684b8db20700f5cccacdef2896e2860ceb2d7c67b48706c415e96168372aec94065f8ba40ac36b459180a56d77508de60c
7
- data.tar.gz: b787e299ece3725eb6c9680907949d4cd61a24de9b9a6f99975fa5e1d600ac20452f53074a737ba7dd3a8fd9d5540ba30d92098a580cb01c0ad96eb31da3bd87
6
+ metadata.gz: adf62a12597d88e8feef9ef9e88c9fa51e547ea3c7fb6a87f5d273db356a496acb163f4988c234ac1ddb33a5aa9250588add806ce74bc54dfab487fdd8e638f4
7
+ data.tar.gz: 841f116b19ac1444722690e8511d26c4a00b19ec1997de27128fb824153c5d994466d3b39576e167d0e837e8ae029b3ad36018f0066ce14854fefae2fa574498
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- calicli (1.0.0)
4
+ calicli (1.0.1)
5
5
  activerecord (~> 5.0.0)
6
6
  activesupport (~> 5.0.0)
7
7
  awesome_print
data/lib/calicli/cli.rb CHANGED
@@ -116,18 +116,21 @@ module Calicli
116
116
  end
117
117
 
118
118
 
119
-
120
- begin
121
- url = Calicli.config.erp_api_base + "/data"
122
- resp = RestClient.post url, {data: data, data_type: "harvest"}.to_json, {content_type: :json, accept: :json, 'x-auth-token' => Calicli.config.erp_api_token}
123
- if options[:store]
124
- QuickStore.store.set(:harvest_id, last_id)
125
- QuickStore.store.set(:run_number, (last_run + 1))
119
+ if data.any?
120
+ begin
121
+ url = Calicli.config.erp_api_base + "/data"
122
+ resp = RestClient.post url, {data: data, data_type: "harvest"}.to_json, {content_type: :json, accept: :json, 'x-auth-token' => Calicli.config.erp_api_token}
123
+ if options[:store]
124
+ QuickStore.store.set(:harvest_id, last_id)
125
+ QuickStore.store.set(:run_number, (last_run + 1))
126
+ end
127
+ puts "OK".green
128
+ puts "last_id=#{last_id}, run_number=#{last_run}".green
129
+ rescue => e
130
+ puts "Error: #{e.message}".red
126
131
  end
127
- puts "OK".green
128
- puts "last_id=#{last_id}, run_number=#{last_run}".green
129
- rescue => e
130
- puts "Error: #{e.message}".red
132
+ else
133
+ puts "No new data"
131
134
  end
132
135
 
133
136
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Calicli
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calicli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Sauter