rscribd 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/README.txt +1 -1
- data/Rakefile +1 -1
- data/lib/scribdapi.rb +5 -7
- data/lib/scribdresource.rb +5 -4
- metadata +7 -5
data/History.txt
CHANGED
data/README.txt
CHANGED
data/Rakefile
CHANGED
data/lib/scribdapi.rb
CHANGED
@@ -94,13 +94,11 @@ module Scribd
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
-
|
98
|
-
nil_fields.each { |key| fields.delete key }
|
97
|
+
fields.reject! { |k, v| v.nil? }
|
99
98
|
|
100
99
|
# Don't include file in parameters to calculate signature
|
101
|
-
sign_fields =
|
102
|
-
|
103
|
-
#fields.delete_if {|k,v| k=='file'}
|
100
|
+
sign_fields = fields.dup
|
101
|
+
sign_fields.delete 'file'
|
104
102
|
|
105
103
|
fields['api_sig'] = sign(sign_fields)
|
106
104
|
debug("** POST parameters: #{fields.inspect}")
|
@@ -212,8 +210,8 @@ module Scribd
|
|
212
210
|
#
|
213
211
|
# Parameters:
|
214
212
|
# args - content to output
|
215
|
-
def debug(
|
216
|
-
$stderr.puts(
|
213
|
+
def debug(str)
|
214
|
+
$stderr.puts(str) if @debug
|
217
215
|
end
|
218
216
|
end
|
219
217
|
end
|
data/lib/scribdresource.rb
CHANGED
@@ -143,14 +143,15 @@ module Scribd
|
|
143
143
|
def load_attributes(xml)
|
144
144
|
@attributes.clear
|
145
145
|
xml.each_element do |element|
|
146
|
+
text = element.text.chomp.strip.empty? ? element.cdatas.first.value : element.text
|
146
147
|
@attributes[element.name.to_sym] = if element.attributes['type'] == 'integer' then
|
147
|
-
|
148
|
+
text.to_i
|
148
149
|
elsif element.attributes['type'] == 'float' then
|
149
|
-
|
150
|
+
text.to_f
|
150
151
|
elsif element.attributes['type'] == 'symbol' then
|
151
|
-
|
152
|
+
text.to_sym
|
152
153
|
else
|
153
|
-
|
154
|
+
text
|
154
155
|
end
|
155
156
|
end
|
156
157
|
end
|
metadata
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rscribd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
platform:
|
4
|
+
version: 0.0.5
|
5
|
+
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jared Friedman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-09-25 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mime-types
|
17
|
+
type: :runtime
|
17
18
|
version_requirement:
|
18
19
|
version_requirements: !ruby/object:Gem::Requirement
|
19
20
|
requirements:
|
@@ -23,12 +24,13 @@ dependencies:
|
|
23
24
|
version:
|
24
25
|
- !ruby/object:Gem::Dependency
|
25
26
|
name: hoe
|
27
|
+
type: :development
|
26
28
|
version_requirement:
|
27
29
|
version_requirements: !ruby/object:Gem::Requirement
|
28
30
|
requirements:
|
29
31
|
- - ">="
|
30
32
|
- !ruby/object:Gem::Version
|
31
|
-
version: 1.
|
33
|
+
version: 1.7.0
|
32
34
|
version:
|
33
35
|
description: "== DESCRIPTION: This gem provides a simple and powerful library for the Scribd API, allowing you to write Ruby applications or Ruby on Rails websites that upload, convert, display, search, and control documents in many formats. For more information on the Scribd platform, visit http://www.scribd.com/platform == FEATURES: * Upload your documents to Scribd's servers and access them using the gem * Upload local files or from remote web sites * Search, tag, and organize documents * Associate documents with your users' accounts"
|
34
36
|
email: api@scribd.com
|
@@ -79,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
81
|
requirements: []
|
80
82
|
|
81
83
|
rubyforge_project: rscribd
|
82
|
-
rubygems_version:
|
84
|
+
rubygems_version: 1.2.0
|
83
85
|
signing_key:
|
84
86
|
specification_version: 2
|
85
87
|
summary: Ruby client library for the Scribd API
|