Sha256: f90f9c01968bdc6bf1768007575e552434363d90497f91b198e1b337015864c0

Contents?: true

Size: 828 Bytes

Versions: 77

Compression:

Stored size: 828 Bytes

Contents

require 'dpl/provider'

module DPL
  class Provider
    class CloudFiles < Provider
      requires 'fog'
      experimental 'Rackspace Cloud Files'

      def needs_key?
        false
      end

      def api
        @api ||= Fog::Storage.new(:provider => 'Rackspace', :rackspace_username => option(:username), :rackspace_api_key => option(:api_key), :rackspace_region => option(:region))
      end

      def check_auth
        log "Authenticated as #{option(:username)}"
      end

      def push_app
        container = api.directories.get(option(:container))

        raise Error, 'The specified container does not exist.' if container.nil?

        Dir.glob('**/*').each do |name|
          container.files.create(:key => name, :body => File.open(name)) unless File.directory?(name)
        end
      end
    end
  end
end

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
dpl-1.6.5 lib/dpl/provider/cloud_files.rb
dpl-1.6.6.travis.478.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.5.travis.477.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.5.travis.470.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.5.travis.468.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.5.travis.466.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.5.travis.463.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.4 lib/dpl/provider/cloud_files.rb
dpl-1.6.4.travis.462.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.4.travis.459.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.3 lib/dpl/provider/cloud_files.rb
dpl-1.6.3.travis.458.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.2 lib/dpl/provider/cloud_files.rb
dpl-1.6.3.travis.456.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.2.travis.455.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.1.travis.454.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.1.travis.453.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.1.travis.452.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.1.travis.451.1 lib/dpl/provider/cloud_files.rb