fogbugz 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/fogbugz-areas +19 -27
- data/bin/fogbugz-assign +17 -19
- data/bin/fogbugz-categories +17 -19
- data/bin/fogbugz-close +16 -18
- data/bin/fogbugz-edit +84 -84
- data/bin/fogbugz-filter +30 -27
- data/bin/fogbugz-filters +23 -17
- data/bin/fogbugz-list +25 -27
- data/bin/fogbugz-login +24 -22
- data/bin/fogbugz-logoff +15 -15
- data/bin/fogbugz-milestones +20 -21
- data/bin/fogbugz-new +28 -29
- data/bin/fogbugz-people +18 -20
- data/bin/fogbugz-priorities +18 -19
- data/bin/fogbugz-projects +18 -20
- data/bin/fogbugz-reactivate +16 -18
- data/bin/fogbugz-reopen +16 -18
- data/bin/fogbugz-resolve +30 -30
- data/bin/fogbugz-show +70 -71
- data/bin/fogbugz-start +16 -17
- data/bin/fogbugz-statuses +19 -21
- data/bin/fogbugz-stop +15 -16
- metadata +4 -28
data/bin/fogbugz-new
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
require '
|
5
|
-
require '
|
4
|
+
require 'net/https'
|
5
|
+
require 'uri'
|
6
|
+
require 'rexml/document'
|
6
7
|
require 'tempfile'
|
7
8
|
require 'optparse'
|
8
9
|
require 'yaml'
|
@@ -15,7 +16,7 @@ unless api_url
|
|
15
16
|
end
|
16
17
|
|
17
18
|
api_token = ENV['FOGBUGZ_API_TOKEN']
|
18
|
-
unless
|
19
|
+
unless api_token
|
19
20
|
puts "Environment variable FOGBUGZ_API_TOKEN must be set."
|
20
21
|
exit 1
|
21
22
|
end
|
@@ -26,11 +27,6 @@ options = {}
|
|
26
27
|
optparse = OptionParser.new do |opts|
|
27
28
|
opts.banner = "usage: #{File::basename(__FILE__)} [options] [-|files]"
|
28
29
|
|
29
|
-
options[:verbose] = false
|
30
|
-
opts.on('-v', '--verbose', 'Output verbose debugging information.') do
|
31
|
-
options[:verbose] = true
|
32
|
-
end
|
33
|
-
|
34
30
|
opts.on_tail('-h', '--help') do
|
35
31
|
puts optparse.help
|
36
32
|
exit 1
|
@@ -134,32 +130,35 @@ if not data or data.empty?
|
|
134
130
|
exit 1
|
135
131
|
end
|
136
132
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
133
|
+
uri = URI format("#{api_url}?cmd=new&token=%s&%s%s%s%s%s%s%s%s%s%s%s",
|
134
|
+
URI.escape(api_token),
|
135
|
+
data['title'] ? URI.escape(data['title'].to_s) : '',
|
136
|
+
data['parent'] ? URI.escape(data['parent'].to_s) : '',
|
137
|
+
data['tags'] ? URI.escape(data['tags'].join(',')) : '',
|
138
|
+
data['project'] ? URI.escape(data['project'].to_s) : '',
|
139
|
+
data['area'] ? URI.escape(data['area'].to_s) : '',
|
140
|
+
data['milestone'] ? URI.escape(data['milestone'].to_s) : '',
|
141
|
+
data['category'] ? URI.escape(data['category'].to_s) : '',
|
142
|
+
data['assignee'] ? URI.escape(data['assignee'].to_s) : '',
|
143
|
+
data['priority'] ? URI.escape(data['priority'].to_s) : '',
|
144
|
+
data['estimate'] ? URI.escape(data['estimate'].to_s) : '',
|
145
|
+
data['body'] ? URI.escape(data['body'].to_s) : '')
|
146
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
147
|
+
if uri.scheme == 'https'
|
148
|
+
http.use_ssl = true
|
149
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
150
|
+
end
|
151
|
+
response = http.start { |h| h.request Net::HTTP::Get.new(uri.request_uri) }
|
152
|
+
if response.code != '200'
|
154
153
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
155
154
|
exit 1
|
156
155
|
end
|
157
156
|
|
158
|
-
result =
|
159
|
-
error = result.
|
157
|
+
result = REXML::Document.new(response.body)
|
158
|
+
error = result.elements['/response/error']
|
160
159
|
if error
|
161
|
-
puts "Failed with error: #{error.
|
160
|
+
puts "Failed with error: #{error.text}."
|
162
161
|
exit 1
|
163
162
|
end
|
164
163
|
|
165
|
-
puts "Case #{result.
|
164
|
+
puts "Case #{result.elements['/response/case'].attributes['ixBug']} created."
|
data/bin/fogbugz-people
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
require '
|
5
|
-
require '
|
4
|
+
require 'net/https'
|
5
|
+
require 'uri'
|
6
|
+
require 'rexml/document'
|
6
7
|
require 'optparse'
|
7
8
|
|
8
9
|
api_url = ENV['FOGBUGZ_API_URL']
|
@@ -12,7 +13,7 @@ unless api_url
|
|
12
13
|
end
|
13
14
|
|
14
15
|
api_token = ENV['FOGBUGZ_API_TOKEN']
|
15
|
-
unless
|
16
|
+
unless api_token
|
16
17
|
puts "Environment variable FOGBUGZ_API_TOKEN must be set."
|
17
18
|
exit 1
|
18
19
|
end
|
@@ -21,11 +22,6 @@ options = {}
|
|
21
22
|
optparse = OptionParser.new do |opts|
|
22
23
|
opts.banner = "usage: #{File::basename(__FILE__)} [options]"
|
23
24
|
|
24
|
-
options[:verbose] = false
|
25
|
-
opts.on('-v', '--verbose', 'Output verbose debugging information') do
|
26
|
-
options[:verbose] = true
|
27
|
-
end
|
28
|
-
|
29
25
|
opts.on_tail('-h', '--help') do
|
30
26
|
puts optparse.help
|
31
27
|
exit 1
|
@@ -33,25 +29,27 @@ optparse = OptionParser.new do |opts|
|
|
33
29
|
end
|
34
30
|
optparse.parse!
|
35
31
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
32
|
+
uri = URI format("#{api_url}?cmd=listPeople&token=%s", URI.escape(api_token))
|
33
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
34
|
+
if uri.scheme == 'https'
|
35
|
+
http.use_ssl = true
|
36
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
37
|
+
end
|
38
|
+
response = http.start { |h| h.request Net::HTTP::Get.new(uri.request_uri) }
|
39
|
+
if response.code != '200'
|
42
40
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
43
41
|
exit 1
|
44
42
|
end
|
45
43
|
|
46
|
-
result =
|
47
|
-
error = result.
|
44
|
+
result = REXML::Document.new(response.body)
|
45
|
+
error = result.elements['/response/error']
|
48
46
|
if error
|
49
|
-
puts "Failed with error: #{error.
|
47
|
+
puts "Failed with error: #{error.text}."
|
50
48
|
exit 1
|
51
49
|
end
|
52
50
|
|
53
|
-
result.
|
51
|
+
result.elements.each('/response/people/person') do |person|
|
54
52
|
puts format("%-30.30s %s\n",
|
55
|
-
|
56
|
-
|
53
|
+
person.elements['sFullName'].text,
|
54
|
+
person.elements['sEmail'].text).strip!
|
57
55
|
end
|
data/bin/fogbugz-priorities
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
require '
|
5
|
-
require '
|
4
|
+
require 'net/https'
|
5
|
+
require 'uri'
|
6
|
+
require 'rexml/document'
|
6
7
|
require 'optparse'
|
7
8
|
|
8
9
|
api_url = ENV['FOGBUGZ_API_URL']
|
@@ -12,7 +13,7 @@ unless api_url
|
|
12
13
|
end
|
13
14
|
|
14
15
|
api_token = ENV['FOGBUGZ_API_TOKEN']
|
15
|
-
unless
|
16
|
+
unless api_token
|
16
17
|
puts "Environment variable FOGBUGZ_API_TOKEN must be set."
|
17
18
|
exit 1
|
18
19
|
end
|
@@ -21,11 +22,6 @@ options = {}
|
|
21
22
|
optparse = OptionParser.new do |opts|
|
22
23
|
opts.banner = "usage: #{File::basename(__FILE__)} [options]"
|
23
24
|
|
24
|
-
options[:verbose] = false
|
25
|
-
opts.on('-v', '--verbose', 'Output verbose debugging information') do
|
26
|
-
options[:verbose] = true
|
27
|
-
end
|
28
|
-
|
29
25
|
opts.on_tail('-h', '--help') do
|
30
26
|
puts optparse.help
|
31
27
|
exit 1
|
@@ -33,23 +29,26 @@ optparse = OptionParser.new do |opts|
|
|
33
29
|
end
|
34
30
|
optparse.parse!
|
35
31
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
32
|
+
uri = URI format("#{api_url}?cmd=listPriorities&token=%s",
|
33
|
+
URI.escape(api_token))
|
34
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
35
|
+
if uri.scheme == 'https'
|
36
|
+
http.use_ssl = true
|
37
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
38
|
+
end
|
39
|
+
response = http.start { |h| h.request Net::HTTP::Get.new(uri.request_uri) }
|
40
|
+
if response.code != '200'
|
42
41
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
43
42
|
exit 1
|
44
43
|
end
|
45
44
|
|
46
|
-
result =
|
47
|
-
error = result.
|
45
|
+
result = REXML::Document.new(response.body)
|
46
|
+
error = result.elements['/response/error']
|
48
47
|
if error
|
49
|
-
puts "Failed with error: #{error.
|
48
|
+
puts "Failed with error: #{error.text}."
|
50
49
|
exit 1
|
51
50
|
end
|
52
51
|
|
53
|
-
result.
|
54
|
-
puts
|
52
|
+
result.elements.each('/response/priorities/priority') do |priority|
|
53
|
+
puts priority.elements['sPriority'].text
|
55
54
|
end
|
data/bin/fogbugz-projects
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
require '
|
5
|
-
require '
|
4
|
+
require 'net/https'
|
5
|
+
require 'uri'
|
6
|
+
require 'rexml/document'
|
6
7
|
require 'optparse'
|
7
8
|
|
8
9
|
api_url = ENV['FOGBUGZ_API_URL']
|
@@ -12,7 +13,7 @@ unless api_url
|
|
12
13
|
end
|
13
14
|
|
14
15
|
api_token = ENV['FOGBUGZ_API_TOKEN']
|
15
|
-
unless
|
16
|
+
unless api_token
|
16
17
|
puts "Environment variable FOGBUGZ_API_TOKEN must be set."
|
17
18
|
exit 1
|
18
19
|
end
|
@@ -21,11 +22,6 @@ options = {}
|
|
21
22
|
optparse = OptionParser.new do |opts|
|
22
23
|
opts.banner = "usage: #{File::basename(__FILE__)} [options]"
|
23
24
|
|
24
|
-
options[:verbose] = false
|
25
|
-
opts.on('-v', '--verbose', 'Output verbose debugging information') do
|
26
|
-
options[:verbose] = true
|
27
|
-
end
|
28
|
-
|
29
25
|
opts.on_tail('-h', '--help') do
|
30
26
|
puts optparse.help
|
31
27
|
exit 1
|
@@ -33,25 +29,27 @@ optparse = OptionParser.new do |opts|
|
|
33
29
|
end
|
34
30
|
optparse.parse!
|
35
31
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
32
|
+
uri = URI format("#{api_url}?cmd=listProjects&token=%s", URI.escape(api_token))
|
33
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
34
|
+
if uri.scheme == 'https'
|
35
|
+
http.use_ssl = true
|
36
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
37
|
+
end
|
38
|
+
response = http.start { |h| h.request Net::HTTP::Get.new(uri.request_uri) }
|
39
|
+
if response.code != '200'
|
42
40
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
43
41
|
exit 1
|
44
42
|
end
|
45
43
|
|
46
|
-
result =
|
47
|
-
error = result.
|
44
|
+
result = REXML::Document.new(response.body)
|
45
|
+
error = result.elements['/response/error']
|
48
46
|
if error
|
49
|
-
puts "Failed with error: #{error.
|
47
|
+
puts "Failed with error: #{error.text}."
|
50
48
|
exit 1
|
51
49
|
end
|
52
50
|
|
53
|
-
result.
|
51
|
+
result.elements.each('/response/projects/project') do |project|
|
54
52
|
puts format("%-20.20s %s\n",
|
55
|
-
|
56
|
-
|
53
|
+
project.elements['sPersonOwner'].text,
|
54
|
+
project.elements['sProject'].text).strip!
|
57
55
|
end
|
data/bin/fogbugz-reactivate
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
require '
|
5
|
-
require '
|
4
|
+
require 'net/https'
|
5
|
+
require 'uri'
|
6
|
+
require 'rexml/document'
|
6
7
|
require 'optparse'
|
7
8
|
|
8
9
|
api_url = ENV['FOGBUGZ_API_URL']
|
@@ -12,7 +13,7 @@ unless api_url
|
|
12
13
|
end
|
13
14
|
|
14
15
|
api_token = ENV['FOGBUGZ_API_TOKEN']
|
15
|
-
unless
|
16
|
+
unless api_token
|
16
17
|
puts "Environment variable FOGBUGZ_API_TOKEN must be set."
|
17
18
|
exit 1
|
18
19
|
end
|
@@ -21,11 +22,6 @@ options = {}
|
|
21
22
|
optparse = OptionParser.new do |opts|
|
22
23
|
opts.banner = "usage: #{File::basename(__FILE__)} [options] <case>"
|
23
24
|
|
24
|
-
options[:verbose] = false
|
25
|
-
opts.on('-v', '--verbose', 'Output verbose debugging information.') do
|
26
|
-
options[:verbose] = true
|
27
|
-
end
|
28
|
-
|
29
25
|
opts.on_tail('-h', '--help') do
|
30
26
|
puts optparse.help
|
31
27
|
exit 1
|
@@ -37,20 +33,22 @@ unless ARGV[0]
|
|
37
33
|
exit 1
|
38
34
|
end
|
39
35
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
36
|
+
uri = URI format("#{api_url}?cmd=reactivate&token=%s&ixBug=%s",
|
37
|
+
URI.escape(api_token), URI.escape(ARGV[0]))
|
38
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
39
|
+
if uri.scheme == 'https'
|
40
|
+
http.use_ssl = true
|
41
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
42
|
+
end
|
43
|
+
response = http.start { |h| h.request Net::HTTP::Get.new(uri.request_uri) }
|
44
|
+
if response.code != '200'
|
47
45
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
48
46
|
exit 1
|
49
47
|
end
|
50
48
|
|
51
|
-
result =
|
52
|
-
error = result.
|
49
|
+
result = REXML::Document.new(response.body)
|
50
|
+
error = result.elements['/response/error']
|
53
51
|
if error
|
54
|
-
puts "Failed with error: #{error.
|
52
|
+
puts "Failed with error: #{error.text}."
|
55
53
|
exit 1
|
56
54
|
end
|
data/bin/fogbugz-reopen
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
require '
|
5
|
-
require '
|
4
|
+
require 'net/https'
|
5
|
+
require 'uri'
|
6
|
+
require 'rexml/document'
|
6
7
|
require 'optparse'
|
7
8
|
|
8
9
|
api_url = ENV['FOGBUGZ_API_URL']
|
@@ -12,7 +13,7 @@ unless api_url
|
|
12
13
|
end
|
13
14
|
|
14
15
|
api_token = ENV['FOGBUGZ_API_TOKEN']
|
15
|
-
unless
|
16
|
+
unless api_token
|
16
17
|
puts "Environment variable FOGBUGZ_API_TOKEN must be set."
|
17
18
|
exit 1
|
18
19
|
end
|
@@ -21,11 +22,6 @@ options = {}
|
|
21
22
|
optparse = OptionParser.new do |opts|
|
22
23
|
opts.banner = "usage: #{File::basename(__FILE__)} [options] <case>"
|
23
24
|
|
24
|
-
options[:verbose] = false
|
25
|
-
opts.on('-v', '--verbose', 'Output verbose debugging information.') do
|
26
|
-
options[:verbose] = true
|
27
|
-
end
|
28
|
-
|
29
25
|
opts.on_tail('-h', '--help') do
|
30
26
|
puts optparse.help
|
31
27
|
exit 1
|
@@ -37,20 +33,22 @@ unless ARGV[0]
|
|
37
33
|
exit 1
|
38
34
|
end
|
39
35
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
36
|
+
uri = URI format("#{api_url}?cmd=reopen&token=%s&ixBug=%s",
|
37
|
+
URI.escape(api_token), URI.escape(ARGV[0]))
|
38
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
39
|
+
if uri.scheme == 'https'
|
40
|
+
http.use_ssl = true
|
41
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
42
|
+
end
|
43
|
+
response = http.start { |h| h.request Net::HTTP::Get.new(uri.request_uri) }
|
44
|
+
if response.code != '200'
|
47
45
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
48
46
|
exit 1
|
49
47
|
end
|
50
48
|
|
51
|
-
result =
|
52
|
-
error = result.
|
49
|
+
result = REXML::Document.new(response.body)
|
50
|
+
error = result.elements['/response/error']
|
53
51
|
if error
|
54
|
-
puts "Failed with error: #{error.
|
52
|
+
puts "Failed with error: #{error.text}."
|
55
53
|
exit 1
|
56
54
|
end
|
data/bin/fogbugz-resolve
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
require '
|
5
|
-
require '
|
4
|
+
require 'net/https'
|
5
|
+
require 'uri'
|
6
|
+
require 'rexml/document'
|
6
7
|
require 'optparse'
|
7
8
|
|
8
9
|
api_url = ENV['FOGBUGZ_API_URL']
|
@@ -12,7 +13,7 @@ unless api_url
|
|
12
13
|
end
|
13
14
|
|
14
15
|
api_token = ENV['FOGBUGZ_API_TOKEN']
|
15
|
-
unless
|
16
|
+
unless api_token
|
16
17
|
puts "Environment variable FOGBUGZ_API_TOKEN must be set."
|
17
18
|
exit 1
|
18
19
|
end
|
@@ -21,11 +22,6 @@ options = {}
|
|
21
22
|
optparse = OptionParser.new do |opts|
|
22
23
|
opts.banner = "usage: #{File::basename(__FILE__)} [options] <case> <status>"
|
23
24
|
|
24
|
-
options[:verbose] = false
|
25
|
-
opts.on('-v', '--verbose', 'Output verbose debugging information.') do
|
26
|
-
options[:verbose] = true
|
27
|
-
end
|
28
|
-
|
29
25
|
opts.on_tail('-h', '--help') do
|
30
26
|
puts optparse.help
|
31
27
|
exit 1
|
@@ -37,46 +33,50 @@ unless ARGV.length == 2
|
|
37
33
|
exit 1
|
38
34
|
end
|
39
35
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
36
|
+
uri = URI format("#{api_url}?cmd=listStatuses&token=%s&fResolved=1",
|
37
|
+
URI.escape(api_token))
|
38
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
39
|
+
if uri.scheme == 'https'
|
40
|
+
http.use_ssl = true
|
41
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
42
|
+
end
|
43
|
+
response = http.start { |h| h.request Net::HTTP::Get.new(uri.request_uri) }
|
44
|
+
if response.code != '200'
|
47
45
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
48
46
|
exit 1
|
49
47
|
end
|
50
48
|
|
51
|
-
result =
|
52
|
-
error = result.
|
49
|
+
result = REXML::Document.new(response.body)
|
50
|
+
error = result.elements['/response/error']
|
53
51
|
if error
|
54
|
-
puts "Failed with error: #{error.
|
52
|
+
puts "Failed with error: #{error.text}."
|
55
53
|
exit 1
|
56
54
|
end
|
57
55
|
|
58
|
-
status = result.
|
56
|
+
status = result.elements["/response/statuses/status[sStatus='#{ARGV[1]}']"]
|
59
57
|
|
60
58
|
unless status
|
61
59
|
puts "#{ARGV[1]} is not a resolved status."
|
62
60
|
exit 1
|
63
61
|
end
|
64
62
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
63
|
+
uri = URI format("#{api_url}?cmd=resolve&token=%s&ixBug=%s&ixStatus=%s",
|
64
|
+
URI.escape(api_token), URI.escape(ARGV[0]),
|
65
|
+
URI.escape(status.elements['ixStatus'].text))
|
66
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
67
|
+
if uri.scheme == 'https'
|
68
|
+
http.use_ssl = true
|
69
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
70
|
+
end
|
71
|
+
response = http.start { |h| h.request Net::HTTP::Get.new(uri.request_uri) }
|
72
|
+
if response.code != '200'
|
73
73
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
74
74
|
exit 1
|
75
75
|
end
|
76
76
|
|
77
|
-
result =
|
78
|
-
error = result.
|
77
|
+
result = REXML::Document.new(response.body)
|
78
|
+
error = result.elements['/response/error']
|
79
79
|
if error
|
80
|
-
puts "Failed with error: #{error.
|
80
|
+
puts "Failed with error: #{error.text}."
|
81
81
|
exit 1
|
82
82
|
end
|