fogbugz 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/bin/fogbugz-edit CHANGED
@@ -8,6 +8,7 @@ require 'tempfile'
8
8
  require 'optparse'
9
9
  require 'yaml'
10
10
  require 'English'
11
+ require 'time'
11
12
 
12
13
  api_url = ENV['FOGBUGZ_API_URL']
13
14
  unless api_url
@@ -249,19 +250,30 @@ if not data or data.empty?
249
250
  exit 1
250
251
  end
251
252
 
253
+ sTitle = data['title'] ? "&sTitle=#{URI.escape(data['title'].to_s)}" : ''
254
+ ixBugParent = (data['parent'] ?
255
+ "&ixBugParent=#{URI.escape(data['parent'].to_s)}" : '')
256
+ sTags = data['tags'] ? "&sTags=#{URI.escape(data['tags'].join(','))}" : ''
257
+ sProject = (data['project'] ?
258
+ "&sProject=#{URI.escape(data['project'].to_s)}" : '')
259
+ sArea = data['area'] ? "&sArea=#{URI.escape(data['area'].to_s)}" : ''
260
+ sFixFor = (data['milestone'] ?
261
+ "&sFixFor=#{URI.escape(data['milestone'].to_s)}" : '')
262
+ sCategory = (data['category'] ?
263
+ "&sCategory=#{URI.escape(data['category'].to_s)}" : '')
264
+ sPersonAssignedTo = (data['assignee'] ?
265
+ "&sPersonAssignedTo=#{URI.escape(data['assignee'].to_s)}" :
266
+ '')
267
+ sPriority = (data['priority'] ?
268
+ "&sPriority=#{URI.escape(data['priority'].to_s)}" : '')
269
+ hrsCurrEst = (data['estimate'] ?
270
+ "&hrsCurrEst=#{URI.escape(data['estimate'].to_s)}" : '')
271
+ sEvent = data['body'] ? "&sEvent=#{URI.escape(data['body'].to_s)}" : ''
272
+
252
273
  uri = URI format("#{api_url}?cmd=edit&token=%s&ixBug=%s%s%s%s%s%s%s%s%s%s%s%s",
253
274
  URI.escape(api_token), URI.escape(case_id),
254
- data['title'] ? URI.escape(data['title'].to_s) : '',
255
- data['parent'] ? URI.escape(data['parent'].to_s) : '',
256
- data['tags'] ? URI.escape(data['tags'].join(',')) : '',
257
- data['project'] ? URI.escape(data['project'].to_s) : '',
258
- data['area'] ? URI.escape(data['area'].to_s) : '',
259
- data['milestone'] ? URI.escape(data['milestone'].to_s) : '',
260
- data['category'] ? URI.escape(data['category'].to_s) : '',
261
- data['assignee'] ? URI.escape(data['assignee'].to_s) : '',
262
- data['priority'] ? URI.escape(data['priority'].to_s) : '',
263
- data['estimate'] ? URI.escape(data['estimate'].to_s) : '',
264
- data['body'] ? URI.escape(data['body'].to_s) : '')
275
+ sTitle, ixBugParent, sTags, sProject, sArea, sFixFor, sCategory,
276
+ sPersonAssignedTo, sPriority, hrsCurrEst, sEvent)
265
277
  http = Net::HTTP.new(uri.host, uri.port)
266
278
  if uri.scheme == 'https'
267
279
  http.use_ssl = true
data/bin/fogbugz-filters CHANGED
@@ -7,6 +7,13 @@ require 'rexml/document'
7
7
  require 'optparse'
8
8
  require 'highline'
9
9
 
10
+ HighLine.use_color = STDOUT.isatty
11
+ begin
12
+ require 'win32console' if RUBY_PLATFORM =~ /mingw/
13
+ rescue LoadError
14
+ HighLine.use_color = false
15
+ end
16
+
10
17
  api_url = ENV['FOGBUGZ_API_URL']
