Sha256: 23440709b5e9b7db4ddbb326d544f80d5f68e12393d5fa26b640e6fe22566a86

Contents?: true

Size: 732 Bytes

Versions: 2

Compression:

Stored size: 732 Bytes

Contents

require "tencent_cos_sdk"
require "carrierwave/tencent_cos/version"
require "carrierwave/storage/tencent_cos"

module CarrierWave
  module TencentCos
    CarrierWave.configure do |conf|
      conf.storage_engines.merge! tencent_cos: 'CarrierWave::Storage::TencentCos'
    end
  end

  module Uploader
    class Base
      @options = {}

      def self.options
        @options
      end

      def self.tencent_cos= options
        @options = options

        TencentCosSdk.configure do |conf|
          conf.secret_id    = options[:secret_id]
          conf.secret_key   = options[:secret_key]
          conf.host         = options[:host]
          conf.parent_path  = options[:parent_path]
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
carrierwave-tencent_cos-0.1.3 lib/carrierwave/tencent_cos.rb
carrierwave-tencent_cos-0.1.2 lib/carrierwave/tencent_cos.rb