Skip to content

Commit

Permalink
Added Jeweler tasks and slight test reorganization.
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Carlson committed Sep 22, 2009
1 parent d850fca commit c926f05
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 7 deletions.
54 changes: 51 additions & 3 deletions Rakefile
@@ -1,19 +1,67 @@
require 'rubygems'
require 'rake'

task :default => :test
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "rack-gridfs"
gem.summary = "Rack middleware for creating HTTP endpoints for files stored in GridFS"
gem.description = "TODO"
gem.email = "blake@coin-operated.net"
gem.homepage = "http://github.com/skinandbones/rack-gridfs"
gem.authors = ["Blake Carlson"]
gem.rubyforge_project = "rack-gridfs"

gem.add_dependency('rack')
gem.add_dependency('activesupport')
gem.add_dependency('mongodb-mongo', '0.14')

gem.add_development_dependency('mocha', '0.9.4')
gem.add_development_dependency('rack-test')
gem.add_development_dependency('thoughtbot-shoulda')
end

Jeweler::RubyforgeTasks.new do |rubyforge|
rubyforge.doc_task = "rdoc"
end
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end

require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
# test.libs << 'lib' << '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|
if File.exist?('VERSION')
version = File.read('VERSION')
else
version = ""
end

rdoc.rdoc_dir = 'rdoc'
rdoc.title = "Rack::GridFS 0.0.1"
rdoc.title = "Rack::GridFS #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
4 changes: 2 additions & 2 deletions test/rack/gridfs_test.rb → test/gridfs_test.rb
@@ -1,4 +1,4 @@
require File.join(File.dirname(__FILE__), '..', 'test_helper')
require 'test_helper'

class Rack::GridFSTest < Test::Unit::TestCase
include Rack::Test::Methods
Expand Down Expand Up @@ -29,7 +29,7 @@ def app
def load_artifact(filename, key, content_type)
GridFS::GridStore.unlink(db, key)
GridFS::GridStore.open(db, key, 'w', :content_type => content_type) do |dest|
File.open(File.join(File.dirname(__FILE__), '..', 'artifacts', filename), 'r') do |orig|
File.open(File.join(File.dirname(__FILE__), 'artifacts', filename), 'r') do |orig|
dest.puts orig.read
end
end
Expand Down
2 changes: 0 additions & 2 deletions test/test_helper.rb
@@ -1,8 +1,6 @@
require 'rubygems'
require 'test/unit'
require 'shoulda'

gem 'mocha', '0.9.4'
require 'mocha'

require 'rack/builder'
Expand Down

0 comments on commit c926f05

Please sign in to comment.