harold 0.1.0 → 0.1.1
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/Gemfile.lock +1 -1
- data/harold.gemspec +1 -1
- data/lib/strategies/cancel.rb +10 -4
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 380c80ab77490e9a3819d7b346d8451c48e3e27455042fa14fc4c53038d600d5
|
4
|
+
data.tar.gz: b791c14f0aecc59dc7144a932ef5c88859f63f139ff2c458714cdfeeba7bd98e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ee85fe9dcf4c133e8e8eb80ebb81564e523cb81c63ecc44edb72363e54537623ff2763f107e329434ca2958ac7bdb81e586cc6d52cbd35fb4ed0eb10d2b0b59
|
7
|
+
data.tar.gz: b91ab3efced6adced5fdd11d1f7755cd0d9f815e9d6c6d1355fc5c36a722c1c15e8ee1cb9c7672e63a2a41d82b8d8e077b0ff8e4478328e3b1c78caac87be509
|
data/Gemfile.lock
CHANGED
data/harold.gemspec
CHANGED
data/lib/strategies/cancel.rb
CHANGED
@@ -24,14 +24,20 @@ module Harold
|
|
24
24
|
# The result of this method are all the id's of operations which
|
25
25
|
# have been added 'or' updated. All items which are added/updated
|
26
26
|
# 'and' afterwards deleted will be non-present in this list.
|
27
|
+
# If an operation has been updated and afterards deleted, both
|
28
|
+
# operations will be returned.
|
27
29
|
def useful_items(operations)
|
28
|
-
|
29
|
-
|
30
|
-
|
30
|
+
items = Hash.new { |hash, key| hash[key] = [] }
|
31
|
+
|
32
|
+
operations.each do |operation|
|
33
|
+
if operation.type == :delete && items[operation.id].include?(:add)
|
34
|
+
items.delete(operation.id)
|
31
35
|
else
|
32
|
-
items.
|
36
|
+
items[operation.id] << operation.type
|
33
37
|
end
|
34
38
|
end
|
39
|
+
|
40
|
+
items.keys
|
35
41
|
end
|
36
42
|
end
|
37
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: harold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- grdw
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,7 +80,7 @@ metadata:
|
|
80
80
|
homepage_uri: https://github.com/wetransfer/harold
|
81
81
|
source_code_uri: https://github.com/wetransfer/harold
|
82
82
|
changelog_uri: https://github.com/wetransfer/harold/CHANGELOG.md
|
83
|
-
post_install_message:
|
83
|
+
post_install_message:
|
84
84
|
rdoc_options: []
|
85
85
|
require_paths:
|
86
86
|
- lib
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubygems_version: 3.1.2
|
99
|
-
signing_key:
|
99
|
+
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: Helpers for collaborative environments
|
102
102
|
test_files: []
|