1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
Gem::Specification.new do |s|
s.name = 'bio'
s.version = "<% ###### Below is executed in ERB environment ######
# Version can be specified by the environment variable
env_ver = ENV['BIORUBY_GEM_VERSION']
env_ver = nil if env_ver.to_s.strip.empty?
# By default, determined from lib/bio/version.rb
load "./lib/bio/version.rb" unless defined?(BIO_VERSION_RB_LOADED)
ver = Bio::BIORUBY_VERSION.dup
case Bio::BIORUBY_EXTRA_VERSION
when nil
# does nothing
when /\A\.(pre)\z/
ver.push $1
ver.push Time.now.strftime("%Y%m%d")
when /\A\.(.+)\z/
ver.push $1
else
raise "unsupported BIORUBY_EXTRA_VERSION"
end
%><%=
(env_ver || ver.join('.'))
###### Above is executed in ERB environment ######
%>"
s.author = "BioRuby project"
s.email = "staff@bioruby.org"
s.homepage = "http://bioruby.org/"
s.license = "Ruby"
s.summary = "Bioinformatics library"
s.description = "BioRuby is a library for bioinformatics (biology + information science)."
s.platform = Gem::Platform::RUBY
s.files = [
<% ###### Below is executed in ERB environment ######
# Gets file list from the "git ls-files" command.
files = (`git ls-files` rescue nil).to_s.split(/\r?\n/)
files.delete_if { |x| x.empty? }
# When git-ls-files isn't available, creates a list from current files.
if !$? or !($?.success?) or files.size <= 0 then
files =
[ "README.rdoc", "README_DEV.rdoc",
"ChangeLog", "KNOWN_ISSUES.rdoc",
"RELEASE_NOTES.rdoc",
"Rakefile", "bioruby.gemspec.erb",
"bioruby.gemspec", "setup.rb",
"extconf.rb", "LEGAL",
"COPYING", "COPYING.ja", "GPL", "LGPL"
] + Dir.glob("{doc,etc,gemfiles,lib,sample,test}/**/*").delete_if do |item|
case item
when /(\A|\/)CVS(\z|\/)/, /(\A|\/)rdoc(\z|\/)/, /\~\z/
true
else
false
end
end
end
%><%=
files.sort.collect { |x| x.dump }.join(",\n ")
###### Above is executed in ERB environment ######
%>
]
s.extra_rdoc_files = [
<%= ###### Below is executed in ERB environment ######
# Files whose suffix are .rdoc are selected.
rdoc_files = files.find_all { |item| /\.rdoc\z/ =~ item }
# Fail safe settings
if rdoc_files.empty? then
rdoc_files = [ 'README.rdoc', 'README_DEV.rdoc',
'RELEASE_NOTES.rdoc',
'doc/Changes-1.3.rdoc',
]
end
def rdoc_files.add_file(name)
self.push(name) unless self.include?(name)
end
#rdoc_files.add_file "ChangeLog"
#rdoc_files.add_file "LEGAL"
rdoc_files.sort.collect { |x| x.dump }.join(",\n ")
###### Above is executed in ERB environment ######
%>
]
s.rdoc_options << '--main' << 'README.rdoc'
s.rdoc_options << '--title' << 'BioRuby API documentation'
s.rdoc_options << '--exclude' << '\.yaml\z'
s.rdoc_options << '--line-numbers' << '--inline-source'
s.require_path = 'lib'
end
|