activestorage-aliyun 0.4.0 → 0.4.1

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: 7a6e97cb757b635493a02597209f20c7b73283f6922b604fac48836cb86c323f
4
- data.tar.gz: c3472d980a98774ce2e4592c68cef5fd36b88423243fc1c9a5fa0b76f39518e4
3
+ metadata.gz: 04e1265400dd3a5203a08928630037e34b75e1fb0e225c209228d7bb42330671
4
+ data.tar.gz: ae3ab3f2ddf9f71994ba5798b0f10f4130a2c6fd245fe50dba0c6a0bacb96fd4
5
5
  SHA512:
6
- metadata.gz: 6f1c434607f6db1ae7383143b9ac4d8673b8b39af86c1ae130c9617bb1d23fc81ca9cb458d25b7b432f5199ee4856a9741ae84f229d7669ef4408c32218ff0b3
7
- data.tar.gz: 2a748673e30e2d73cc4b335c017265592ccfca051f3bf4ae775a72731549dfc376aeaca94dd35866cf15bc58d48d994fa54782ead184dcfe19760cff28be91a8
6
+ metadata.gz: 33d3f92832c8f21dc890eb682e0e949fe50efc7066f2320bdaf11a16b98fe42ca90aa0ac87bc37bec6d1f6a898c0bc8c5939ab1693425f7078f49c5d59e9d337
7
+ data.tar.gz: 6670c6fcace9bacc6cf806d32d2922e2a73c533a0ee1945fddff7815cc10be94d28bd50fcc2a29dcdc1bb267dfb6a1cd78d844f3be0ebdb9583349e8cce4f136
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.4.1
2
+
3
+ - Remove config.path `/` prefix for fix #7 issue.
4
+
1
5
  ## 0.4.0
2
6
 
3
7
  - Support present `params` to `service_url` to oss image url.
@@ -103,8 +103,11 @@ module ActiveStorage
103
103
  attr_reader :config
104
104
 
105
105
  def path_for(key)
106
- return key unless config.fetch(:path, nil)
107
- File.join(config.fetch(:path), key)
106
+ root_path = config.fetch(:path, nil)
107
+ return key unless root_path
108
+
109
+ root_path = root_path.sub(/^\//, "")
110
+ File.join(root_path, key)
108
111
  end
109
112
 
110
113
  def object_url(key, sign:, expires_in: 60, params: {})
@@ -1,3 +1,3 @@
1
1
  module ActiveStorageAliyun
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activestorage-aliyun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee