boxnet 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Boxnet
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
data/lib/boxnet.rb CHANGED
@@ -41,7 +41,7 @@ module Boxnet
41
41
  params_string = params.join(",")
42
42
  raw_result = get(@@URL + "?api_key=#{@@API_KEY}&action=get_account_tree&auth_token=#{auth_token}&folder_id=#{folder_id}&params[]=#{params_string}")
43
43
  end
44
-
44
+
45
45
  Result.new(raw_result)
46
46
  end
47
47
  end
data/lib/file_node.rb CHANGED
@@ -3,13 +3,15 @@ module Boxnet
3
3
  attr :files, :folders
4
4
 
5
5
  def process_node(data)
6
+ return data.nil?
6
7
  @files = []
7
- @folders = []
8
-
9
- if data["folder"]
8
+ @folders = []
9
+
10
+ if data.has_key?("folder")
10
11
  self.folders << Folder.new(data["folder"])
11
- elsif data["folders"]
12
+ elsif data.has_key?("folders")
12
13
  folder = data["folders"]["folder"]
14
+
13
15
  if folder.class == Array
14
16
  folder.each do |f|
15
17
  self.folders << Folder.new(f)
@@ -19,8 +21,9 @@ module Boxnet
19
21
  end
20
22
  end
21
23
 
22
- if data["files"]
24
+ if data.has_key?("files")
23
25
  file = data["files"]["file"]
26
+
24
27
  if file.class == Array
25
28
  file.each do |f|
26
29
  self.files << File.new(f)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: boxnet
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.6
5
+ version: 0.0.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jonathan Birkholz
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-11-25 00:00:00 Z
13
+ date: 2011-12-05 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec