Created
June 8, 2011 22:08
-
-
Save blowmage/1015556 to your computer and use it in GitHub Desktop.
Simple Gem Template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require "rake" | |
require "rake/tasklib" | |
require "flay" | |
require "flay_task" | |
FlayTask.new do |t| | |
t.verbose = true | |
end | |
rescue LoadError | |
task :flay do | |
abort "Flay is not available. In order to run flay, you must: sudo gem install flay" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require "rake" | |
require "rake/tasklib" | |
require "flog" | |
require "flog_task" | |
FlogTask.new do |t| | |
t.verbose = true | |
end | |
rescue LoadError | |
task :flog do | |
abort "Flog is not available. In order to run flog, you must: sudo gem install flog" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rake" | |
Gem::Specification.new do |s| | |
s.name = "GEM_NAME" | |
s.version = "0.1.0" | |
s.summary = "GEM_SUMMARY (short)" | |
s.description = "GEM_DESCRIPTION (longer)" | |
s.homepage = "http://example.com/GEM_NAME" | |
s.authors = ["GEM_AUTHOR_NAME"] | |
s.email = "GEM_AUTHOR_EMAIL" | |
#s.date = "2011-06-08" # defaults to today | |
s.files = FileList["lib/**/*.rb", "bin/*", "[A-Z]*", "test/**/*"].to_a | |
# RDoc settings | |
s.extra_rdoc_files = FileList["[A-Z]*"].to_a | |
s.rdoc_options << "--title" << s.summary << | |
"--main" << "README.rdoc" << | |
"--line-numbers" << "--charset=UTF-8" | |
# Test settings | |
s.test_files = FileList["test/**/*"].to_a | |
# Dependencies | |
if s.respond_to? :specification_version then | |
s.specification_version = 3 | |
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new("1.2.0") then | |
s.add_runtime_dependency "GEM_RUNTIME_DEPENDENCY", [">= 1.0.0"] | |
s.add_development_dependency "GEM_DEVELOPMENT_DEPENDENCY", [">= 1.0.0"] | |
else | |
s.add_dependency "GEM_RUNTIME_DEPENDENCY", [">= 1.0.0"] | |
s.add_dependency "GEM_DEVELOPMENT_DEPENDENCY", [">= 1.0.0"] | |
end | |
else | |
s.add_dependency "GEM_RUNTIME_DEPENDENCY", [">= 1.0.0"] | |
s.add_dependency "GEM_DEVELOPMENT_DEPENDENCY", [">= 1.0.0"] | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get all the dependencies defined in the gemspec | |
gemspec |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rake" | |
require "rake/clean" | |
Dir["tasks/**/*.rake"].each { |t| load t } | |
task :default => :test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require "rcov/rcovtask" | |
Rcov::RcovTask.new do |t| | |
t.libs << "test" | |
t.pattern = "test/**/test_*.rb" | |
t.verbose = true | |
end | |
rescue LoadError | |
task :rcov do | |
abort "RCov is unavailable. In order to run rcov, you must: gem install rcov" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rake/rdoctask" | |
Rake::RDocTask.new do |t| | |
# t.rdoc_dir = "html" | |
# t.title = "GEM_NAME -- GEM_SUMMARY" | |
# t.options << "--line-numbers --inline-source" | |
# t.rdoc_files.include(gemspec.files) | |
# t.main = "README.rdoc" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require "reek" | |
require "reek/rake/task" | |
Reek::Rake::Task.new do |t| | |
t.verbose = true | |
end | |
rescue LoadError | |
task :reek do | |
abort "Reek is unavailable. In order to run reek, you must: gem install reek" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require "rake" | |
require "rake/tasklib" | |
require "roodi" | |
require "roodi_task" | |
RoodiTask.new do |t| | |
t.verbose = false | |
end | |
rescue LoadError | |
task :roodi do | |
abort "Roodi is unavailable. In order to run roodi, you must: gem install roodi" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rake/testtask" | |
Rake::TestTask.new do |t| | |
t.libs << "lib" << "test" | |
t.pattern = "test/**/test_*.rb" | |
t.verbose = true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment