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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9fbdd69a2b81d0a3bdf08fee5c795b8658ada71
4
- data.tar.gz: f3996ffcbd4ec4e285b69a0fb73eb447dd929940
3
+ metadata.gz: a352bd2dbc4786c081d94884b12b3c098e57bd36
4
+ data.tar.gz: b019f3bee942f91bd3b4918f1a0703f82ec65f56
5
5
  SHA512:
6
- metadata.gz: 7362e2a22cc857d5377a6db064346d5a161ba18573b7fabe727c6fb194c29adbe397657ca9abe9a643782cc9af9c66fb7c3dda0b00a52c4572467ebf2590710f
7
- data.tar.gz: 023a42f15e2cb6bdd7293f9dfcb857d95690fe02df9cf985807a1d49169da7665bf0531b4b9328c100995e69df168b28bd15b888dc6dcf58bedb2c8ed47eb996
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,
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "rails-assets-for-upyun"
6
- s.version = "0.0.6"
6
+ s.version = "0.0.7"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Michael Yin"]
9
9
  s.email = ["layerssss@gmail.com"]
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.6
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-05 00:00:00.000000000 Z
11
+ date: 2014-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client