Permalink
Browse files

- Now using Bundler to manage the Gem

- Added an rcov task (for Ruby 1.8 testing)
- Added simplecov (for Ruby 1.9 testing)
  • Loading branch information...
1 parent 94996c9 commit 4de4fb997dafb72d6ce5133ed59ca23de626ce0a Daz Oakley committed Feb 15, 2011
Showing with 82 additions and 61 deletions.
  1. +4 −0 Gemfile
  2. +22 −0 Gemfile.lock
  3. +2 −0 Manifest
  4. +2 −21 Rakefile
  5. +19 −34 biomart.gemspec
  6. +1 −0 lib/biomart.rb
  7. +3 −0 lib/biomart/version.rb
  8. +16 −0 tasks/rcov.rake
  9. +13 −6 test/test_helper.rb
View
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in lorem.gemspec
+gemspec
View
@@ -0,0 +1,22 @@
+PATH
+ remote: .
+ specs:
+ biomart (0.2.1)
+ builder
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ builder (3.0.0)
+ shoulda (2.11.3)
+ simplecov (0.4.0)
+ simplecov-html (~> 0.4.0)
+ simplecov-html (0.4.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ biomart!
+ shoulda (>= 2.10)
+ simplecov
View
@@ -9,7 +9,9 @@ lib/biomart/database.rb
lib/biomart/dataset.rb
lib/biomart/filter.rb
lib/biomart/server.rb
+lib/biomart/version.rb
tasks/metrics.rake
+tasks/rcov.rake
tasks/shoulda.rake
tasks/yard.rake
test/test_biomart.rb
View
@@ -1,25 +1,6 @@
-require 'rubygems'
-require 'rake'
+require 'bundler'
-require './lib/biomart'
-
-begin
- require 'echoe'
-
- Echoe.new('biomart', '0.2.0') do |p|
- p.description = 'A ruby API for interacting with Biomart XML based webservices.'
- p.url = 'http://github.com/dazoakley/biomart'
- p.author = 'Darren Oakley'
- p.email = 'daz.oakley@gmail.com'
- p.ignore_pattern = ['tmp/*', 'script/*']
- p.dependencies = [['builder','~>2']]
- p.development_dependencies = [['shoulda','>= 2.10'],['yard', '>= 0']]
- end
-
-rescue LoadError => boom
- puts "You are missing a dependency required for meta-operations on this gem."
- puts "#{boom.to_s.capitalize}."
-end
+Bundler::GemHelper.install_tasks
Dir['tasks/*.rake'].each { |t| load t }
task :default => [:test]
View
@@ -1,40 +1,25 @@
# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "biomart/version"
Gem::Specification.new do |s|
- s.name = %q{biomart}
- s.version = "0.2.0"
+ s.name = "biomart"
+ s.version = Biomart::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Darren Oakley"]
+ s.email = ["daz.oakley@gmail.com"]
+ s.homepage = "http://github.com/dazoakley/biomart"
+ s.summary = "A ruby API for interacting with Biomart services."
+ s.description = "A ruby API for interacting with Biomart XML based webservices."
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Darren Oakley"]
- s.date = %q{2010-06-10}
- s.description = %q{A ruby API for interacting with Biomart XML based webservices.}
- s.email = ["daz.oakley@gmail.com"]
- s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.rdoc"]
- s.files = ["History.txt", "Manifest.txt", "README.rdoc", "Rakefile", "biomart.gemspec", "lib/biomart.rb", "lib/biomart/attribute.rb", "lib/biomart/database.rb", "lib/biomart/dataset.rb", "lib/biomart/filter.rb", "lib/biomart/server.rb", "script/console", "script/destroy", "script/generate", "tasks/metrics.task", "tasks/shoulda.task", "test/test_biomart.rb", "test/test_helper.rb"]
- s.homepage = %q{http://github.com/dazoakley/biomart}
- s.rdoc_options = ["--main", "README.rdoc"]
- s.require_paths = ["lib"]
- s.rubyforge_project = %q{biomart}
- s.rubygems_version = %q{1.3.7}
- s.summary = %q{A ruby API for interacting with Biomart services.}
- s.test_files = ["test/test_biomart.rb", "test/test_helper.rb"]
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
+ s.rubyforge_project = "biomart"
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<builder>, [">= 0"])
- s.add_development_dependency(%q<shoulda>, [">= 2.10"])
- s.add_development_dependency(%q<hoe>, [">= 2.6.1"])
- else
- s.add_dependency(%q<builder>, [">= 0"])
- s.add_dependency(%q<shoulda>, [">= 2.10"])
- s.add_dependency(%q<hoe>, [">= 2.6.1"])
- end
- else
- s.add_dependency(%q<builder>, [">= 0"])
- s.add_dependency(%q<shoulda>, [">= 2.10"])
- s.add_dependency(%q<hoe>, [">= 2.6.1"])
- end
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+
+ s.add_runtime_dependency("builder", [">= 0"])
+ s.add_development_dependency("shoulda", [">= 2.10"])
+ s.add_development_dependency("simplecov", [">= 0"])
end
View
@@ -131,6 +131,7 @@ def check_response( body, code )
directory = File.expand_path(File.dirname(__FILE__))
+require File.join(directory, 'biomart', 'version')
require File.join(directory, 'biomart', 'server')
require File.join(directory, 'biomart', 'database')
require File.join(directory, 'biomart', 'dataset')
@@ -0,0 +1,3 @@
+module Biomart
+ VERSION = "0.2.1"
+end
View
@@ -0,0 +1,16 @@
+begin
+ require "rcov/rcovtask"
+
+ desc "Analyze code coverage with tests"
+ Rcov::RcovTask.new do |t|
+ t.libs << "test"
+ t.test_files = FileList["test/test*.rb"]
+ t.verbose = true
+ t.rcov_opts << "--exclude /gems/,/Library/,spec,features"
+ end
+rescue LoadError
+ if /^1\.8/ === RUBY_VERSION
+ puts "[ERROR] Unable to load 'rcov' tasks - please install rcov"
+ end
+end
+
View
@@ -1,9 +1,16 @@
-begin
- require 'shoulda'
-rescue LoadError
- require 'rubygems' unless ENV['NO_RUBYGEMS']
- require 'shoulda'
+
+$:.unshift( "#{File.expand_path(File.dirname(__FILE__))}/../lib" )
+
+require 'rubygems'
+require 'bundler/setup'
+require 'shoulda'
+
+# Set-up SimpleCov (code coverage tool for Ruby 1.9)
+if /^1.9/ === RUBY_VERSION
+ require 'simplecov'
+ SimpleCov.start do
+ coverage_dir 'simplecov'
+ end
end
-$:.unshift(File.dirname(__FILE__) + '/../lib')
require 'biomart'

0 comments on commit 4de4fb9

Please sign in to comment.