Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Simple Gem Template

View GEM_NAME.gemspec
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
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
View GEM_NAME.gemspec
1 2
# Get all the dependencies defined in the gemspec
gemspec
View GEM_NAME.gemspec
1 2 3 4 5 6
require "rake"
require "rake/clean"
 
Dir["tasks/**/*.rake"].each { |t| load t }
 
task :default => :test
View GEM_NAME.gemspec
1 2 3 4 5 6 7 8 9 10 11 12 13
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
View GEM_NAME.gemspec
1 2 3 4 5 6 7 8 9 10 11 12 13
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
View GEM_NAME.gemspec
1 2 3 4 5 6 7 8 9 10 11 12
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
View GEM_NAME.gemspec
1 2 3 4 5 6 7 8
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
View GEM_NAME.gemspec
1 2 3 4 5 6 7 8 9 10 11
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
View GEM_NAME.gemspec
1 2 3 4 5 6 7 8 9 10 11 12 13
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
View GEM_NAME.gemspec
1 2 3 4 5 6
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
Something went wrong with that request. Please try again.