bugzyrb 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
data/bugzyrb.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bugzyrb}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
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"]
12
- s.date = %q{2010-07-12}
12
+ s.date = %q{2010-09-12}
13
13
  s.default_executable = %q{bugzyrb}
14
14
  s.description = %q{basic, easy-to-use command-line issue-tracker using sqlite for ruby 1.9}
15
15
  s.email = %q{sentinel1879@gmail.com}
@@ -39,14 +39,14 @@ Gem::Specification.new do |s|
39
39
  s.rdoc_options = ["--charset=UTF-8"]
40
40
  s.require_paths = ["lib"]
41
41
  s.rubyforge_project = %q{bugzyrb}
42
- s.rubygems_version = %q{1.3.6}
42
+ s.rubygems_version = %q{1.3.7}
43
43
  s.summary = %q{command-line bug/issue tracker using sqlite, ruby 1.9}
44
44
 
45
45
  if s.respond_to? :specification_version then
46
46
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
47
47
  s.specification_version = 3
48
48
 
49
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
49
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
50
50
  s.add_development_dependency(%q<yard>, [">= 0.5"])
51
51
  s.add_runtime_dependency(%q<subcommand>, [">= 1.0.5"])
52
52
  s.add_runtime_dependency(%q<highline>, [">= 1.5.2"])
@@ -399,7 +399,7 @@ module Cmdapp
399
399
  end
400
400
  def file_append filename, text
401
401
  filename = File.expand_path filename
402
- File.open(temp,"a"){ |f| f.write text }
402
+ File.open(filename,"a"){ |f| f.write text }
403
403
  end
404
404
  def check_file filename=@app_file_path
405
405
  File.exists?(filename) or die "#{filename} does not exist in this dir. "
@@ -434,7 +434,7 @@ module Cmdapp
434
434
  # FIXME: move to Cmdapp
435
435
  def get_lines prompt=nil
436
436
  #prompt ||= "Enter multiple lines, to quit enter . on empty line"
437
- #message prompt
437
+ message prompt if prompt
438
438
  str = ""
439
439
  while $stdin.gets # reads from STDIN
440
440
  case $_.chomp
@@ -76,4 +76,8 @@ module ColorConstants
76
76
  # Set the terminal's background ANSI color to white.
77
77
  ON_WHITE = "\e[47m"
78
78
 
79
+ def printred text
80
+ puts "#{RED} #{text} #{CLEAR} "
81
+ end
82
+
79
83
  end
@@ -95,7 +95,8 @@ module Database
95
95
  str << qstr.join(",")
96
96
  str << ")"
97
97
  #puts str
98
- @db.execute(str, *bind_vars)
98
+ # 2010-09-12 11:42 removed splat due to change in sqlite3 1.3.x
99
+ @db.execute(str, bind_vars)
99
100
  rowid = @db.get_first_value( "select last_insert_rowid();")
100
101
  return rowid
101
102
  end
@@ -105,16 +106,19 @@ module Database
105
106
  end
106
107
  def sql_comments_insert id, comment, created_by = $default_user
107
108
  #date_created = date_cr | Time.now
108
- @db.execute("insert into comments (id, comment, created_by) values (?,?,?)", id, comment, created_by )
109
+ # 2010-09-12 11:42 added [ ] due to change in sqlite3 1.3.x
110
+ @db.execute("insert into comments (id, comment, created_by) values (?,?,?)", [id, comment, created_by] )
109
111
  rowid = @db.get_first_value( "select last_insert_rowid();")
110
112
  return rowid
111
113
  end
112
114
  def sql_logs_insert id, field, log, created_by = $default_user
113
115
  #date_created = date_cr | Time.now
114
- @db.execute("insert into log (id, field, log, created_by) values (?,?,?,?)", id, field, log, created_by )
116
+ # 2010-09-12 11:42 added [ ] due to change in sqlite3 1.3.x
117
+ @db.execute("insert into log (id, field, log, created_by) values (?,?,?,?)", [id, field, log, created_by] )
115
118
  end
116
119
  def sql_delete_bug id
117
- message "deleting #{id}"
120
+ #message "deleting #{id}"
121
+ puts "deleting #{id}"
118
122
  @db.execute( "delete from bugs where id = ?", id )
119
123
  @db.execute( "delete from comments where id = ?", id )
120
124
  @db.execute( "delete from log where id = ?", id )
@@ -128,7 +132,8 @@ module Database
128
132
  # @param [String] value to update
129
133
  # @example sql_update "bugs", 9, :name, "Roger"
130
134
  def sql_update table, id, field, value
131
- @db.execute( "update #{table} set #{field} = ?, date_modified = ? where id = ?", value,$now, id)
135
+ # 2010-09-12 11:42 added to_s to now, due to change in sqlite3 1.3.x
136
+ @db.execute( "update #{table} set #{field} = ?, date_modified = ? where id = ?", [value,$now.to_s, id])
132
137
  end
133
138
 
134
139
  # update a row from bugs based on id, can give multiple fieldnames and values
@@ -139,7 +144,7 @@ module Database
139
144
  fields = []
140
145
  values = []
141
146
  fv << "date_modified"
