carrierwave-aliyun 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e35daac8dca6800ec0bee1188fcd0f96551a3bb
4
- data.tar.gz: 7ec55a5d7d3b982ed581a835d7d00995d740d0df
3
+ metadata.gz: f7e1a032a15f971ac7d1557dbae299ad9076d140
4
+ data.tar.gz: 85fe40058d6305cadb67a3a1c60485ad70abf25f
5
5
  SHA512:
6
- metadata.gz: cd5ae962bdf2333e5b5416a96229ff03ea843f65ee5d3da4f6f573fd442591398bc028bae44f3feaccedb5805df3e23bb119fa166f756ad1b30da77439597c0c
7
- data.tar.gz: 2f394b70e87988f7ac9a68ac8bd46c17ef11b41036a75d1adb8a6e97c16cfc63e2c1548aed751ec94967431a67d70fd816d15caa0f8ef7518d4afdb3b282bc25
6
+ metadata.gz: 3723c0a1664b2f323f07100a85fba1de96636e6542c4b3ddeb57996c56e16e55633a36676d0c13455500139236c33283c9313f8facea5d195443234da6bb61a4
7
+ data.tar.gz: 2e936b1cf3a2eded52064bb2382acb6800390ca09fbe6f6845c69396738215aa953e783ed7b2e8684c1d634399ad30a6191bd5d8fb2516a5c6fd325258e215ac
@@ -1,3 +1,7 @@
1
+ ## 0.3.5
2
+
3
+ * CarrierWave::Storage::Aliyun::File 继承 CarrierWave::SanitizedFile 以实现一些方法;
4
+
1
5
  ## 0.3.4
2
6
 
3
7
  * Use OpenSSL::HMAC with Ruby 2.2.0.
data/Gemfile CHANGED
@@ -1,12 +1,10 @@
1
1
  source "http://ruby.taobao.org"
2
- gem "rake"
3
2
 
4
- group :test do
5
- gem 'rails'
6
- gem 'sqlite3-ruby', :require => 'sqlite3'
7
- gem 'carrierwave'
8
- gem 'mini_magick'
9
- gem 'rest-client'
10
- gem 'rspec','~> 2.6.0'
11
- gem 'mocha','0.10.0'
12
- end
3
+
4
+ gemspec
5
+
6
+ gem 'rake'
7
+ gem 'rails', '4.2.0'
8
+ gem 'sqlite3-ruby', :require => 'sqlite3'
9
+ gem 'mini_magick'
10
+ gem 'rspec'
data/README.md CHANGED
@@ -10,6 +10,8 @@ This gem adds support for [Aliyun OSS](http://oss.aliyun.com) to [CarrierWave](h
10
10
  gem install carrierwave-aliyun
11
11
  ```
12
12
 
13
+ > NOTE: 此 Gem 是一个 CarrierWave 的组件,你需要配合 CarrierWave 一起使用。
14
+
13
15
  ## Using Bundler
14
16
 
15
17
  ```ruby
@@ -19,7 +21,7 @@ gem 'carrierwave-aliyun'
19
21
 
20
22
  ## Configuration
21
23
 
22
- 创建这么个脚本 `config/initializes/carrierwave.rb` 填入下面的代码,并修改对应的配置:
24
+ 创建这么个脚本 `config/initializers/carrierwave.rb` 填入下面的代码,并修改对应的配置:
23
25
 
24
26
  ```ruby
25
27
  CarrierWave.configure do |config|
@@ -1,7 +1,7 @@
1
1
  module CarrierWave
2
2
  module Aliyun
3
3
  class Version
4
- MAJOR, MINOR, PATCH = 0, 3, 4
4
+ MAJOR, MINOR, PATCH = 0, 3, 5
5
5
 
6
6
  ##
7
7
  # Returns the major version ( big release based off of multiple minor releases )
@@ -2,8 +2,8 @@
2
2
  require 'carrierwave'
3
3
  require 'digest/md5'
4
4
  require 'openssl'
5
- require "rest-client"
6
5
  require 'uri'
6
+ require "rest-client"
7
7
 
8
8
  module CarrierWave
9
9
  module Storage
@@ -11,10 +11,10 @@ module CarrierWave
11
11
 
12
12
  class Connection
13
13
  def initialize(options={})
14
- @aliyun_access_id = options[:aliyun_access_id]
15
- @aliyun_access_key = options[:aliyun_access_key]
16
- @aliyun_bucket = options[:aliyun_bucket]
17
- @aliyun_area = options[:aliyun_area] || 'cn-hangzhou'
14
+ @aliyun_access_id = options[:aliyun_access_id]
15
+ @aliyun_access_key = options[:aliyun_access_key]
16
+ @aliyun_bucket = options[:aliyun_bucket]
17
+ @aliyun_area = options[:aliyun_area] || 'cn-hangzhou'
18
18
  @aliyun_upload_host = options[:aliyun_upload_host]
19
19
 
20
20
  # Host for upload
@@ -139,7 +139,7 @@ module CarrierWave
139
139
  end
140
140
  end
141
141
 
142
- class File
142
+ class File < CarrierWave::SanitizedFile
143
143
  def initialize(uploader, base, path)
144
144
  @uploader = uploader
145
145
  @path = path
@@ -40,4 +40,12 @@ describe "Aliyun" do
40
40
  url = @connection.put("a/a.jpg",load_file("foo.jpg"))
41
41
  url.should == "http://foo.bar.com/a/a.jpg"
42
42
  end
43
+
44
+ describe 'File' do
45
+ it 'should have respond_to identifier' do
46
+ f = CarrierWave::Storage::Aliyun::File.new(nil, nil, nil)
47
+ f.should respond_to(:identifier)
48
+ f.should respond_to(:filename)
49
+ end
50
+ end
43
51
  end
@@ -22,6 +22,7 @@ module Rails
22
22
  end
23
23
 
24
24
  ActiveRecord::Migration.verbose = false
25
+ ActiveRecord::Base.raise_in_transactional_callbacks = true
25
26
 
26
27
  # 测试的时候需要修改这个地方
27
28
  ALIYUN_ACCESS_ID = "osOXJ5VeQVgDLMs3"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave-aliyun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-09 00:00:00.000000000 Z
11
+ date: 2015-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  version: '0'
83
83
  requirements: []
84
84
  rubyforge_project:
85
- rubygems_version: 2.4.5
85
+ rubygems_version: 2.4.7
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: Aliyun OSS support for Carrierwave