standard-file 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: a59d62786a05ab1ca7d8c9b0c3b6bda41405a9aa
4
- data.tar.gz: 69dfd3ecc8d0cf67afd0c0d1e2ef6395b16489df
3
+ metadata.gz: 3539b3967bbb099392cfa19a41dcda6e760d8dc7
4
+ data.tar.gz: bbc647e2e439f6940a7cacd95239a055cefdaa94
5
5
  SHA512:
6
- metadata.gz: b3738a096e0f49552c0f1afea404bc849d96d2141eaf2aebc5db7b6c15d59508c7e9b6bbf82b7d7259b8f5e9b1622b5da5275cadadab980804fdb559968e4b4c
7
- data.tar.gz: c585d6b12c4b92cb02ed14a08ded3b15762b9f39e96e8299009036aa0e27357f5bc132f4658d488a30240a7beda3518af71a582a51f090a5750d9960d88ee92b
6
+ metadata.gz: 0eb56de338e0204e67bab6828fddb73f3f983c44e7a3c5ebe29f9c776c376d4ae0f0114c646b2d7db32e6828f4bb470f47c1e0f00c0c13fa05fd685e14e1d503
7
+ data.tar.gz: 4bae7bf628ee8e4016cefa5d45e83735b083002ab9ac365d1c62782ed3e4944325eea79cf7342128f5af65e555ea8dc665a3fe9799497679554b376ab7dc925f
@@ -29,15 +29,17 @@ module StandardFile
29
29
  end
30
30
 
31
31
  # manage conflicts
32
+ min_conflict_interval = 5
33
+
32
34
  saved_ids = saved_items.map{|x| x.uuid }
33
35
  retrieved_ids = retrieved_items.map{|x| x.uuid }
34
36
  conflicts = saved_ids & retrieved_ids # & is the intersection
35
37
  # saved items take precedence, retrieved items are duplicated with a new uuid
36
38
  conflicts.each do |conflicted_uuid|
37
- # if changes are greater than 60 seconds apart, create conflicted copy, otherwise discard conflicted
39
+ # if changes are greater than min_conflict_interval seconds apart, create conflicted copy, otherwise discard conflicted
38
40
  saved = saved_items.find{|i| i.uuid == conflicted_uuid}
39
41
  conflicted = retrieved_items.find{|i| i.uuid == conflicted_uuid}
40
- if (saved.updated_at - conflicted.updated_at).abs > 60
42
+ if (saved.updated_at - conflicted.updated_at).abs > min_conflict_interval
41
43
  puts "\n\n\n Creating conflicted copy of #{saved.uuid}\n\n\n"
42
44
  dup = conflicted.dup
43
45
  dup.user = conflicted.user
@@ -1,3 +1,3 @@
1
1
  module StandardFile
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard-file
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Standard File
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-10 00:00:00.000000000 Z
11
+ date: 2017-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails