Class: Floccus::Cloud

Inherits:
Object
  • Object
show all
Defined in:
lib/floccus/cloud.rb

Constant Summary collapse

CONFIG_PATH =
"#{ENV['HOME']}/.floccfg"

Instance Method Summary collapse

Constructor Details

#initializeCloud

Returns a new instance of Cloud.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/floccus/cloud.rb', line 6

def initialize
  config = YAML.load(File.read(CONFIG_PATH))

  AWS.config(
    :access_key_id     => config["access_key_id"], 
    :secret_access_key => config["secret_access_key"]
  )
  @default_bucket = config["default_bucket"]
  @domain = config["domain"]

  @s3 = AWS::S3.new
end

Instance Method Details

#bucketObject



19
20
21
# File 'lib/floccus/cloud.rb', line 19

def bucket
  @default_bucket
end

#domainObject



31
32
33
# File 'lib/floccus/cloud.rb', line 31

def domain
  @domain
end

#s3Object



23
24
25
# File 'lib/floccus/cloud.rb', line 23

def s3
  @s3
end

#use_domain?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/floccus/cloud.rb', line 27

def use_domain?
  @domain
end