Skip to content

Commit

Permalink
Tidied up gem specification and moved to bundler/minitest/rcov for de…
Browse files Browse the repository at this point in the history
…velopment
  • Loading branch information
jeremyolliver committed Apr 2, 2011
1 parent cd10507 commit 7e2188d
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 36 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
.yardoc/*
.yardoc/*
*.gem
.bundle
Gemfile.lock
pkg/*
coverage
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "http://rubygems.org"

# Specify your gem's dependencies in resque-batched-logger.gemspec
gemspec
34 changes: 15 additions & 19 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'

desc 'Default: run unit tests.'
task :default => :test
require 'bundler'
Bundler::GemHelper.install_tasks

desc 'Test the gvis plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end

desc 'Generate documentation for the gvis plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'Gvis'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
require 'rcov/rcovtask'
Rcov::RcovTask.new do |test|
test.rcov_opts << '--exclude /gems/,/Library/,/usr/,spec,lib/tasks' # exclude external gems/libraries
test.libs << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end

task :default => :test
15 changes: 10 additions & 5 deletions gvis.gemspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
Gem::Specification.new do |s|
s.name = "gvis"
s.version = "2.0.1"
s.summary = "Easily embed charts with Google Visualization API"
s.platform = Gem::Platform::RUBY
s.author = "Jeremy Olliver"
s.email = "[email protected]"
s.homepage = "http://github.com/jeremyolliver/gvis"
s.summary = "Easily embed charts with Google Visualization API"
s.description = "Easily embed charts with Google Visualization API, using ruby formatted options in your view files"
s.author = "Jeremy Olliver"

s.files = ["README","Rakefile","MIT-LICENSE"]
s.files += ["lib/gvis.rb", "lib/data_table.rb", "lib/google_visualization.rb"]
# s.test_files = ["test/gvis_test.rb", "test/test_helper.rb"]
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_paths = ["lib"]

s.add_development_dependency 'bundler'
s.add_development_dependency 'minitest'
s.add_development_dependency 'rcov'
end
8 changes: 0 additions & 8 deletions test/gvis_test.rb

This file was deleted.

19 changes: 19 additions & 0 deletions test/helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'minitest/unit'

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'gvis'

class MiniTest::Unit::TestCase
end

MiniTest::Unit.autorun
7 changes: 7 additions & 0 deletions test/test_data_table.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'helper'

class TestDataTable < MiniTest::Unit::TestCase
def test_something_for_real
flunk "hey buddy, you should probably rename this file and start testing for real"
end
end
7 changes: 7 additions & 0 deletions test/test_google_visualization.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'helper'

class TestGoogleVisualization < MiniTest::Unit::TestCase
def test_something_for_real
flunk "hey buddy, you should probably rename this file and start testing for real"
end
end
7 changes: 7 additions & 0 deletions test/test_gvis.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'helper'

class TestGvis < MiniTest::Unit::TestCase
def test_something_for_real
flunk "hey buddy, you should probably rename this file and start testing for real"
end
end
3 changes: 0 additions & 3 deletions test/test_helper.rb

This file was deleted.

0 comments on commit 7e2188d

Please sign in to comment.