It's the full featured Ruby SDK for Qcloud COS(Cloud Object Service).
We keep API simple but powerful, to give you more freedom.
Enjoy it!
Add this line to your application's Gemfile:
gem 'qcloud_cos'
And then execute:
$ bundle
Or install it yourself as:
$ gem install qcloud_cos
QcloudCos.configure do |config|
config.app_id = 'app-id'
config.secret_id = 'secret_id'
config.secret_key = 'secret_key'
config.endpoint = "http://web.file.myqcloud.com/files/v1/"
config.bucket = "default-bucket-name"
end
QcloudCos.list # 列出 / 目录下的文件和文件夹
QcloudCos.upload('/test.log', 'Hello World')
QcloudCos.upload('/test.log', File.new('path/to/log'))
QcloudCos.upload_slice('/video.mp4', 'path/to/video.mp4')
QcloudCos.create_folder('/test/') # 创建目录
$ qcloud-cos config
$ qcloud-cos info
$ qcloud-cos list
More Example and Scenario, visit our Document
Here is original Restful API, It has the most detailed and authoritative explanation for every API.
Here is our RDoc Document, It's well format to help you find more detail about methods.
Here are some more guides for help you. Welcome to advice.
We use minitest for test and rubocop for Syntax checker, If you want to make contribute to this library. Confirm below Command is success:
bundle exec rake test
licensed under the Apache License 2.0