Module: BitBucket

Extended by:
AutoloadHelper, Configuration
Defined in:
lib/bitbucket_rest_api/error/forbidden.rb,
lib/bitbucket_rest_api.rb,
lib/bitbucket_rest_api/api.rb,
lib/bitbucket_rest_api/user.rb,
lib/bitbucket_rest_api/error.rb,
lib/bitbucket_rest_api/repos.rb,
lib/bitbucket_rest_api/teams.rb,
lib/bitbucket_rest_api/users.rb,
lib/bitbucket_rest_api/client.rb,
lib/bitbucket_rest_api/issues.rb,
lib/bitbucket_rest_api/result.rb,
lib/bitbucket_rest_api/request.rb,
lib/bitbucket_rest_api/version.rb,
lib/bitbucket_rest_api/response.rb,
lib/bitbucket_rest_api/constants.rb,
lib/bitbucket_rest_api/utils/url.rb,
lib/bitbucket_rest_api/connection.rb,
lib/bitbucket_rest_api/normalizer.rb,
lib/bitbucket_rest_api/repos/keys.rb,
lib/bitbucket_rest_api/api/actions.rb,
lib/bitbucket_rest_api/api_factory.rb,
lib/bitbucket_rest_api/deprecation.rb,
lib/bitbucket_rest_api/invitations.rb,
lib/bitbucket_rest_api/repos/forks.rb,
lib/bitbucket_rest_api/validations.rb,
lib/bitbucket_rest_api/repos/commit.rb,
lib/bitbucket_rest_api/authorization.rb,
lib/bitbucket_rest_api/configuration.rb,
lib/bitbucket_rest_api/repos/commits.rb,
lib/bitbucket_rest_api/repos/sources.rb,
lib/bitbucket_rest_api/request/oauth.rb,
lib/bitbucket_rest_api/users/account.rb,
lib/bitbucket_rest_api/repos/download.rb,
lib/bitbucket_rest_api/repos/services.rb,
lib/bitbucket_rest_api/repos/webhooks.rb,
lib/bitbucket_rest_api/error/no_events.rb,
lib/bitbucket_rest_api/error/not_found.rb,
lib/bitbucket_rest_api/issues/comments.rb,
lib/bitbucket_rest_api/repos/following.rb,
lib/bitbucket_rest_api/request/jsonize.rb,
lib/bitbucket_rest_api/response/xmlize.rb,
lib/bitbucket_rest_api/error/bad_events.rb,
lib/bitbucket_rest_api/parameter_filter.rb,
lib/bitbucket_rest_api/repos/changesets.rb,
lib/bitbucket_rest_api/repos/components.rb,
lib/bitbucket_rest_api/response/helpers.rb,
lib/bitbucket_rest_api/response/jsonize.rb,
lib/bitbucket_rest_api/response/mashify.rb,
lib/bitbucket_rest_api/error/bad_request.rb,
lib/bitbucket_rest_api/error/blank_value.rb,
lib/bitbucket_rest_api/error/validations.rb,
lib/bitbucket_rest_api/issues/components.rb,
lib/bitbucket_rest_api/issues/milestones.rb,
lib/bitbucket_rest_api/validations/token.rb,
lib/bitbucket_rest_api/error/client_error.rb,
lib/bitbucket_rest_api/error/unauthorized.rb,
lib/bitbucket_rest_api/repos/pull_request.rb,
lib/bitbucket_rest_api/request/basic_auth.rb,
lib/bitbucket_rest_api/validations/format.rb,
lib/bitbucket_rest_api/error/service_error.rb,
lib/bitbucket_rest_api/error/unknown_value.rb,
lib/bitbucket_rest_api/response/raise_error.rb,
lib/bitbucket_rest_api/validations/presence.rb,
lib/bitbucket_rest_api/validations/required.rb,
lib/bitbucket_rest_api/error/invalid_options.rb,
lib/bitbucket_rest_api/error/required_params.rb,
lib/bitbucket_rest_api/repos/default_reviewers.rb,
lib/bitbucket_rest_api/error/service_unavailable.rb,
lib/bitbucket_rest_api/error/unprocessable_entity.rb,
lib/bitbucket_rest_api/error/internal_server_error.rb

Overview

:nodoc

Defined Under Namespace

Modules: Authorization, AutoloadHelper, Configuration, Connection, Constants, Error, Normalizer, ParameterFilter, Request, Result, Utils, VERSION, Validations Classes: API, ApiFactory, Client, Invitations, Issues, Repos, Response, Teams, User, Users

Constant Summary collapse

DEPRECATION_PREFIX =
"[BitBucketAPI] Deprecation warning:"

Constants included from Configuration

Configuration::DEFAULT_ACCESS_TOKEN, Configuration::DEFAULT_ADAPTER, Configuration::DEFAULT_BASIC_AUTH, Configuration::DEFAULT_CLIENT_ID, Configuration::DEFAULT_CLIENT_SECRET, Configuration::DEFAULT_CONNECTION_OPTIONS, Configuration::DEFAULT_ENDPOINT, Configuration::DEFAULT_LOGIN, Configuration::DEFAULT_MIME_TYPE, Configuration::DEFAULT_OAUTH_SECRET, Configuration::DEFAULT_OAUTH_TOKEN, Configuration::DEFAULT_PASSWORD, Configuration::DEFAULT_REPO, Configuration::DEFAULT_USER, Configuration::DEFAULT_USER_AGENT, Configuration::VALID_OPTIONS_KEYS

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from AutoloadHelper

autoload_all, lookup_constant, register_constant

Methods included from Configuration

configure, extended, options, set_defaults

Class Attribute Details

.api_clientObject

Handle for the client instance


16
17
18
# File 'lib/bitbucket_rest_api.rb', line 16

def api_client
  @api_client
end

.deprecation_trackerObject


11
12
13
# File 'lib/bitbucket_rest_api/deprecation.rb', line 11

def deprecation_tracker
  @deprecation_tracker ||= []
end

Class Method Details

.deprecate(method, alternate_method = nil) ⇒ Object

Displays deprecation message to the user. Each message is printed once.


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/bitbucket_rest_api/deprecation.rb', line 17

def deprecate(method, alternate_method=nil)
  return if deprecation_tracker.include? method
  deprecation_tracker << method

  message = <<-NOTICE
#{DEPRECATION_PREFIX}

* #{method} is deprecated.
  NOTICE
  if alternate_method
    message << <<-ADDITIONAL
* please use #{alternate_method} instead.
    ADDITIONAL
  end
  warn_deprecation(message)
end

.method_missing(method, *args, &block) ⇒ Object

Delegate to BitBucket::Client


27
28
29
30
# File 'lib/bitbucket_rest_api.rb', line 27

def method_missing(method, *args, &block)
  return super unless new.respond_to?(method)
  new.send(method, *args, &block)
end

.new(options = { }, &block) ⇒ BitBucket::Client

Alias for BitBucket::Client.new

Returns:


21
22
23
# File 'lib/bitbucket_rest_api.rb', line 21

def new(options = { }, &block)
  @api_client = BitBucket::Client.new(options, &block)
end

.respond_to?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)

32
33
34
# File 'lib/bitbucket_rest_api.rb', line 32

def respond_to?(method, include_private = false)
  new.respond_to?(method, include_private) || super(method, include_private)
end

.warn_deprecation(message) ⇒ Object


34
35
36
# File 'lib/bitbucket_rest_api/deprecation.rb', line 34

def warn_deprecation(message)
  send :warn, message
end