Skip to content
Browse files

Rip out jeweler and use bundler instead

  • Loading branch information...
1 parent 4c531dd commit d73224f9019ea1530418d2c8cac53fe57c52404e @jcf jcf committed May 18, 2011
Showing with 40 additions and 168 deletions.
  1. +3 −0 .gitignore
  2. +0 −2 Gemfile
  3. +6 −28 Rakefile
  4. +0 −1 VERSION
  5. +2 −1 lib/webmock.rb
  6. +3 −0 lib/webmock/version.rb
  7. +1 −3 lib/webmock/webmock.rb
  8. +1 −4 spec/webmock_shared.rb
  9. +24 −129 webmock.gemspec
View
3 .gitignore
@@ -19,4 +19,7 @@ rdoc
pkg
## PROJECT::SPECIFIC
+*.gem
+.bundle
Gemfile.lock
+pkg/*
View
2 Gemfile
@@ -1,4 +1,2 @@
source "http://rubygems.org/"
gemspec
-
-gem 'jeweler'
View
34 Rakefile
@@ -1,27 +1,5 @@
-require 'rubygems'
-require 'rake'
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "webmock"
- gem.summary = %Q{Library for stubbing HTTP requests in Ruby.}
- gem.description = %Q{WebMock allows stubbing HTTP requests and setting expectations on HTTP requests.}
- gem.email = "bartosz.blimke@gmail.com"
- gem.homepage = "http://github.com/bblimke/webmock"
- gem.authors = ["Bartosz Blimke"]
- gem.add_dependency "addressable", "~> 2.2", "> 2.2.5"
- gem.add_dependency "crack", ">=0.1.7"
- gem.add_development_dependency "rspec", ">= 2.0.0"
- gem.add_development_dependency "httpclient", ">= 2.1.5.2"
- gem.add_development_dependency "patron", ">= 0.4.9" unless RUBY_PLATFORM =~ /java/
- gem.add_development_dependency "em-http-request", ">= 0.2.14" unless RUBY_PLATFORM =~ /java/
- gem.add_development_dependency "curb", ">= 0.7.8" unless RUBY_PLATFORM =~ /java/
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
-end
+require 'bundler'
+Bundler::GemHelper.install_tasks
namespace :spec do
desc 'Run specs against 1.8.6, REE, 1.8.7, 1.9.2 and jRuby'
@@ -36,7 +14,7 @@ end
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new do |t|
- t.rspec_opts = ["-c", "-f progress", "-r ./spec/spec_helper.rb"]
+ t.rspec_opts = ["-c", "-f progress", "-r ./spec/spec_helper.rb"]
t.pattern = 'spec/**/*_spec.rb'
end
@@ -51,11 +29,11 @@ task :default => [:spec, :test]
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
+ $:.push File.expand_path('../lib', __FILE__)
+ require 'webmock/version'
rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "webmock #{version}"
+ rdoc.title = "webmock #{WebMock::VERSION}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/webmock/webmock.rb')
end
-
View
1 VERSION
@@ -1 +0,0 @@
-1.6.3
View
3 lib/webmock.rb
@@ -4,6 +4,7 @@
require 'crack'
require 'webmock/deprecation'
+require 'webmock/version'
require 'webmock/http_lib_adapters/net_http'
require 'webmock/http_lib_adapters/httpclient'
@@ -33,4 +34,4 @@
require 'webmock/request_registry'
require 'webmock/stub_registry'
require 'webmock/api'
-require 'webmock/webmock'
+require 'webmock/webmock'
View
3 lib/webmock/version.rb
@@ -0,0 +1,3 @@
+module WebMock
+ VERSION = '1.6.3'
+end
View
4 lib/webmock/webmock.rb
@@ -22,9 +22,7 @@ class << self
end
def self.version
- open(File.join(File.dirname(__FILE__), '../../VERSION')) { |f|
- f.read.strip
- }
+ VERSION
end
def self.allow_net_connect!(options = {})
View
5 spec/webmock_shared.rb
@@ -10,14 +10,11 @@
class MyException < StandardError; end;
describe "WebMock version" do
-
it "should report version" do
- WebMock.version.should == open(File.join(File.dirname(__FILE__), "..", "VERSION")).read.strip
+ WebMock.version.should == WebMock::VERSION
end
-
end
-
shared_examples_for "WebMock" do
before(:each) do
WebMock.disable_net_connect!
View
153 webmock.gemspec
@@ -1,137 +1,32 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
+$:.push File.expand_path('../lib', __FILE__)
+require 'webmock/version'
Gem::Specification.new do |s|
- s.name = %q{webmock}
- s.version = "1.6.3"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Bartosz Blimke"]
- s.date = %q{2011-05-18}
+ s.name = 'webmock'
+ s.version = WebMock::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ['Bartosz Blimke']
+ s.email = ['bartosz.blimke@gmail.com']
+ s.homepage = 'http://github.com/bblimke/webmock'
+ s.summary = %q{Library for stubbing HTTP requests in Ruby.}
s.description = %q{WebMock allows stubbing HTTP requests and setting expectations on HTTP requests.}
- s.email = %q{bartosz.blimke@gmail.com}
- s.extra_rdoc_files = [
- "LICENSE",
- "README.md"
- ]
- s.files = [
- ".rvmrc",
- "CHANGELOG.md",
- "Gemfile",
- "LICENSE",
- "README.md",
- "Rakefile",
- "VERSION",
- "lib/webmock.rb",
- "lib/webmock/api.rb",
- "lib/webmock/assertion_failure.rb",
- "lib/webmock/callback_registry.rb",
- "lib/webmock/config.rb",
- "lib/webmock/cucumber.rb",
- "lib/webmock/deprecation.rb",
- "lib/webmock/errors.rb",
- "lib/webmock/http_lib_adapters/curb.rb",
- "lib/webmock/http_lib_adapters/em_http_request.rb",
- "lib/webmock/http_lib_adapters/httpclient.rb",
- "lib/webmock/http_lib_adapters/net_http.rb",
- "lib/webmock/http_lib_adapters/net_http_response.rb",
- "lib/webmock/http_lib_adapters/patron.rb",
- "lib/webmock/request_execution_verifier.rb",
- "lib/webmock/request_pattern.rb",
- "lib/webmock/request_registry.rb",
- "lib/webmock/request_signature.rb",
- "lib/webmock/request_stub.rb",
- "lib/webmock/response.rb",
- "lib/webmock/responses_sequence.rb",
- "lib/webmock/rspec.rb",
- "lib/webmock/rspec/matchers.rb",
- "lib/webmock/rspec/matchers/request_pattern_matcher.rb",
- "lib/webmock/rspec/matchers/webmock_matcher.rb",
- "lib/webmock/stub_registry.rb",
- "lib/webmock/stub_request_snippet.rb",
- "lib/webmock/test_unit.rb",
- "lib/webmock/util/hash_counter.rb",
- "lib/webmock/util/hash_keys_stringifier.rb",
- "lib/webmock/util/headers.rb",
- "lib/webmock/util/uri.rb",
- "lib/webmock/webmock.rb",
- "spec/curb_spec.rb",
- "spec/curb_spec_helper.rb",
- "spec/em_http_request_spec.rb",
- "spec/em_http_request_spec_helper.rb",
- "spec/errors_spec.rb",
- "spec/example_curl_output.txt",
- "spec/httpclient_spec.rb",
- "spec/httpclient_spec_helper.rb",
- "spec/net_http_spec.rb",
- "spec/net_http_spec_helper.rb",
- "spec/network_connection.rb",
- "spec/other_net_http_libs_spec.rb",
- "spec/patron_spec.rb",
- "spec/patron_spec_helper.rb",
- "spec/request_execution_verifier_spec.rb",
- "spec/request_pattern_spec.rb",
- "spec/request_registry_spec.rb",
- "spec/request_signature_spec.rb",
- "spec/request_stub_spec.rb",
- "spec/response_spec.rb",
- "spec/spec_helper.rb",
- "spec/stub_registry_spec.rb",
- "spec/stub_request_snippet_spec.rb",
- "spec/util/hash_counter_spec.rb",
- "spec/util/hash_keys_stringifier_spec.rb",
- "spec/util/headers_spec.rb",
- "spec/util/uri_spec.rb",
- "spec/vendor/addressable/lib/addressable/uri.rb",
- "spec/vendor/addressable/lib/uri.rb",
- "spec/vendor/crack/lib/crack.rb",
- "spec/vendor/right_http_connection-1.2.4/History.txt",
- "spec/vendor/right_http_connection-1.2.4/Manifest.txt",
- "spec/vendor/right_http_connection-1.2.4/README.txt",
- "spec/vendor/right_http_connection-1.2.4/Rakefile",
- "spec/vendor/right_http_connection-1.2.4/lib/net_fix.rb",
- "spec/vendor/right_http_connection-1.2.4/lib/right_http_connection.rb",
- "spec/vendor/right_http_connection-1.2.4/setup.rb",
- "spec/webmock_shared.rb",
- "test/test_helper.rb",
- "test/test_webmock.rb",
- "webmock.gemspec"
- ]
- s.homepage = %q{http://github.com/bblimke/webmock}
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.6.2}
- s.summary = %q{Library for stubbing HTTP requests in Ruby.}
- if s.respond_to? :specification_version then
- s.specification_version = 3
+ s.rubyforge_project = 'webmock'
+
+ s.add_dependency 'addressable', '~> 2.2', '> 2.2.5'
+ s.add_dependency 'crack', '>=0.1.7'
+ s.add_development_dependency 'rspec', '>= 2.0.0'
+ s.add_development_dependency 'httpclient', '>= 2.1.5.2'
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<addressable>, ["> 2.2.5", "~> 2.2"])
- s.add_runtime_dependency(%q<crack>, [">= 0.1.7"])
- s.add_development_dependency(%q<rspec>, [">= 2.0.0"])
- s.add_development_dependency(%q<httpclient>, [">= 2.1.5.2"])
- s.add_development_dependency(%q<patron>, [">= 0.4.9"])
- s.add_development_dependency(%q<em-http-request>, [">= 0.2.14"])
- s.add_development_dependency(%q<curb>, [">= 0.7.8"])
- else
- s.add_dependency(%q<webmock>, [">= 0"])
- s.add_dependency(%q<jeweler>, [">= 0"])
- s.add_dependency(%q<rspec>, [">= 2.0.0"])
- s.add_dependency(%q<httpclient>, [">= 2.1.5.2"])
- s.add_dependency(%q<patron>, [">= 0.4.9"])
- s.add_dependency(%q<em-http-request>, [">= 0.2.14"])
- s.add_dependency(%q<curb>, [">= 0.7.8"])
- end
- else
- s.add_dependency(%q<webmock>, [">= 0"])
- s.add_dependency(%q<jeweler>, [">= 0"])
- s.add_dependency(%q<rspec>, [">= 2.0.0"])
- s.add_dependency(%q<httpclient>, [">= 2.1.5.2"])
- s.add_dependency(%q<patron>, [">= 0.4.9"])
- s.add_dependency(%q<em-http-request>, [">= 0.2.14"])
- s.add_dependency(%q<curb>, [">= 0.7.8"])
+ unless RUBY_PLATFORM =~ /java/
+ s.add_development_dependency 'patron', '>= 0.4.9'
+ s.add_development_dependency 'em-http-request', '>= 0.2.14'
+ s.add_development_dependency 'curb', '>= 0.7.8'
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']
+end

3 comments on commit d73224f

@sferik
sferik commented on d73224f May 18, 2011

#94 includes this plus some additional changes. The only thing I missed was updating the .gitignore.

As a general rule, conditional logic shouldn't appear in a gemspec because it gets built into a static YAML file. As such, I would recommend pulling out:

unless RUBY_PLATFORM =~ /java/

Those three gems all install on the latest version of JRuby anyway.

@jcf
Collaborator
jcf commented on d73224f May 18, 2011
@myronmarston
Collaborator

I was under the impression you couldn't add gem dependencies to a Gemfile and have RubyGems install those dependencies.

This is correct. Gemfile is only for bundler; the gemspec is for rubygems. Bundler can read the gemspec, but rubygems contains no functionality to read the Gemfile.

Whatever you do, don't put jruby-openssl in the gemspec; it wreaks havoc on end-users who are not using jruby. See this issue as well.

Please sign in to comment.
Something went wrong with that request. Please try again.