ika 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ika/version.rb +1 -1
- data/lib/ika.rb +8 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d73ca85b5443b02bf3e96f686748ceec8d78e10
|
4
|
+
data.tar.gz: db621af9d2fd9802f81aa0c8357dd89e41de3042
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8fff98c9d66ffb068b9094933d9f512c4585d702e64c3ea53685c634a8fc469f42011ff810a36578dea40d543d85ff08e4a7dcfe63640114d07285bb3830efb
|
7
|
+
data.tar.gz: 1e44c7872237fb20ca0ee0d438f530c927b5f5986d305a27b91fb8ae0fbfefc444205082661abfda1c9708c67f3ceca278a3371cb0d58b4228703d6205d3f2b3
|
data/lib/ika/version.rb
CHANGED
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
|
-
|
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 ==
|
44
|
-
|
45
|
-
|
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.
|
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-
|
12
|
+
date: 2015-07-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|