rails-assets-for-upyun 0.0.2 → 0.0.3

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: ae55bd6d901a1f386c08e8973facec323c72ca1a
4
- data.tar.gz: 5e9e96e06eb4db0d411f095676a4b1c86298c4cc
3
+ metadata.gz: ba82698c0095d6b9c9c98518256c415a9b8524c1
4
+ data.tar.gz: e4eebb71945f26496d8e528628445c2e8f5ca1a1
5
5
  SHA512:
6
- metadata.gz: 106f8028528be7597060259c6d139781c5ecf0b292efe2f29e952cfa9cd75aebb5aef8a87c35f6cef0f6470d89303936cce357272bb3e392323c3b46070fbf26
7
- data.tar.gz: 2cbbc918f0bd15f62912a295430de3dfe3fff5a71c8c65b2e5fdf62be43647bfdfb508e15ca41c96cf79706a153c98c739b23314fba204f7be70b846167d81be
6
+ metadata.gz: 6a591fa1e1fb0edf29e92640e2b5a6032cd028b68851e0a2281c6bdfc68bd0c84bc32c4cb3dfdb0381d8ea24ae6cfce20d467a183272bb97a754da3ee761869c
7
+ data.tar.gz: f72b8c573fc2c40a0bf3e34b47c295662a8db03ccecfc56805d21122f75b73260c5ca9879238e12b706a45e4e416cead1a4aef0f6b1942258082b302398b8255
data/README.md CHANGED
@@ -4,7 +4,7 @@ rails-assets-for-upyun
4
4
 
5
5
  ## 用法
6
6
 
7
- 1. 在 `Gemfile` 里引用我: `gem "rails-assets-for-upyun"`
7
+ 1. 在 `Gemfile` 里引用我: `gem 'rails-assets-for-upyun', '>= 0.0.3'`
8
8
  2. 首先设置好在生产环境中调用 UpYun 上的资源
9
9
 
10
10
  ```
@@ -1,14 +1,14 @@
1
1
  class RailsAssetsForUpyun
2
2
  def self.publish(bucket, username, password, bucket_path="/", localpath='public', upyun_ap="http://v0.api.upyun.com")
3
3
  Dir[File.join localpath, "**", "*"].select{|f| File.file? f }.each do |file|
4
- url = "/#{bucket}#{bucket_path}#{file[localpath.to_s.size + 1 .. -1]}"
4
+ url = URI.encode "/#{bucket}#{bucket_path}#{file[localpath.to_s.size + 1 .. -1]}"
5
5
  date = Time.now.httpdate
6
6
  size = RestClient.head("#{upyun_ap}#{url}", {\
7
7
  Authorization: "UpYun #{username}:#{signature 'HEAD', url, date, 0, password}",
8
8
  Date: date}) do |response, request, result, &block|
9
9
  case response.code
10
10
  when 200
11
- response.headers[:x_upyun_file_size]
11
+ response.headers[:x_upyun_file_size].to_i
12
12
  when 404
13
13
  nil
14
14
  end
@@ -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.2"
6
+ s.version = "0.0.3"
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.2
4
+ version: 0.0.3
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-04-17 00:00:00.000000000 Z
11
+ date: 2014-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client