calicli 0.1.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: 385a2f2778d3f7c6657f61eae2bf4421b77510f519b25f00c945455f9fcbbca0
4
- data.tar.gz: 886c66d46f16da258e720da713485eb61d5c4bb77a544fadba01489574afd52d
3
+ metadata.gz: 53dcc55bb0890dc8c600948646c60f29e9e02f02862bd46236ce91e36d28cd3b
4
+ data.tar.gz: 3529400215c076c2e7422f790ac64840fe82d138f539ad7d25fd2332b946876a
5
5
  SHA512:
6
- metadata.gz: '023873fe8228ca07f992a0c3dea76f2a9d2dda7f668706d78bb84b317574fa921a611b0284842fc8031e449ecef0da3e04b5f4a96f886b1df35621a4d1fb3183'
7
- data.tar.gz: 5a3ead27e8a8167b25c7c3b13a53b0770042ad2e2587d3621d1fe5f5ef742369fe6d9b4a94673a55e940b6c4034ac4cca60462a2a1086b439e97cdd36c6fa4a0
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 (0.1.0)
4
+ calicli (1.0.1)
5
5
  activerecord (~> 5.0.0)
6
6
  activesupport (~> 5.0.0)
7
7
  awesome_print
@@ -31,25 +31,25 @@ GEM
31
31
  arel (7.1.4)
32
32
  awesome_print (1.9.2)
33
33
  aws-eventstream (1.2.0)
34
- aws-partitions (1.666.0)
35
- aws-sdk-core (3.168.1)
34
+ aws-partitions (1.711.0)
35
+ aws-sdk-core (3.170.0)
36
36
  aws-eventstream (~> 1, >= 1.0.2)
37
37
  aws-partitions (~> 1, >= 1.651.0)
38
38
  aws-sigv4 (~> 1.5)
39
39
  jmespath (~> 1, >= 1.6.1)
40
- aws-sdk-kms (1.59.0)
40
+ aws-sdk-kms (1.62.0)
41
41
  aws-sdk-core (~> 3, >= 3.165.0)
42
42
  aws-sigv4 (~> 1.1)
43
- aws-sdk-s3 (1.117.1)
43
+ aws-sdk-s3 (1.119.1)
44
44
  aws-sdk-core (~> 3, >= 3.165.0)
45
45
  aws-sdk-kms (~> 1)
46
46
  aws-sigv4 (~> 1.4)
47
- aws-sdk-sqs (1.52.0)
47
+ aws-sdk-sqs (1.53.0)
48
48
  aws-sdk-core (~> 3, >= 3.165.0)
49
49
  aws-sigv4 (~> 1.1)
50
50
  aws-sigv4 (1.5.2)
51
51
  aws-eventstream (~> 1, >= 1.0.2)
52
- concurrent-ruby (1.1.10)
52
+ concurrent-ruby (1.2.0)
53
53
  domain_name (0.5.20190701)
54
54
  unf (>= 0.0.5, < 1.0.0)
55
55
  http-accept (1.7.0)
@@ -58,17 +58,17 @@ GEM
58
58
  i18n (1.12.0)
59
59
  concurrent-ruby (~> 1.0)
60
60
  jmespath (1.6.2)
61
- jwt (2.5.0)
61
+ jwt (2.6.0)
62
62
  mime-types (3.4.1)
63
63
  mime-types-data (~> 3.2015)
64
64
  mime-types-data (3.2022.0105)
65
65
  minitest (5.16.3)
66
66
  mysql2 (0.5.4)
67
67
  netrc (0.11.0)
68
- nokogiri (1.13.9-arm64-darwin)
68
+ nokogiri (1.14.2-arm64-darwin)
69
69
  racc (~> 1.4)
70
70
  quick_store (1.0.0)
71
- racc (1.6.0)
71
+ racc (1.6.2)
72
72
  rake (13.0.6)
73
73
  rest-client (2.1.0)
74
74
  http-accept (>= 1.7.0, < 2.0)
data/lib/calicli/cli.rb CHANGED
@@ -12,6 +12,7 @@ module Calicli
12
12
  harvest_id = QuickStore.store.get(:harvest_id)
13
13
  run_number =QuickStore.store.get(:run_number)
14
14
  puts "Storage: harvest_id=#{harvest_id}, run_number=#{run_number}"
15
+ puts "Connection: harvest_count=#{Harvest.count}"
15
16
  end
16
17
 
17
18
  desc "clean storage", "cleans the local storage"
@@ -41,7 +42,6 @@ module Calicli
41
42
  puts "Blocks: #{Block.count}"
42
43
  Block.find_each do |b|
43
44
  puts "#{b.iID_BLOQUE} => #{b.sDESCRIPCION}"
44
- puts " => #{b.areas.count}"
45
45
  b.areas.each do |a|
46
46
  puts " => #{a.sDESCRIPCION} : area=#{a.dAREA}, dist=#{a.dDISTANCIA}"
47
47
  end
@@ -92,7 +92,7 @@ module Calicli
92
92
  puts "date=#{date.beginning_of_day} .... #{date.end_of_day}"
93
93
  arel = arel.where(dtFECHA: date.beginning_of_day..date.end_of_day)
94
94
  else last_processed
95
- arel = arel.where("iID_ENTREGA > ?", last_proceseed)
95
+ arel = arel.where("iID_ENTREGA > ?", last_processed)
96
96
  end
97
97
 
98
98
  if by_run
@@ -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 = "0.1.0"
4
+ VERSION = "1.0.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calicli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Sauter
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-23 00:00:00.000000000 Z
11
+ date: 2023-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  - !ruby/object:Gem::Version
209
209
  version: '0'
210
210
  requirements: []
211
- rubygems_version: 3.2.3
211
+ rubygems_version: 3.1.4
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: Calinda Sync Ops