boxnet 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/boxnet.gemspec +1 -1
- data/lib/boxnet/version.rb +2 -2
- data/lib/boxnet.rb +1 -1
- data/lib/file.rb +1 -1
- data/lib/file_node.rb +6 -6
- data/lib/file_tree.rb +1 -1
- data/lib/folder.rb +1 -1
- data/lib/result.rb +2 -2
- data/lib/ticket.rb +1 -1
- data/spec/get_account_file_tree_spec.rb +3 -3
- metadata +1 -1
data/boxnet.gemspec
CHANGED
data/lib/boxnet/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module
|
2
|
-
VERSION = "0.0.
|
1
|
+
module BoxnetApi
|
2
|
+
VERSION = "0.0.11"
|
3
3
|
end
|
data/lib/boxnet.rb
CHANGED
data/lib/file.rb
CHANGED
data/lib/file_node.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module BoxnetApi
|
2
2
|
class FileNode
|
3
3
|
attr :files, :folders
|
4
4
|
|
@@ -9,16 +9,16 @@ module Boxnet
|
|
9
9
|
|
10
10
|
if data.has_key?("folder")
|
11
11
|
puts "1" if data["folder"].nil?
|
12
|
-
self.folders <<
|
12
|
+
self.folders << BoxnetApi::Folder.new(data["folder"])
|
13
13
|
elsif data.has_key?("folders")
|
14
14
|
folder = data["folders"]["folder"]
|
15
15
|
|
16
16
|
if folder.class == Array
|
17
17
|
folder.each do |f|
|
18
|
-
self.folders <<
|
18
|
+
self.folders << BoxnetApi::Folder.new(f)
|
19
19
|
end
|
20
20
|
elsif folder.class == Hash
|
21
|
-
self.folders <<
|
21
|
+
self.folders << BoxnetApi::Folder.new(folder)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -27,10 +27,10 @@ module Boxnet
|
|
27
27
|
|
28
28
|
if file.class == Array
|
29
29
|
file.each do |f|
|
30
|
-
self.files <<
|
30
|
+
self.files << BoxnetApi::File.new(f)
|
31
31
|
end
|
32
32
|
elsif file.class == Hash
|
33
|
-
self.files <<
|
33
|
+
self.files << BoxnetApi::File.new(file)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
data/lib/file_tree.rb
CHANGED
data/lib/folder.rb
CHANGED
data/lib/result.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
module
|
1
|
+
module BoxnetApi
|
2
2
|
class Result
|
3
3
|
attr :raw_result, :file_tree
|
4
4
|
|
5
5
|
def initialize(raw_result)
|
6
6
|
@raw_result = raw_result
|
7
7
|
unless status == "Wrong input"
|
8
|
-
@file_tree = ::
|
8
|
+
@file_tree = BoxnetApi::FileTree.new(raw_result)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
data/lib/ticket.rb
CHANGED
@@ -2,13 +2,13 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe "get account tree" do
|
4
4
|
before(:each) do
|
5
|
-
|
5
|
+
BoxnetApi::Client.API_KEY = ENV["BOXNET_API_KEY"]
|
6
6
|
end
|
7
7
|
|
8
8
|
context "entire tree from root" do
|
9
9
|
before(:each) do
|
10
10
|
@auth_token = "d402qzspvmk46zo6l59kcplaidmza76o"
|
11
|
-
@result =
|
11
|
+
@result = BoxnetApi::Client.get_account_tree(@auth_token, "0")
|
12
12
|
end
|
13
13
|
it { @result.should_not be_nil }
|
14
14
|
end
|
@@ -16,7 +16,7 @@ describe "get account tree" do
|
|
16
16
|
context "entire tree from root" do
|
17
17
|
before(:each) do
|
18
18
|
@auth_token = "vgp6hb8kjpxbctlmrrigdmvz2fyqpvib"
|
19
|
-
@result =
|
19
|
+
@result = BoxnetApi::Client.get_account_tree(@auth_token, "0")
|
20
20
|
end
|
21
21
|
it { @result.should_not be_nil }
|
22
22
|
end
|