Module: EasyManageClient

Defined in:
lib/easy_manage_client/configuration.rb,
lib/easy_manage_client.rb,
lib/easy_manage_client/core.rb,
lib/easy_manage_client/railtie.rb,
lib/easy_manage_client/version.rb,
lib/easy_manage_client/downloader.rb

Overview

main module

Defined Under Namespace

Classes: Configuration, Core, DownloadProcessFailed, Downloader, Error, InvalidExtension, InvalidResponseContent, NoProfilesWereFound, ProfileNotFound, Railtie

Constant Summary collapse

VERSION =
'0.1.3'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationsObject

Returns the value of attribute configurations.



6
7
8
# File 'lib/easy_manage_client/configuration.rb', line 6

def configurations
  @configurations
end

Class Method Details

.configuration(profile = :default) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/easy_manage_client/configuration.rb', line 8

def configuration(profile = :default)
  raise NoProfilesWereFound if configurations.nil? || configurations.empty?

  configurations.select do |conf|
    conf.profile == profile
  end.first || raise(ProfileNotFound, "Undefined profile: #{profile}")
end

.configure(profile = :default) {|conf| ... } ⇒ Object

Yields:

  • (conf)


35
36
37
38
39
# File 'lib/easy_manage_client/configuration.rb', line 35

def self.configure(profile = :default)
  conf = initialize_configuration
  yield(conf)
  after_configuration_events(conf, profile)
end