<NME> qiniu.rb
<BEF> # encoding: utf-8
module CarrierWave
  module Storage
    class Qiniu < Abstract
      def store!(file)
        QiniuFile.new(uploader, uploader.store_path).tap do |qiniu_file|
          qiniu_file.store(file)
        end
      end

      def cache!(file)
        QiniuFile.new(uploader, uploader.cache_path).tap do |qiniu_file|
          qiniu_file.store(file)
        end
      end

      def retrieve!(identifier)
        QiniuFile.new(uploader, uploader.store_path(identifier))
      end

      def retrieve_from_cache!(identifier)
        QiniuFile.new(uploader, uploader.cache_path(identifier))
      end

      ##
      # Deletes a cache dir
      #
      def delete_dir!(path)
        # do nothing, because there's no such things as 'empty directory'
      end

      def clean_cache!(seconds)
        # 如果缓存目录在云端,建议使用七牛云存储的生命周期设置, 以减少主动 API 调用次数
        raise 'Use Qiniu Object Lifecycle Management to clean the cache'
      end
    end
  end
end

        def url
          if @uploader.qiniu_bucket_domain and @uploader.qiniu_bucket_domain.size > 0
            "#{@qiniu_protocal}://#{@uploader.qiniu_bucket_domain}/#{@path}"
          else
            qiniu_connection.get_public_url(@path)               
          end

<MSG> could set http/https protocal for url

<DFF> @@ -97,7 +97,7 @@ module CarrierWave
 
         def url
           if @uploader.qiniu_bucket_domain and @uploader.qiniu_bucket_domain.size > 0
-            "#{@qiniu_protocal}://#{@uploader.qiniu_bucket_domain}/#{@path}"
+            "#{@uploader.qiniu_protocal}://#{@uploader.qiniu_bucket_domain}/#{@path}"
           else
             qiniu_connection.get_public_url(@path)               
           end

{'addition_count': 1, 'commit_subject': 'could set http/https protocal for url', 'deletion_count': 1, 'file_extension': '.rb', 'lang': 'rb', 'license': 'mit', 'repo_name': 'huobazi/carrierwave-qiniu'}