142
- fv << $now
147
+ fv << $now.to_s
143
148
  fv.each_with_index do |f, i|
144
149
  if i % 2 == 0
145
150
  fields << "#{f} = ?"
@@ -149,7 +154,7 @@ module Database
149
154
  end
150
155
 
151
156
  print( "update bugs set #{fields.join(" ,")} where id = ?", *values, id)
152
- @db.execute( "update bugs set #{fields.join(" ,")} where id = ?", *values, id)
157
+ @db.execute( "update bugs set #{fields.join(" ,")} where id = ?", [*values, id])
153
158
  end
154
159
  #
155
160
  # return a single row from table based on rowid
@@ -201,25 +206,42 @@ if __FILE__ == $PROGRAM_NAME
201
206
  include Database
202
207
  # some tests. change bugs with real name
203
208
  db = DB.new
204
- db.dummy
209
+ #db.dummy
205
210
  puts "\n------------ all row -----\n"
206
211
  #db.select "bugs" do |r|
207
212
  #puts r
208
213
  ##puts r.join(" | ")
209
214
  #end
210
215
  res = db.select "bugs"
216
+ count = 0
211
217
  if res
212
218
  puts "count: #{res.count}"
213
219
  #puts res.public_methods
214
220
  res.each do |e|
215
221
  puts e.join(" | ")
222
+ count += 1
223
+ break if count ==3
216
224
  end
217
225
  end
226
+ puts "#{count} rows retrieved"
227
+ puts
228
+ puts "--- sql_update"
218
229
  db.sql_update "bugs", 1, "fix", "A fix added at #{$now}"
230
+ puts
231
+ puts "--- sql_bugs_update_mult "
219
232
  db.sql_bugs_update_mult 1, "title", "a new title #{$num}", "description", "a new description #{$num}"
220
233
  puts "\n------------ one row -----\n "
221
- db.select_where "bugs", "id", 1 do |r|
234
+ db.select_where "bugs", "id", 77 do |r|
222
235
  puts r.join(" | ")
223
236
  end
237
+ id = 77
238
+ comment = "adding a comment at #{$now}"
239
+ puts "--- sql_comments_insert "
240
+ db.sql_comments_insert id, comment, created_by = $default_user
241
+ field = "fix" ; log="modified fix"
242
+ puts "--- sql_logs_insert "
243
+ db.sql_logs_insert id, field, log, created_by = $default_user
244
+ puts "--- sql_delete_bug "
245
+ db.sql_delete_bug 76
224
246
 
225
247
  end # if
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 0
9
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Rahul Kumar
@@ -14,13 +14,14 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-12 00:00:00 +05:30
17
+ date: 2010-09-12 00:00:00 +05:30
18
18
  default_executable: bugzyrb
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: yard
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
24
25
  requirements:
25
26
  - - ">="
26
27
  - !ruby/object:Gem::Version
@@ -34,6 +35,7 @@ dependencies:
34
35
  name: subcommand
35
36
  prerelease: false
36
37
  requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
37
39
  requirements:
38
40
  - - ">="
39
41
  - !ruby/object:Gem::Version
@@ -48,6 +50,7 @@ dependencies:
48
50
  name: highline
49
51
  prerelease: false
50
52
  requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
51
54
  requirements:
52
55
  - - ">="
53
56
  - !ruby/object:Gem::Version
@@ -62,6 +65,7 @@ dependencies:
62
65
  name: terminal-table
63
66
  prerelease: false
64
67
  requirement: &id004 !ruby/object:Gem::Requirement
68
+ none: false
65
69
  requirements:
66
70
  - - ">="
67
71
  - !ruby/object:Gem::Version
@@ -76,6 +80,7 @@ dependencies:
76
80
  name: sqlite3-ruby
77
81
  prerelease: false
78
82
  requirement: &id005 !ruby/object:Gem::Requirement
83
+ none: false
79
84
  requirements:
80
85
  - - ">="
81
86
  - !ruby/object:Gem::Version
@@ -90,6 +95,7 @@ dependencies:
90
95
  name: arrayfields
91
96
  prerelease: false
92
97
  requirement: &id006 !ruby/object:Gem::Requirement
98
+ none: false
93
99
  requirements:
94
100
  - - ">="
95
101
  - !ruby/object:Gem::Version
@@ -135,6 +141,7 @@ rdoc_options:
135
141
  require_paths:
136
142
  - lib
137
143
  required_ruby_version: !ruby/object:Gem::Requirement
144
+ none: false
138
145
  requirements:
139
146
  - - ">="
140
147
  - !ruby/object:Gem::Version
@@ -142,6 +149,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
149
  - 0
143
150
  version: "0"
144
151
  required_rubygems_version: !ruby/object:Gem::Requirement
152
+ none: false
145
153
  requirements:
146
154
  - - ">="
147
155
  - !ruby/object:Gem::Version
@@ -151,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
159
  requirements: []
152
160
 
153
161
  rubyforge_project: bugzyrb
154
- rubygems_version: 1.3.6
162
+ rubygems_version: 1.3.7
155
163
  signing_key:
156
164
  specification_version: 3
157
165
  summary: command-line bug/issue tracker using sqlite, ruby 1.9