Class: CarthageCacheRes::MissingConfigurationKey

Inherits:
Struct
  • Object
show all
Defined in:
lib/carthage_cache_res/configuration_validator.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#keynameObject

Returns the value of attribute keyname

Returns:

  • (Object)

    the current value of keyname



3
4
5
# File 'lib/carthage_cache_res/configuration_validator.rb', line 3

def keyname
  @keyname
end

#solutionObject

Returns the value of attribute solution

Returns:

  • (Object)

    the current value of solution



3
4
5
# File 'lib/carthage_cache_res/configuration_validator.rb', line 3

def solution
  @solution
end

Class Method Details

.missing_aws_access_key_idObject



28
29
30
# File 'lib/carthage_cache_res/configuration_validator.rb', line 28

def self.missing_aws_access_key_id
  missing_aws_key("access_key_id", "access key ID")
end

.missing_aws_key(keyname, name) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/carthage_cache_res/configuration_validator.rb', line 14

def self.missing_aws_key(keyname, name)
  solution =  "You need to specify the AWS #{name} to be used.\n"     \
              "You can either define a environmental variable "        \
              "AWS_REGION or add ':#{keyname}: YOUR_KEY_VALUE' "      \
              "under the :aws_s3_client_options: key in the "         \
              ".carthage_cache_res.yml file.\nYou can also run "          \
              "'carthage_cache_res config' to generate the config file."
  self.new("aws_s3_client_options.#{keyname}", solution)
end

.missing_aws_regionObject



24
25
26
# File 'lib/carthage_cache_res/configuration_validator.rb', line 24

def self.missing_aws_region
  missing_aws_key("region", "region")
end

.missing_aws_secret_access_keyObject



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

def self.missing_aws_secret_access_key
  missing_aws_key("secret_access_key", "secret access key")
end

.missing_bucket_nameObject



5
6
7
8
9
10
11
12
# File 'lib/carthage_cache_res/configuration_validator.rb', line 5

def self.missing_bucket_name
  solution =  "You need to specify the AWS S3 bucket to be used.\n" \
              "You can either pass the '--bucket-name' option or "  \
              " add ':bucket_name: YOUR_BUCKET_NAME' to "           \
              ".carthage_cache_res.yml file.\nYou can also run "        \
              "'carthage_cache_res config' to generate the config file."
  self.new(:bucket_name, solution)
end