mirror of
https://github.com/wahyd4/ruby-sdk.git
synced 2026-08-09 04:46:10 +10:00
@@ -7,3 +7,6 @@ rvm:
|
||||
before_script:
|
||||
- export QINIU_ACCESS_KEY=QWYn5TFQsLLU1pL5MFEmX3s5DmHdUThav9WyOWOm
|
||||
- export QINIU_SECRET_KEY=Bxckh6FA-Fbs9Yt3i3cbKVK22UPBmAOHJcL95pGz
|
||||
gemfile:
|
||||
- Gemfile
|
||||
- rails3/Gemfile
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
# Specify your gem's dependencies in qiniu-s3.gemspec
|
||||
gemspec
|
||||
# Specify your gem's dependencies in qiniu.gemspec
|
||||
gemspec :name => 'qiniu'
|
||||
|
||||
# platforms :jruby do
|
||||
# gem "jruby-openssl"
|
||||
|
||||
+24
-17
@@ -2,29 +2,36 @@ PATH
|
||||
remote: .
|
||||
specs:
|
||||
qiniu (6.4.1)
|
||||
json (~> 1.7)
|
||||
mime-types (~> 2.4.3)
|
||||
rest-client (~> 1.6)
|
||||
json (~> 1.8)
|
||||
mime-types (~> 1.19)
|
||||
rest-client (~> 1.7.3)
|
||||
ruby-hmac (~> 0.4)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
diff-lcs (1.1.3)
|
||||
diff-lcs (1.2.5)
|
||||
fakeweb (1.3.0)
|
||||
json (1.8.1)
|
||||
mime-types (1.23)
|
||||
rake (10.0.3)
|
||||
rest-client (1.6.7)
|
||||
mime-types (>= 1.16)
|
||||
rspec (2.12.0)
|
||||
rspec-core (~> 2.12.0)
|
||||
rspec-expectations (~> 2.12.0)
|
||||
rspec-mocks (~> 2.12.0)
|
||||
rspec-core (2.12.2)
|
||||
rspec-expectations (2.12.1)
|
||||
diff-lcs (~> 1.1.3)
|
||||
rspec-mocks (2.12.2)
|
||||
json (1.8.2)
|
||||
mime-types (1.25.1)
|
||||
netrc (0.10.3)
|
||||
rake (10.4.2)
|
||||
rest-client (1.7.3)
|
||||
mime-types (>= 1.16, < 3.0)
|
||||
netrc (~> 0.7)
|
||||
rspec (3.2.0)
|
||||
rspec-core (~> 3.2.0)
|
||||
rspec-expectations (~> 3.2.0)
|
||||
rspec-mocks (~> 3.2.0)
|
||||
rspec-core (3.2.2)
|
||||
rspec-support (~> 3.2.0)
|
||||
rspec-expectations (3.2.0)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.2.0)
|
||||
rspec-mocks (3.2.1)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.2.0)
|
||||
rspec-support (3.2.2)
|
||||
ruby-hmac (0.4.0)
|
||||
|
||||
PLATFORMS
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
require 'qiniu/http'
|
||||
|
||||
module Qiniu
|
||||
module Misc
|
||||
class << self
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@ Gem::Specification.new do |gem|
|
||||
gem.add_development_dependency "rake", ">= 0.9"
|
||||
gem.add_development_dependency "rspec", ">= 2.11"
|
||||
gem.add_development_dependency "fakeweb", "~> 1.3"
|
||||
gem.add_runtime_dependency "json", "~> 1.7"
|
||||
gem.add_runtime_dependency "rest-client", "~> 1.6"
|
||||
gem.add_runtime_dependency "json", "~> 1.8"
|
||||
gem.add_runtime_dependency "rest-client", "~> 1.7.3"
|
||||
gem.add_runtime_dependency "mime-types", "~> 2.4.3"
|
||||
gem.add_runtime_dependency "ruby-hmac", "~> 0.4"
|
||||
gem.add_runtime_dependency "jruby-openssl", "~> 0.7" if RUBY_PLATFORM == "java"
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
# Specify your gem's dependencies in rails3/qiniu.gemspec
|
||||
gemspec :name => 'qiniu'
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
require File.expand_path('../../lib/qiniu/version', __FILE__)
|
||||
|
||||
Gem::Specification.new do |gem|
|
||||
gem.authors = ["why404","BluntBlade"]
|
||||
gem.email = ["sdk@qiniu.com"]
|
||||
gem.description = %q{Qiniu Resource (Cloud) Storage SDK for Ruby. See: http://developer.qiniu.com/docs/v6/sdk/ruby-sdk.html}
|
||||
gem.summary = %q{Qiniu Resource (Cloud) Storage SDK for Ruby}
|
||||
gem.homepage = "https://github.com/qiniu/ruby-sdk"
|
||||
|
||||
gem.files = `git ls-files`.split($\)
|
||||
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
||||
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
||||
gem.name = "qiniu"
|
||||
gem.require_paths = ["lib"]
|
||||
gem.version = Qiniu::Version.to_s
|
||||
gem.license = "MIT"
|
||||
|
||||
# specify any dependencies here; for example:
|
||||
gem.add_development_dependency "rake", ">= 0.9"
|
||||
gem.add_development_dependency "rspec", ">= 2.11"
|
||||
gem.add_development_dependency "fakeweb", "~> 1.3"
|
||||
gem.add_runtime_dependency "json", "~> 1.8"
|
||||
gem.add_runtime_dependency "rest-client", "~> 1.7.3"
|
||||
gem.add_runtime_dependency "mime-types", "~> 1.19"
|
||||
gem.add_runtime_dependency "ruby-hmac", "~> 0.4"
|
||||
gem.add_runtime_dependency "jruby-openssl", "~> 0.7" if RUBY_PLATFORM == "java"
|
||||
end
|
||||
+26
-38
@@ -34,7 +34,7 @@ module Qiniu
|
||||
context ".buckets" do
|
||||
it "should works" do
|
||||
result = Qiniu.buckets
|
||||
result.should_not be_false
|
||||
expect(result).to_not be_empty
|
||||
puts result.inspect
|
||||
end
|
||||
end
|
||||
@@ -42,7 +42,7 @@ module Qiniu
|
||||
context ".set_protected" do
|
||||
it "should works" do
|
||||
result = Qiniu.set_protected(@bucket, 1)
|
||||
result.should_not be_false
|
||||
expect(result).to eq(true)
|
||||
puts result.inspect
|
||||
end
|
||||
end
|
||||
@@ -50,7 +50,7 @@ module Qiniu
|
||||
context ".set_separator" do
|
||||
it "should works" do
|
||||
result = Qiniu.set_separator(@bucket, "-")
|
||||
result.should_not be_false
|
||||
expect(result).to eq(true)
|
||||
puts result.inspect
|
||||
end
|
||||
end
|
||||
@@ -58,7 +58,7 @@ module Qiniu
|
||||
context ".set_style" do
|
||||
it "should works" do
|
||||
result = Qiniu.set_style(@bucket, "small.jpg", "imageMogr/auto-orient/thumbnail/!120x120r/gravity/center/crop/!120x120/quality/80")
|
||||
result.should_not be_false
|
||||
expect(result).to eq(true)
|
||||
puts result.inspect
|
||||
end
|
||||
end
|
||||
@@ -66,7 +66,7 @@ module Qiniu
|
||||
context ".unset_style" do
|
||||
it "should works" do
|
||||
result = Qiniu.unset_style(@bucket, "small.jpg")
|
||||
result.should_not be_false
|
||||
expect(result).to eq(true)
|
||||
puts result.inspect
|
||||
end
|
||||
end
|
||||
@@ -82,7 +82,7 @@ module Qiniu
|
||||
:enable_crc32_check => true
|
||||
}
|
||||
result = Qiniu.upload_file(upload_opts)
|
||||
result.should_not be_false
|
||||
expect(result).to_not be_empty
|
||||
puts result.inspect
|
||||
end
|
||||
|
||||
@@ -132,24 +132,22 @@ module Qiniu
|
||||
File.unlink(localfile) if File.exists?(localfile)
|
||||
#expect
|
||||
puts result1.inspect
|
||||
result1.should_not be_false
|
||||
result1.should_not be_empty
|
||||
expect(result1).to_not be_empty
|
||||
#stat
|
||||
result2 = Qiniu.stat(@bucket, key)
|
||||
puts result2.inspect
|
||||
result2.should_not be_false
|
||||
expect(result2).to_not be_empty
|
||||
#delete
|
||||
result3 = Qiniu.delete(@bucket, key)
|
||||
puts result3.inspect
|
||||
result3.should_not be_false
|
||||
expect(result3).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
context ".stat" do
|
||||
it "should works" do
|
||||
result = Qiniu.stat(@bucket, @key)
|
||||
result.should_not be_false
|
||||
result.should_not be_empty
|
||||
expect(result).to_not be_empty
|
||||
puts result.inspect
|
||||
end
|
||||
end
|
||||
@@ -157,8 +155,7 @@ module Qiniu
|
||||
context ".get" do
|
||||
it "should works" do
|
||||
result = Qiniu.get(@bucket, @key, "qiniu_spec.rb", 10)
|
||||
result.should_not be_false
|
||||
result.should_not be_empty
|
||||
expect(result).to_not be_empty
|
||||
puts result.inspect
|
||||
end
|
||||
end
|
||||
@@ -166,8 +163,7 @@ module Qiniu
|
||||
context ".download" do
|
||||
it "should works" do
|
||||
result = Qiniu.download(@bucket, @key, "rs_spec.rb", 10)
|
||||
result.should_not be_false
|
||||
result.should_not be_empty
|
||||
expect(result).to_not be_empty
|
||||
puts result.inspect
|
||||
end
|
||||
end
|
||||
@@ -175,8 +171,7 @@ module Qiniu
|
||||
context ".batch" do
|
||||
it "should works" do
|
||||
result = Qiniu.batch("stat", @bucket, [@key])
|
||||
result.should_not be_false
|
||||
result.should_not be_empty
|
||||
expect(result).to_not be_empty
|
||||
puts result.inspect
|
||||
end
|
||||
end
|
||||
@@ -184,8 +179,7 @@ module Qiniu
|
||||
context ".batch_stat" do
|
||||
it "should works" do
|
||||
result = Qiniu.batch_stat(@bucket, [@key])
|
||||
result.should_not be_false
|
||||
result.should_not be_empty
|
||||
expect(result).to_not be_empty
|
||||
puts result.inspect
|
||||
end
|
||||
end
|
||||
@@ -193,8 +187,7 @@ module Qiniu
|
||||
context ".batch_get" do
|
||||
it "should works" do
|
||||
result = Qiniu.batch_get(@bucket, [@key])
|
||||
result.should_not be_false
|
||||
result.should_not be_empty
|
||||
expect(result).to_not be_empty
|
||||
puts result.inspect
|
||||
end
|
||||
end
|
||||
@@ -202,8 +195,7 @@ module Qiniu
|
||||
context ".batch_download" do
|
||||
it "should works" do
|
||||
result = Qiniu.batch_download(@bucket, [@key])
|
||||
result.should_not be_false
|
||||
result.should_not be_empty
|
||||
expect(result).to_not be_empty
|
||||
puts result.inspect
|
||||
end
|
||||
end
|
||||
@@ -236,42 +228,40 @@ module Qiniu
|
||||
context ".move" do
|
||||
it "should works" do
|
||||
result = Qiniu.move(@bucket, @key, @bucket, @key2)
|
||||
result.should_not be_false
|
||||
expect(result).to eq(true)
|
||||
|
||||
result2 = Qiniu.stat(@bucket, @key2)
|
||||
result2.should_not be_false
|
||||
expect(result2).to_not be_empty
|
||||
|
||||
result3 = Qiniu.move(@bucket, @key2, @bucket, @key)
|
||||
result3.should_not be_false
|
||||
expect(result3).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
context ".copy" do
|
||||
it "should works" do
|
||||
result = Qiniu.copy(@bucket, @key, @bucket, @key2)
|
||||
result.should_not be_false
|
||||
expect(result).to eq(true)
|
||||
|
||||
result3 = Qiniu.delete(@bucket, @key2)
|
||||
result3.should_not be_false
|
||||
expect(result3).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
context ".delete" do
|
||||
it "should works" do
|
||||
result = Qiniu.delete(@bucket, @key)
|
||||
result.should_not be_false
|
||||
expect(result).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
context ".image_info" do
|
||||
it "should works" do
|
||||
data = Qiniu.get(@test_image_bucket, @test_image_key)
|
||||
data.should_not be_false
|
||||
data.should_not be_empty
|
||||
expect(data).to_not be_empty
|
||||
puts data.inspect
|
||||
result = Qiniu.image_info(data["url"])
|
||||
result.should_not be_false
|
||||
result.should_not be_empty
|
||||
expect(result).to_not be_empty
|
||||
puts result.inspect
|
||||
end
|
||||
end
|
||||
@@ -279,8 +269,7 @@ module Qiniu
|
||||
context ".image_mogrify_save_as" do
|
||||
it "should works" do
|
||||
data = Qiniu.get(@test_image_bucket, @test_image_key)
|
||||
data.should_not be_false
|
||||
data.should_not be_empty
|
||||
expect(data).to_not be_empty
|
||||
puts data.inspect
|
||||
|
||||
dest_key = "cropped-" + @test_image_key
|
||||
@@ -295,8 +284,7 @@ module Qiniu
|
||||
:auto_orient => true
|
||||
}
|
||||
result2 = Qiniu.image_mogrify_save_as(@test_image_bucket, dest_key, src_img_url, mogrify_options)
|
||||
result2.should_not be_false
|
||||
result2.should_not be_empty
|
||||
expect(result2).to_not be_empty
|
||||
puts result2.inspect
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user