Sha256: 5672602458fd00df0cf24525d69d58d5a447441fc13f64e1e9a1d4afd4867804

Contents?: true

Size: 1.24 KB

Versions: 92

Compression:

Stored size: 1.24 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 'mime-types', load: 'mime/types', version: '~> 2.6.2' # Anything higher requires Ruby 2.x
      requires 'nokogiri', version: '~> 1.6.8.1' # 1.7.0 and up requires Ruby 2.1.0 (via fog-xml)
      requires 'fog-rackspace', load: 'fog/rackspace'
      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

92 entries across 92 versions & 2 rubygems

Version Path
dpl-1.8.48.travis.2486.5 lib/dpl/provider/cloud_files.rb
dpl-1.8.47 lib/dpl/provider/cloud_files.rb
dpl-1.8.47.travis.2485.5 lib/dpl/provider/cloud_files.rb
dpl-1.8.47.travis.2484.5 lib/dpl/provider/cloud_files.rb
dpl-1.8.47.travis.2483.5 lib/dpl/provider/cloud_files.rb
dpl-1.8.47.travis.2459.3 lib/dpl/provider/cloud_files.rb
dpl-1.8.47.travis.2458.3 lib/dpl/provider/cloud_files.rb
dpl-1.8.46 lib/dpl/provider/cloud_files.rb
dpl-1.8.47.travis.2456.5 lib/dpl/provider/cloud_files.rb
dpl-1.8.46.travis.2455.5 lib/dpl/provider/cloud_files.rb
dpl-1.8.46.travis.2454.5 lib/dpl/provider/cloud_files.rb
dpl-1.8.46.travis.2451.5 lib/dpl/provider/cloud_files.rb
dpl-1.8.46.travis.2449.5 lib/dpl/provider/cloud_files.rb
dpl-1.8.46.travis.2444.5 lib/dpl/provider/cloud_files.rb
dpl-1.8.45 lib/dpl/provider/cloud_files.rb
dpl-1.8.46.travis.2418.5 lib/dpl/provider/cloud_files.rb
dpl-1.8.45.travis.2417.5 lib/dpl/provider/cloud_files.rb
dpl-1.8.44 lib/dpl/provider/cloud_files.rb
dpl-1.8.45.travis.2398.5 lib/dpl/provider/cloud_files.rb
dpl-1.8.44.travis.2397.5 lib/dpl/provider/cloud_files.rb