Skip to content

Housecleaning #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in ruby_gnuplot.gemspec
gemspec
34 changes: 18 additions & 16 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
require 'jeweler2'
Jeweler::Tasks.new do |s|
s.name = 'gnuplot'
s.description = s.summary = "Utility library to aid in interacting with gnuplot from ruby"
s.version = "2.6.1"
s.authors='roger pack'
s.email = "[email protected]"
s.homepage = "http://github.com/rdp/ruby_gnuplot/tree/master"
end
require "bundler/gem_tasks"
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rubygems/package_task'

task :default => :test
require_relative 'lib/ruby_gnuplot/version'

desc 'run unit tests'
task :test do
Dir.chdir 'test'
for file in Dir['*']
system("ruby #{file}")
end
task :default => :test

Rake::TestTask.new do |t|
t.libs << "lib" << 'spec/support'
t.test_files = FileList['test/**/*.rb']
t.verbose = false
t.warning = false
end

def gemspec
@clean_gemspec ||= eval(File.read(File.expand_path('../ruby_gnuplot.gemspec', __FILE__)))
end

Jeweler::RubygemsDotOrgTasks.new
Gem::PackageTask.new(gemspec) { |pkg| }
3 changes: 3 additions & 0 deletions lib/ruby_gnuplot/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module RubyGnuplot
VERSION = "2.6.1"
end
21 changes: 21 additions & 0 deletions ruby_gnuplot.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'ruby_gnuplot/version'

Gem::Specification.new do |s|
s.name = 'gnuplot'
s.description = s.summary = "Utility library to aid in interacting with gnuplot from ruby"
s.version = RubyGnuplot::VERSION
s.authors='roger pack'
s.email = "[email protected]"
s.homepage = "http://github.com/rdp/ruby_gnuplot/tree/master"
s.license = "BSD"

s.files = `git ls-files`.split($/)
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
s.test_files = s.files.grep(%r{^(test|spec|features)/})
s.require_paths = ["lib"]

s.add_development_dependency 'minitest'
end
12 changes: 6 additions & 6 deletions test/arrtest.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
require '../lib/gnuplot'
require 'gnuplot'

Gnuplot.open do |gp|
Gnuplot::Plot.new( gp ) do |plot|

plot.title "Array Plot Example"
plot.ylabel "x"
plot.xlabel "x^2"

x = (0..50).collect { |v| v.to_f }
y = x.collect { |v| v ** 2 }

plot.data << Gnuplot::DataSet.new( [x, y] ) do |ds|
ds.with = "linespoints"
ds.notitle
end

end

end

4 changes: 2 additions & 2 deletions test/histtest.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require '../lib/gnuplot'
require 'gnuplot'

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

x = (0..500).collect { |v| (rand()-0.5)**3 }
plot.data << Gnuplot::DataSet.new( [x] ) do |ds|
ds.title = "smooth frequency"
ds.title = "smooth frequency"
ds.using = "(bin($1,.01)):(1.)"
ds.smooth = "freq"
ds.with = "boxes"
Expand Down
12 changes: 6 additions & 6 deletions test/multtest.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
require '../lib/gnuplot'
require 'gnuplot'

# File.open( "gnuplot.dat", "w") do |gp|
Gnuplot.open do |gp|
Gnuplot::Plot.new( gp ) do |plot|

plot.xrange "[-10:10]"
plot.title "Sin Wave Example"
plot.ylabel "x"
plot.xlabel "sin(x)"

x = (0..50).collect { |v| v.to_f }
y = x.collect { |v| v ** 2 }

Expand All @@ -18,14 +18,14 @@
ds.title = "String function"
ds.linewidth = 4
},

Gnuplot::DataSet.new( [x, y] ) { |ds|
ds.with = "linespoints"
ds.title = "Array data"
}
]

end

end

12 changes: 6 additions & 6 deletions test/sinwave.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
require '../lib/gnuplot'
require 'gnuplot'

Gnuplot.open do |gp|
Gnuplot::Plot.new( gp ) do |plot|

plot.xrange "[-10:10]"
plot.title "Sin Wave Example"
plot.ylabel "x"
plot.xlabel "sin(x)"

plot.data << Gnuplot::DataSet.new( "sin(x)" ) do |ds|
ds.with = "lines"
ds.linewidth = 4
end

end

end

12 changes: 6 additions & 6 deletions test/test_gnuplot.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- ruby -*-

require '../lib/gnuplot'
require 'test/unit'
require 'gnuplot'
require 'minitest/autorun'

class StdDataTest < Test::Unit::TestCase
class StdDataTest < MiniTest::Test

def test_array_1d
data = (0..5).to_a
Expand Down Expand Up @@ -38,7 +38,7 @@ def test_array_nd
end


class DataSetTest < Test::Unit::TestCase
class DataSetTest < MiniTest::Test

def test_yield_ctor
ds = Gnuplot::DataSet.new do |ds|
Expand All @@ -58,7 +58,7 @@ def test_yield_ctor
end


class PlotTest < Test::Unit::TestCase
class PlotTest < MiniTest::Test

def test_no_data
plot = Gnuplot::Plot.new do |p|
Expand Down Expand Up @@ -130,7 +130,7 @@ def test_style


require 'rbconfig'
CONFIG = Config::MAKEFILE_CONFIG
CONFIG = RbConfig::MAKEFILE_CONFIG

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