diff --git a/.gitignore b/.gitignore index dc3f3ea..fc4dfc9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,18 @@ -Gemfile.lock -coverage -rdoc -doc -.yardoc -.bundle -pkg -*.swp -log -*.sqlite3 -features/settings.yml *.gem +*.sqlite3 +*.swp +.bundle +.ruby-gemset .tags -TAGS .tags_sorted_by_file +.yardoc +/.idea +Gemfile.lock +TAGS coverage +doc +features/settings.yml +log +pkg +rdoc tags -/.idea -.ruby-gemset diff --git a/.ruby-version b/.ruby-version index 005119b..3ad0595 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.4.1 +3.1.5 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b9c6d67..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -before_install: - - gem install bundler -matrix: - allow_failures: - - rvm: ruby-head - - rvm: jruby-19mode -rvm: - - 1.9.2 - - 1.9.3 - - rbx-19mode - - jruby-19mode - - ruby-head -branches: - only: master -notifications: - email: false diff --git a/Gemfile b/Gemfile index c80ee36..851fabc 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,2 @@ -source "http://rubygems.org" - +source 'https://rubygems.org' gemspec diff --git a/bitbucket_rest_api.gemspec b/bitbucket_rest_api.gemspec index e1155ad..b892af5 100644 --- a/bitbucket_rest_api.gemspec +++ b/bitbucket_rest_api.gemspec @@ -6,9 +6,9 @@ Gem::Specification.new do |gem| gem.name = 'bitbucket_rest_api' gem.authors = [ "Mike Cochran" ] gem.email = "mcochran@linux.com" - gem.homepage = 'https://github.com/vongrippen/bitbucket' - gem.summary = %q{ Ruby wrapper for the BitBucket API supporting OAuth and Basic Authentication } - gem.description = %q{ Ruby wrapper for the BitBucket API supporting OAuth and Basic Authentication } + gem.homepage = 'https://github.com/codeship/bitbucket' + gem.summary = %q{ Ruby wrapper for the Bitbucket API supporting OAuth and basic authentication } + gem.description = %q{ Ruby wrapper for the Bitbucket API supporting OAuth and basic authentication } gem.version = BitBucket::VERSION::STRING.dup gem.license = "MIT" @@ -16,19 +16,17 @@ Gem::Specification.new do |gem| gem.require_paths = %w[ lib ] gem.add_dependency 'hashie' - gem.add_dependency 'faraday', '~> 0.9.0' - gem.add_dependency 'multi_json', '>= 1.7.5', '< 2.0' - gem.add_dependency 'faraday_middleware', '~> 0.9.0' - gem.add_dependency 'nokogiri', '>= 1.5.2' - gem.add_dependency 'simple_oauth', '~> 0.2.0' + gem.add_dependency 'faraday', '>= 1', '< 2' + gem.add_dependency 'multi_json', '>= 1.15.0', '< 2.0' + gem.add_dependency 'faraday_middleware', '~> 1.2.0' + gem.add_dependency 'nokogiri', '>= 1.15.6' + gem.add_dependency 'simple_oauth', '~> 0.3.1' - gem.add_development_dependency 'rspec', '>= 0' + gem.add_development_dependency 'rspec', '>= 3' gem.add_development_dependency 'rack-test' - gem.add_development_dependency 'webmock', '~> 1.8.0' - gem.add_development_dependency 'vcr', '~> 2.2.0' - gem.add_development_dependency 'simplecov', '~> 0.6.1' + gem.add_development_dependency 'webmock', '~> 3.23.0' + gem.add_development_dependency 'simplecov', '~> 0.22.0' gem.add_development_dependency 'rake' gem.add_development_dependency 'bundler' gem.add_development_dependency 'pry-byebug' - gem.add_development_dependency 'mocha', '~> 1.4.0' end diff --git a/lib/bitbucket_rest_api/version.rb b/lib/bitbucket_rest_api/version.rb index 28b953b..72de8f0 100644 --- a/lib/bitbucket_rest_api/version.rb +++ b/lib/bitbucket_rest_api/version.rb @@ -4,7 +4,7 @@ module BitBucket module VERSION MAJOR = 0 MINOR = 1 - PATCH = 7 + PATCH = 8 STRING = [MAJOR, MINOR, PATCH].compact.join('.') end diff --git a/spec/bitbucket_rest_api/request_spec.rb b/spec/bitbucket_rest_api/request_spec.rb index a84c2c2..39a689b 100644 --- a/spec/bitbucket_rest_api/request_spec.rb +++ b/spec/bitbucket_rest_api/request_spec.rb @@ -2,8 +2,19 @@ require 'bitbucket_rest_api/request' describe BitBucket::Request do - let(:fake_api) { (Class.new { include BitBucket::Request })} - let(:faraday_connection) { Faraday.new(:url => 'https://api.bitbucket.org') } + let(:fake_api) do + Class.new do + include BitBucket::Request + + def connection(*args) + Faraday.new(:url => 'https://api.bitbucket.org') + end + + def new_access_token + '12345' + end + end + end describe "request" do it "raises an ArgumentError if an unsupported HTTP verb is used" do @@ -11,18 +22,13 @@ end context "with a connection" do - before do - (fake_api).any_instance.stubs(:connection).returns(faraday_connection) - (fake_api).any_instance.stubs(:new_access_token).returns("12345") - end - it "supports get" do stub_request(:get, "https://api.bitbucket.org/1.0/endpoint"). with(:headers => { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization' => 'Bearer 12345', - 'User-Agent' => 'Faraday v0.9.2' + 'User-Agent' => "Faraday v#{Faraday::VERSION}" }) fake_api.new.request(:get, '/1.0/endpoint', {}, {}) @@ -35,7 +41,7 @@ 'Accept' => '*/*', 'Content-Type'=>'application/x-www-form-urlencoded', 'Authorization' => 'Bearer 12345', - 'User-Agent' => 'Faraday v0.9.2' + 'User-Agent' => "Faraday v#{Faraday::VERSION}" }) fake_api.new.request(:put, '/1.0/endpoint', { 'data' => { 'key' => 'value'} }, {}) @@ -48,7 +54,7 @@ 'Accept' => '*/*', 'Content-Type'=>'application/x-www-form-urlencoded', 'Authorization' => 'Bearer 12345', - 'User-Agent' => 'Faraday v0.9.2' + 'User-Agent' => "Faraday v#{Faraday::VERSION}" }) fake_api.new.request(:patch, '/1.0/endpoint', { 'data' => { 'key' => 'value'} }, {}) @@ -59,7 +65,7 @@ with(:headers => { 'Accept' => '*/*', 'Authorization' => 'Bearer 12345', - 'User-Agent' => 'Faraday v0.9.2' + 'User-Agent' => "Faraday v#{Faraday::VERSION}" }) fake_api.new.request(:delete, '/1.0/endpoint', {}, {}) end @@ -71,7 +77,7 @@ 'Accept' => '*/*', 'Content-Type'=>'application/x-www-form-urlencoded', 'Authorization' => 'Bearer 12345', - 'User-Agent' => 'Faraday v0.9.2' + 'User-Agent' => "Faraday v#{Faraday::VERSION}" }) fake_api.new.request(:post, '/1.0/endpoint', { 'data' => { 'key' => 'value'} }, {}) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 27cfe60..196ab4c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,22 +3,15 @@ require 'webmock/rspec' require 'pry' -require 'vcr' require 'bitbucket_rest_api' RSpec.configure do |config| config.expect_with :rspec do |expectations| expectations.include_chain_clauses_in_custom_matcher_descriptions = true - config.mock_with :mocha end config.mock_with :rspec do |mocks| mocks.verify_partial_doubles = true end end - -# VCR.configure do |config| -# config.cassette_library_dir = 'spec/fixtures/vcr_cassettes' -# config.hook_into :webmock -# end