Skip to content

Commit 6f3dd78

Browse files
authored
Merge pull request #34 from dmorrill10/master
Housecleaning
2 parents 3c001ab + 6b9ebad commit 6f3dd78

File tree

9 files changed

+72
-42
lines changed

9 files changed

+72
-42
lines changed

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source 'https://rubygems.org'
2+
3+
# Specify your gem's dependencies in ruby_gnuplot.gemspec
4+
gemspec

Rakefile

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
require 'jeweler2'
2-
Jeweler::Tasks.new do |s|
3-
s.name = 'gnuplot'
4-
s.description = s.summary = "Utility library to aid in interacting with gnuplot from ruby"
5-
s.version = "2.6.1"
6-
s.authors='roger pack'
7-
s.email = "[email protected]"
8-
s.homepage = "http://github.com/rdp/ruby_gnuplot/tree/master"
9-
end
1+
require "bundler/gem_tasks"
2+
require 'rake'
3+
require 'rake/clean'
4+
require 'rake/testtask'
5+
require 'rubygems/package_task'
106

11-
task :default => :test
7+
require_relative 'lib/ruby_gnuplot/version'
128

139
desc 'run unit tests'
14-
task :test do
15-
Dir.chdir 'test'
16-
for file in Dir['*']
17-
system("ruby #{file}")
18-
end
10+
task :default => :test
11+
12+
Rake::TestTask.new do |t|
13+
t.libs << "lib" << 'spec/support'
14+
t.test_files = FileList['test/**/*.rb']
15+
t.verbose = false
16+
t.warning = false
17+
end
18+
19+
def gemspec
20+
@clean_gemspec ||= eval(File.read(File.expand_path('../ruby_gnuplot.gemspec', __FILE__)))
1921
end
2022

21-
Jeweler::RubygemsDotOrgTasks.new
23+
Gem::PackageTask.new(gemspec) { |pkg| }

lib/ruby_gnuplot/version.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module RubyGnuplot
2+
VERSION = "2.6.1"
3+
end

ruby_gnuplot.gemspec

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# coding: utf-8
2+
lib = File.expand_path('../lib', __FILE__)
3+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4+
require 'ruby_gnuplot/version'
5+
6+
Gem::Specification.new do |s|
7+
s.name = 'gnuplot'
8+
s.description = s.summary = "Utility library to aid in interacting with gnuplot from ruby"
9+
s.version = RubyGnuplot::VERSION
10+
s.authors='roger pack'
11+
s.email = "[email protected]"
12+
s.homepage = "http://github.com/rdp/ruby_gnuplot/tree/master"
13+
s.license = "BSD"
14+
15+
s.files = `git ls-files`.split($/)
16+
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
17+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
18+
s.require_paths = ["lib"]
19+
20+
s.add_development_dependency 'minitest'
21+
end

test/arrtest.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
require '../lib/gnuplot'
1+
require 'gnuplot'
22

33
Gnuplot.open do |gp|
44
Gnuplot::Plot.new( gp ) do |plot|
5-
5+
66
plot.title "Array Plot Example"
77
plot.ylabel "x"
88
plot.xlabel "x^2"
9-
9+
1010
x = (0..50).collect { |v| v.to_f }
1111
y = x.collect { |v| v ** 2 }
1212

1313
plot.data << Gnuplot::DataSet.new( [x, y] ) do |ds|
1414
ds.with = "linespoints"
1515
ds.notitle
1616
end
17-
17+
1818
end
19-
19+
2020
end
21-
21+

test/histtest.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require '../lib/gnuplot'
1+
require 'gnuplot'
22

33
Gnuplot.open do |gp|
44
gp << "bin(x, s) = s*int(x/s)\n"
@@ -10,7 +10,7 @@
1010

1111
x = (0..500).collect { |v| (rand()-0.5)**3 }
1212
plot.data << Gnuplot::DataSet.new( [x] ) do |ds|
13-
ds.title = "smooth frequency"
13+
ds.title = "smooth frequency"
1414
ds.using = "(bin($1,.01)):(1.)"
1515
ds.smooth = "freq"
1616
ds.with = "boxes"

test/multtest.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
require '../lib/gnuplot'
1+
require 'gnuplot'
22

33
# File.open( "gnuplot.dat", "w") do |gp|
44
Gnuplot.open do |gp|
55
Gnuplot::Plot.new( gp ) do |plot|
6-
6+
77
plot.xrange "[-10:10]"
88
plot.title "Sin Wave Example"
99
plot.ylabel "x"
1010
plot.xlabel "sin(x)"
11-
11+
1212
x = (0..50).collect { |v| v.to_f }
1313
y = x.collect { |v| v ** 2 }
1414

@@ -18,14 +18,14 @@
1818
ds.title = "String function"
1919
ds.linewidth = 4
2020
},
21-
21+
2222
Gnuplot::DataSet.new( [x, y] ) { |ds|
2323
ds.with = "linespoints"
2424
ds.title = "Array data"
2525
}
2626
]
2727

2828
end
29-
29+
3030
end
31-
31+

test/sinwave.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
require '../lib/gnuplot'
1+
require 'gnuplot'
22

33
Gnuplot.open do |gp|
44
Gnuplot::Plot.new( gp ) do |plot|
5-
5+
66
plot.xrange "[-10:10]"
77
plot.title "Sin Wave Example"
88
plot.ylabel "x"
99
plot.xlabel "sin(x)"
10-
10+
1111
plot.data << Gnuplot::DataSet.new( "sin(x)" ) do |ds|
1212
ds.with = "lines"
1313
ds.linewidth = 4
1414
end
15-
15+
1616
end
17-
17+
1818
end
19-
19+

test/test_gnuplot.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- ruby -*-
22

3-
require '../lib/gnuplot'
4-
require 'test/unit'
3+
require 'gnuplot'
4+
require 'minitest/autorun'
55

6-
class StdDataTest < Test::Unit::TestCase
6+
class StdDataTest < MiniTest::Test
77

88
def test_array_1d
99
data = (0..5).to_a
@@ -38,7 +38,7 @@ def test_array_nd
3838
end
3939

4040

41-
class DataSetTest < Test::Unit::TestCase
41+
class DataSetTest < MiniTest::Test
4242

4343
def test_yield_ctor
4444
ds = Gnuplot::DataSet.new do |ds|
@@ -58,7 +58,7 @@ def test_yield_ctor
5858
end
5959

6060

61-
class PlotTest < Test::Unit::TestCase
61+
class PlotTest < MiniTest::Test
6262

6363
def test_no_data
6464
plot = Gnuplot::Plot.new do |p|
@@ -130,7 +130,7 @@ def test_style
130130

131131

132132
require 'rbconfig'
133-
CONFIG = Config::MAKEFILE_CONFIG
133+
CONFIG = RbConfig::MAKEFILE_CONFIG
134134

135135
# This attempts to test the functions that comprise the gnuplot package. Most
136136
# of the bug reports that I get for this package have to do with finding the

0 commit comments

Comments
 (0)