删除已经废弃的EU服务相关代码。

This commit is contained in:
Liang Tao
2014-02-08 15:14:47 +08:00
parent cb748d8857
commit 1a1affc3d3
4 changed files with 0 additions and 121 deletions
-12
View File
@@ -58,18 +58,6 @@ module Qiniu
code == StatusOK
end
=begin
def set_watermark(customer_id, options = {})
code, data = EU.set_watermark(customer_id, options)
code == StatusOK
end
def get_watermark(customer_id = nil)
code, data = EU.get_watermark(customer_id)
code == StatusOK ? data : false
end
=end
def put_file opts = {}
code, data = IO.put_file(opts[:file],
opts[:bucket],
-22
View File
@@ -1,22 +0,0 @@
# -*- encoding: utf-8 -*-
module Qiniu
module RS
module EU
class << self
include Utils
def set_watermark(customer_id, options = {})
Auth.request Config.settings[:eu_host] + '/wmset', options.merge({:customer => customer_id})
end
def get_watermark(customer_id = nil)
post_data = customer_id.nil? ? nil : {:customer => customer_id}
Auth.request Config.settings[:eu_host] + '/wmget', post_data
end
end
end
end
end
-66
View File
@@ -1,66 +0,0 @@
# -*- encoding: utf-8 -*-
require 'spec_helper'
require 'qiniu/rs'
require 'qiniu/rs/pub'
require 'qiniu/rs/eu'
module Qiniu
module RS
describe EU do
before :all do
@customer_id = "why404@gmail.com"
@bucket = 'RubySdkTest' + (Time.now.to_i+rand(1000)).to_s
@key = "image_logo_for_test.png"
result = Qiniu::RS.mkbucket(@bucket)
puts result.inspect
result.should be_true
local_file = File.expand_path('../' + @key, __FILE__)
upopts = {:scope => @bucket, :expires_in => 3600, :customer => @customer_id}
uptoken = Qiniu::RS.generate_upload_token(upopts)
data = Qiniu::RS.upload_file :uptoken => uptoken, :file => local_file, :bucket => @bucket, :key => @key
puts data.inspect
code2, data2 = Qiniu::RS::Pub.set_separator(@bucket, "-")
code2.should == 200
puts data2.inspect
code3, data3 = Qiniu::RS::Pub.set_style(@bucket, "small.jpg", "imageView/1/w/120/h/120/q/85/format/jpg/watermark/1")
code3.should == 200
puts data3.inspect
end
after :all do
result = Qiniu::RS.drop(@bucket)
puts result.inspect
result.should_not be_false
end
=begin
context ".set_watermark" do
it "should works" do
options = {
:text => "Powered by QiniuRS"
}
code, data = Qiniu::RS::EU.set_watermark(@customer_id, options)
code.should == 200
puts data.inspect
end
end
context ".get_watermark" do
it "should works" do
code, data = Qiniu::RS::EU.get_watermark(@customer_id)
code.should == 200
puts data.inspect
end
end
=end
end
end
end
-21
View File
@@ -95,27 +95,6 @@ module Qiniu
end
end
=begin
context ".set_watermark" do
it "should works" do
options = {
:text => "Powered by QiniuRS"
}
result = Qiniu::RS.set_watermark(1, options)
result.should_not be_false
puts result.inspect
end
end
context ".get_watermark" do
it "should works" do
result = Qiniu::RS.get_watermark(1)
result.should_not be_false
puts result.inspect
end
end
=end
context ".upload_file" do
it "should works" do
uptoken_opts = {:scope => @bucket, :escape => 0}