Sha256: 6c3c43efcc891bd3cf82a0ad4ece92540f35007fd4a651534895eb2d0b556e2f

Contents?: true

Size: 1.21 KB

Versions: 17

Compression:

Stored size: 1.21 KB

Contents

require 'dpl/provider'

module DPL
  class Provider
    class CloudFiles < Provider
      requires 'net-ssh',    load: 'net/ssh',    version: '~> 2.9.2' # Anything higher requires Ruby 2.x
      requires 'fog-google', load: 'fog/google', version: '< 0.1.1'  # Anything higher requires Ruby 2.x
      requires 'fog', version: '< 1.35.0' # Anything higher requires fog-google 0.1.1 and up, which, in turn, requires Ruby 2.x
      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

17 entries across 17 versions & 1 rubygems

Version Path
dpl-1.8.11.travis.1218.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.10.travis.1217.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.10 lib/dpl/provider/cloud_files.rb
dpl-1.8.10.travis.1215.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.9.travis.1214.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.9 lib/dpl/provider/cloud_files.rb
dpl-1.8.9.travis.1204.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.8.travis.1203.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.8.travis.1202.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.8 lib/dpl/provider/cloud_files.rb
dpl-1.8.8.travis.1201.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.8.travis.1187.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.8.travis.1183.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.8.travis.1179.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.8.travis.1167.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.8.travis.1151.4 lib/dpl/provider/cloud_files.rb
dpl-1.8.7 lib/dpl/provider/cloud_files.rb