ssimsort 0.0.8 → 0.1.0

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/ssimsort.rb +6 -2
  3. data/ssimsort.gemspec +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77293fbc06c3f71d43bd33c78b6980a0796065ee
4
- data.tar.gz: bbf55942de50882a7a6fa4e9dd55913f8aadc13f
3
+ metadata.gz: c3809a9a2eef5abf72bbce3a7655c3faa876fcd6
4
+ data.tar.gz: 1dbf8efdacd3552b52fb180dcad2f8f5b0a2c26d
5
5
  SHA512:
6
- metadata.gz: 4dc2d8d6db81fe91e6c8bd4b6b93d9881a6bee3f218c45c0d09f5fab08d52ca8f9accb2e4c20dbc9855ca62ff60cdc55dc8bdf885ece949c203c4c4143d61ddc
7
- data.tar.gz: d71259a6129d8f78abf5df697346e07f2502dfe85c0b68e23241971dbbf07a2b32a6f54ccd44113098e088168764b7fcbbed681afda3651da33e3726e8e7fd84
6
+ metadata.gz: 583c6aa86b69c698b6f4c080f3ea003fa6629509d1491f9d21b2272e04de3b3d9fdf8c2ad9bce2acd2280588f7078c9a1dcae4494ecabe5411efb17f8f958b96
7
+ data.tar.gz: 0b5928163a9cc71a57f601b61fe220af000f6281bd5ca241f4b429b4acdcaac6a2f757228960a40d711cb33c3f63e5c9acf36a1d9b215667c3fc0164e462af2c
data/lib/ssimsort.rb CHANGED
@@ -42,9 +42,13 @@ module SsimSort
42
42
  set = files.combination(2).to_a
43
43
  set.each do |file1,file2|
44
44
  path = "#{output_path}/#{file1.split("/").last}/"
45
- dir = FileUtils.makedirs(path) unless File.exists?(path)
46
45
  simil = SsimSort.ssim(file1,file2)
47
- simil < tolerance ? next : FileUtils.cp(file2,path)
46
+ if simil < tolerance
47
+ next
48
+ else
49
+ FileUtils.makedirs(path) unless File.exists?(path)
50
+ FileUtils.cp(file2,path)
51
+ end
48
52
  end
49
53
  end
50
54
 
data/ssimsort.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ssimsort'
3
- s.version = '0.0.8'
3
+ s.version = '0.1.0'
4
4
  s.date = '2013-11-25'
5
5
  s.summary = "SsimSort"
6
6
  s.description = "Sort images easily by their similarity"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssimsort
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Galaad Gauthier