vuzitruby 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +3 -2
- data/bin/vuzitcl +2 -2
- data/lib/vuzitruby/base.rb +8 -3
- data/lib/vuzitruby/service.rb +1 -1
- metadata +2 -2
data/README
CHANGED
@@ -45,7 +45,8 @@ Find Document Example - how to load a document:
|
|
45
45
|
Vuzit::Service.public_key = 'YOUR_PUBLIC_API_KEY'
|
46
46
|
Vuzit::Service.private_key = 'YOUR_PRIVATE_API_KEY'
|
47
47
|
|
48
|
-
doc = Vuzit::Document
|
48
|
+
doc = Vuzit::Document.find("DOCUMENT_ID")
|
49
|
+
|
49
50
|
puts "Document id: " + doc.id
|
50
51
|
puts "Document title: " + doc.title
|
51
52
|
|
@@ -56,7 +57,7 @@ Delete (destroy) Document Example:
|
|
56
57
|
Vuzit::Service.public_key = 'YOUR_PUBLIC_API_KEY'
|
57
58
|
Vuzit::Service.private_key = 'YOUR_PRIVATE_API_KEY'
|
58
59
|
|
59
|
-
doc = Vuzit::Document
|
60
|
+
doc = Vuzit::Document.destroy("DOCUMENT_ID")
|
60
61
|
|
61
62
|
Upload and View with the JavaScript API Example for a Rails RHTML file:
|
62
63
|
|
data/bin/vuzitcl
CHANGED
@@ -27,7 +27,7 @@ def global_parameters_load(args)
|
|
27
27
|
options.key = value
|
28
28
|
end
|
29
29
|
|
30
|
-
opts.on("-
|
30
|
+
opts.on("-u", "--service-url=URL", "Sets the service URL") do |value|
|
31
31
|
options.service_url = value
|
32
32
|
end
|
33
33
|
end
|
@@ -47,7 +47,7 @@ def global_parameters_load(args)
|
|
47
47
|
|
48
48
|
Vuzit::Service.public_key = keys[0]
|
49
49
|
Vuzit::Service.private_key = keys[1]
|
50
|
-
Vuzit::Service.user_agent = "VuzitCL Ruby 1.1
|
50
|
+
Vuzit::Service.user_agent = "VuzitCL Ruby 1.2.1"
|
51
51
|
|
52
52
|
if options.service_url != nil
|
53
53
|
Vuzit::Service.service_url = options.service_url
|
data/lib/vuzitruby/base.rb
CHANGED
@@ -26,6 +26,9 @@ module Vuzit
|
|
26
26
|
result.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
27
27
|
result.use_ssl = true
|
28
28
|
end
|
29
|
+
# This compensates for the occassional load delay that the Net::HTTP
|
30
|
+
# library does not tolerate unless it is set.
|
31
|
+
result.read_timeout = 15 * 60
|
29
32
|
|
30
33
|
return result
|
31
34
|
end
|
@@ -51,8 +54,12 @@ module Vuzit
|
|
51
54
|
def self.parameters_to_url(resource, params, id = nil, extension = 'xml')
|
52
55
|
params = parameters_clean(params)
|
53
56
|
|
57
|
+
# The Ruby HTTP library does not want the "http://domain.com" in the
|
58
|
+
# URL as most other libraries do. If the service URL is provided
|
59
|
+
# then less tolerant web servers like IIS will reject it.
|
54
60
|
result = ''
|
55
|
-
result <<
|
61
|
+
result << "/" << resource
|
62
|
+
|
56
63
|
result << ("/" << id) if !id.nil?
|
57
64
|
result << "." << extension << "?"
|
58
65
|
|
@@ -91,8 +98,6 @@ module Vuzit
|
|
91
98
|
|
92
99
|
http = http_connection
|
93
100
|
|
94
|
-
# API methods can be slow.
|
95
|
-
http.read_timeout = 15 * 60
|
96
101
|
request = Net::HTTP::Post.new('/documents', {'User-Agent' => Vuzit::Service.user_agent})
|
97
102
|
request.multipart_params = parameters_clean(fields)
|
98
103
|
|
data/lib/vuzitruby/service.rb
CHANGED
@@ -47,7 +47,7 @@ module Vuzit
|
|
47
47
|
@@public_key = nil
|
48
48
|
@@private_key = nil
|
49
49
|
@@service_url = 'http://vuzit.com'
|
50
|
-
@@product_name = 'VuzitRuby Library 1.2.
|
50
|
+
@@product_name = 'VuzitRuby Library 1.2.1'
|
51
51
|
@@user_agent = @@product_name
|
52
52
|
|
53
53
|
# TODO: For all of the set variables do not allow nil values
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vuzitruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brent Matzelle
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-31 00:00:00 -04:00
|
13
13
|
default_executable: vuzitcl
|
14
14
|
dependencies: []
|
15
15
|
|