indie-raster 0.0.1 → 0.0.2
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.
- data/build-c/indie-raster +0 -0
- data/indie-raster.gemspec +1 -1
- data/src-ruby/indie-raster.rb +16 -6
- metadata +1 -1
data/build-c/indie-raster
CHANGED
|
Binary file
|
data/indie-raster.gemspec
CHANGED
data/src-ruby/indie-raster.rb
CHANGED
|
@@ -80,13 +80,23 @@ class IndieRasterSession
|
|
|
80
80
|
cmd = File.expand_path(File.dirname(__FILE__) + "/../build-c/indie-raster")
|
|
81
81
|
input = @c.join ''
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
tmppath = opt[:commands_temp_path]
|
|
84
|
+
if tmppath
|
|
85
|
+
File.open(tmppath, "w") do |f|
|
|
86
|
+
f.write input
|
|
87
|
+
end
|
|
88
|
+
out = `cat '#{tmppath}' | #{cmd}`
|
|
89
|
+
`rm '#{tmppath}'`
|
|
90
|
+
else
|
|
91
|
+
stdin, stdout, stderr = Open3.popen3 cmd
|
|
92
|
+
stdin.puts input
|
|
93
|
+
stdin.close
|
|
94
|
+
out = stdout.read
|
|
95
|
+
err = stderr.read
|
|
96
|
+
end
|
|
97
|
+
|
|
86
98
|
code = $?.to_i
|
|
87
|
-
|
|
88
|
-
err = stderr.read
|
|
89
|
-
#TODO handle error
|
|
99
|
+
#TODO handle errors
|
|
90
100
|
|
|
91
101
|
return out
|
|
92
102
|
end
|