attache-api 0.3.0 → 1.0.0

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: 45b92f794dde145cbafe72e3e79a25d04d214b87
4
- data.tar.gz: e92db56d34dc75e6b1867a9431771ebd406be24e
3
+ metadata.gz: ad7f4dc9aa75177f763af313edbd2e729b12fd28
4
+ data.tar.gz: 8af7b0c32da05e86e13ed5964af69b6833615782
5
5
  SHA512:
6
- metadata.gz: 268a7c6aa10b112c3c4293a3615beee065240ded1cebc2a1c83c713394ef62301fc4c948a17b52eaf4a14a8a8700ff873530e92b24bffbd5629c21347a629ebf
7
- data.tar.gz: 864da926d65a4b53eb141ecfa0d582a34f911a2a0c760472e7506cf1577ec73c22880ad47c6cabeebec0969187e90f5e445671517a4a5d5d0139e5812e7fb942
6
+ metadata.gz: ce5a320b2c0c8652691f8f54c3ab8ed5b910a89a162c07056add5d79ab73ae06b7084ff2d6c6770d30506020d5dbc92898eb45701c195c5d654c6231d7034f41
7
+ data.tar.gz: 9d63f22d41a181eea617f85dbb843049404c98fb3fe7e64b0a690061a7d154313129994df0fa4eefa47327184a253e198987f0b9b91f683dedd414980bd1e830
@@ -27,9 +27,11 @@ module Attache
27
27
  Utils.array(new_value)
28
28
  end
29
29
 
30
- def attache_mark_for_discarding(old_value, new_value, attaches_discarded)
31
- obsoleted = Utils.array(old_value).collect {|x| x['path'] } - Utils.array(new_value).collect {|x| x['path'] }
32
- obsoleted.each {|path| attaches_discarded.push(path) unless path.nil? || path == "" }
30
+ def attache_update_pending_diffs(old_value, new_value, pending_backup, pending_discard)
31
+ old_paths = Utils.array(old_value).collect { |x| x['path'] }.reject { |path| path.nil? || path == "" }
32
+ new_paths = Utils.array(new_value).collect { |x| x['path'] }.reject { |path| path.nil? || path == "" }
33
+ pending_backup.push(*(new_paths - old_paths))
34
+ pending_discard.push(*(old_paths - new_paths))
33
35
  end
34
36
 
35
37
  def attaches_discard!(files)
@@ -1,5 +1,5 @@
1
1
  module Attache
2
2
  module API
3
- VERSION = "0.3.0"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attache-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - choonkeat