ruby-box 1.9.3 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODE3OWJkYWM1ZTZkNzU5NjczZGU3Yzk5Y2I1MjZkNjhiZWI2OGIwZQ==
4
+ MjMyZTQ5ZjBiOTU5NWI0YWM0YTY3MjY2MGQ1NjIyOTIxNmExZWFmZQ==
5
5
  data.tar.gz: !binary |-
6
- NzYxZjVkNWJiZDg2MDdiYTVmMmI5ZDg3MjQwZGIzNzNiMjRiNTQxYg==
6
+ OTI5MzI1N2IwM2NjOTUxZjEwYmI5NGM2NWEzOTc5YTY3MTRhNjI2ZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZWU0ZjE0YzVjZmNiMGEyZmU3NmNiNWE2ZjRiMDlkYmIyNTY5Mjc2MTRhZTdm
10
- NGE1NWMyZGYwNDM4MTRmZWI5ZmU5MTM4ZDYzZjQxMmJiZjBhOWQ0ODRiYjdh
11
- NTVmNDE3OWZkNTlmZTJiZTA1NTU5MjQ2MzNkNmY0MWI5ZGYxNzc=
9
+ NTI2OTUwMTQ1YWM5MGMzNTZjMjlhYzhiYjE1MWJjOTI1MWQ2NTg5Yzg2NzQ0
10
+ NzE0MGQwN2EwMDIyNDI2OTA4ZTQ4MWU1NGFiNzM5OWFjYWZjMjkzZjFkM2Zk
11
+ NmNkNzY3MGRmZWYzOTUzYzI3MTMzODcwYTA2ZWJkYjg3M2E5MGY=
12
12
  data.tar.gz: !binary |-
13
- MjVmYjNkMjQ4NmMyNmJlMDczZmY5YTQ5ODE1ZmY4MTExMTkwZWMyMWQ3ZGVm
14
- MGRlZDlkZGJkMDM4ZDk1ZGJhZTI5ZmU4ZTk4ZDc3ZmEwOGZjYmM3YjYxYWQ1
15
- MWIyM2Y1NDY5OTdjOWUwY2M2MzYwNWNhMzk1OWNhZWUyZjA3M2E=
13
+ MjUxNzdjNDk5NTZiMGYyZTRkNGVhY2E5ZTRmNTI1ZThlOWFhYmFiNDFiNzU3
14
+ Y2RjMGM5ZDlkNTQyOTQxM2NiODA0Y2U0MzNkOGU2ODkwNzQ0ODAwYWM1MTEz
15
+ YWMyNjRjOGE3YzFlODhjZTY5MjQ2NjkwZDIyYjMwNTk1ZGMwYTA=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.9.3
1
+ 1.10.0
data/lib/ruby-box.rb CHANGED
@@ -12,6 +12,7 @@ require 'ruby-box/exceptions'
12
12
  require 'ruby-box/event_response'
13
13
  require 'ruby-box/event'
14
14
  require 'ruby-box/web_link'
15
+ require 'ruby-box/shared_link'
15
16
 
16
17
  module RubyBox
17
18
  API_URL = 'https://api.box.com/2.0'
data/lib/ruby-box/item.rb CHANGED
@@ -110,6 +110,11 @@ module RubyBox
110
110
  create_shared_link(nil)
111
111
  end
112
112
 
113
+ def shared_link
114
+ return nil unless @raw_item['shared_link']
115
+ RubyBox::Item.factory(@session, @raw_item['shared_link'].merge('type' => 'shared_link'))
116
+ end
117
+
113
118
  protected
114
119
 
115
120
  def self.factory(session, entry)
@@ -125,6 +130,10 @@ module RubyBox
125
130
  false
126
131
  end
127
132
 
133
+ def as_json(opts={})
134
+ @raw_item
135
+ end
136
+
128
137
  private
129
138
 
130
139
  def many(key)
@@ -0,0 +1,10 @@
1
+ module RubyBox
2
+ class SharedLink < Item
3
+
4
+ private
5
+
6
+ def has_mini_format?
7
+ false
8
+ end
9
+ end
10
+ end
data/ruby-box.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "ruby-box"
8
- s.version = "1.9.3"
8
+ s.version = "1.10.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Attachments.me"]
12
- s.date = "2013-08-07"
12
+ s.date = "2013-08-08"
13
13
  s.description = "ruby gem for box.com 2.0 api"
14
14
  s.email = "ben@attachments.me"
15
15
  s.extra_rdoc_files = [
@@ -36,6 +36,7 @@ Gem::Specification.new do |s|
36
36
  "lib/ruby-box/folder.rb",
37
37
  "lib/ruby-box/item.rb",
38
38
  "lib/ruby-box/session.rb",
39
+ "lib/ruby-box/shared_link.rb",
39
40
  "lib/ruby-box/user.rb",
40
41
  "lib/ruby-box/web_link.rb",
41
42
  "ruby-box.gemspec",
@@ -214,7 +214,8 @@ describe RubyBox, :skip => true do
214
214
 
215
215
  # share link was successfully created.
216
216
  folder.shared_link.url.should match /https?:\/\/[\S]+/
217
-
217
+ folder.shared_link.is_a?(RubyBox::SharedLink).should == true
218
+
218
219
  # share link can be disabled.
219
220
  folder.disable_shared_link
220
221
  folder.shared_link.should == nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-box
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.3
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Attachments.me
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-07 00:00:00.000000000 Z
11
+ date: 2013-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multipart-post
@@ -149,6 +149,7 @@ files:
149
149
  - lib/ruby-box/folder.rb
150
150
  - lib/ruby-box/item.rb
151
151
  - lib/ruby-box/session.rb
152
+ - lib/ruby-box/shared_link.rb
152
153
  - lib/ruby-box/user.rb
153
154
  - lib/ruby-box/web_link.rb
154
155
  - ruby-box.gemspec