bitballoon 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bitballoon/site.rb +8 -4
- data/lib/bitballoon/version.rb +1 -1
- metadata +2 -2
data/lib/bitballoon/site.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
23
|
-
|
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
|
data/lib/bitballoon/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2013-10-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth2
|