gnuplot 2.4.1 → 2.5.0

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 (4) hide show
  1. data/ChangeLog +3 -0
  2. data/Rakefile +12 -4
  3. data/lib/gnuplot.rb +12 -5
  4. metadata +12 -15
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ 2.5.0
2
+ * save output to instance variable, thanks for the patch.
3
+
1
4
  2.4.1
2
5
  * Quote escape more strings. Thanks for the tip!
3
6
 
data/Rakefile CHANGED
@@ -1,10 +1,18 @@
1
- require 'jeweler'
1
+ require 'jeweler2'
2
2
  Jeweler::Tasks.new do |s|
3
3
  s.name = 'gnuplot'
4
4
  s.description = s.summary = "Utility library to aid in interacting with gnuplot from ruby"
5
- s.version = "2.4.1"
5
+ s.version = "2.5.0"
6
6
  s.authors='roger pack'
7
- s.autorequire = 'gnuplot.rb'
8
7
  s.email = "rogerpack2005@gmail.com"
9
8
  s.homepage = "http://github.com/rdp/ruby_gnuplot/tree/master"
10
- end
9
+ end
10
+
11
+ desc 'run unit tests'
12
+ task :test do
13
+ Dir.chdir 'test'
14
+ for file in Dir['*']
15
+ system("ruby #{file}")
16
+ end
17
+ end
18
+ Jeweler::RubygemsDotOrgTasks.new
@@ -55,8 +55,9 @@ module Gnuplot
55
55
  #
56
56
  # Return the path to the gnuplot executable or nil if one cannot be found.
57
57
  def Gnuplot.gnuplot( persist = true )
58
- cmd = '"' + which( ENV['RB_GNUPLOT'] || 'gnuplot' ) + '"'
59
- raise 'gnuplot executable not found' unless cmd
58
+ exe_loc = which( ENV['RB_GNUPLOT'] || 'gnuplot' )
59
+ raise 'gnuplot executable not found on path' unless exe_loc
60
+ cmd = '"' + exe_loc + '"'
60
61
  cmd += " -persist" if persist
61
62
  cmd
62
63
  end
@@ -70,9 +71,15 @@ module Gnuplot
70
71
  # <b>todo</b> Add a method to pass the gnuplot path to the function.
71
72
 
72
73
  def Gnuplot.open( persist=true )
73
- cmd = Gnuplot.gnuplot( persist ) or raise 'gnuplot not found'
74
- IO::popen( cmd, "w") { |io| yield io }
75
- end
74
+ cmd = Gnuplot.gnuplot( persist )
75
+ IO::popen( cmd, "w+") { |io|
76
+ yield io
77
+ io.close_write
78
+ @output = io.read
79
+ }
80
+ return @output
81
+ end
82
+
76
83
 
77
84
 
78
85
  # Holds command information and performs the formatting of that command
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnuplot
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 2.4.1
4
+ version: 2.5.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - roger pack
9
- autorequire: gnuplot.rb
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-20 00:00:00.000000000 Z
12
+ date: 2012-06-27 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Utility library to aid in interacting with gnuplot from ruby
15
15
  email: rogerpack2005@gmail.com
@@ -40,29 +40,26 @@ files:
40
40
  - test/test_gnuplot.rb
41
41
  homepage: http://github.com/rdp/ruby_gnuplot/tree/master
42
42
  licenses: []
43
- post_install_message:
43
+ post_install_message:
44
44
  rdoc_options: []
45
45
  require_paths:
46
46
  - lib
47
47
  required_ruby_version: !ruby/object:Gem::Requirement
48
+ none: false
48
49
  requirements:
49
50
  - - ! '>='
50
51
  - !ruby/object:Gem::Version
51
- version: !binary |-
52
- MA==
53
- none: false
52
+ version: '0'
54
53
  required_rubygems_version: !ruby/object:Gem::Requirement
54
+ none: false
55
55
  requirements:
56
56
  - - ! '>='
57
57
  - !ruby/object:Gem::Version
58
- version: !binary |-
59
- MA==
60
- none: false
58
+ version: '0'
61
59
  requirements: []
62
- rubyforge_project:
63
- rubygems_version: 1.8.19
64
- signing_key:
60
+ rubyforge_project:
61
+ rubygems_version: 1.8.23
62
+ signing_key:
65
63
  specification_version: 3
66
64
  summary: Utility library to aid in interacting with gnuplot from ruby
67
65
  test_files: []
68
- ...