fresnel 0.6.1 → 0.6.2

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/fresnel.gemspec +2 -2
  2. data/lib/fresnel.rb +28 -3
  3. metadata +2 -2
@@ -3,8 +3,8 @@ Gem::Specification.new do |s|
3
3
  s.name = 'fresnel'
4
4
  s.summary = "Fresnel is a console manager to LighthouseApp.com using the official lighthouse api."
5
5
  s.description = s.summary
6
- s.version = '0.6.1'
7
- s.date = '2010-01-08'
6
+ s.version = '0.6.2'
7
+ s.date = '2010-01-10'
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Gerard de Brieder", "Wes Oldenbeuving"]
10
10
  s.email = "smeevil@gmail.com"
@@ -1,4 +1,4 @@
1
- require 'active_support'
1
+ %w(activesupport active_support).each { |l| require l rescue nil }
2
2
  require 'terminal-table/import'
3
3
  require 'highline/import'
4
4
 
@@ -377,11 +377,12 @@ class Fresnel
377
377
  puts "Current state : #{ticket.versions.last.state}"
378
378
  choices = {
379
379
  :states => %w[open resolved invalid hold new],
380
- :actions => %w[quit tickets bins comments assign self web links errors]
380
+ :actions => %w[quit tickets bins comments assign self web links errors Tag]
381
381
  }
382
382
  states = choices[:states]
383
383
  action=InputDetector.pretty_prompt(choices).answer
384
384
  case action
385
+ when "T" then tag(:ticket=>number)
385
386
  when "t" then tickets
386
387
  when "b" then get_bins
387
388
  when "c" then comment(number)
@@ -476,6 +477,30 @@ class Fresnel
476
477
  end
477
478
  end
478
479
 
480
+ def tag(options)
481
+ ticket=get_ticket(options[:ticket])
482
+ tags=ask("Tags #{@@tags.join(", ")} : ")
483
+ tags=tags.split(" ")
484
+ expanded_tags=[]
485
+ tags.each do |tag|
486
+ match=false
487
+ if tag.length==1
488
+ @@tags.each do |predefined_tag|
489
+ if predefined_tag=~/\[#{tag}\]/
490
+ match=true
491
+ expanded_tags<<predefined_tag.gsub(/\[|\]/,"")
492
+ end
493
+ end
494
+ end
495
+ expanded_tags<<tag unless match
496
+ end
497
+ puts "tags are #{expanded_tags.inspect}"
498
+ ticket.tags=expanded_tags
499
+ ticket.save
500
+ tickets
501
+ end
502
+
503
+
479
504
  def create
480
505
  system("mate -w /tmp/fresnel_new_ticket")
481
506
  if File.exists?("/tmp/fresnel_new_ticket")
@@ -493,7 +518,7 @@ class Fresnel
493
518
  body << l
494
519
  end
495
520
  body=body.to_s
496
- tags=ask("Tags #{@@tags.join(",")} : ")
521
+ tags=ask("Tags #{@@tags.join(", ")} : ")
497
522
  tags=tags.split(" ")
498
523
  expanded_tags=[]
499
524
  tags.each do |tag|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fresnel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerard de Brieder
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-01-08 00:00:00 +01:00
13
+ date: 2010-01-10 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency