Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

boilerplate files; rack/contrib.rb and spec_rack_contrib.rb

commit 6137cfa882b1fead1ecc072c499750b4c4390a8b 1 parent 200fe55
Ryan Tomayko rtomayko authored
18 COPYING
View
@@ -0,0 +1,18 @@
+Copyright (c) 2008 The Committers
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 README
View
@@ -0,0 +1,12 @@
+= Contributed Rack Middleware and Utilities
+
+This package includes a variety of components for Rack, a Ruby web server
+interface.
+
+http://github.com/rtomayko/rack-contrib
+
+== Links
+
+Rack:: <http://rack.rubyforge.org/>
+Rack's Rubyforge project:: <http://rubyforge.org/projects/rack>
+rack-devel mailing list:: <http://groups.google.com/group/rack-devel>
89 Rakefile
View
@@ -0,0 +1,89 @@
+# Rakefile for Rack::Contrib. -*-ruby-*-
+require 'rake/rdoctask'
+require 'rake/testtask'
+
+desc "Run all the tests"
+task :default => [:test]
+
+desc "Do predistribution stuff"
+task :predist => [:changelog, :rdoc]
+
+desc "Make an archive as .tar.gz"
+task :dist => [:fulltest, :predist] do
+ sh "git archive --format=tar --prefix=#{release}/ HEAD^{tree} >#{release}.tar"
+ sh "pax -waf #{release}.tar -s ':^:#{release}/:' RDOX ChangeLog doc"
+ sh "gzip -f -9 #{release}.tar"
+end
+
+# Helper to retrieve the "revision number" of the git tree.
+def git_tree_version
+ if File.directory?(".git")
+ @tree_version ||= `git describe`.strip.sub('-', '.')
+ @tree_version << ".0" unless @tree_version.count('.') == 2
+ else
+ $: << "lib"
+ require 'rack/contrib'
+ @tree_version = Rack::Contrib.release
+ end
+ @tree_version
+end
+
+def gem_version
+ git_tree_version.gsub(/-.*/, '')
+end
+
+def release
+ "rack-contrib-#{git_tree_version}"
+end
+
+def manifest
+ `git ls-files`.split("\n")
+end
+
+
+desc "Generate a ChangeLog"
+task :changelog do
+ File.open("ChangeLog", "w") { |out|
+ `git log -z`.split("\0").map { |chunk|
+ author = chunk[/Author: (.*)/, 1].strip
+ date = chunk[/Date: (.*)/, 1].strip
+ desc, detail = $'.strip.split("\n", 2)
+ detail ||= ""
+ detail.rstrip!
+ out.puts "#{date} #{author}"
+ out.puts " * #{desc.strip}"
+ out.puts detail unless detail.empty?
+ out.puts
+ }
+ }
+end
+
+
+desc "Generate RDox"
+task "RDOX" do
+ sh "specrb -Ilib:test -a --rdox >RDOX"
+end
+
+desc "Run all the fast tests"
+task :test do
+ sh "specrb -Ilib:test -w #{ENV['TEST'] || '-a'} #{ENV['TESTOPTS']}"
+end
+
+desc "Run all the tests"
+task :fulltest do
+ sh "specrb -Ilib:test -w #{ENV['TEST'] || '-a'} #{ENV['TESTOPTS']}"
+end
+
+desc "Generate RDoc documentation"
+Rake::RDocTask.new(:rdoc) do |rdoc|
+ rdoc.options << '--line-numbers' << '--inline-source' <<
+ '--main' << 'README' <<
+ '--title' << 'Rack Contrib Documentation' <<
+ '--charset' << 'utf-8'
+ rdoc.rdoc_dir = "doc"
+ rdoc.rdoc_files.include 'README'
+ rdoc.rdoc_files.include 'RDOX'
+ rdoc.rdoc_files.include('lib/rack/*.rb')
+ rdoc.rdoc_files.include('lib/rack/*/*.rb')
+end
+task :rdoc => ["RDOX"]
8 lib/rack/contrib.rb
View
@@ -0,0 +1,8 @@
+require 'rack'
+module Rack
+ module Contrib
+ def self.release
+ "0.4"
+ end
+ end
+end
7 test/spec_rack_contrib.rb
View
@@ -0,0 +1,7 @@
+require 'rack/contrib'
+
+context "Rack::Contrib" do
+ specify "should expose release" do
+ Rack::Contrib.should.respond_to :release
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.