Sha256: 9a0c650710d8a1f3b48f4e67d0eb82ac35667443981267c1c57ad4fe29c5e4c4

Contents?: true

Size: 925 Bytes

Versions: 192

Compression:

Stored size: 925 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?

        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
    end
  end
end

Version data entries

192 entries across 192 versions & 1 rubygems

Version Path
dpl-1.8.5.travis.1113.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.5.travis.1112.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.5.travis.1104.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.5.travis.1101.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.5.travis.1097.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.4.travis.1090.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.3 lib/dpl/provider/cloud_files.rb
dpl-1.8.3.travis.1088.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.3.travis.1087.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.3.travis.1078.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.2 lib/dpl/provider/cloud_files.rb
dpl-1.8.2.travis.1075.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.2.travis.1071.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.1 lib/dpl/provider/cloud_files.rb
dpl-1.8.1.travis.1070.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.1.travis.1063.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.0 lib/dpl/provider/cloud_files.rb
dpl-1.7.23.travis.1061.4 lib/dpl/provider/cloud_files.rb
dpl-1.7.23.travis.1059.4 lib/dpl/provider/cloud_files.rb