rails-assets-for-upyun 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails-assets-for-upyun.rb +2 -1
- data/rails-assets-for-upyun.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a352bd2dbc4786c081d94884b12b3c098e57bd36
|
4
|
+
data.tar.gz: b019f3bee942f91bd3b4918f1a0703f82ec65f56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1de21abd50a29edc2c5fe69e271fe0ef83e956f25d97082e44e65225294ffebc668aa776325fbb554fb4253485518c9b1ee08a670884a16d3c6cd22da030f76a
|
7
|
+
data.tar.gz: 9f7cbcb8cb968d8bdc909e6edf849d195d6aa6363ff3c226a1f2183980773c7433d90e11c02ad2fdea2db565053e0be6ce9f9b5fca91ab49bcedf558150d3e57
|
@@ -2,6 +2,7 @@ class RailsAssetsForUpyun
|
|
2
2
|
def self.publish(bucket, username, password, bucket_path="/", localpath='public', upyun_ap="http://v0.api.upyun.com")
|
3
3
|
# http://stackoverflow.com/questions/357754/can-i-traverse-symlinked-directories-in-ruby-with-a-glob
|
4
4
|
Dir[File.join localpath, "**{,/*/**}/*"].select{|f| File.file? f}.each do |file|
|
5
|
+
|
5
6
|
url = URI.encode "/#{bucket}#{bucket_path}#{file[localpath.to_s.size + 1 .. -1]}"
|
6
7
|
date = Time.now.httpdate
|
7
8
|
size = RestClient.head("#{upyun_ap}#{url}", {\
|
@@ -18,7 +19,7 @@ class RailsAssetsForUpyun
|
|
18
19
|
puts "skipping #{file}.."
|
19
20
|
else
|
20
21
|
file_content = File.read(file)
|
21
|
-
puts "uploading #{file}.."
|
22
|
+
puts "uploading #{size} => #{file_size} #{file}.."
|
22
23
|
RestClient.put("#{upyun_ap}#{url}", file_content,{\
|
23
24
|
Authorization: "UpYun #{username}:#{signature 'PUT', url, date, file_size, password}",
|
24
25
|
Date: date,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-assets-for-upyun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Yin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|