ruby-bugzilla 0.2 → 0.2.1

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/bzconsole +35 -37
  2. data/lib/bugzilla.rb +1 -1
  3. metadata +3 -2
data/bin/bzconsole CHANGED
@@ -32,8 +32,8 @@ require 'uri'
32
32
  $KCODE = 'u'
33
33
 
34
34
  begin
35
- gem 'ruby-bugzilla'
36
- rescue Gem::LoadError
35
+ require 'bugzilla'
36
+ rescue LoadError
37
37
  require File.join(File.dirname(__FILE__), "..", "lib", "bugzilla.rb")
38
38
  $:.push(File.join(File.dirname(__FILE__), "..", "lib"))
39
39
  end
@@ -703,49 +703,47 @@ module BzConsole
703
703
 
704
704
  end # module BzConsole
705
705
 
706
- if $0 == __FILE__ then
707
- begin
708
- opts = {}
709
- opts[:command] = {}
710
- subargv = []
706
+ begin
707
+ opts = {}
708
+ opts[:command] = {}
709
+ subargv = []
711
710
 
712
- o = ARGV.options do |opt|
713
- opt.banner = sprintf("Usage: %s [global options] <command> ...", File.basename(__FILE__))
714
- opt.separator ""
715
- opt.separator "Global options:"
716
- opt.on('-c', '--config=FILE', 'read FILE as the configuration file.') {|v| opts[:config] = v}
717
- opt.on('-h', '--help', 'show this message') {|x| opts[:help] = true}
711
+ o = ARGV.options do |opt|
712
+ opt.banner = sprintf("Usage: %s [global options] <command> ...", File.basename(__FILE__))
713
+ opt.separator ""
714
+ opt.separator "Global options:"
715
+ opt.on('-c', '--config=FILE', 'read FILE as the configuration file.') {|v| opts[:config] = v}
716
+ opt.on('-h', '--help', 'show this message') {|x| opts[:help] = true}
718
717
 
719
- cmds = BzConsole.constants.sort.map {|x| (k = eval("BzConsole::#{x}")).class == Class && x != "CommandTemplate" ? x.downcase : nil}.compact
718
+ cmds = BzConsole.constants.sort.map {|x| (k = eval("BzConsole::#{x}")).class == Class && x != "CommandTemplate" ? x.downcase : nil}.compact
720
719
 
721
- subargv = opt.order(ARGV);
720
+ subargv = opt.order(ARGV);
722
721
 
723
- command = subargv[0]
722
+ command = subargv[0]
724
723
 
725
- if subargv.length > 0 then
726
- n = cmds.index(command)
727
- unless n.nil? then
728
- opts[:instance] = eval("BzConsole::#{cmds[n].capitalize}.new(Bugzilla::Plugin::Template.new)")
729
- subargv = opts[:instance].parse(opt, subargv[1..-1], opts[:command])
730
- else
731
- STDERR.printf("E: Unknown command: %s\n", subargv[0])
732
- STDERR.printf(" Available commands: %s\n", cmds.join(' '))
733
- exit 1
734
- end
724
+ if subargv.length > 0 then
725
+ n = cmds.index(command)
726
+ unless n.nil? then
727
+ opts[:instance] = eval("BzConsole::#{cmds[n].capitalize}.new(Bugzilla::Plugin::Template.new)")
728
+ subargv = opts[:instance].parse(opt, subargv[1..-1], opts[:command])
735
729
  else
736
- opt.separator ""
737
- opt.separator "Available commands:"
738
- opt.separator sprintf(" %s", cmds.join(' '))
739
- end
740
-
741
- if opts[:instance].nil? && subargv.length == 0 ||
742
- opts[:help] == true ||
743
- subargv.length < opts[:instance].n_args then
744
- puts opt.help
745
- exit
730
+ STDERR.printf("E: Unknown command: %s\n", subargv[0])
731
+ STDERR.printf(" Available commands: %s\n", cmds.join(' '))
732
+ exit 1
746
733
  end
734
+ else
735
+ opt.separator ""
736
+ opt.separator "Available commands:"
737
+ opt.separator sprintf(" %s", cmds.join(' '))
747
738
  end
748
739
 
749
- opts[:instance].do(subargv, opts)
740
+ if opts[:instance].nil? && subargv.length == 0 ||
741
+ opts[:help] == true ||
742
+ subargv.length < opts[:instance].n_args then
743
+ puts opt.help
744
+ exit
745
+ end
750
746
  end
747
+
748
+ opts[:instance].do(subargv, opts)
751
749
  end
data/lib/bugzilla.rb CHANGED
@@ -30,7 +30,7 @@ require 'xmlrpc/client'
30
30
 
31
31
  module Bugzilla
32
32
 
33
- VERSION = "0.2"
33
+ VERSION = "0.2.1"
34
34
 
35
35
  =begin rdoc
36
36
 
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-bugzilla
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- version: "0.2"
9
+ - 1
10
+ version: 0.2.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Akira TAGOH