Permalink
Browse files

Removed Jeweler.

  • Loading branch information...
1 parent 71efb6c commit 6cf3574b52bdb0cbc87dbf19bc0254d9e6e25656 @samsm committed May 24, 2011
Showing with 50 additions and 114 deletions.
  1. +4 −0 Gemfile
  2. +2 −52 Rakefile
  3. +0 −1 VERSION
  4. +19 −18 lib/rack-static-if-present.rb
  5. +9 −0 lib/rack-static-if-present/version.rb
  6. +16 −43 rack-static-if-present.gemspec
View
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in rack-static-if-present.gemspec
+gemspec
View
@@ -1,52 +1,2 @@
-require 'rubygems'
-require 'rake'
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "rack-static-if-present"
- gem.summary = "Like Rack::Static. Except only if there is a static file to serve."
- gem.description = "Not much to explain. Not a lot of code, but wanted it packaged up for easy use/deployment."
- gem.email = "samsm@samsm.com"
- gem.homepage = "http://github.com/samsm/rack-static-if-present"
- gem.authors = ["Sam Schenkman-Moore"]
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
-end
-
-require 'rake/testtask'
-Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
-end
-
-begin
- require 'rcov/rcovtask'
- Rcov::RcovTask.new do |test|
- test.libs << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
- end
-rescue LoadError
- task :rcov do
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
- end
-end
-
-task :test => :check_dependencies
-
-task :default => :test
-
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
-
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "rack-static-if-present #{version}"
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
+require 'bundler'
+Bundler::GemHelper.install_tasks
View
@@ -1 +0,0 @@
-0.1.0
@@ -1,21 +1,22 @@
-class Rack::StaticIfPresent
-
- def initialize(app, options={})
- @app = app
- @urls = options[:urls] || ["/favicon.ico"]
- root = options[:root] || Dir.pwd
- @file_server = Rack::File.new(root)
- end
-
- def call(env)
- path = env["PATH_INFO"]
- can_serve = @urls.any? { |url| path.index(url) == 0 }
-
- if can_serve
- result = @file_server.call(env)
- return result if result[0] == 200
+module Rack
+ module StaticIfPresent
+ def initialize(app, options={})
+ @app = app
+ @urls = options[:urls] || ["/favicon.ico"]
+ root = options[:root] || Dir.pwd
+ @file_server = Rack::File.new(root)
+ end
+
+ def call(env)
+ path = env["PATH_INFO"]
+ can_serve = @urls.any? { |url| path.index(url) == 0 }
+
+ if can_serve
+ result = @file_server.call(env)
+ return result if result[0] == 200
+ end
+ @app.call(env)
end
- @app.call(env)
+
end
-
end
@@ -0,0 +1,9 @@
+module Rack
+ module Static
+ module If
+ module Present
+ VERSION = "0.2.0"
+ end
+ end
+ end
+end
@@ -1,50 +1,23 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "rack-static-if-present/version"
Gem::Specification.new do |s|
- s.name = %q{rack-static-if-present}
- s.version = "0.1.0"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Sam Schenkman-Moore"]
- s.date = %q{2009-12-15}
+ s.name = "rack-static-if-present"
+ s.version = Rack::Static::If::Present::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Sam Schenkman-Moore"]
+ s.email = ["samsm@samsm.com"]
+ s.homepage = "http://github.com/samsm/rack-static-if-present"
+ s.summary = %q{Like Rack::Static. Except only if there is a static file to serve.}
s.description = %q{Not much to explain. Not a lot of code, but wanted it packaged up for easy use/deployment.}
- s.email = %q{samsm@samsm.com}
- s.extra_rdoc_files = [
- "LICENSE",
- "README.rdoc"
- ]
- s.files = [
- ".document",
- ".gitignore",
- "LICENSE",
- "README.rdoc",
- "Rakefile",
- "VERSION",
- "lib/rack-static-if-present.rb",
- "test/helper.rb",
- "test/test_rack-static-if-present.rb"
- ]
- s.homepage = %q{http://github.com/samsm/rack-static-if-present}
- s.rdoc_options = ["--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.5}
- s.summary = %q{Like Rack::Static. Except only if there is a static file to serve.}
- s.test_files = [
- "test/helper.rb",
- "test/test_rack-static-if-present.rb"
- ]
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
+ s.rubyforge_project = "rack-static-if-present"
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- else
- end
- else
- end
-end
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+ s.add_dependency 'rack', ['~> 1']
+end

0 comments on commit 6cf3574

Please sign in to comment.