dropbox 0.0.8 → 0.0.9

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.
@@ -1,5 +1,9 @@
1
+ == 0.0.9 (April 16, 2010):
2
+ * Really fixed bug with empty stats (chrissearle)
3
+ * Fixed a bug uploading files (Luka87)
4
+
1
5
  == 0.0.8 (March 12, 2010):
2
- * Fixed bug with empty stats
6
+ * Fixed bug with empty stats (chrissearle)
3
7
 
4
8
  == 0.0.7 (March 11, 2010):
5
9
  * Fixed stats
@@ -15,6 +15,8 @@ A simple stop-gap Ruby API for DropBox. Hopefully DropBox will release a real A
15
15
  d.create("/local/path/to/file.txt","/testdirectory") # upload a file to the directory
16
16
  d.rename("/testdirectory/file.txt","file.txt") # rename the file
17
17
  d.destroy("file.txt") # remove the file
18
+ d.usage_stats
19
+ # => {:regular_used=>18.6, :shared_used=>670.2, :free=>1359.2, :used=>688.8, :percent=>34%, :total=>2048.0}
18
20
 
19
- d2 = d = DropBox.new("you@email.com","password!", "optional_namespace") # all actions will happen in /optional_namesapce
21
+ d2 = DropBox.new("you@email.com","password!", "optional_namespace") # all actions will happen in /optional_namespace
20
22
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
@@ -158,7 +158,7 @@ class DropBox
158
158
  stats[:regular_used] = regular_data[0].to_f * ((regular_data[1] == "G") ? 1024 : 1) unless regular_data.nil?
159
159
 
160
160
  shared_data = stats_page.at('span.bar-graph-legend.bar-graph-shared').next.content.scan(/\((\d+(?:\.\d+)?)([MG])B/)[0]
161
- stats[:shared_used] = shared_data[0].to_f * ((shared_data[1] == "G") ? 1024 : 1) unless regular_data.nil?
161
+ stats[:shared_used] = shared_data[0].to_f * ((shared_data[1] == "G") ? 1024 : 1) unless shared_data.nil?
162
162
 
163
163
  return stats
164
164
  end
@@ -167,11 +167,12 @@ class DropBox
167
167
  def namespace_path(path)
168
168
  # remove the start slash if we have one
169
169
  path.gsub(/^\//,"")
170
- if @folder_namespace.empty?
170
+ new_path = if @folder_namespace.empty?
171
171
  "/#{path}"
172
172
  else
173
- "/#{@folder_namespace}/#{path}"
173
+ "/#{@folder_namespace}/#{path}"
174
174
  end
175
+ new_path.gsub("//","/")
175
176
  end
176
177
 
177
178
  def normalize_namespace(file)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 8
9
- version: 0.0.8
8
+ - 9
9
+ version: 0.0.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Tys von Gaza
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-03-12 00:00:00 -07:00
20
+ date: 2010-04-16 00:00:00 -06:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency