Qiniu Cloud Storage SDK for Ruby, support multiple configure for SaaS product.
Install the gem and add to the application's Gemfile by executing:
$ bundle add qinium
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install qinium
只传域名即可(不要带 http:// / https://)。协议由配置里的 protocol 决定(默认 :https;需要走 HTTP 时设 protocol: :http)。
不传 up_host 时,仍通过七牛 UC 解析上传域(与旧版一致)。
Qinium.new(
bucket: "my-bucket",
access_key: ENV["QINIU_AK"],
secret_key: ENV["QINIU_SK"],
protocol: :https, # 或 :http
up_host: "xxx.kodo-accelerate.ap-southeast-1.qiniucs.com"
)
# => #up_host 返回 "https://xxx..." 或 "http://xxx..."(视 protocol)After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/qinium.
The gem is available as open source under the terms of the MIT License.