boxnet 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.
data/boxnet.gemspec CHANGED
@@ -4,7 +4,7 @@ require "boxnet/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "boxnet"
7
- s.version = Boxnet::VERSION
7
+ s.version = BoxnetApi::VERSION
8
8
  s.authors = ["Jonathan Birkholz"]
9
9
  s.email = ["rookieone@gmail.com"]
10
10
  s.homepage = ""
@@ -1,3 +1,3 @@
1
- module Boxnet
2
- VERSION = "0.0.10"
1
+ module BoxnetApi
2
+ VERSION = "0.0.11"
3
3
  end
data/lib/boxnet.rb CHANGED
@@ -7,7 +7,7 @@ require 'folder'
7
7
  require 'file'
8
8
  require 'ticket'
9
9
 
10
- module Boxnet
10
+ module BoxnetApi
11
11
  class Client
12
12
  include HTTParty
13
13
  @@API_KEY = nil
data/lib/file.rb CHANGED
@@ -1,4 +1,4 @@
1
- module Boxnet
1
+ module BoxnetApi
2
2
  class File < FileNode
3
3
  attr :id, :name, :description, :file_count, :sha1, :size
4
4
  attr :tags, :shared, :created, :updated, :user_id, :shared_link
data/lib/file_node.rb CHANGED
@@ -1,4 +1,4 @@
1
- module Boxnet
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 << Boxnet::Folder.new(data["folder"])
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 << Boxnet::Folder.new(f)
18
+ self.folders << BoxnetApi::Folder.new(f)
19
19
  end
20
20
  elsif folder.class == Hash
21
- self.folders << Boxnet::Folder.new(folder)
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 << Boxnet::File.new(f)
30
+ self.files << BoxnetApi::File.new(f)
31
31
  end
32
32
  elsif file.class == Hash
33
- self.files << Boxnet::File.new(file)
33
+ self.files << BoxnetApi::File.new(file)
34
34
  end
35
35
  end
36
36
  end
data/lib/file_tree.rb CHANGED
@@ -1,4 +1,4 @@
1
- module Boxnet
1
+ module BoxnetApi
2
2
  class FileTree < FileNode
3
3
 
4
4
  def initialize(raw_result)
data/lib/folder.rb CHANGED
@@ -1,4 +1,4 @@
1
- module Boxnet
1
+ module BoxnetApi
2
2
  class Folder < FileNode
3
3
  attr :id, :name, :description, :file_count, :user_id
4
4
  attr :shared, :shared_link, :permission, :size, :created, :updated
data/lib/result.rb CHANGED
@@ -1,11 +1,11 @@
1
- module Boxnet
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 = ::Boxnet::FileTree.new(raw_result)
8
+ @file_tree = BoxnetApi::FileTree.new(raw_result)
9
9
  end
10
10
  end
11
11
 
data/lib/ticket.rb CHANGED
@@ -1,4 +1,4 @@
1
- module Boxnet
1
+ module BoxnetApi
2
2
  class Ticket
3
3
  attr :ticket, :status
4
4
 
@@ -2,13 +2,13 @@ require 'spec_helper'
2
2
 
3
3
  describe "get account tree" do
4
4
  before(:each) do
5
- Boxnet::Client.API_KEY = ENV["BOXNET_API_KEY"]
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 = Boxnet::Client.get_account_tree(@auth_token, "0")
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 = Boxnet::Client.get_account_tree(@auth_token, "0")
19
+ @result = BoxnetApi::Client.get_account_tree(@auth_token, "0")
20
20
  end
21
21
  it { @result.should_not be_nil }
22
22
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: boxnet
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.10
5
+ version: 0.0.11
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jonathan Birkholz