Skip to content

Commit 946d099

Browse files
committed
Merge branch 'master' into testing-only
2 parents 7ce90a0 + 0e53c0e commit 946d099

File tree

22 files changed

+514
-30
lines changed

22 files changed

+514
-30
lines changed

.rspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--color
1+
--color -fd

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.3
1+
1.9.2

bin/console

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env ruby
2+
require 'bundler/setup'
3+
require 'bitbucket_rest_api'
4+
5+
require 'pry'
6+
Pry.start

bitbucket_rest_api.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ Gem::Specification.new do |gem|
2727
gem.add_development_dependency 'simplecov', '~> 0.6.1'
2828
gem.add_development_dependency 'rake'
2929
gem.add_development_dependency 'bundler'
30-
gem.add_development_dependency 'pry'
30+
gem.add_development_dependency 'pry-debugger'
3131
gem.add_development_dependency 'mocha'
3232
end

lib/bitbucket_rest_api/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module Configuration
4949
DEFAULT_BASIC_AUTH = nil
5050

5151
# The endpoint used to connect to BitBucket if none is set, in the event that BitBucket is ever available on location
52-
DEFAULT_ENDPOINT = 'https://bitbucket.org/api'.freeze
52+
DEFAULT_ENDPOINT = 'https://api.bitbucket.org'.freeze
5353

5454
# The value sent in the http header for 'User-Agent' if none is set
5555
DEFAULT_USER_AGENT = "BitBucket Ruby Gem #{BitBucket::VERSION::STRING}".freeze

lib/bitbucket_rest_api/connection.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ def connection(options = {})
8989
clear_cache unless options.empty?
9090
puts "OPTIONS:#{conn_options.inspect}" if ENV['DEBUG']
9191

92-
@connection ||= Faraday.new(conn_options.merge(:builder => stack(options)))
92+
@connection ||= Faraday.new(conn_options.merge(:builder => stack(options))) do |faraday|
93+
faraday.response :logger if ENV['DEBUG']
94+
end
9395
end
9496

9597
end # Connection

lib/bitbucket_rest_api/core_ext/hash.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ def except(*items) # :nodoc:
66

77
def except!(*keys) # :nodoc:
88
copy = self.dup
9+
# FIXME delete! is not a hash instance method
910
keys.each { |key| copy.delete!(key) }
1011
copy
1112
end unless method_defined?(:except!)

lib/bitbucket_rest_api/error.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ def initialize(message)
3030
invalid_options
3131
required_params
3232
unknown_value
33+
bad_events
34+
no_events
35+
blank_value
3336
].each do |error|
3437
require "bitbucket_rest_api/error/#{error}"
3538
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module BitBucket
2+
module Error
3+
class BadEvents < ClientError
4+
def initialize(event)
5+
super "The event: '#{event}', does not exist :("
6+
end
7+
end
8+
end
9+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module BitBucket
2+
module Error
3+
class BlankValue < ClientError
4+
def initialize(required_key)
5+
super "The value for: '#{required_key}', cannot be blank :("
6+
end
7+
end
8+
end
9+
end

0 commit comments

Comments
 (0)