rscribd 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ === 0.0.5 / 2008-09-25
2
+
3
+ * Updated RScribd to work with server-side API changes.
4
+
1
5
  === 0.0.4 / 2008-02-20
2
6
 
3
7
  * Fixed a bug that caused errors when Rails models shared the same name as Scribd objects.
data/README.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  = rscribd
2
2
 
3
- * 0.0.4 (Feb 20, 2007)
3
+ * 0.0.5 (Sep 25, 2007)
4
4
 
5
5
  == DESCRIPTION:
6
6
 
data/Rakefile CHANGED
@@ -3,7 +3,7 @@
3
3
  require 'rubygems'
4
4
  require 'hoe'
5
5
 
6
- Hoe.new('rscribd', '0.0.4') do |p|
6
+ Hoe.new('rscribd', '0.0.5') do |p|
7
7
  p.rubyforge_name = 'rscribd'
8
8
  p.author = 'Jared Friedman'
9
9
  p.email = 'api@scribd.com'
@@ -94,13 +94,11 @@ module Scribd
94
94
  end
95
95
  end
96
96
 
97
- nil_fields = fields.keys.select { |key| fields[key] == nil }
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
- fields.map {|k,v| sign_fields[k] = v if k != 'file' }
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(*args)
216
- $stderr.puts(sprintf(*args)) if @debug
213
+ def debug(str)
214
+ $stderr.puts(str) if @debug
217
215
  end
218
216
  end
219
217
  end
@@ -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
- element.text.to_i
148
+ text.to_i
148
149
  elsif element.attributes['type'] == 'float' then
149
- element.text.to_f
150
+ text.to_f
150
151
  elsif element.attributes['type'] == 'symbol' then
151
- element.text.to_sym
152
+ text.to_sym
152
153
  else
153
- element.text
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.4
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-02-20 00:00:00 -08:00
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.5.0
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: 0.9.5
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