Permalink
Browse files

using Jeweler to generate gem

  • Loading branch information...
1 parent 744f465 commit fcd68d467365b1c7bb420b58aba1a7cc4628a4c6 @martinbtt committed Jun 5, 2009
Showing with 55 additions and 101 deletions.
  1. +15 −90 Rakefile
  2. +40 −11 net-http-spy.gemspec
View
105 Rakefile
@@ -2,6 +2,21 @@ require "rubygems"
require "rake/gempackagetask"
require "rake/rdoctask"
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gemspec|
+ gemspec.name = "net-http-spy"
+ gemspec.summary = "Ever wondered what HTTP requests the Ruby gem you are using to connect to a third party API is making? Use HTTP Spy to see what is going on behind the scenes."
+ gemspec.email = "martin@beyondthetype.com"
+ gemspec.homepage = "http://github.com/martinbtt/net-http-spy"
+ gemspec.description = "Ever wondered what HTTP requests the Ruby gem you are using to connect to a third party API is making? Use HTTP Spy to see what is going on behind the scenes."
+ gemspec.authors = ["Martin Sadler"]
+ gemspec.files.include Dir["examples/*.rb"] + ["readme.markdown"]
+ end
+rescue LoadError
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
+end
+
task :default => :spec
require "spec"
@@ -11,53 +26,6 @@ Spec::Rake::SpecTask.new do |t|
t.libs = ["spec"]
end
-# This builds the actual gem. For details of what all these options
-# mean, and other ones you can add, check the documentation here:
-#
-# http://rubygems.org/read/chapter/20
-#
-spec = Gem::Specification.new do |s|
-
- # Change these as appropriate
- s.name = "net-http-spy"
- s.version = "0.1.1"
- s.summary = "Ever wondered what HTTP requests the Ruby gem you are using to connect to a third party API is making? Use HTTP Spy to see what is going on behind the scenes."
- s.author = "Martin Sadler"
- s.email = "martin@beyondthetype.com"
- s.homepage = "http://beyondthetype.com"
-
- s.has_rdoc = true
- s.extra_rdoc_files = %w(readme.markdown)
- s.rdoc_options = %w(--main readme.markdown)
-
- # Add any extra files to include in the gem
- s.files = %w(readme.markdown) + Dir.glob("{spec,lib,examples}/**/*")
-
- s.require_paths = ["lib"]
-
- # If you want to depend on other gems, add them here, along with any
- # relevant versions
- # s.add_dependency("some_other_gem", "~> 0.1.0")
-
- s.add_development_dependency("rspec") # add any other gems for testing/development
- s.add_development_dependency("twitter")
-
- # If you want to publish automatically to rubyforge, you'll may need
- # to tweak this, and the publishing task below too.
- s.rubyforge_project = "net-http-spy"
-end
-
-# This task actually builds the gem. We also regenerate a static
-# .gemspec file, which is useful if something (i.e. GitHub) will
-# be automatically building a gem for this project. If you're not
-# using GitHub, edit as appropriate.
-Rake::GemPackageTask.new(spec) do |pkg|
- pkg.gem_spec = spec
-
- # Generate the gemspec file for github.
- file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
- File.open(file, "w") {|f| f << spec.to_ruby }
-end
# Generate documentation
Rake::RDocTask.new do |rd|
@@ -70,46 +38,3 @@ desc 'Clear out RDoc and generated packages'
task :clean => [:clobber_rdoc, :clobber_package] do
rm "#{spec.name}.gemspec"
end
-
-# If you want to publish to RubyForge automatically, here's a simple
-# task to help do that. If you don't, just get rid of this.
-# Be sure to set up your Rubyforge account details with the Rubyforge
-# gem; you'll need to run `rubyforge setup` and `rubyforge config` at
-# the very least.
-begin
- require "rake/contrib/sshpublisher"
- namespace :rubyforge do
-
- desc "Release gem and RDoc documentation to RubyForge"
- task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
-
- namespace :release do
- desc "Release a new version of this gem"
- task :gem => [:package] do
- require 'rubyforge'
- rubyforge = RubyForge.new
- rubyforge.configure
- rubyforge.login
- rubyforge.userconfig['release_notes'] = spec.summary
- path_to_gem = File.join(File.dirname(__FILE__), "pkg", "#{spec.name}-#{spec.version}.gem")
- puts "Publishing #{spec.name}-#{spec.version.to_s} to Rubyforge..."
- rubyforge.add_release(spec.rubyforge_project, spec.name, spec.version.to_s, path_to_gem)
- end
-
- desc "Publish RDoc to RubyForge."
- task :docs => [:rdoc] do
- config = YAML.load(
- File.read(File.expand_path('~/.rubyforge/user-config.yml'))
- )
-
- host = "#{config['username']}@rubyforge.org"
- remote_dir = "/var/www/gforge-projects/net-http-spy/" # Should be the same as the rubyforge project name
- local_dir = 'rdoc'
-
- Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
- end
- end
- end
-rescue LoadError
- puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
-end
View
@@ -2,33 +2,62 @@
Gem::Specification.new do |s|
s.name = %q{net-http-spy}
- s.version = "0.1.1"
+ s.version = "0.1.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Martin Sadler"]
- s.date = %q{2009-05-07}
+ s.date = %q{2009-06-05}
+ s.description = %q{Ever wondered what HTTP requests the Ruby gem you are using to connect to a third party API is making? Use HTTP Spy to see what is going on behind the scenes.}
s.email = %q{martin@beyondthetype.com}
+ s.files = [
+ "Rakefile",
+ "VERSION",
+ "examples/fogbugz.rb",
+ "examples/fogbugz.rb",
+ "examples/google.rb",
+ "examples/google.rb",
+ "examples/twitter-calltrace.rb",
+ "examples/twitter-calltrace.rb",
+ "examples/twitter-customlog.rb",
+ "examples/twitter-customlog.rb",
+ "examples/twitter-simple.rb",
+ "examples/twitter-simple.rb",
+ "examples/twitter-verbose.rb",
+ "examples/twitter-verbose.rb",
+ "examples/twitter-withbody.rb",
+ "examples/twitter-withbody.rb",
+ "lib/net-http-spy.rb",
+ "net-http-spy.gemspec",
+ "readme.markdown",
+ "readme.markdown",
+ "spec/spec.opts",
+ "spec/spec_helper.rb",
+ "spec/spy_spec.rb"
+ ]
s.homepage = %q{http://github.com/martinbtt/net-http-spy}
- s.extra_rdoc_files = ["readme.markdown"]
- s.files = Dir['lib/**/*.rb'] + Dir['[A-Z]*'] + Dir['spec/*'] + Dir['examples/*.rb'] + ["readme.markdown"]
- s.rdoc_options = ["--main", "readme.markdown"]
+ s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.3}
s.summary = %q{Ever wondered what HTTP requests the Ruby gem you are using to connect to a third party API is making? Use HTTP Spy to see what is going on behind the scenes.}
+ s.test_files = [
+ "spec/spec_helper.rb",
+ "spec/spy_spec.rb",
+ "examples/fogbugz.rb",
+ "examples/google.rb",
+ "examples/twitter-calltrace.rb",
+ "examples/twitter-customlog.rb",
+ "examples/twitter-simple.rb",
+ "examples/twitter-verbose.rb",
+ "examples/twitter-withbody.rb"
+ ]
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<rspec>, [">= 0"])
- s.add_development_dependency(%q<twitter>, [">= 0"])
else
- s.add_dependency(%q<rspec>, [">= 0"])
- s.add_dependency(%q<twitter>, [">= 0"])
end
else
- s.add_dependency(%q<rspec>, [">= 0"])
- s.add_dependency(%q<twitter>, [">= 0"])
end
end

0 comments on commit fcd68d4

Please sign in to comment.