This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
test.db | ||
/pkg |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,75 @@ | ||
require 'rake/clean' | ||
|
||
task :default => :spec | ||
|
||
desc 'Run specs' | ||
task :spec do | ||
sh 'bacon -a' | ||
end | ||
|
||
# PACKAGING ============================================================ | ||
|
||
# Load the gemspec using the same limitations as github | ||
require 'rubygems/specification' | ||
$spec = eval(File.read('sinatra-sequel.gemspec')) | ||
|
||
def package(ext='') | ||
"pkg/#{$spec.name}-#{$spec.version}" + ext | ||
end | ||
|
||
desc 'Build packages' | ||
task :package => %w[.gem .tar.gz].map { |ext| package(ext) } | ||
|
||
desc 'Build and install as local gem' | ||
task :install => package('.gem') do | ||
sh "gem install #{package('.gem')}" | ||
end | ||
|
||
directory 'pkg/' | ||
CLOBBER.include('pkg') | ||
|
||
file package('.gem') => %W[pkg/ #{$spec.name}.gemspec] + $spec.files do |f| | ||
sh "gem build #{$spec.name}.gemspec" | ||
mv File.basename(f.name), f.name | ||
end | ||
|
||
file package('.tar.gz') => %w[pkg/] + $spec.files do |f| | ||
sh <<-SH | ||
git archive \ | ||
--prefix=#{$spec.name}-#{$spec.version}/ \ | ||
--format=tar \ | ||
HEAD | gzip > #{f.name} | ||
SH | ||
end | ||
|
||
# Rubyforge Release / Publish Tasks ================================== | ||
|
||
desc 'Publish gem and tarball to rubyforge' | ||
task 'release' => [package('.gem'), package('.tar.gz')] do |t| | ||
sh <<-SH | ||
rubyforge add_release wink #{$spec.name} #{$spec.version} #{package('.gem')} && | ||
rubyforge add_file wink #{$spec.name} #{$spec.version} #{package('.tar.gz')} | ||
SH | ||
end | ||
|
||
# rebuild the gemspec manifest and update timestamps. | ||
task "#{$spec.name}.gemspec" => FileList['{lib,spec}/**','Rakefile','COPYING','README.md'] do |f| | ||
# read spec file and split out manifest section | ||
spec = File.read(f.name) | ||
head, manifest, tail = spec.split(" # = MANIFEST =\n") | ||
# replace version and date | ||
head.sub!(/\.date = '.*'/, ".date = '#{Date.today.to_s}'") | ||
# determine file list from git ls-files | ||
files = `git ls-files`. | ||
split("\n"). | ||
sort. | ||
reject{ |file| file =~ /^\./ }. | ||
reject { |file| file =~ /^doc/ }. | ||
map{ |file| " #{file}" }. | ||
join("\n") | ||
# piece file back together and write... | ||
manifest = " s.files = %w[\n#{files}\n ]\n" | ||
spec = [head,manifest,tail].join(" # = MANIFEST =\n") | ||
File.open(f.name, 'w') { |io| io.write(spec) } | ||
puts "updated #{f.name}" | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Gem::Specification.new do |s| | ||
s.specification_version = 2 if s.respond_to? :specification_version= | ||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | ||
|
||
s.name = 'sinatra-sequel' | ||
s.version = '0.9.0' | ||
s.date = '2009-08-08' | ||
|
||
s.description = "Extends Sinatra with Sequel ORM config, migrations, and helpers" | ||
s.summary = s.description | ||
|
||
s.authors = ["Ryan Tomayko"] | ||
s.email = "rtomayko@gmail.com" | ||
|
||
# = MANIFEST = | ||
s.files = %w[ | ||
COPYING | ||
README.md | ||
Rakefile | ||
lib/sinatra/sequel.rb | ||
sinatra-sequel.gemspec | ||
spec/spec_sinatra_sequel.rb | ||
] | ||
# = MANIFEST = | ||
|
||
s.test_files = s.files.select {|path| path =~ /^spec\/.*.rb/ } | ||
|
||
s.extra_rdoc_files = %w[README.md COPYING] | ||
s.add_dependency 'sinatra', '>= 0.9.4' | ||
s.add_dependency 'sequel', '>= 3.2.0' | ||
s.add_development_dependency 'bacon' | ||
|
||
s.has_rdoc = true | ||
s.homepage = "http://github.com/rtomayko/sinatra-sequel" | ||
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Sinatra::Sequel"] | ||
s.require_paths = %w[lib] | ||
s.rubyforge_project = 'wink' | ||
s.rubygems_version = '1.1.1' | ||
end |