Module: RadiantClippedExtension::Cloud

Defined in:
lib/cloud.rb

Class Method Summary collapse

Class Method Details

.credentialsObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/cloud.rb', line 5

def self.credentials
  case Radiant.config["paperclip.fog.provider"]
  when "AWS"
    {
      :provider => "AWS",
      :aws_access_key_id => Radiant.config["paperclip.s3.key"],
      :aws_secret_access_key => Radiant.config["paperclip.s3.secret"],
      :region => Radiant.config["paperclip.s3.region"],
    }
  when "Google"
    {
      :provider => "Google",
      :rackspace_username => Radiant.config["paperclip.google_storage.access_key_id"],
      :rackspace_api_key  => Radiant.config["paperclip.google_storage.secret_access_key"]
    }
  when "Rackspace"
    {
      :provider => "Rackspace",
      :rackspace_username => Radiant.config["paperclip.rackspace.username"],
      :rackspace_api_key  => Radiant.config["paperclip.rackspace.api_key"]
    }
  end
end

.hostObject



29
30
31
32
33
34
35
36
37
# File 'lib/cloud.rb', line 29

def self.host
  return Radiant.config["paperclip.fog.host"] if Radiant.config["paperclip.fog.host"]
  case Radiant.config["paperclip.fog.provider"]
  when "AWS"
    "http://#{Radiant.config['paperclip.fog.directory']}.s3.amazonaws.com"
  else
    nil
  end
end