numo-gnuplot 0.1.2 → 0.1.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/numo/gnuplot.rb +13 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8bad6abaa98a0a9d7359396665513a4c5d89dd67
4
- data.tar.gz: 24b90ba847429a8af4b6afe4c8c57ef77ac286fc
3
+ metadata.gz: 39a3ebbe14ce683f9921fa70f40e60b398f76678
4
+ data.tar.gz: c2508063acf8dca872ab6c53bd5ae075c379681f
5
5
  SHA512:
6
- metadata.gz: 7eb740ca2acb363b8b876f3e5e70bb815f4cbcd417a76b7e61c1190807fd19cbacb1b3f9b9671d0163f3898aa6d351346b86de0087c8093e7a4a8d83e4326d2b
7
- data.tar.gz: dee61360f7deac2c128747a71584ef290edf417cc9e32adb8a83cec2e341cff77ba4003a819736004acc4a6e0eb29fdac04e1fa6334b137a0437f2c1c5806027
6
+ metadata.gz: a5dee4a5e360d41ea5804845a76b081fa6f8e1c13bd134538a3b618861095b534cb5dad8d844be79b7dc0846703c9bba38c14bad20e65a748e9461531402098f
7
+ data.tar.gz: 63e12b30cb0e739a6fc5cffb2a3a99300ff3160148be08f1e7c10929699d5c1ec17b0400baf75128137d4e2f0b9761a6a25ee92f83c34a48b6f87f4cc92f6b9a
data/lib/numo/gnuplot.rb CHANGED
@@ -11,7 +11,7 @@ module Numo
11
11
 
12
12
  class Gnuplot
13
13
 
14
- VERSION = "0.1.2"
14
+ VERSION = "0.1.3"
15
15
  POOL = []
16
16
  DATA_FORMAT = "%.5g"
17
17
 
@@ -24,12 +24,19 @@ class Gnuplot
24
24
  def initialize(gnuplot_command="gnuplot")
25
25
  @history = []
26
26
  @debug = false
27
- unless system("which "+gnuplot_command)
28
- kernel_raise GnuplotError,"Gnuplot command not found"
29
- end
30
- @iow = IO.popen(gnuplot_command+" 2>&1","w+")
31
- @ior = @iow
27
+ r0,@iow = IO.pipe
28
+ @ior,w2 = IO.pipe
29
+ IO.popen(gnuplot_command,:in=>r0,:err=>w2)
30
+ r0.close
31
+ w2.close
32
32
  @gnuplot_version = send_cmd("print GPVAL_VERSION")[0].chomp
33
+ if /\.(\w+)$/ =~ (filename = ENV['NUMO_GNUPLOT_OUTPUT'])
34
+ ext = $1
35
+ ext = KNOWN_EXT[ext] || ext
36
+ opts = ENV['NUMO_GNUPLOT_OPTION'] || ''
37
+ set terminal:[ext,opts]
38
+ set output:filename
39
+ end
33
40
  end
34
41
 
35
42
  attr_reader :history
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: numo-gnuplot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro TANAKA
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-11 00:00:00.000000000 Z
11
+ date: 2016-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler