png_quantizator 0.2.0 → 0.2.1

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: 302f575beeda78b881993fda239f4d1fff9c114b
4
- data.tar.gz: 633bb61eee57d2fba8a95774e867fe6a2582735f
3
+ metadata.gz: d0c8b1c83e7e6ac6423fff59fd463e39535b9101
4
+ data.tar.gz: 8a0b054aec8ebe971708df4991412add92a286b3
5
5
  SHA512:
6
- metadata.gz: 760f8e771bc53a8ffe14506e317c9bc6bc1cafb402b92ddbc528c93ee595962f65d132f6a6308f4156d89d1d84b764954b4190d4a174d21714d3d943c7abc403
7
- data.tar.gz: 414a959102aba631a7176b4957a6cacb623e4c7ef6b3278d93a2520866ad190902d5b0e17166f4752f10f55057b9b52940ba221501df063fb2f956a2b0ef9ba8
6
+ metadata.gz: db4c79816d49b0f60ecf74be8b1371aa014f33978c1530e424462a1e981d710fbd8b6d9ca8548336748bbe8f2fa838409397e617a18a942c98393a07121f4b4c
7
+ data.tar.gz: d8e1b8e042a1a48c11a23f621cf6416947f91a3f3f3db9a1a0c094703eb4a94cc21a82c85e2b7efc9ad1c0fd6cc9ee2d3534a6be3b905d7eb382f49eff78e349
@@ -16,13 +16,12 @@ module PngQuantizator
16
16
  end
17
17
 
18
18
  def quantize!(colors = 256)
19
- Tempfile.open([SecureRandom.hex(16), ".png"]) do |temp_path|
20
- res = quantize_to(temp_path, colors)
21
- FileUtils.cp(temp_path, @file_path)
19
+ Tempfile.open([SecureRandom.hex(16), ".png"]) do |file|
20
+ quantize_to(file.path, colors)
21
+ FileUtils.cp(file.path, @file_path)
22
22
 
23
- temp_path.close
24
- temp_path.delete
25
- res
23
+ file.close
24
+ true
26
25
  end
27
26
  end
28
27
 
@@ -38,7 +37,11 @@ module PngQuantizator
38
37
  f.flush
39
38
  end
40
39
 
41
- [wait_thr.value, stderr.gets(nil)]
40
+ stdout.close
41
+ error_message = stderr.gets(nil)
42
+ stderr.close
43
+
44
+ [wait_thr.value, error_message]
42
45
  end
43
46
 
44
47
  raise(PngQuantError, err_msg) if exit_code != 0
@@ -1,3 +1,3 @@
1
1
  module PngQuantizator
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: png_quantizator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roger Campos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-21 00:00:00.000000000 Z
11
+ date: 2015-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec