activestorage_upyun 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a1a49cc2be589a8801185a27f87bfcab3fbf97299f1075d48d9bbba213ee68b
4
- data.tar.gz: f19761541aef40916fab6b03cce9fdde46d9e56eceefb0a581421432fd16ecf5
3
+ metadata.gz: ed799a10214b73035941a3cd3ce0df53715424118f5f92631f971da783776b14
4
+ data.tar.gz: 3ed031623b3be001835849dd329db0833fa996f73e110b47a10f55ee85c54372
5
5
  SHA512:
6
- metadata.gz: 34bcc7fb8348dac77d6efb4e0b8b7197725efa56594f518bd0bdb43e44178497c6d166b04c1df5983276b96c0cb529bfe81dbb8d4db7175c155fdf533ff61083
7
- data.tar.gz: 330afc7754b0a809e3f1c1bb32aa4a9b2a2ed8d56fa57c3f078e2e92faf32ce20c02ea3c67f48b80a281420fe2ea11af522eccfb75e5fdbde079fbef6102c029
6
+ metadata.gz: ca715bd2e7f87244f2e537c4a732cafd0c802cc0cb5690ebab6853956ffefc213ae7600c21e9361b677b6a1f214bcafb7674ef28f0774c414bdfd31e803fd3e5
7
+ data.tar.gz: b74928ab2c6d61b7b0e6e14150189f4d71fcaa7fb821d1cb9b3e94353b98d59a7d51c19988eaa732f9c1a3bea020beb0f33f432144a974bc64a5f6a3a13c8585
data/README.md CHANGED
@@ -5,7 +5,7 @@ Upyun service for activestorage.
5
5
  Add this line to your application's Gemfile:
6
6
 
7
7
  ```ruby
8
- gem 'activestorage_upyun'
8
+ gem 'activestorage_upyun', require: false
9
9
  ```
10
10
 
11
11
  Set up upyun storage service in config/storage.yml:
@@ -13,9 +13,9 @@ Set up upyun storage service in config/storage.yml:
13
13
  ```yml
14
14
  upyun:
15
15
  service: Upyun
16
- bucket: <%= ENV['UPYUUN_BUCKET'] %>
17
- operator: <%= ENV['UPYUUN_OPERATOR'] %>
18
- password: <%= ENV['UPYUUN_PASSWORD'] %>
16
+ bucket: <%= ENV['UPYUN_BUCKET'] %>
17
+ operator: <%= ENV['UPYUN_OPERATOR'] %>
18
+ password: <%= ENV['UPYUN_PASSWORD'] %>
19
19
  host: <%= ENV['UPYUN_HOST'] %>
20
20
  folder: <%= ENV['UPYUN_FOLDER'] %>
21
21
  ```
@@ -43,9 +43,9 @@ thumb version use `!` as default identifier, if you want to use `_` as identifie
43
43
  ```yml
44
44
  upyun:
45
45
  service: Upyun
46
- bucket: <%= ENV['UPYUUN_BUCKET'] %>
47
- operator: <%= ENV['UPYUUN_OPERATOR'] %>
48
- password: <%= ENV['UPYUUN_PASSWORD'] %>
46
+ bucket: <%= ENV['UPYUN_BUCKET'] %>
47
+ operator: <%= ENV['UPYUN_OPERATOR'] %>
48
+ password: <%= ENV['UPYUN_PASSWORD'] %>
49
49
  host: <%= ENV['UPYUN_HOST'] %>
50
50
  folder: <%= ENV['UPYUN_FOLDER'] %>
51
51
  identifier: _
@@ -1,3 +1,5 @@
1
+ require "upyun"
2
+
1
3
  module ActiveStorage
2
4
  # Wraps the upyun Storage Service as an Active Storage service.
3
5
  # See ActiveStorage::Service for the generic API documentation that applies to all services.
@@ -7,9 +9,9 @@ module ActiveStorage
7
9
  #
8
10
  # upyun:
9
11
  # service: Upyun
10
- # bucket: <%= ENV['UPYUUN_BUCKET'] %>
11
- # operator: <%= ENV['UPYUUN_OPERATOR'] %>
12
- # password: <%= ENV['UPYUUN_PASSWORD'] %>
12
+ # bucket: <%= ENV['UPYUN_BUCKET'] %>
13
+ # operator: <%= ENV['UPYUN_OPERATOR'] %>
14
+ # password: <%= ENV['UPYUN_PASSWORD'] %>
13
15
  # host: <%= ENV['UPYUN_HOST'] %>
14
16
  # folder: <%= ENV['UPYUN_FOLDER'] %>
15
17
  #
@@ -20,7 +22,7 @@ module ActiveStorage
20
22
  #
21
23
  #
22
24
  class Service::UpyunService < Service
23
- ENDPOINT = 'http://v0.api.upyun.com'
25
+ ENDPOINT = 'https://v0.api.upyun.com'
24
26
  IDENTIFIER = '!'
25
27
 
26
28
  attr_reader :upyun, :bucket, :operator, :password, :host, :folder, :upload_options
@@ -35,7 +37,7 @@ module ActiveStorage
35
37
  @upyun = Upyun::Rest.new(bucket, operator, password, options)
36
38
  end
37
39
 
38
- def upload(key, io, checksum: nil)
40
+ def upload(key, io, checksum: nil, content_type: nil, disposition: nil, filename: nil)
39
41
  instrument :upload, key: key, checksum: checksum do
40
42
  begin
41
43
  result = @upyun.put(path_for(key), io)
@@ -151,4 +153,4 @@ module ActiveStorage
151
153
  Time.now.utc.strftime('%a, %d %b %Y %H:%M:%S GMT')
152
154
  end
153
155
  end
154
- end
156
+ end
@@ -1,6 +1,4 @@
1
- require "upyun"
2
1
  require "activestorage_upyun/version"
3
2
  require 'active_storage/service/upyun_service'
4
3
  module ActivestorageUpyun
5
- # Your code goes here...
6
4
  end
@@ -1,3 +1,3 @@
1
1
  module ActivestorageUpyun
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activestorage_upyun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - doabit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-29 00:00:00.000000000 Z
11
+ date: 2018-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activestorage