Module: Gemfury

Extended by:
Configuration
Defined in:
lib/gemfury.rb,
lib/gemfury/const.rb,
lib/gemfury/error.rb,
lib/gemfury/client.rb,
lib/gemfury/version.rb,
lib/gemfury/platform.rb,
lib/gemfury/configuration.rb,
lib/gemfury/client/filters.rb,
lib/gemfury/client/middleware.rb

Defined Under Namespace

Modules: Command, Configuration, Const, Platform Classes: Client

Constant Summary collapse

VALID_OPTIONS_KEYS =
Configuration::CONFIGURATION_DEFAULTS.keys.freeze
Error =

Base Error class

Class.new(StandardError)
InvalidGemVersion =

The Gemfury gem version doesn’t match the one on the server

Class.new(Error)
Unauthorized =

Client#user_api_key is not defined or Gemfury returns 401

Class.new(Error)
Forbidden =

Client is not allowed to perform this operation

Class.new(Error)
Conflict =

Account is locked for another operation

Class.new(Error)
NotFound =

Returned if something is not found

Class.new(Error)
CorruptGemFile =

Corrupt Gem File

Class.new(Error)
DupeVersion =

Version already exists

Class.new(Error)
TimeoutError =

TimeoutError for 503s

Class.new(Error)
VERSION =
'0.13.0'

Constants included from Configuration

Configuration::CONFIGURATION_DEFAULTS

Instance Attribute Summary

Attributes included from Configuration

#account, #adapter, #api_version, #endpoint, #gitpoint, #pushpoint, #user_agent, #user_api_key

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Convenience method to allow configuration options to be set in a block

Yields:

  • (_self)

Yield Parameters:

  • _self (Gemfury)

    the object that the method was called on



41
42
43
# File 'lib/gemfury.rb', line 41

def configure
  yield self
end

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

Delegate to Gemfury::Client



61
62
63
64
65
# File 'lib/gemfury.rb', line 61

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

  new.send(method, *args, &block)
end

.new(options = {}) ⇒ Gemfury::Client

Alias for Gemfury::Client.new

Returns:



36
37
38
# File 'lib/gemfury.rb', line 36

def new(options = {})
  Gemfury::Client.new(options)
end

.optionsHash

Create a hash of options and their values

Returns:

  • (Hash)

    the options and their values



47
48
49
50
51
# File 'lib/gemfury.rb', line 47

def options
  VALID_OPTIONS_KEYS.each_with_object({}) do |k, options|
    options[k] = send(k)
  end
end

.resetConfiguration

Reset all configuration options to defaults

Returns:



55
56
57
58
# File 'lib/gemfury.rb', line 55

def reset
  CONFIGURATION_DEFAULTS.each { |k, v| send("#{k}=", v) }
  self
end

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

Returns:

  • (Boolean)


67
68
69
# File 'lib/gemfury.rb', line 67

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