ruby-box 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.markdown +1 -1
- data/VERSION +1 -1
- data/lib/ruby-box/collaboration.rb +4 -0
- data/lib/ruby-box/comment.rb +4 -0
- data/lib/ruby-box/discussion.rb +4 -0
- data/lib/ruby-box/event.rb +0 -7
- data/lib/ruby-box/event_response.rb +1 -5
- data/lib/ruby-box/file.rb +4 -0
- data/lib/ruby-box/folder.rb +4 -0
- data/lib/ruby-box/item.rb +3 -3
- data/lib/ruby-box/web_link.rb +0 -7
- data/ruby-box.gemspec +3 -2
- data/spec/integration_spec.rb +2 -2
- data/spec/item_spec.rb +31 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTc3YWExYjRlZWQyZDQyMjM3M2YxNTBhOGVhNmM2OTc2ZGM4YjIxMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmE2M2M2Njg3OWIxYjgyNWUzMzNmMzc2OGFjMzZlZGM5MGIzNmMyNA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTZiZTZjMzM1MmE1M2M1OGRhYzcwMzlmOTk2MzVlOGRjYjE4ZGZmOWY3YmRh
|
10
|
+
ZWExZDljOTc4YzQzZGMyNjU2ZWEzZmZmNjkwMDQxNTIyM2RjNzM3OTRhMmE0
|
11
|
+
NmZlOGE4YTk3NjNjNGY2NTgxN2Y4MzExNzVkMDRjYmIxNzYxODE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2RiOWE4NzNkYmNkMWUxMWQ3YTk3YTc3ODA0OGVmOTZiYTg3NGRhYTEwZDE5
|
14
|
+
N2VjODVkOTliZmNmYzJmMmIxODMzZGEyMWE1Mjg4ZTFhNjUyNWJjYzU0MmZm
|
15
|
+
MzU5NTJkMTY0MThmM2E4MGIxNTE2YzVlYjZiODc1MzMwYWY5ZTE=
|
data/README.markdown
CHANGED
@@ -144,7 +144,7 @@ end
|
|
144
144
|
|
145
145
|
```ruby
|
146
146
|
file = client.file('/image_folder/an-image.jpg').create_shared_link
|
147
|
-
p file.shared_link
|
147
|
+
p file.shared_link.url # https://www.box.com/s/d6de3224958c1755412
|
148
148
|
```
|
149
149
|
|
150
150
|
Search
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.6.0
|
data/lib/ruby-box/comment.rb
CHANGED
data/lib/ruby-box/discussion.rb
CHANGED
data/lib/ruby-box/event.rb
CHANGED
data/lib/ruby-box/file.rb
CHANGED
data/lib/ruby-box/folder.rb
CHANGED
data/lib/ruby-box/item.rb
CHANGED
@@ -113,16 +113,16 @@ module RubyBox
|
|
113
113
|
protected
|
114
114
|
|
115
115
|
def self.factory(session, entry)
|
116
|
-
type = entry['type'] ? entry['type'].capitalize.to_sym : nil
|
116
|
+
type = entry['type'] ? entry['type'].split('_').map(&:capitalize).join('').to_sym : nil
|
117
117
|
if RubyBox.constants.include? type
|
118
118
|
RubyBox.const_get(type).new(session, entry)
|
119
119
|
else
|
120
|
-
entry
|
120
|
+
RubyBox::Item.new(session, entry)
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
124
|
def has_mini_format?
|
125
|
-
|
125
|
+
false
|
126
126
|
end
|
127
127
|
|
128
128
|
private
|
data/lib/ruby-box/web_link.rb
CHANGED
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.
|
8
|
+
s.version = "1.6.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-07-
|
12
|
+
s.date = "2013-07-16"
|
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 = [
|
@@ -48,6 +48,7 @@ Gem::Specification.new do |s|
|
|
48
48
|
"spec/helper/account.example",
|
49
49
|
"spec/helper/account.rb",
|
50
50
|
"spec/integration_spec.rb",
|
51
|
+
"spec/item_spec.rb",
|
51
52
|
"spec/me_spec.rb",
|
52
53
|
"spec/spec_helper.rb"
|
53
54
|
]
|
data/spec/integration_spec.rb
CHANGED
@@ -204,7 +204,7 @@ describe RubyBox, :skip => true do
|
|
204
204
|
folder = @client.create_folder('/ruby-box_gem_testing/shared_folder').create_shared_link
|
205
205
|
|
206
206
|
# share link was successfully created.
|
207
|
-
folder.shared_link
|
207
|
+
folder.shared_link.url.should match /https?:\/\/[\S]+/
|
208
208
|
|
209
209
|
# share link can be disabled.
|
210
210
|
folder.disable_shared_link
|
@@ -218,7 +218,7 @@ describe RubyBox, :skip => true do
|
|
218
218
|
file = @client.upload_file('spec/fixtures/' + utf8_file_name, '/ruby-box_gem_testing/cool stuff/').create_shared_link
|
219
219
|
|
220
220
|
# share link was successfully created.
|
221
|
-
file.shared_link
|
221
|
+
file.shared_link.url.should match /https?:\/\/[\S]+/
|
222
222
|
|
223
223
|
# share link can be disabled.
|
224
224
|
file.disable_shared_link
|
data/spec/item_spec.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
#encoding: UTF-8
|
2
|
+
|
3
|
+
require 'ruby-box'
|
4
|
+
require 'webmock/rspec'
|
5
|
+
|
6
|
+
describe RubyBox::Item do
|
7
|
+
|
8
|
+
before do
|
9
|
+
@session = RubyBox::Session.new
|
10
|
+
@client = RubyBox::Client.new(@session)
|
11
|
+
end
|
12
|
+
|
13
|
+
describe '#factory' do
|
14
|
+
|
15
|
+
it 'creates an object from a web_link hash' do
|
16
|
+
web_link = RubyBox::Item.factory(@session, {
|
17
|
+
'type' => 'web_link'
|
18
|
+
})
|
19
|
+
web_link.type.should == 'web_link'
|
20
|
+
web_link.instance_of?(RubyBox::WebLink).should == true
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'defaults to item object if unknown type' do
|
24
|
+
banana = RubyBox::Item.factory(@session, {
|
25
|
+
'type' => 'banana'
|
26
|
+
})
|
27
|
+
banana.type.should == 'banana'
|
28
|
+
banana.instance_of?(RubyBox::Item).should == true
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
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.
|
4
|
+
version: 1.6.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-07-
|
11
|
+
date: 2013-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multipart-post
|
@@ -161,6 +161,7 @@ files:
|
|
161
161
|
- spec/helper/account.example
|
162
162
|
- spec/helper/account.rb
|
163
163
|
- spec/integration_spec.rb
|
164
|
+
- spec/item_spec.rb
|
164
165
|
- spec/me_spec.rb
|
165
166
|
- spec/spec_helper.rb
|
166
167
|
homepage: http://github.com/attachmentsme/ruby-box
|