bugzyrb 0.3.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -7,6 +7,8 @@ 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
+
10
12
  == Purpose
11
13
 
12
14
  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.
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ begin
17
17
  gem.add_dependency "highline", ">= 1.5.2"
18
18
  gem.add_dependency "terminal-table", ">= 1.4.2"
19
19
  gem.add_dependency "sqlite3-ruby", ">= 1.2.5"
20
- gem.add_dependency "arrayfields", ">= 4.7.4"
20
+ # gem.add_dependency "arrayfields", ">= 4.7.4"
21
21
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
22
22
  end
23
23
  Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.3
@@ -2,7 +2,7 @@
2
2
  require 'rubygems'
3
3
  require 'sqlite3'
4
4
  require 'pp'
5
- require 'arrayfields'
5
+ #require 'arrayfields' # removed 2011-09-21
6
6
  module Database
7
7
  class DB
8
8
  attr_accessor :db
@@ -33,11 +33,14 @@ module Database
33
33
  return rows
34
34
  end
35
35
  # returns many rows
36
+ # 2011-09-21 Please specify results_as_hash or typr_translation before calling
37
+ # as it crashes in some cases and works in others.
36
38
  # @param [String] sql statement
37
39
  # @return [Array, nil] array if rows, else nil
38
40
  def run text
39
41
  #puts " --- #{text} --- "
40
- @db.type_translation = true
42
+ #@db.type_translation = true # here it works, if i remove then long date is shown
43
+ #@db.results_as_hash = true # 2011-09-21
41
44
  rows = []
42
45
  @db.execute( text ) do |row|
43
46
  if block_given?
@@ -51,7 +54,7 @@ module Database
51
54
  end
52
55
  def select_where table, *wherecond
53
56
  #puts " --- #{table} --- #{wherecond} "
54
- @db.type_translation = true
57
+ #@db.type_translation = true # causing errors in sqlite3 columns() not found for Array
55
58
  wherestr = nil
56
59
  rows = []
57
60
  if wherecond and !wherecond.empty?
@@ -61,7 +64,7 @@ module Database
61
64
  if wherestr
62
65
  #puts " wherestr #{wherestr}, #{values} "
63
66
  #stmt = @db.prepare("select * from #{table} #{wherestr} ", *values)
64
- @db.execute( "select * from #{table} #{wherestr}", *values ) do |row|
67
+ @db.execute( "select * from #{table} #{wherestr}", *values ) do |row|
65
68
  if block_given?
66
69
  yield row
67
70
  else
@@ -162,7 +165,7 @@ module Database
162
165
  # @param [Fixnum] rowid
163
166
  # @return [Array] resultset (based on arrayfield)
164
167
  def sql_select_rowid table, id
165
- # @db.results_as_hash = true
168
+ @db.results_as_hash = true # 2011-09-21
166
169
  return nil if id.nil? or table.nil?
167
170
  row = @db.get_first_row( "select * from #{table} where rowid = ?", id )
168
171
  return row
data/lib/bugzyrb.rb CHANGED
@@ -360,6 +360,8 @@ TEXT
360
360
  comment_count = 0
361
361
  #puts row
362
362
  row.each_pair { |name, val|
363
+ x = (name =~ /[A-Za-z]/)
364
+ next unless x # 2011-09-21 skip names that are just numbers
363
365
  next if name == "project" && !$use_project
364
366
  next if name == "version" && !$use_version
365
367
  next if name == "component" && !$use_component
@@ -383,13 +385,13 @@ TEXT
383
385
  end
384
386
  puts "Log:"
385
387
  ctr = 0
386
- db.select_where "log", "id", id do |r|
387
- ctr += 1
388
- #puts "------- (#{r['date_created']}) #{r['created_by']} ------"
389
- puts "------- #{r['date_created']} - #{r['created_by']} (#{ctr})------"
390
- puts " * [#{r['field']}]: #{r['log']} "
388
+ db.select_where "log", "id", id do |r|
389
+ ctr += 1
390
+ #puts "------- (#{r['date_created']}) #{r['created_by']} ------"
391
+ puts "------- #{r['date_created']} - #{r['created_by']} (#{ctr})------"
392
+ puts " * [#{r['field']}]: #{r['log']} "
393
+ end
391
394
  #pp r
392
- end
393
395
  end
394
396
  ## tried out a version of view that uses template replacement
395
397
  # but can't do placement of second column -- it does not come aligned, so forget
@@ -529,11 +531,13 @@ TEXT
529
531
  db = get_db
530
532
  #db.run "select * from bugs " do |row|
531
533
  #end
534
+ descindex = nil
532
535
  fields = "id,status,title,severity,priority,start_date,due_date"
533
536
  if @options[:short]
534
537
  fields = "id,status,title"
535
538
  elsif @options[:long]
536
539
  fields = "id,status,title,severity,priority,due_date,description"
540
+ descindex = 6
537
541
  end
538
542
  where = nil
539
543
  wherestring = ""
@@ -553,14 +557,19 @@ TEXT
553
557
  end
554
558
  puts wherestring
555
559
 
560
+ db.db.type_translation = true
561
+ db.db.results_as_hash = false # 2011-09-21
556
562
  rows = db.run "select #{fields} from bugs #{wherestring} "
563
+ db.db.type_translation = false
557
564
  die "No rows" unless rows
558
565
 
559
566
  rows = Cmdapp.filter_rows( rows, incl) do |row, regexp|
560
- row['title'] =~ regexp
567
+ #row['title'] =~ regexp
568
+ row[2] =~ regexp
561
569
  end
562
570
  rows = Cmdapp.filter_rows( rows, excl) do |row, regexp|
563
- row['title'] !~ regexp
571
+ #row['title'] !~ regexp
572
+ row[2] !~ regexp
564
573
  end
565
574
  headings = fields.split ","
566
575
  # if you want to filter output send a delimiter
@@ -568,11 +577,18 @@ TEXT
568
577
  delim = @options[:delimiter] || "\t"
569
578
  puts headings.join delim
570
579
  rows.each do |e|
571
- d = e['description']
572
- e['description'] = d.gsub(/\n/," ") if d
580
+ # d = e['description'] # changed 2011 dts
581
+ if descindex
582
+ d = e[descindex]
583
+ e[descindex] = d.gsub(/\n/," ") if d
584
+ end
573
585
  puts e.join delim
574
586
  end
575
587
  else
588
+ if rows.size == 0
589
+ puts "No rows"
590
+ return
591
+ end
576
592
  # pretty output tabular format etc
577
593
  require 'terminal-table/import'
578
594
  #table = table(nil, *rows)
@@ -811,6 +827,7 @@ TEXT
811
827
  sql = "select log.id, title, log.created_by, log.date_created, log from log,bugs where bugs.id = log.id order by log.date_created desc limit #{limit}"
812
828
 
813
829
  db = get_db
830
+ db.db.results_as_hash = true # 2011-09-21
814
831
  db.run sql do |row|
815
832
  log = Cmdapp.indent2( row['log'],20)
816
833
  text = <<-TEXT
@@ -834,6 +851,7 @@ TEXT
834
851
  sql = "select comments.id, title, comments.created_by, comments.date_created, comment from comments,bugs where bugs.id = comments.id order by comments.date_created desc limit #{limit}"
835
852
 
836
853
  db = get_db
854
+ db.db.results_as_hash = true # 2011-09-21
837
855
  db.run sql do |row|
838
856
  comment = Cmdapp.indent2( row['comment'],20)
839
857
  text = <<-TEXT
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugzyrb
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 3
8
- - 1
9
- version: 0.3.1
4
+ prerelease:
5
+ version: 0.3.3
10
6
  platform: ruby
11
7
  authors:
12
8
  - Rahul Kumar
@@ -14,8 +10,7 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2010-09-12 00:00:00 +05:30
18
- default_executable: bugzyrb
13
+ date: 2011-09-21 00:00:00 Z
19
14
  dependencies:
20
15
  - !ruby/object:Gem::Dependency
21
16
  name: yard
@@ -25,9 +20,6 @@ dependencies:
25
20
  requirements:
26
21
  - - ">="
27
22
  - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- - 5
31
23
  version: "0.5"
32
24
  type: :development
33
25
  version_requirements: *id001
@@ -39,10 +31,6 @@ dependencies:
39
31
  requirements:
40
32
  - - ">="
41
33
  - !ruby/object:Gem::Version
42
- segments:
43
- - 1
44
- - 0
45
- - 5
46
34
  version: 1.0.5
47
35
  type: :runtime
48
36
  version_requirements: *id002
@@ -54,10 +42,6 @@ dependencies:
54
42
  requirements:
55
43
  - - ">="
56
44
  - !ruby/object:Gem::Version
57
- segments:
58
- - 1
59
- - 5
60
- - 2
61
45
  version: 1.5.2
62
46
  type: :runtime
63
47
  version_requirements: *id003
@@ -69,10 +53,6 @@ dependencies:
69
53
  requirements:
70
54
  - - ">="
71
55
  - !ruby/object:Gem::Version
72
- segments:
73
- - 1
74
- - 4
75
- - 2
76
56
  version: 1.4.2
77
57
  type: :runtime
78
58
  version_requirements: *id004
@@ -84,28 +64,9 @@ dependencies:
84
64
  requirements:
85
65
  - - ">="
86
66
  - !ruby/object:Gem::Version
87
- segments:
88
- - 1
89
- - 2
90
- - 5
91
67
  version: 1.2.5
92
68
  type: :runtime
93
69
  version_requirements: *id005
94
- - !ruby/object:Gem::Dependency
95
- name: arrayfields
96
- prerelease: false
97
- requirement: &id006 !ruby/object:Gem::Requirement
98
- none: false
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- segments:
103
- - 4
104
- - 7
105
- - 4
106
- version: 4.7.4
107
- type: :runtime
108
- version_requirements: *id006
109
70
  description: basic, easy-to-use command-line issue-tracker using sqlite for ruby 1.9
110
71
  email: sentinel1879@gmail.com
111
72
  executables:
@@ -117,7 +78,6 @@ extra_rdoc_files:
117
78
  - README.rdoc
118
79
  files:
119
80
  - .document
120
- - .gitignore
121
81
  - CHANGELOG.rdoc
122
82
  - LICENSE
123
83
  - README.rdoc
@@ -131,13 +91,12 @@ files:
131
91
  - lib/bugzyrb/common/colorconstants.rb
132
92
  - lib/bugzyrb/common/db.rb
133
93
  - lib/bugzyrb/common/sed.rb
134
- has_rdoc: true
135
94
  homepage: http://github.com/rkumar/bugzyrb
136
95
  licenses: []
137
96
 
138
97
  post_install_message:
139
- rdoc_options:
140
- - --charset=UTF-8
98
+ rdoc_options: []
99
+
141
100
  require_paths:
142
101
  - lib
143
102
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -145,21 +104,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
145
104
  requirements:
146
105
  - - ">="
147
106
  - !ruby/object:Gem::Version
148
- segments:
149
- - 0
150
107
  version: "0"
151
108
  required_rubygems_version: !ruby/object:Gem::Requirement
152
109
  none: false
153
110
  requirements:
154
111
  - - ">="
155
112
  - !ruby/object:Gem::Version
156
- segments:
157
- - 0
158
113
  version: "0"
159
114
  requirements: []
160
115
 
161
116
  rubyforge_project: bugzyrb
162
- rubygems_version: 1.3.7
117
+ rubygems_version: 1.8.8
163
118
  signing_key:
164
119
  specification_version: 3
165
120
  summary: command-line bug/issue tracker using sqlite, ruby 1.9
data/.gitignore DELETED
@@ -1,26 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
- TODO2.txt
21
- serial_number*
22
- *.sqlite
23
- *.db
24
-
25
-
26
- ## PROJECT::SPECIFIC