ika 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ika/version.rb +1 -1
  3. data/lib/ika.rb +8 -4
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 445850d5ed265759a2d0fbf1e139ea2af728b2d2
4
- data.tar.gz: ae8be98de4260f41331a00be42991cb6b7922a4e
3
+ metadata.gz: 5d73ca85b5443b02bf3e96f686748ceec8d78e10
4
+ data.tar.gz: db621af9d2fd9802f81aa0c8357dd89e41de3042
5
5
  SHA512:
6
- metadata.gz: b05f0fa66d21a8521298d4118ff59e615712c5c9bd5c546d0d9106c0d1f44e55f04eade81b7edf01b7f490a010ee15d4d226dc1b457e7cc6a667c59b5bb00106
7
- data.tar.gz: 5e49528daa04168f46033066a439f0a0fffe1a89d11066e7e9ed17f6b4a79c3c349d5a7bfea7675d61331f6ac4a22189e7b737a35ed8417cfeff3136ac991926
6
+ metadata.gz: b8fff98c9d66ffb068b9094933d9f512c4585d702e64c3ea53685c634a8fc469f42011ff810a36578dea40d543d85ff08e4a7dcfe63640114d07285bb3830efb
7
+ data.tar.gz: 1e44c7872237fb20ca0ee0d438f530c927b5f5986d305a27b91fb8ae0fbfefc444205082661abfda1c9708c67f3ceca278a3371cb0d58b4228703d6205d3f2b3
data/lib/ika/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ika
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
data/lib/ika.rb CHANGED
@@ -25,7 +25,10 @@ module Ika
25
25
  remove_target_ids = []
26
26
  end
27
27
  objects.each do |object|
28
- record_exists = true if exists?(id: object['id'].to_i)
28
+ if exists?(id: object['id'].to_i)
29
+ record_exists = true
30
+ exist_object = where(id: object['id'].to_i).first
31
+ end
29
32
 
30
33
  object_params = {}
31
34
  object.keys.each do |key|
@@ -40,9 +43,10 @@ module Ika
40
43
  obj_name = object[key]['name'] || object[key][:name]
41
44
  if obj_url && File.exist?('public' + obj_url)
42
45
  md5 = Digest::MD5.file('public' + obj_url)
43
- need_update = false if md5 == obj_md5 && record_exists == true
44
- elsif obj_url
45
- object_params[key] = base64_conversion(obj_data, obj_name) if need_update
46
+ need_update = false if md5 == obj_md5 && record_exists && obj_name == Pathname(exist_object.try(key.to_sym).to_s).basename.to_s
47
+ end
48
+ if obj_url && need_update
49
+ object_params[key] = base64_conversion(obj_data, obj_name)
46
50
  end
47
51
  else
48
52
  object_params[key] = object[key]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ika
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Makoto NAKAYA
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-07 00:00:00.000000000 Z
12
+ date: 2015-07-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails