Permalink
Browse files

Cleaned up gemspec/Rakefile to use Bundler and Jeweler

  • Loading branch information...
1 parent 3198192 commit f3228611f27187ffc4b886d84b23a6bfc70accfb @toolmantim committed Feb 23, 2010
Showing with 64 additions and 51 deletions.
  1. +2 −1 .gitignore
  2. +4 −0 .yardopts
  3. +17 −0 Gemfile
  4. +1 −1 LICENSE
  5. +17 −0 README.md
  6. +20 −18 Rakefile
  7. +3 −9 test_example.rb
  8. +0 −22 toadhopper-sinatra.gemspec
View
@@ -1,3 +1,4 @@
-/dist/
+/pkg/
.yardoc
+toadhopper-sinatra.gemspec
/doc/
View
@@ -0,0 +1,4 @@
+-r
+README.md
+-
+LICENSE
View
17 Gemfile
@@ -0,0 +1,17 @@
+source :gemcutter
+
+gem 'toadhopper', '1.0.0'
+gem 'sinatra'
+
+group :development do
+ gem 'rake'
+ gem 'yard'
+ gem 'jeweler'
+end
+
+group :test do
+ gem 'rake'
+ gem 'exemplor'
+ gem 'rack-test', :require => "rack/test"
+ gem 'rr'
+end
View
@@ -1,6 +1,6 @@
The MIT License
-Copyright (c) 2009 Tim Lucas
+Copyright (c) 2009-10 Tim Lucas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
@@ -19,3 +19,20 @@
For usage see example.rb. To install:
gem install toadhopper-sinatra
+
+## Development
+
+Install Bundler 0.9.x, then:
+
+ % git clone git://github.com/toolmantim/toadhopper-sinatra.git
+ % cd toadhopper-sinatra
+ % bundle install
+ % bundle exec rake test
+
+To generate the docs:
+
+ % bundle exec yardoc
+
+To build the gem:
+
+ % bundle exec rake build
View
@@ -1,23 +1,25 @@
-require 'rake/testtask'
+Bundler.setup(:default, :development, :test)
+Bundler.require(:development, :test)
-Rake::TestTask.new do |t|
- t.libs << "test"
- t.test_files = FileList['test/test*.rb']
- t.verbose = true
-end
+Jeweler::Tasks.new do |s|
+ s.name = "toadhopper-sinatra"
+ s.summary = "Post Hoptoad notifications from Sinatra"
+ s.email = "t.lucas@toolmantim.com"
+ s.homepage = "http://github.com/toolmantim/toadhopper-sinatra"
+ s.authors = ["Tim Lucas"]
+ s.extra_rdoc_files = ["README.md", "LICENSE", "example.rb"]
+
+ require File.join(File.dirname(__FILE__), 'lib', 'sinatra', 'toadhopper')
+ s.version = Sinatra::Toadhopper::VERSION
-begin
- gem "sr-mg", "<= 0.0.5"
- require "mg"
- MG.new("toadhopper-sinatra.gemspec")
-rescue Gem::LoadError
+ require 'bundler'
+ bundle = Bundler::Definition.from_gemfile("Gemfile")
+ bundle.dependencies.
+ select { |d| d.groups.include?(:default) || d.groups.include?(:runtime) }.
+ each { |d| s.add_dependency(d.name, d.version_requirements.to_s) }
end
-begin
- gem "yard"
- require 'yard'
- YARD::Rake::YardocTask.new do |t|
- t.options = ['-r', 'README.md', '--files', 'example.rb', 'LICENSE', 'example.rb'] # optional
- end
-rescue Gem::LoadError
+desc "Run tests"
+task :test do
+ exec "/usr/bin/env ruby #{File.dirname(__FILE__)}/test_example.rb"
end
View
@@ -1,16 +1,10 @@
-toadhopper_dir = "#{File.dirname(__FILE__)}/../toadhopper"
-raise "#{toadhopper_dir} does not exist" unless File.directory?(toadhopper_dir)
-$:.unshift "#{toadhopper_dir}/lib"
+Bundler.setup(:default, :test)
+Bundler.require(:test)
$:.unshift "#{File.dirname(__FILE__)}/lib"
-
require "#{File.dirname(__FILE__)}/example"
-Sinatra::Application.set :environment, :production
-require 'exemplor'
-
-require 'rack/test'
-require 'rr'
+Sinatra::Application.set :environment, :production
eg.helpers do
include Rack::Test::Methods
View
@@ -1,22 +0,0 @@
-Gem::Specification.new do |s|
- s.name = "toadhopper-sinatra"
- s.version = "1.0.2"
- s.extra_rdoc_files = ["README.md", "LICENSE"]
- s.summary = "Post Hoptoad notifications from Sinatra"
- s.description = s.summary
- s.authors = ["Tim Lucas"]
- s.email = "t.lucas@toolmantim.com"
- s.homepage = "http://github.com/toolmantim/toadhopper-sinatra"
- s.require_path = "lib"
- s.rubyforge_project = "th-sinatra"
- s.files = %w(
- README.md
- Rakefile
- LICENSE
- lib/sinatra/toadhopper.rb
- example.rb
- test_example.rb
- )
- s.has_rdoc = true
- s.add_dependency("toadhopper", ["1.0.0"])
-end

0 comments on commit f322861

Please sign in to comment.