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.1.travis.449.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.1.travis.447.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.0 lib/dpl/provider/cloud_files.rb
dpl-1.5.11.travis.445.1 lib/dpl/provider/cloud_files.rb
dpl-1.5.11.travis.437.1 lib/dpl/provider/cloud_files.rb
dpl-1.5.11.travis.436.1 lib/dpl/provider/cloud_files.rb
dpl-1.5.11.travis.435.1 lib/dpl/provider/cloud_files.rb
dpl-1.5.11.travis.432.1 lib/dpl/provider/cloud_files.rb
dpl-1.5.11.travis.430.1 lib/dpl/provider/cloud_files.rb
dpl-1.5.11.travis.414.1 lib/dpl/provider/cloud_files.rb
dpl-1.5.10 lib/dpl/provider/cloud_files.rb
dpl-1.5.10.travis.413.1 lib/dpl/provider/cloud_files.rb
dpl-1.5.10.travis.402.1 lib/dpl/provider/cloud_files.rb
dpl-1.6.0.travis.399.1 lib/dpl/provider/cloud_files.rb
dpl-1.5.9 lib/dpl/provider/cloud_files.rb
dpl-1.5.9.travis.397.1 lib/dpl/provider/cloud_files.rb
dpl-1.5.9.travis.394.1 lib/dpl/provider/cloud_files.rb
dpl-1.5.9.travis.393.1 lib/dpl/provider/cloud_files.rb
dpl-1.5.9.travis.390.1 lib/dpl/provider/cloud_files.rb
dpl-1.5.9.travis.373.1 lib/dpl/provider/cloud_files.rb