rails-assets-for-upyun 0.0.3 → 0.0.5

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: ba82698c0095d6b9c9c98518256c415a9b8524c1
4
- data.tar.gz: e4eebb71945f26496d8e528628445c2e8f5ca1a1
3
+ metadata.gz: 19e6b840e95be0dd2bb2d65f46a9f7b152b876e6
4
+ data.tar.gz: e13a023541c496eb1f6af0210a29b1838d2c9ced
5
5
  SHA512:
6
- metadata.gz: 6a591fa1e1fb0edf29e92640e2b5a6032cd028b68851e0a2281c6bdfc68bd0c84bc32c4cb3dfdb0381d8ea24ae6cfce20d467a183272bb97a754da3ee761869c
7
- data.tar.gz: f72b8c573fc2c40a0bf3e34b47c295662a8db03ccecfc56805d21122f75b73260c5ca9879238e12b706a45e4e416cead1a4aef0f6b1942258082b302398b8255
6
+ metadata.gz: a098a18a59d1e23a3d90bb8d3151e287c454a71732984de267a65e9457d51cc58078dd3154514bf26d9f4e605b045c658fdd8601094b90405967bb5ace355cb0
7
+ data.tar.gz: a9f65456c7d618ec2e379736d02c5ca4851ced152ba0ff5a4b65fc5fbfda5640572331ec81dccf2d2b53cf9042bdcf04d4b34fab2a1599c72002567ae81c98ce
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', '>= 0.0.3'`
7
+ 1. 在 `Gemfile` 里引用我: `gem 'rails-assets-for-upyun', '>= 0.0.5'`
8
8
  2. 首先设置好在生产环境中调用 UpYun 上的资源
9
9
 
10
10
  ```
@@ -1,6 +1,7 @@
1
1
  class RailsAssetsForUpyun
2
2
  def self.publish(bucket, username, password, bucket_path="/", localpath='public', upyun_ap="http://v0.api.upyun.com")
3
- Dir[File.join localpath, "**", "*"].select{|f| File.file? f }.each do |file|
3
+ # http://stackoverflow.com/questions/357754/can-i-traverse-symlinked-directories-in-ruby-with-a-glob
4
+ Dir[File.join localpath, "**{,/*/**}/*"].select{|f| File.file? f}.each do |file|
4
5
  url = URI.encode "/#{bucket}#{bucket_path}#{file[localpath.to_s.size + 1 .. -1]}"
5
6
  date = Time.now.httpdate
6
7
  size = RestClient.head("#{upyun_ap}#{url}", {\
@@ -15,7 +16,7 @@ class RailsAssetsForUpyun
15
16
  end
16
17
  unless size == (file_size = File.size file)
17
18
  file_content = File.read(file)
18
- p "uploading #{file}.."
19
+ puts "uploading #{file}.."
19
20
  RestClient.put("#{upyun_ap}#{url}", file_content,{\
20
21
  Authorization: "UpYun #{username}:#{signature 'PUT', url, date, file_size, password}",
21
22
  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.3"
6
+ s.version = "0.0.5"
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.3
4
+ version: 0.0.5
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-20 00:00:00.000000000 Z
11
+ date: 2014-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client