jiraa 1.0.2 → 1.0.3

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.
Files changed (3) hide show
  1. data/bin/jiraa +16 -10
  2. data/lib/jiraa/version.rb +1 -1
  3. metadata +1 -1
data/bin/jiraa CHANGED
@@ -15,8 +15,10 @@ include GLI::App
15
15
 
16
16
  program_desc 'Command line application for accessing the Jira 5 API'
17
17
 
18
+ desc 'Display version information'
18
19
  version Jiraa::VERSION
19
20
 
21
+
20
22
  desc 'The base URL of your Jira instance (e.g. https://jira.company.com)'
21
23
  arg_name 'URL'
22
24
  flag [:U,:url]
@@ -141,8 +143,8 @@ command "log-work" do |c|
141
143
  end
142
144
  end
143
145
 
144
- desc 'Display information about the Jira server'
145
- command :server do |c|
146
+ desc 'Display information about Jira'
147
+ command :info do |c|
146
148
  c.action do |global_options,options,args|
147
149
  info = JiraClient.server_info
148
150
  puts "Server: #{info.server_title}"
@@ -179,7 +181,7 @@ command :search do |c|
179
181
  end
180
182
  end
181
183
 
182
- desc 'Display your issues currently in progress'
184
+ desc 'Display issues currently in progress and assigned to you'
183
185
  command :current do |c|
184
186
  c.action do |global_options,options,args|
185
187
  issues = JiraClient.find_issues(:jql => "assignee = currentUser() AND status = 'In Progress'", :fields => [:summary, :status])
@@ -191,7 +193,7 @@ command :current do |c|
191
193
  end
192
194
 
193
195
  desc 'Tell Jira how you feel about it'
194
- arg_name 'EXPLETIVES...'
196
+ arg_name 'EXPLETIVE...'
195
197
  command :rant do |c|
196
198
  c.action do |global_options,options,args|
197
199
  help_now! "Missing expletives" if args.length == 0
@@ -211,7 +213,7 @@ def load_config(global_config)
211
213
  config = if File.exists?(config_filename)
212
214
  read_config_file(config_filename)
213
215
  else
214
- create_config_file(config_filename)
216
+ create_config_file(config_filename, global_config)
215
217
  end
216
218
 
217
219
  config.merge! global_config
@@ -221,19 +223,23 @@ def read_config_file(filename)
221
223
  YAML.load_file(filename) || {}
222
224
  end
223
225
 
224
- def create_config_file(filename)
226
+ def create_config_file(filename, config)
227
+ url = config[:url] || "https://jira.example.com"
228
+ username = config[:username] || "username"
229
+ password = config[:password] || "password"
230
+ certificate = config[:certificate] || "/usr/local/certificates/my_cert.pem"
225
231
  File.open(filename, 'w') do |file|
226
232
  file.write <<-EOF
227
233
  ---
228
234
  # Enter the URL of your Jira instance here:
229
- # url: https://jira.example.com
235
+ #{'#' unless config[:url]}url: #{url}
230
236
 
231
237
  # If your Jira server uses HTTP basic authentication then fill in your username and password:
232
- # username: my_username
233
- # password: my_password
238
+ #{'#' unless config[:username]}username: #{username}
239
+ #{'#' unless config[:password]}password: #{password}
234
240
 
235
241
  # If your Jira server users SSL certificate authentication then provide a path to your certificate:
236
- # certificate: /usr/local/certificates/my_cert.pem
242
+ #{'#' unless config[:certificate]}certificate: #{certificate}
237
243
  EOF
238
244
  {}
239
245
  end
@@ -1,3 +1,3 @@
1
1
  module Jiraa
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jiraa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: