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-filter
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] <filter>"
|
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,42 +33,49 @@ unless ARGV[0]
|
|
37
33
|
exit 1
|
38
34
|
end
|
39
35
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
36
|
+
uri = URI format("#{api_url}?cmd=listFilters&token=%s", URI.escape(api_token))
|
37
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
38
|
+
if uri.scheme == 'https'
|
39
|
+
http.use_ssl = true
|
40
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
41
|
+
end
|
42
|
+
response = http.start { |h| h.request Net::HTTP::Get.new(uri.request_uri) }
|
43
|
+
if response.code != '200'
|
44
44
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
45
45
|
exit 1
|
46
46
|
end
|
47
47
|
|
48
|
-
result =
|
49
|
-
error = result.
|
48
|
+
result = REXML::Document.new(response.body)
|
49
|
+
error = result.elements['/response/error']
|
50
50
|
if error
|
51
|
-
puts "Failed with error: #{error.
|
51
|
+
puts "Failed with error: #{error.text}."
|
52
52
|
exit 1
|
53
53
|
end
|
54
54
|
|
55
55
|
params = { :cmd => 'setCurrentFilter', :token => api_token }
|
56
|
-
filter = result.
|
57
|
-
|
58
|
-
params[:sFilter] = filter['sFilter']
|
59
|
-
else
|
56
|
+
filter = result.elements["/response/filters/filter[.='#{ARGV[0]}']"]
|
57
|
+
unless filter
|
60
58
|
puts "#{ARGV[0]} is not a valid filter."
|
61
59
|
exit 1
|
62
60
|
end
|
63
61
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
if
|
62
|
+
uri = URI format("#{api_url}?cmd=setCurrentFilter&token=%s&sFilter=%s",
|
63
|
+
URI.escape(api_token),
|
64
|
+
URI.escape(filter.attributes['sFilter']))
|
65
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
66
|
+
if uri.scheme == 'https'
|
67
|
+
http.use_ssl = true
|
68
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
69
|
+
end
|
70
|
+
response = http.start { |h| h.request Net::HTTP::Get.new(uri.request_uri) }
|
71
|
+
if response.code != '200'
|
69
72
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
70
73
|
exit 1
|
71
74
|
end
|
72
75
|
|
73
|
-
result =
|
74
|
-
error = result.
|
76
|
+
result = REXML::Document.new(response.body)
|
77
|
+
error = result.elements['/response/error']
|
75
78
|
if error
|
76
|
-
puts "Failed with error: #{error.
|
79
|
+
puts "Failed with error: #{error.text}."
|
77
80
|
exit 1
|
78
81
|
end
|
data/bin/fogbugz-filters
CHANGED
@@ -1,9 +1,11 @@
|
|
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'
|
8
|
+
require 'highline'
|
7
9
|
|
8
10
|
api_url = ENV['FOGBUGZ_API_URL']
|
9
11
|
unless api_url
|
@@ -12,7 +14,7 @@ unless api_url
|
|
12
14
|
end
|
13
15
|
|
14
16
|
api_token = ENV['FOGBUGZ_API_TOKEN']
|
15
|
-
unless
|
17
|
+
unless api_token
|
16
18
|
puts "Environment variable FOGBUGZ_API_TOKEN must be set."
|
17
19
|
exit 1
|
18
20
|
end
|
@@ -21,11 +23,6 @@ options = {}
|
|
21
23
|
optparse = OptionParser.new do |opts|
|
22
24
|
opts.banner = "usage: #{File::basename(__FILE__)} [options]"
|
23
25
|
|
24
|
-
options[:verbose] = false
|
25
|
-
opts.on('-v', '--verbose', 'Output verbose debugging information') do
|
26
|
-
options[:verbose] = true
|
27
|
-
end
|
28
|
-
|
29
26
|
opts.on_tail('-h', '--help') do
|
30
27
|
puts optparse.help
|
31
28
|
exit 1
|
@@ -33,21 +30,30 @@ optparse = OptionParser.new do |opts|
|
|
33
30
|
end
|
34
31
|
optparse.parse!
|
35
32
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
33
|
+
uri = URI format("#{api_url}?cmd=listFilters&token=%s", 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'
|
40
41
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
41
42
|
exit 1
|
42
43
|
end
|
43
44
|
|
44
|
-
result =
|
45
|
-
error = result.
|
45
|
+
result = REXML::Document.new(response.body)
|
46
|
+
error = result.elements['/response/error']
|
46
47
|
if error
|
47
|
-
puts "Failed with error: #{error.
|
48
|
+
puts "Failed with error: #{error.text}."
|
48
49
|
exit 1
|
49
50
|
end
|
50
51
|
|
51
|
-
|
52
|
-
|
52
|
+
HighLine.use_color = STDOUT.isatty
|
53
|
+
result.elements.each('/response/filters/filter') do |filter|
|
54
|
+
if filter.attributes['status'] == 'current'
|
55
|
+
puts "* #{HighLine.new.color(filter.text, HighLine::GREEN)}"
|
56
|
+
else
|
57
|
+
puts " #{filter.text}"
|
58
|
+
end
|
53
59
|
end
|
data/bin/fogbugz-list
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] [query]"
|
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
|
@@ -38,32 +34,34 @@ optparse = OptionParser.new do |opts|
|
|
38
34
|
end
|
39
35
|
optparse.parse!
|
40
36
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
37
|
+
uri = URI format("#{api_url}?cmd=search&token=%s&cols=%s%s%s",
|
38
|
+
URI.escape(api_token),
|
39
|
+
URI.escape('ixBug,sPersonAssignedTo,sFixFor,sPriority,sTitle'),
|
40
|
+
ARGV[0] ? "&q=#{URI.escape(ARGV[0])}" : '',
|
41
|
+
options[:max] ? "&max=#{URI.escape(options[:max])}" : '')
|
42
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
43
|
+
if uri.scheme == 'https'
|
44
|
+
http.use_ssl = true
|
45
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
46
|
+
end
|
47
|
+
response = http.start { |h| h.request Net::HTTP::Get.new(uri.request_uri) }
|
48
|
+
if response.code != '200'
|
51
49
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
52
50
|
exit 1
|
53
51
|
end
|
54
52
|
|
55
|
-
result =
|
56
|
-
error = result.
|
53
|
+
result = REXML::Document.new(response.body)
|
54
|
+
error = result.elements['/response/error']
|
57
55
|
if error
|
58
|
-
puts "Failed with error: #{error.
|
56
|
+
puts "Failed with error: #{error.text}."
|
59
57
|
exit 1
|
60
58
|
end
|
61
59
|
|
62
|
-
result.
|
60
|
+
result.elements.each('/response/cases/case') do |bug|
|
63
61
|
puts format("%-6.6s %-20.20s %-16.16s %-16.16s %s\n",
|
64
|
-
bug.
|
65
|
-
bug.
|
66
|
-
bug.
|
67
|
-
bug.
|
68
|
-
bug.
|
62
|
+
bug.elements['ixBug'].text,
|
63
|
+
bug.elements['sPersonAssignedTo'].text,
|
64
|
+
bug.elements['sFixFor'].text,
|
65
|
+
bug.elements['sPriority'].text,
|
66
|
+
bug.elements['sTitle'].text).strip!
|
69
67
|
end
|
data/bin/fogbugz-login
CHANGED
@@ -1,14 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
require '
|
5
|
-
require '
|
6
|
-
require '
|
7
|
-
require 'pp'
|
4
|
+
require 'net/https'
|
5
|
+
require 'uri'
|
6
|
+
require 'rexml/document'
|
8
7
|
require 'optparse'
|
9
|
-
require '
|
10
|
-
require 'English'
|
11
|
-
require 'term/ansicolor'
|
8
|
+
require 'highline'
|
12
9
|
|
13
10
|
api_url = ENV['FOGBUGZ_API_URL']
|
14
11
|
unless api_url
|
@@ -20,9 +17,9 @@ options = {}
|
|
20
17
|
optparse = OptionParser.new do |opts|
|
21
18
|
opts.banner = "usage: #{File::basename(__FILE__)} [options] <email> <password>"
|
22
19
|
|
23
|
-
options[:
|
24
|
-
opts.
|
25
|
-
options[:
|
20
|
+
options[:password] = nil
|
21
|
+
opts.on_tail('-p', '--password=<password>') do |password|
|
22
|
+
options[:password] = password
|
26
23
|
end
|
27
24
|
|
28
25
|
opts.on_tail('-h', '--help') do
|
@@ -31,30 +28,35 @@ optparse = OptionParser.new do |opts|
|
|
31
28
|
end
|
32
29
|
end
|
33
30
|
optparse.parse!
|
34
|
-
unless ARGV.length ==
|
31
|
+
unless ARGV.length == 1
|
35
32
|
puts optparse.help
|
36
33
|
exit 1
|
37
34
|
end
|
38
35
|
|
39
|
-
|
40
|
-
:
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
if
|
36
|
+
password = options[:password] ||
|
37
|
+
HighLine.new.ask('Password: ') { |q| q.echo = false }
|
38
|
+
|
39
|
+
uri = URI format("#{api_url}?cmd=logon&email=%s&password=%s",
|
40
|
+
URI.escape(ARGV[0]), password)
|
41
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
42
|
+
if uri.scheme == 'https'
|
43
|
+
http.use_ssl = true
|
44
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
45
|
+
end
|
46
|
+
response = http.start { |h| h.request Net::HTTP::Get.new(uri.request_uri) }
|
47
|
+
if response.code != '200'
|
46
48
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
47
49
|
exit 1
|
48
50
|
end
|
49
51
|
|
50
|
-
result =
|
51
|
-
error = result.
|
52
|
+
result = REXML::Document.new(response.body)
|
53
|
+
error = result.elements['/response/error']
|
52
54
|
if error
|
53
|
-
puts "Failed with error: #{error.
|
55
|
+
puts "Failed with error: #{error.text}."
|
54
56
|
exit 1
|
55
57
|
end
|
56
58
|
|
57
59
|
puts <<HERE
|
58
60
|
Login successful. Set the following environment variable:
|
59
|
-
export FOGBUGZ_API_TOKEN=#{result.
|
61
|
+
export FOGBUGZ_API_TOKEN=#{result.elements['/response/token'].text}
|
60
62
|
HERE
|
data/bin/fogbugz-logoff
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,17 +29,21 @@ optparse = OptionParser.new do |opts|
|
|
33
29
|
end
|
34
30
|
optparse.parse!
|
35
31
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
32
|
+
uri = URI format("#{api_url}?cmd=logoff&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'
|
40
40
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
41
41
|
exit 1
|
42
42
|
end
|
43
43
|
|
44
|
-
result =
|
45
|
-
error = result.
|
44
|
+
result = REXML::Document.new(response.body)
|
45
|
+
error = result.elements['/response/error']
|
46
46
|
if error
|
47
|
-
puts "Failed with error: #{error.
|
47
|
+
puts "Failed with error: #{error.text}."
|
48
48
|
exit 1
|
49
49
|
end
|
data/bin/fogbugz-milestones
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,37 +22,35 @@ 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
|
32
28
|
end
|
33
29
|
end
|
34
30
|
optparse.parse!
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
31
|
+
|
32
|
+
uri = URI format("#{api_url}?cmd=listFixFors&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'
|
41
40
|
puts "HTTP request to #{api_url} failed with code #{response.code}."
|
42
41
|
exit 1
|
43
42
|
end
|
44
43
|
|
45
|
-
result =
|
46
|
-
error = result.
|
44
|
+
result = REXML::Document.new(response.body)
|
45
|
+
error = result.elements['/response/error']
|
47
46
|
if error
|
48
|
-
puts "Failed with error: #{error.
|
47
|
+
puts "Failed with error: #{error.text}."
|
49
48
|
exit 1
|
50
49
|
end
|
51
50
|
|
52
|
-
result.
|
51
|
+
result.elements.each('/response/fixfors/fixfor') do |milestones|
|
53
52
|
puts format("%-30.30s %-16.16s %s\n",
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
milestones.elements['sFixFor'].text,
|
54
|
+
milestones.elements['dt'].text,
|
55
|
+
milestones.elements['sProject'].text).strip!
|
57
56
|
end
|