Class: DPL::Provider::CloudFiles
Instance Attribute Summary
#context, #options
Instance Method Summary
collapse
apt_get, #check_app, #cleanup, #commit_msg, context, #create_key, #default_text_charset, #default_text_charset?, #deploy, deprecated, #detect_encoding?, #encoding_for, #error, experimental, #initialize, #log, new, npm_g, #option, pip, requires, #run, #setup_git_credentials, #setup_git_ssh, #sha, shell, #uncleanup, #user_agent, #warn
Constructor Details
This class inherits a constructor from DPL::Provider
Instance Method Details
#api ⇒ Object
16
17
18
|
# File 'lib/dpl/provider/cloud_files.rb', line 16
def api
@api ||= Fog::Storage.new(:provider => 'Rackspace', :rackspace_username => option(:username), :rackspace_api_key => option(:api_key), :rackspace_region => option(:region))
end
|
#check_auth ⇒ Object
20
21
22
|
# File 'lib/dpl/provider/cloud_files.rb', line 20
def check_auth
log "Authenticated as #{option(:username)}"
end
|
#needs_key? ⇒ Boolean
12
13
14
|
# File 'lib/dpl/provider/cloud_files.rb', line 12
def needs_key?
false
end
|
#push_app ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/dpl/provider/cloud_files.rb', line 24
def push_app
container = api.directories.get(option(:container))
raise Error, 'The specified container does not exist.' if container.nil?
glob_args = ['**/*']
glob_args << File::FNM_DOTMATCH if options[:dot_match]
Dir.glob(*glob_args).each do |name|
container.files.create(:key => name, :body => File.open(name)) unless File.directory?(name)
end
end
|