cloudapp_api 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/cloudapp_api.gemspec +2 -2
  3. data/lib/cloudapp/drop.rb +52 -4
  4. metadata +29 -29
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
data/cloudapp_api.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "cloudapp_api"
8
- s.version = "0.3.2"
8
+ s.version = "0.3.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Aaron Russell"]
12
- s.date = "2011-10-14"
12
+ s.date = "2011-11-09"
13
13
  s.description = "A simple Ruby wrapper for the CloudApp API. Uses HTTParty with a simple ActiveResource-like interface."
14
14
  s.email = "aaron@gc4.co.uk"
15
15
  s.extra_rdoc_files = [
data/lib/cloudapp/drop.rb CHANGED
@@ -177,6 +177,13 @@ module CloudApp
177
177
  self.class.recover self.href
178
178
  end
179
179
 
180
+ # Is the drop an image?
181
+ #
182
+ # @return [Boolean]
183
+ def image?
184
+ item_type == 'image'
185
+ end
186
+
180
187
  # Is the drop a bookmark?
181
188
  #
182
189
  # @return [Boolean]
@@ -184,13 +191,54 @@ module CloudApp
184
191
  item_type == 'bookmark'
185
192
  end
186
193
 
187
- # Is the drop an image?
194
+ # Is the drop a text file?
188
195
  #
189
196
  # @return [Boolean]
190
- def image?
191
- item_type == 'image'
197
+ def text?
198
+ item_type == 'text'
199
+ end
200
+
201
+ # Is the drop an archive?
202
+ #
203
+ # @return [Boolean]
204
+ def archive?
205
+ item_type == 'archive'
192
206
  end
193
-
207
+
208
+ # Is the drop an audio file?
209
+ #
210
+ # @return [Boolean]
211
+ def audio?
212
+ item_type == 'audio'
213
+ end
214
+
215
+ # Is the drop a video file?
216
+ #
217
+ # @return [Boolean]
218
+ def video?
219
+ item_type == 'video'
220
+ end
221
+
222
+ # Is the drop an unknown file type?
223
+ #
224
+ # @return [Boolean]
225
+ def unknown?
226
+ item_type == 'unknown'
227
+ end
228
+
229
+ # Return the drops raw data as a string, useful for returning the text of documents
230
+ #
231
+ # @return [String]
232
+ def raw
233
+ @raw ||= HTTParty.get(content_url).to_s
234
+ end
235
+
236
+ private
237
+
238
+ def extension
239
+ File.extname(content_url)[1..-1].to_s.downcase if content_url
240
+ end
241
+
194
242
  end
195
243
 
196
244
  # The Item class is now deprecated in favour of the Drop class.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudapp_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-14 00:00:00.000000000Z
12
+ date: 2011-11-09 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
16
- requirement: &70159207985200 !ruby/object:Gem::Requirement
16
+ requirement: &2246831460 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.6.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70159207985200
24
+ version_requirements: *2246831460
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mime-types
27
- requirement: &70159207984440 !ruby/object:Gem::Requirement
27
+ requirement: &2246830880 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70159207984440
35
+ version_requirements: *2246830880
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70159207983240 !ruby/object:Gem::Requirement
38
+ requirement: &2246830340 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.1.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70159207983240
46
+ version_requirements: *2246830340
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: fakeweb
49
- requirement: &70159207982080 !ruby/object:Gem::Requirement
49
+ requirement: &2246829800 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70159207982080
57
+ version_requirements: *2246829800
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: yard
60
- requirement: &70159207981100 !ruby/object:Gem::Requirement
60
+ requirement: &2246829100 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.6.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70159207981100
68
+ version_requirements: *2246829100
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bluecloth
71
- requirement: &70159207980260 !ruby/object:Gem::Requirement
71
+ requirement: &2246828520 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70159207980260
79
+ version_requirements: *2246828520
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: cucumber
82
- requirement: &70159207979320 !ruby/object:Gem::Requirement
82
+ requirement: &2246827840 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70159207979320
90
+ version_requirements: *2246827840
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: bundler
93
- requirement: &70159207963980 !ruby/object:Gem::Requirement
93
+ requirement: &2246827080 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 1.0.0
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70159207963980
101
+ version_requirements: *2246827080
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: jeweler
104
- requirement: &70159207962920 !ruby/object:Gem::Requirement
104
+ requirement: &2246826440 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: 1.5.1
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70159207962920
112
+ version_requirements: *2246826440
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rcov
115
- requirement: &70159207962180 !ruby/object:Gem::Requirement
115
+ requirement: &2246825840 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70159207962180
123
+ version_requirements: *2246825840
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: httparty
126
- requirement: &70159207955720 !ruby/object:Gem::Requirement
126
+ requirement: &2246825240 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: 0.6.0
132
132
  type: :runtime
133
133
  prerelease: false
134
- version_requirements: *70159207955720
134
+ version_requirements: *2246825240
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: rspec
137
- requirement: &70159207954400 !ruby/object:Gem::Requirement
137
+ requirement: &2246824620 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ~>
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: 2.1.0
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *70159207954400
145
+ version_requirements: *2246824620
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: yard
148
- requirement: &70159207953080 !ruby/object:Gem::Requirement
148
+ requirement: &2246823840 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ~>
@@ -153,7 +153,7 @@ dependencies:
153
153
  version: 0.6.0
154
154
  type: :development
155
155
  prerelease: false
156
- version_requirements: *70159207953080
156
+ version_requirements: *2246823840
157
157
  description: A simple Ruby wrapper for the CloudApp API. Uses HTTParty with a simple
158
158
  ActiveResource-like interface.
159
159
  email: aaron@gc4.co.uk
@@ -224,7 +224,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
224
224
  version: '0'
225
225
  segments:
226
226
  - 0
227
- hash: 1025824897898580958
227
+ hash: -4572567371114008398
228
228
  required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  none: false
230
230
  requirements: