bugzyrb 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.rdoc +9 -0
- data/README.rdoc +6 -12
- data/Rakefile +1 -2
- data/VERSION +1 -1
- data/bugzyrb.gemspec +1 -4
- data/lib/bugzyrb.rb +147 -71
- data/lib/bugzyrb/common/cmdapp.rb +1 -0
- data/lib/bugzyrb/common/db.rb +5 -3
- data/lib/bugzyrb/version.rb +1 -1
- metadata +31 -32
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2d762cb5adf5de0227003b2334654b9dad1e459f
|
4
|
+
data.tar.gz: f58cb75a5d7d8e9b213c5f41479e55dda0737199
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3ab6b5a450dca5be511df039ba24c9b61ceb3f7f6bf83c5a9e9e7ce33dbe917b37560da081718c9143131162409dc1df69bf9a68fdc312df42eda5de85dfa071
|
7
|
+
data.tar.gz: f839808eb6d9472a5b2f6e0f479c79fa79d7d32d1aaa098b73bf57c3f3c87b18da2220ecedbbc970445bf0755f746506d50cb30759277d18c439976eb123082c
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
= bugzyrb 0.5.0, 2014-06-06
|
2
|
+
* removed dependency to arrayfields and terminal table
|
3
|
+
* various other changes, am coming in after a long time
|
4
|
+
and seeing changes over the 0.4.0 version.
|
5
|
+
|
6
|
+
2011-12-18
|
7
|
+
* Commented out require of sed.rb - I hope its not required somewhere
|
8
|
+
* removed dependency on terminal-table
|
9
|
+
|
1
10
|
= bugzyrb 0.3.4, 2011-09-28
|
2
11
|
* default list will not show closed
|
3
12
|
* --show-all to show closed
|
data/README.rdoc
CHANGED
@@ -7,8 +7,6 @@ This is not an extensive, full-fledged bug or issue tracker such a bugzilla. Its
|
|
7
7
|
|
8
8
|
Maintains priority, severity, status, fix, comments. All updates are logged.
|
9
9
|
|
10
|
-
A change in Sqlite3 not supporting arrayfields resulted in everything crashing. I've now fixed that -- finally.
|
11
|
-
|
12
10
|
== Purpose
|
13
11
|
|
14
12
|
There are already other command-line bug trackers, some ruby some not. I've had problems installing many. As far as ruby ones, some do not work on 1.9 and this bug has not been rectified for over a year. Others rely on gems that are broken and the maintainer has abandoned them.
|
@@ -48,15 +46,16 @@ Depends on :
|
|
48
46
|
* terminal-table - for formatting output (this is optional)
|
49
47
|
if you use list --bare, then you don't need this gem
|
50
48
|
|
51
|
-
Install [Gemcutter](http://gemcutter.org) and execute:
|
52
49
|
$ gem install bugzyrb
|
53
50
|
|
54
51
|
== Example
|
55
|
-
TODO
|
56
52
|
|
57
|
-
init: Initialize a database with tables
|
58
|
-
|
53
|
+
init: Initialize a database with tables
|
54
|
+
|
55
|
+
add: Add an issue -- will prompt for fields
|
56
|
+
|
59
57
|
qadd: Add an issue -- will use defaults for all fields but title
|
58
|
+
|
60
59
|
view: view given issue (or last entered)
|
61
60
|
|
62
61
|
bugzyrb help
|
@@ -86,13 +85,8 @@ view: view given issue (or last entered)
|
|
86
85
|
|
87
86
|
== Known Issues
|
88
87
|
|
89
|
-
|
90
|
-
1.9.especially), 2 the first time. My other program, bugzy.txt (also on github)
|
91
|
-
lists out bugs instantly. Seems to be a gem load issue.
|
92
|
-
I use this program for bugs, and bugzy.txt for features.
|
88
|
+
I've also written a couple of shell-scripts for reporting from the sql tables
|
93
89
|
|
94
|
-
I've also written a couple of shell-scripts for reporting from the sql tables, these
|
95
|
-
scripts print reports instantly.
|
96
90
|
https://gist.github.com/1437194
|
97
91
|
https://gist.github.com/1437244
|
98
92
|
|
data/Rakefile
CHANGED
@@ -11,11 +11,10 @@ begin
|
|
11
11
|
gem.homepage = "http://github.com/rkumar/bugzyrb"
|
12
12
|
gem.authors = ["Rahul Kumar"]
|
13
13
|
gem.rubyforge_project = "bugzyrb"
|
14
|
-
#gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
15
14
|
gem.add_development_dependency "yard", ">= 0.5"
|
16
15
|
gem.add_dependency "subcommand", ">= 1.0.5"
|
17
16
|
gem.add_dependency "highline", ">= 1.5.2"
|
18
|
-
gem.add_dependency "terminal-table", ">= 1.4.2"
|
17
|
+
#gem.add_dependency "terminal-table", ">= 1.4.2"
|
19
18
|
gem.add_dependency "sqlite3", ">= 1.2.5"
|
20
19
|
# gem.add_dependency "arrayfields", ">= 4.7.4"
|
21
20
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.0
|
data/bugzyrb.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "bugzyrb"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.5.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Rahul Kumar"]
|
@@ -48,20 +48,17 @@ Gem::Specification.new do |s|
|
|
48
48
|
s.add_development_dependency(%q<yard>, [">= 0.5"])
|
49
49
|
s.add_runtime_dependency(%q<subcommand>, [">= 1.0.5"])
|
50
50
|
s.add_runtime_dependency(%q<highline>, [">= 1.5.2"])
|
51
|
-
s.add_runtime_dependency(%q<terminal-table>, [">= 1.4.2"])
|
52
51
|
s.add_runtime_dependency(%q<sqlite3>, [">= 1.2.5"])
|
53
52
|
else
|
54
53
|
s.add_dependency(%q<yard>, [">= 0.5"])
|
55
54
|
s.add_dependency(%q<subcommand>, [">= 1.0.5"])
|
56
55
|
s.add_dependency(%q<highline>, [">= 1.5.2"])
|
57
|
-
s.add_dependency(%q<terminal-table>, [">= 1.4.2"])
|
58
56
|
s.add_dependency(%q<sqlite3>, [">= 1.2.5"])
|
59
57
|
end
|
60
58
|
else
|
61
59
|
s.add_dependency(%q<yard>, [">= 0.5"])
|
62
60
|
s.add_dependency(%q<subcommand>, [">= 1.0.5"])
|
63
61
|
s.add_dependency(%q<highline>, [">= 1.5.2"])
|
64
|
-
s.add_dependency(%q<terminal-table>, [">= 1.4.2"])
|
65
62
|
s.add_dependency(%q<sqlite3>, [">= 1.2.5"])
|
66
63
|
end
|
67
64
|
end
|
data/lib/bugzyrb.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
#
|
2
3
|
=begin
|
3
4
|
* Name: bugzyrb.rb
|
4
5
|
* Description: a command line bug tracker uses sqlite3 (port of bugzy.sh)
|
@@ -7,10 +8,16 @@
|
|
7
8
|
* License: Ruby License
|
8
9
|
|
9
10
|
=end
|
10
|
-
|
11
|
+
# TODO
|
12
|
+
# a possible optimization.
|
13
|
+
# when listing there's a lot of stuff that can be avoided such as what is in init_vars
|
14
|
+
# as well as loading of config file.
|
15
|
+
#
|
16
|
+
#puts "XXX first comes here #{Time.new.to_f} " # 2011-12-16 22:46:40
|
17
|
+
# XXX why next line?
|
11
18
|
$:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
|
12
19
|
require 'bugzyrb/common/colorconstants'
|
13
|
-
require 'bugzyrb/common/sed'
|
20
|
+
#require 'bugzyrb/common/sed' # are we using this at all
|
14
21
|
require 'bugzyrb/common/cmdapp'
|
15
22
|
require 'bugzyrb/version'
|
16
23
|
require 'subcommand'
|
@@ -18,31 +25,11 @@ require 'sqlite3'
|
|
18
25
|
require 'highline/import'
|
19
26
|
require 'bugzyrb/common/db'
|
20
27
|
include ColorConstants
|
21
|
-
include Sed
|
28
|
+
#include Sed
|
22
29
|
include Cmdapp
|
23
30
|
include Subcommands
|
24
31
|
include Database
|
25
32
|
|
26
|
-
# monkey_patch for terminal_table using coloring, does *not* work perfectly here
|
27
|
-
# https://gist.github.com/625808
|
28
|
-
# for 1.9.3 setting this to true was causing it to eat up first 'm' in task
|
29
|
-
# and show no colors at all.
|
30
|
-
ELIMINATE_ANSI_ESCAPE = false
|
31
|
-
class String
|
32
|
-
alias_method :to_s_orig, :to_s
|
33
|
-
def to_s
|
34
|
-
str = self.to_s_orig
|
35
|
-
if ::ELIMINATE_ANSI_ESCAPE
|
36
|
-
str = str.sub(/^\e\[[\[\e0-9;m]+m/, "")
|
37
|
-
str = str.sub(/(\e\[[\[\e0-9;m]+m)$/, "")
|
38
|
-
# Above works for only one, beg or eol
|
39
|
-
str = str.gsub(/\e\[[\[\e0-9;m]+m/, "")
|
40
|
-
#str = str.gsub(/(\e\[[\[\e0-9;m]+m)/, "")
|
41
|
-
end
|
42
|
-
str
|
43
|
-
end
|
44
|
-
end
|
45
|
-
# end monkey
|
46
33
|
#
|
47
34
|
VERSION = Bugzyrb::Version::STRING
|
48
35
|
DATE = "2011-12-06"
|
@@ -96,43 +83,82 @@ class Bugzy
|
|
96
83
|
## data is a 2 dim array: rows and fields. It contains each row of the file
|
97
84
|
# as an array of strings. The item number is space padded.
|
98
85
|
@data = []
|
86
|
+
#puts "XXX starting up ... #{Time.new.to_f} "
|
99
87
|
init_vars
|
100
88
|
end
|
101
89
|
def init_vars
|
102
90
|
@app_default_action = "list" # TODO:
|
103
91
|
@file = @app_file_path = @options[:file] || "bugzy.sqlite"
|
104
|
-
#@app_serial_path = File.expand_path("~/serial_numbers")
|
105
|
-
#@deleted_path = "todo_deleted.txt"
|
106
|
-
#@todo_delim = "\t"
|
107
92
|
@appname = File.basename( Dir.getwd ) #+ ".#{$0}"
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
@
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
93
|
+
end
|
94
|
+
#
|
95
|
+
# this is called by cmdapp by which time it knows what action we have
|
96
|
+
def init_defaults
|
97
|
+
if @action == "list"
|
98
|
+
init_colors
|
99
|
+
else
|
100
|
+
|
101
|
+
# only for adding a bug
|
102
|
+
t = Time.now
|
103
|
+
# in order to support the testing framework
|
104
|
+
#ut = ENV["TODO_TEST_TIME"]
|
105
|
+
#t = Time.at(ut.to_i) if ut
|
106
|
+
@now = t.strftime("%Y-%m-%d %H:%M:%S")
|
107
|
+
#@today = t.strftime("%Y-%m-%d")
|
108
|
+
@verbose = @options[:verbose]
|
109
|
+
# menu MENU
|
110
|
+
@valid_type = %w[bug enhancement feature task]
|
111
|
+
@valid_severity = %w[normal critical moderate]
|
112
|
+
@valid_status = %w[open started closed stopped canceled]
|
113
|
+
@valid_priority = %w[P1 P2 P3 P4 P5]
|
114
|
+
$prompt_desc = $prompt_type = $prompt_status = $prompt_severity = $prompt_assigned_to = $prompt_priority = true
|
115
|
+
$default_priority = nil
|
116
|
+
$default_type = "bug"
|
117
|
+
$default_severity = "normal"
|
118
|
+
$default_status = "open"
|
119
|
+
$default_priority = "P3"
|
120
|
+
$default_assigned_to = "unassigned"
|
121
|
+
$default_due = 5 # how many days in advance due date should be
|
122
|
+
#$bare = @options[:bare]
|
129
123
|
$use_readline = true
|
130
|
-
|
124
|
+
$g_row = nil
|
125
|
+
end
|
131
126
|
# we need to load the cfg file here, if given # , or else in home dir.
|
127
|
+
# we place this here so it can override defaults
|
132
128
|
if @options[:config]
|
133
129
|
load @options[:config]
|
134
130
|
end
|
135
131
|
end
|
132
|
+
# setting for colors
|
133
|
+
# Ideally we should check for whether any have been overriden in config file
|
134
|
+
# If you nilify these in config, then that color will not be highlighted at all
|
135
|
+
def init_colors
|
136
|
+
$desc_color = "#{GREEN}" # color of description portion
|
137
|
+
# color the title based on priority
|
138
|
+
$p5color = "#{BLUE}#{BOLD}"
|
139
|
+
$p4color = "#{MAGENTA}"
|
140
|
+
$p3color = "#{CYAN}#{BOLD}"
|
141
|
+
$p2color = "#{BOLD}"
|
142
|
+
$p1color = "#{YELLOW}#{ON_RED}"
|
143
|
+
#
|
144
|
+
# color for only the type column
|
145
|
+
$bugcolor = "#{BLACK}#{ON_RED}"
|
146
|
+
$enhcolor = "#{GREEN}"
|
147
|
+
$feacolor = "#{CYAN}"
|
148
|
+
|
149
|
+
# color for row of started event
|
150
|
+
$startedcolor = "#{STANDOUT}"
|
151
|
+
|
152
|
+
cols = %x[tput colors] rescue 8
|
153
|
+
cols = cols.to_i
|
154
|
+
if cols >= 256
|
155
|
+
$desc_color = "\x1b[38;5;236m" # 256 colors, grey
|
156
|
+
$p5color = "\x1b[38;5;57m" # some kinda blue
|
157
|
+
$p4color = "\x1b[38;5;239m" # grey. 256 colors
|
158
|
+
$p3color = "\x1b[38;5;244m" # grey, 256 colors
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
136
162
|
%w[type severity status priority].each do |f|
|
137
163
|
eval(
|
138
164
|
"def validate_#{f}(value)
|
@@ -575,6 +601,8 @@ TEXT
|
|
575
601
|
# list testing
|
576
602
|
# list crash -windows
|
577
603
|
# list -- -linux
|
604
|
+
# list --no-sort
|
605
|
+
#
|
578
606
|
def list args
|
579
607
|
# lets look at args as search words
|
580
608
|
incl, excl = Cmdapp._list_args args
|
@@ -583,11 +611,17 @@ TEXT
|
|
583
611
|
#end
|
584
612
|
# will not be able to find title due to function
|
585
613
|
descdelim = '>>'
|
614
|
+
maxcols = %x[tput cols] rescue 80
|
615
|
+
maxcols = maxcols.to_i
|
616
|
+
maxcols = 80 if maxcols == 0
|
617
|
+
w = maxcols - 15 -4 # trying to extend it as much as possible, but one or 2 cols less
|
586
618
|
#fields = 'id,status,type,priority,substr(title || " >>" || ifnull(description,""),0,85)'
|
587
|
-
fields = %Q[id,status,type,priority,substr(title || " #{descdelim}" || ifnull(description,""),0
|
588
|
-
format
|
619
|
+
fields = %Q[id,status,type,priority,substr(title || " #{descdelim}" || ifnull(description,""),0,#{w})]
|
620
|
+
# NOTE format no longer used, we use fmt !! 2011-12-18
|
621
|
+
format = "%-3s | %-6s | %-4s | %-#{w}s"
|
622
|
+
#format = "%-3s | %-7s | %-5s | %-100s"
|
589
623
|
if @options[:short]
|
590
|
-
fields = "id,
|
624
|
+
fields = "id,priority,title"
|
591
625
|
format = "%3s | %6s | %60s "
|
592
626
|
elsif @options[:long]
|
593
627
|
fields = "id,status,priority,title,description"
|
@@ -625,6 +659,7 @@ TEXT
|
|
625
659
|
if where
|
626
660
|
wherestring = " where " + where.join(" and ")
|
627
661
|
end
|
662
|
+
orderstring = " order by id " unless @options[:sort]
|
628
663
|
orderstring ||= " order by status asc, priority desc " # 2011-09-30 so highest prio comes at end
|
629
664
|
puts wherestring if @options[:verbose]
|
630
665
|
|
@@ -668,46 +703,64 @@ TEXT
|
|
668
703
|
end
|
669
704
|
# NOTE: terminal table gets the widths wrong because of coloring info.
|
670
705
|
if @options[:colored]
|
671
|
-
#
|
706
|
+
# we build a format fmt based on ... size of headings (lol)
|
707
|
+
# and there's no delimiter to boot. 2011-12-19
|
708
|
+
fmt = ""
|
709
|
+
headings.each_with_index { |e, i| fmt << "%#{e.size+1}s " }
|
710
|
+
fmt << "\n"
|
711
|
+
b= fmt % headings
|
712
|
+
print b
|
713
|
+
b1 = b.tr('a-zA-Z','-')
|
714
|
+
print b1
|
715
|
+
|
672
716
|
startrow = nil
|
673
717
|
fr = titleindex
|
674
718
|
rows.each_with_index do |e, index|
|
675
719
|
s = e[titleindex]
|
676
720
|
s.gsub!("\n", ";")
|
677
721
|
s.gsub!(/(#\w+)/,"#{UNDERLINE}\\1#{UNDERLINE_OFF}")
|
678
|
-
s.gsub!(/(>>.*)/,"#{
|
679
|
-
|
680
|
-
|
722
|
+
s.gsub!(/(>>.*)/,"#{$desc_color}\\1#{CLEAR}") if $desc_color
|
723
|
+
if statindex
|
724
|
+
st = e[statindex]
|
725
|
+
e[statindex] = e[statindex][0,2]
|
726
|
+
end
|
681
727
|
e[typeindex] = e[typeindex][0,3] if typeindex
|
682
728
|
if typeindex
|
683
729
|
case e[typeindex]
|
684
730
|
when 'bug'
|
685
|
-
e[typeindex] = "#{
|
731
|
+
e[typeindex] = "#{$bugcolor}#{e[typeindex]}#{CLEAR}" if $bugcolor
|
686
732
|
when 'enh'
|
687
|
-
e[typeindex] = "#{
|
733
|
+
e[typeindex] = "#{$enhcolor}#{e[typeindex]}#{CLEAR}" if $enhcolor
|
688
734
|
else
|
689
|
-
e[typeindex] = "#{
|
735
|
+
e[typeindex] = "#{$feacolor}#{e[typeindex]}#{CLEAR}" if $feacolor
|
690
736
|
end
|
691
737
|
end
|
692
738
|
frv = e[fr]
|
693
739
|
if st == 'started'
|
694
740
|
startrow = index unless startrow
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
741
|
+
if $startedcolor
|
742
|
+
e[fr] = "#{$startedcolor}#{frv}" # highlight started tasks
|
743
|
+
e[-1] = "#{e[-1]}#{CLEAR}"
|
744
|
+
end
|
699
745
|
else
|
700
746
|
if priindex
|
701
747
|
pri = e[priindex]
|
702
748
|
case pri
|
703
|
-
when "
|
704
|
-
e[fr] = "#{
|
749
|
+
when "P5"
|
750
|
+
e[fr] = "#{$p5color}#{frv}" if $p5color
|
751
|
+
e[-1] = "#{e[-1]}#{CLEAR}"
|
752
|
+
when "P4"
|
753
|
+
e[fr] = "#{$p4color}#{frv}" if $p4color
|
754
|
+
e[-1] = "#{e[-1]}#{CLEAR}"
|
755
|
+
when "P3"
|
756
|
+
e[fr] = "#{$p3color}#{frv}" if $p3color
|
705
757
|
e[-1] = "#{e[-1]}#{CLEAR}"
|
706
758
|
when "P1"
|
707
|
-
e[fr] = "#{YELLOW}#{ON_RED}#{frv}"
|
759
|
+
#e[fr] = "#{YELLOW}#{ON_RED}#{frv}"
|
760
|
+
e[fr] = "#{$p1color}#{frv}" if $p1color
|
708
761
|
e[-1] = "#{e[-1]}#{CLEAR}"
|
709
762
|
when "P2"
|
710
|
-
e[fr] = "#{
|
763
|
+
e[fr] = "#{$p2color}#{frv}" if $p2color
|
711
764
|
e[-1] = "#{e[-1]}#{CLEAR}"
|
712
765
|
else
|
713
766
|
#e[fr] = "#{CLEAR}#{frv}"
|
@@ -716,16 +769,30 @@ TEXT
|
|
716
769
|
end
|
717
770
|
|
718
771
|
#print "#{format}\n" % e
|
772
|
+
print fmt % e
|
719
773
|
end
|
720
|
-
rows.insert(startrow, :separator) if startrow
|
774
|
+
#rows.insert(startrow, :separator) if startrow
|
721
775
|
#return
|
776
|
+
else
|
777
|
+
table(headings, rows)
|
722
778
|
end
|
723
779
|
# pretty output tabular format etc
|
724
|
-
require 'terminal-table/import'
|
725
|
-
table = table(headings, *rows)
|
726
|
-
puts table
|
780
|
+
#require 'terminal-table/import'
|
781
|
+
#table = table(headings, *rows)
|
782
|
+
#puts table
|
783
|
+
#table(headings, rows)
|
727
784
|
end
|
728
785
|
end
|
786
|
+
def table(headings, rows)
|
787
|
+
fmt = ""
|
788
|
+
headings.each_with_index { |e, i| fmt << "%#{e.size+1}s " }
|
789
|
+
fmt << "\n"
|
790
|
+
b= fmt % headings
|
791
|
+
print b
|
792
|
+
b1 = b.tr('a-zA-Z','-')
|
793
|
+
print b1
|
794
|
+
rows.each { |e| print fmt % e }
|
795
|
+
end
|
729
796
|
## validate user entered id
|
730
797
|
# All methods should call this first.
|
731
798
|
# @param [Fixnum] id (actually can be String) to validate
|
@@ -1020,11 +1087,13 @@ TEXT
|
|
1020
1087
|
def self.main args
|
1021
1088
|
ret = nil
|
1022
1089
|
begin
|
1090
|
+
#puts "XXX before parsing options #{Time.new.to_f} "
|
1023
1091
|
# http://www.ruby-doc.org/stdlib/libdoc/optparse/rdoc/classes/OptionParser.html
|
1024
1092
|
require 'optparse'
|
1025
1093
|
options = {}
|
1026
1094
|
options[:verbose] = false
|
1027
1095
|
options[:colored] = true
|
1096
|
+
options[:sort] = true
|
1028
1097
|
$bare = false
|
1029
1098
|
# adding some env variable pickups, so you don't have to keep passing.
|
1030
1099
|
showall = ENV["TODO_SHOW_ALL"]
|
@@ -1041,6 +1110,7 @@ TEXT
|
|
1041
1110
|
#puts "found #{config} "
|
1042
1111
|
end
|
1043
1112
|
|
1113
|
+
|
1044
1114
|
Subcommands::global_options do |opts|
|
1045
1115
|
opts.banner = "Usage: #{APPNAME} [options] [subcommand [options]]"
|
1046
1116
|
opts.description = "Bug list manager"
|
@@ -1214,6 +1284,10 @@ TEXT
|
|
1214
1284
|
opts.on("-u","--unassigned", "not assigned") { |v|
|
1215
1285
|
options[:unassigned] = v
|
1216
1286
|
}
|
1287
|
+
# added no-sort on 2011-12-19 so we can get based on id
|
1288
|
+
opts.on("--[no-]sort", "don't sort") do |v|
|
1289
|
+
options[:sort] = v
|
1290
|
+
end
|
1217
1291
|
end
|
1218
1292
|
Subcommands::command :viewlogs do |opts|
|
1219
1293
|
opts.banner = "Usage: viewlogs [options] ISSUE_NO"
|
@@ -1287,7 +1361,9 @@ TEXT
|
|
1287
1361
|
end
|
1288
1362
|
#raise "-f FILENAME is mandatory" unless options[:file]
|
1289
1363
|
|
1290
|
-
|
1364
|
+
#puts "XXX after parsing options #{Time.new.to_f} " # 2011-12-16 22:46:35
|
1365
|
+
c = Bugzy.new(options, args)
|
1366
|
+
#puts "XXX before run #{Time.new.to_f} "
|
1291
1367
|
ret = c.run
|
1292
1368
|
ensure
|
1293
1369
|
end
|
data/lib/bugzyrb/common/db.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
#!/usr/bin/env ruby -w
|
2
|
-
require 'rubygems'
|
2
|
+
#require 'rubygems'
|
3
3
|
require 'sqlite3'
|
4
4
|
require 'pp'
|
5
|
-
#require 'arrayfields' # removed 2011-09-21
|
6
5
|
module Database
|
7
6
|
class DB
|
8
7
|
attr_accessor :db
|
9
8
|
|
10
9
|
def initialize dbname="bugzy.sqlite"
|
11
|
-
|
10
|
+
unless File.exists? dbname
|
11
|
+
puts "#{dbname} does not exist. Try 'init' or '-d path' or '--help'"
|
12
|
+
exit -1
|
13
|
+
end
|
12
14
|
@db = SQLite3::Database.new(dbname)
|
13
15
|
$now = Time.now
|
14
16
|
$num = rand(100)
|
data/lib/bugzyrb/version.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bugzyrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Rahul Kumar
|
@@ -13,59 +12,60 @@ date: 2011-12-06 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: yard
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0.5'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.5'
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: subcommand
|
27
|
-
requirement:
|
28
|
-
none: false
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
|
-
- -
|
31
|
+
- - '>='
|
31
32
|
- !ruby/object:Gem::Version
|
32
33
|
version: 1.0.5
|
33
34
|
type: :runtime
|
34
35
|
prerelease: false
|
35
|
-
version_requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.0.5
|
36
41
|
- !ruby/object:Gem::Dependency
|
37
42
|
name: highline
|
38
|
-
requirement:
|
39
|
-
none: false
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
40
44
|
requirements:
|
41
|
-
- -
|
45
|
+
- - '>='
|
42
46
|
- !ruby/object:Gem::Version
|
43
47
|
version: 1.5.2
|
44
48
|
type: :runtime
|
45
49
|
prerelease: false
|
46
|
-
version_requirements:
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: terminal-table
|
49
|
-
requirement: &70245608878200 !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
55
|
-
type: :runtime
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: *70245608878200
|
54
|
+
version: 1.5.2
|
58
55
|
- !ruby/object:Gem::Dependency
|
59
56
|
name: sqlite3
|
60
|
-
requirement:
|
61
|
-
none: false
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
62
58
|
requirements:
|
63
|
-
- -
|
59
|
+
- - '>='
|
64
60
|
- !ruby/object:Gem::Version
|
65
61
|
version: 1.2.5
|
66
62
|
type: :runtime
|
67
63
|
prerelease: false
|
68
|
-
version_requirements:
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.2.5
|
69
69
|
description: basic, easy-to-use command-line issue-tracker using sqlite for ruby 1.9
|
70
70
|
email: sentinel1879@gmail.com
|
71
71
|
executables:
|
@@ -93,25 +93,24 @@ files:
|
|
93
93
|
- lib/bugzyrb/version.rb
|
94
94
|
homepage: http://github.com/rkumar/bugzyrb
|
95
95
|
licenses: []
|
96
|
+
metadata: {}
|
96
97
|
post_install_message:
|
97
98
|
rdoc_options: []
|
98
99
|
require_paths:
|
99
100
|
- lib
|
100
101
|
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
-
none: false
|
102
102
|
requirements:
|
103
|
-
- -
|
103
|
+
- - '>='
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '0'
|
106
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
-
none: false
|
108
107
|
requirements:
|
109
|
-
- -
|
108
|
+
- - '>='
|
110
109
|
- !ruby/object:Gem::Version
|
111
110
|
version: '0'
|
112
111
|
requirements: []
|
113
112
|
rubyforge_project: bugzyrb
|
114
|
-
rubygems_version:
|
113
|
+
rubygems_version: 2.2.2
|
115
114
|
signing_key:
|
116
115
|
specification_version: 3
|
117
116
|
summary: command-line bug/issue tracker using sqlite, ruby 1.9
|