tsks 0.0.15 → 0.0.16

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
  SHA256:
3
- metadata.gz: b586fc95fb2c8a9eb61946e455e3f506072f21c0253fae9a501a089942399a8e
4
- data.tar.gz: 43a9e769270960a9632794b42489d87f638289981ad4ceb1eaf1964ff3860479
3
+ metadata.gz: eba37aa1a580178be1d1a37dfa7aac67ee5d133b047a53b186be514ff047b8f4
4
+ data.tar.gz: 6cf976319e8e70cab7dab0529d3c34cfea6428eb559d03ca1f0115d5e296af1a
5
5
  SHA512:
6
- metadata.gz: 8c9e0dc7955ba274db1b86258ea7ff25770dab13e77929419a2f907b982161f55b736489e68a38292dba858abb64f7309a3ff6c47de691e6585406e20188f8a2
7
- data.tar.gz: 14a1fb179964c41fb4375d1ea0ab94371ae591c9473147223677e82e04f7daaf9617a9813b37c9c8adce32d8fd9cb6ca721338ab0679802d17e906d07cea53d8
6
+ metadata.gz: 8b1e46d8649e769ad5d74e0c0f46628f15cf725faf96838d446afaf9cc5eafa2c25abbab5ab8e7bbb306ac240df42b3d3e58e7fea8fc1712517972a09092af77
7
+ data.tar.gz: 95c1406756b470b2417e3615937ccad9bc3b2ff9622f1e63e8098c6ad55e8d19f80d244d75466627704f997f742d401423588494bf837ee0efec80ce102af409
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tsks (0.0.15)
4
+ tsks (0.0.16)
5
5
  httparty
6
6
  sqlite3
7
7
  thor
data/bin/build ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ bundle exec rake build
data/lib/tsks/actions.rb CHANGED
@@ -11,7 +11,7 @@ module Tsks
11
11
  end
12
12
 
13
13
  def self.update_server_for_removed_tsks token
14
- tsks_uuids = Tsks::Storage.select_removed_uuids
14
+ tsks_uuids = Tsks::Storage.select_removed_tsk_ids
15
15
 
16
16
  if !tsks_uuids.empty?
17
17
  for id in tsks_uuids
data/lib/tsks/cli.rb CHANGED
@@ -168,10 +168,20 @@ module Tsks
168
168
 
169
169
  if get_res[:tsks]
170
170
  if get_res[:ok] == true
171
- local_tsks_to_post = local_tsks - remote_tsks
171
+ raw_local_tsks = local_tsks.map {|t| t.reject{|k,_| k == :rowid}}
172
+ local_tsks_to_post = raw_local_tsks - remote_tsks
173
+
174
+ tsks_to_post = []
175
+ for local_tsk in local_tsks
176
+ for local_tsk_to_post in local_tsks_to_post
177
+ if local_tsk[:tsk] == local_tsk_to_post[:tsk]
178
+ tsks_to_post.append local_tsk
179
+ end
180
+ end
181
+ end
172
182
 
173
- if local_tsks_to_post.count > 0
174
- for tsk in local_tsks_to_post
183
+ if tsks_to_post.count > 0
184
+ for tsk in tsks_to_post
175
185
  post_res = Tsks::Request.post "/tsks", token, {tsk: tsk}
176
186
  posted_tsk = post_res[:tsk]
177
187
 
@@ -183,7 +193,8 @@ module Tsks
183
193
 
184
194
  # TODO: review this process
185
195
  updated_local_tsks = Tsks::Storage.select_all
186
- remote_tsks_to_storage = remote_tsks - updated_local_tsks
196
+ raw_updated_local_tsks = updated_local_tsks.map {|t| t.reject{|k,_| k == :rowid}}
197
+ remote_tsks_to_storage = remote_tsks - raw_updated_local_tsks
187
198
 
188
199
  if remote_tsks_to_storage.count > 0
189
200
  Tsks::Storage.insert_many remote_tsks_to_storage
data/lib/tsks/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tsks
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.16"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tsks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luan Ramos Vicente
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-29 00:00:00.000000000 Z
11
+ date: 2023-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -96,6 +96,7 @@ files:
96
96
  - Gemfile.lock
97
97
  - README.md
98
98
  - Rakefile
99
+ - bin/build
99
100
  - bin/console
100
101
  - bin/install
101
102
  - bin/release