11
18
  unless api_url
12
19
  puts "Environment variable FOGBUGZ_API_URL must be set."
@@ -49,7 +56,6 @@ if error
49
56
  exit 1
50
57
  end
51
58
 
52
- HighLine.use_color = STDOUT.isatty
53
59
  result.elements.each('/response/filters/filter') do |filter|
54
60
  if filter.attributes['status'] == 'current'
55
61
  puts "* #{HighLine.new.color(filter.text, HighLine::GREEN)}"
data/bin/fogbugz-new CHANGED
@@ -130,19 +130,30 @@ if not data or data.empty?
130
130
  exit 1
131
131
  end
132
132
 
133
- uri = URI format("#{api_url}?cmd=new&token=%s&%s%s%s%s%s%s%s%s%s%s%s",
133
+ sTitle = data['title'] ? "&sTitle=#{URI.escape(data['title'].to_s)}" : ''
134
+ ixBugParent = (data['parent'] ?
135
+ "&ixBugParent=#{URI.escape(data['parent'].to_s)}" : '')
136
+ sTags = data['tags'] ? "&sTags=#{URI.escape(data['tags'].join(','))}" : ''
137
+ sProject = (data['project'] ?
138
+ "&sProject=#{URI.escape(data['project'].to_s)}" : '')
139
+ sArea = data['area'] ? "&sArea=#{URI.escape(data['area'].to_s)}" : ''
140
+ sFixFor = (data['milestone'] ?
141
+ "&sFixFor=#{URI.escape(data['milestone'].to_s)}" : '')
142
+ sCategory = (data['category'] ?
143
+ "&sCategory=#{URI.escape(data['category'].to_s)}" : '')
144
+ sPersonAssignedTo = (data['assignee'] ?
145
+ "&sPersonAssignedTo=#{URI.escape(data['assignee'].to_s)}" :
146
+ '')
147
+ sPriority = (data['priority'] ?
148
+ "&sPriority=#{URI.escape(data['priority'].to_s)}" : '')
149
+ hrsCurrEst = (data['estimate'] ?
150
+ "&hrsCurrEst=#{URI.escape(data['estimate'].to_s)}" : '')
151
+ sEvent = data['body'] ? "&sEvent=#{URI.escape(data['body'].to_s)}" : ''
152
+
153
+ uri = URI format("#{api_url}?cmd=new&token=%s%s%s%s%s%s%s%s%s%s%s%s",
134
154
  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) : '')
155
+ sTitle, ixBugParent, sTags, sProject, sArea, sFixFor, sCategory,
156
+ sPersonAssignedTo, sPriority, hrsCurrEst, sEvent)
146
157
  http = Net::HTTP.new(uri.host, uri.port)
147
158
  if uri.scheme == 'https'
148
159
  http.use_ssl = true
data/bin/fogbugz-show CHANGED
@@ -8,6 +8,13 @@ require 'optparse'
8
8
  require 'highline'
9
9
  require 'time'
10
10
 
11
+ HighLine.use_color = STDOUT.isatty
12
+ begin
13
+ require 'win32console' if RUBY_PLATFORM =~ /mingw/
14
+ rescue LoadError
15
+ HighLine.use_color = false
16
+ end
17
+
11
18
  api_url = ENV['FOGBUGZ_API_URL']
12
19
  unless api_url
13
20
  puts "Environment variable FOGBUGZ_API_URL must be set."
@@ -58,9 +65,7 @@ if error
58
65
  exit 1
59
66
  end
60
67
 
61
- HighLine.use_color = STDOUT.isatty
62
68
  hl = HighLine.new
63
-
64
69
  bug = result.elements["/response/cases/case[@ixBug='#{ARGV[0]}']"]
65
70
  unless bug
66
71
  puts "Case #{ARGV[0]} does not exist."
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 2
9
- version: 1.0.2
8
+ - 3
9
+ version: 1.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Erik Charlebois