diff --git a/lib/qiniu/rs.rb b/lib/qiniu/rs.rb index 3b7323b..0c0f457 100755 --- a/lib/qiniu/rs.rb +++ b/lib/qiniu/rs.rb @@ -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], diff --git a/lib/qiniu/rs/eu.rb b/lib/qiniu/rs/eu.rb deleted file mode 100755 index f684417..0000000 --- a/lib/qiniu/rs/eu.rb +++ /dev/null @@ -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 - diff --git a/spec/qiniu/rs/eu_spec.rb b/spec/qiniu/rs/eu_spec.rb deleted file mode 100755 index 5e5894a..0000000 --- a/spec/qiniu/rs/eu_spec.rb +++ /dev/null @@ -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 diff --git a/spec/qiniu/rs_spec.rb b/spec/qiniu/rs_spec.rb index 8c0dd80..4665b12 100755 --- a/spec/qiniu/rs_spec.rb +++ b/spec/qiniu/rs_spec.rb @@ -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}