bitballoon 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,17 +10,21 @@ module BitBalloon
10
10
  def upload_dir(dir)
11
11
  return unless state == "uploading"
12
12
 
13
- shas = {}
13
+ shas = Hash.new { [] }
14
14
  Dir[::File.join(dir, "**", "*")].each do |file|
15
15
  next unless ::File.file?(file)
16
16
  pathname = ::File.join("/", file[dir.length..-1])
17
17
  next if pathname.match(/(^\/?__MACOSX\/|\/\.)/)
18
- shas[Digest::SHA1.hexdigest(::File.read(file))] = pathname
18
+ sha = Digest::SHA1.hexdigest(::File.read(file))
19
+ shas[sha] = shas[sha] + [pathname]
19
20
  end
20
21
 
22
+
21
23
  (required || []).each do |sha|
22
- puts "Uploading #{shas[sha]}"
23
- client.request(:put, ::File.join(path, "files", URI.encode(shas[sha])), :body => ::File.read(::File.join(dir, shas[sha])), :headers => {"Content-Type" => "application/octet-stream"})
24
+ shas[sha].each do |pathname|
25
+ puts "Uploading #{pathname}"
26
+ client.request(:put, ::File.join(path, "files", URI.encode(pathname)), :body => ::File.read(::File.join(dir, pathname)), :headers => {"Content-Type" => "application/octet-stream"})
27
+ end
24
28
  end
25
29
 
26
30
  refresh
@@ -1,3 +1,3 @@
1
1
  module BitBalloon
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitballoon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-16 00:00:00.000000000 Z
12
+ date: 2013-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth2