1 # Rakefile for Rack. -*-ruby-*-
2 require 'rake/rdoctask'
3 require 'rake/testtask'
4 require 'spec/rake/spectask'
7 desc "Run all the tests"
8 task :default => [:spec]
10 desc "Do predistribution stuff"
11 task :predist => [:changelog, :rdoc]
14 desc "Make an archive as .tar.gz"
15 task :dist => [:fulltest, :predist] do
16 sh "git archive --format=tar --prefix=#{release}/ HEAD^{tree} >#{release}.tar"
17 sh "pax -waf #{release}.tar -s ':^:#{release}/:' RDOX SPEC ChangeLog doc"
18 sh "gzip -f -9 #{release}.tar"
21 # Helper to retrieve the "revision number" of the git tree.
23 #if File.directory?(".git")
24 # @tree_version ||= `git describe`.strip.sub('-', '.')
25 # @tree_version << ".0" unless @tree_version.count('.') == 2
29 @tree_version = Rots.release
35 git_tree_version.gsub(/-.*/, '')
39 "ruby-openid-tester-#{git_tree_version}"
43 `git ls-files`.split("\n")
46 desc "Generate a ChangeLog"
48 File.open("ChangeLog", "w") do |out|
49 `git log -z`.split("\0").map do |chunk|
50 author = chunk[/Author: (.*)/, 1].strip
51 date = chunk[/Date: (.*)/, 1].strip
52 desc, detail = $'.strip.split("\n", 2)
55 out.puts "#{date} #{author}"
56 out.puts " * #{desc.strip}"
57 out.puts detail unless detail.empty?
69 require 'rake/packagetask'
70 require 'rake/gempackagetask'
75 spec = Gem::Specification.new do |s|
77 s.version = gem_version
78 s.platform = Gem::Platform::RUBY
79 s.summary = "an OpenID server for making tests of OpenID clients implementations"
81 s.description = <<-EOF
82 Ruby OpenID Test Server (ROST) provides a basic OpenID server made in top of the Rack gem.
83 With this small server, you can make dummy OpenID request for testing purposes,
84 the success of the response will depend on a parameter given on the url of the authentication request.
89 s.executables << 'rots'
90 s.require_path = 'lib'
92 s.extra_rdoc_files = ['README']
93 s.test_files = Dir['spec/*_spec.rb']
95 s.author = 'Roman Gonzalez'
96 s.email = 'romanandreg@gmail.com'
97 s.homepage = 'http://github.com/roman'
98 s.rubyforge_project = 'rots'
100 s.add_development_dependency 'rspec'
101 s.add_development_dependency 'rack'
102 s.add_development_dependency 'ruby-openid', '~> 2.0.0'
105 Rake::GemPackageTask.new(spec) do |p|
112 Spec::Rake::SpecTask.new do |t|
115 desc "Generate RDoc documentation"
116 Rake::RDocTask.new(:rdoc) do |rdoc|
117 rdoc.options << '--line-numbers' << '--inline-source' <<
118 '--main' << 'README' <<
119 '--title' << 'ROTS Documentation' <<
120 '--charset' << 'utf-8'
121 rdoc.rdoc_dir = "doc"
122 rdoc.rdoc_files.include 'README'
123 rdoc.rdoc_files.include('lib/ruby_openid_test_server.rb')
124 rdoc.rdoc_files.include('lib/ruby_openid_test_server/*.rb')