Skip to content

Commit

Permalink
jeweler to bundler and adding badges
Browse files Browse the repository at this point in the history
  • Loading branch information
jtprince committed Jun 18, 2013
1 parent 85f741e commit 9ee34d0
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 99 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ doc/output/*
.*.swp
*.gemspec
playing_around_with
coverage
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: ruby
rvm:
- 2.0.0
- 1.9.3
- jruby-19mode # JRuby in 1.9 mode
- rbx-19mode
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 mspire.gemspec
gemspec
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# mspire

[![Gem Version][GV img]][Gem Version]
[![Build Status][BS img]][Build Status]
[![Dependency Status][DS img]][Dependency Status]
[![Code Climate][CC img]][Code Climate]
[![Coverage Status][CS img]][Coverage Status]

Mspire is a full featured library for working with mass spectrometry data,
particularly proteomic, metabolomic and lipidomic data sets. It aims to be
fast, robust, and beautiful.
Expand Down Expand Up @@ -159,3 +165,16 @@ trypsin.digest("AACCKDDEERFFKPGG") # => ["AACCK", "DDEER", "FFKPGG"]
## Copyright

MIT license. See LICENSE for details.

[Gem Version]: https://rubygems.org/gems/mspire
[Build Status]: https://travis-ci.org/princelab/mspire
[travis pull requests]: https://travis-ci.org/princelab/mspire/pull_requests
[Dependency Status]: https://gemnasium.com/princelab/mspire
[Code Climate]: https://codeclimate.com/github/princelab/mspire
[Coverage Status]: https://coveralls.io/r/princelab/mspire

[GV img]: https://badge.fury.io/rb/mspire.png
[BS img]: https://travis-ci.org/princelab/mspire.png
[DS img]: https://gemnasium.com/princelab/mspire.png
[CC img]: https://codeclimate.com/github/princelab/mspire.png
[CS img]: https://coveralls.io/repos/princelab/mspire/badge.png?branch=master
50 changes: 2 additions & 48 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,65 +1,19 @@
require 'rubygems'
require 'rake'
require 'rspec/core/rake_task'
require 'yard'

require 'jeweler'
Jeweler::Tasks.new do |gem|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
gem.name = "mspire"
gem.homepage = "http://github.com/princelab/mspire"
gem.license = "MIT"
gem.summary = %Q{mass spectrometry proteomics, lipidomics, and tools}
gem.description = %Q{mass spectrometry proteomics, lipidomics, and tools, a rewrite of mspire, merging of ms-* gems}
gem.email = "jtprince@gmail.com"
gem.authors = ["John T. Prince", "Simon Chiang"]
gem.add_dependency "nokogiri", "~> 1.5.9"
gem.add_dependency "bsearch", ">= 1.5.0"
gem.add_dependency "andand", ">= 1.3.3"
gem.add_dependency "obo", ">= 0.1.3"
gem.add_dependency "builder", "~> 3.2.0"
gem.add_dependency "bio", "~> 1.4.3"
gem.add_dependency "trollop", "~> 2.0.0"
# this should be a real dependency, but need to document getting this
# working on windows first!
gem.add_development_dependency "fftw3", "~> 0.3"
gem.add_development_dependency "rspec", "~> 2.13"
gem.add_development_dependency "jeweler", "~> 1.8.4"
#gem.add_development_dependency "rcov", ">= 0"
end
Jeweler::RubygemsDotOrgTasks.new
require "bundler/gem_tasks"

require 'rspec/core'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end

YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb', 'obo/**/*', 'README.md', 'script/**/*'] # optional
#t.options = ['--any', '--extra', '--opts'] # optional
end

RSpec::Core::RakeTask.new(:rcov) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
end

#require 'rcov/rcovtask'
#Rcov::RcovTask.new do |spec|
# spec.libs << 'spec'
# spec.pattern = 'spec/**/*_spec.rb'
# spec.verbose = true
#end

task :default => :spec

require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""

rdoc.rdoc_dir = 'rdoc'
rdoc.title = "mspire #{version}"
rdoc.title = "rubabel #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

Empty file modified bin/mspire
100644 → 100755
Empty file.
4 changes: 1 addition & 3 deletions lib/mspire.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

require 'mspire/mass/aa' # requires mspire/mass & therefore mspire/molecular_formula
require 'mspire/version'

module Mspire
VERSION = IO.read(File.join(File.dirname(__FILE__), '..', 'VERSION')).chomp
CITE = "Prince JT, Marcotte EM. mspire: mass spectrometry proteomics in Ruby. Bioinformatics. 2008. 24(23):2796-7."
end
3 changes: 3 additions & 0 deletions lib/mspire/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Mspire
VERSION = "0.8.6.2"
end
53 changes: 6 additions & 47 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
#$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
#$LOAD_PATH.unshift(File.dirname(__FILE__))

require 'coveralls'
Coveralls.wear!

require 'rubygems'
require 'rspec'
require 'spec_utilities'

TESTFILES = File.dirname(__FILE__) + '/testfiles'

Expand All @@ -19,47 +22,3 @@
end


def benchmark(*args, &block)
if ENV['BENCHMARK']
Benchmark.bmbm(*args, &block)
end
end

# given "filename.ext" returns "filename.CHECK.ext
# block can be given to sanitize each string
def file_check(filename, delete=true, &block)
ext = File.extname(filename)
base = filename.chomp(ext)
checkfile = base + ".CHECK" + ext
File.exist?(filename).should be_true
fstring = IO.read(filename)
cstring = IO.read(checkfile)
if block
(fstring, cstring) = [fstring, cstring].map do |string|
block.call(string)
end
end
fstring.should == cstring
File.unlink(filename) if delete
end

def sanitize_mspire_version_xml(string)
string.gsub(/"mspire(_[\d\.]+)?" version="([\.\d]+)"/, %Q{"mspire" version="X.X.X"})
.gsub(/softwareRef="mspire_[\d\.]+/, 'softwareRef="mspire_X.X.X')
end

require 'stringio'

module Kernel

def capture_stdout
out = StringIO.new
$stdout = out
yield
out.string
ensure
$stdout = STDOUT
end

end

45 changes: 45 additions & 0 deletions spec/spec_utilities.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

def benchmark(*args, &block)
if ENV['BENCHMARK']
Benchmark.bmbm(*args, &block)
end
end

# given "filename.ext" returns "filename.CHECK.ext
# block can be given to sanitize each string
def file_check(filename, delete=true, &block)
ext = File.extname(filename)
base = filename.chomp(ext)
checkfile = base + ".CHECK" + ext
File.exist?(filename).should be_true
fstring = IO.read(filename)
cstring = IO.read(checkfile)
if block
(fstring, cstring) = [fstring, cstring].map do |string|
block.call(string)
end
end
fstring.should == cstring
File.unlink(filename) if delete
end

def sanitize_mspire_version_xml(string)
string.gsub(/"mspire(_[\d\.]+)?" version="([\.\d]+)"/, %Q{"mspire" version="X.X.X"})
.gsub(/softwareRef="mspire_[\d\.]+/, 'softwareRef="mspire_X.X.X')
end

require 'stringio'

module Kernel

def capture_stdout
out = StringIO.new
$stdout = out
yield
out.string
ensure
$stdout = STDOUT
end

end

0 comments on commit 9ee34d0

Please sign in to comment.