Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Removed deprecated Gem::manage_gems from Rakefile. #10

Closed
wants to merge 21 commits into from

3 participants

@CodeGnome
CodeGnome and others added some commits
@CodeGnome CodeGnome Fixed indentation of 'action' case statement. bf12a7f
@CodeGnome CodeGnome Added help command.
- Closes issue #4: Where is `ti help`
  [http://github.com/schacon/ticgit/issues#issue/4]
- ti learned the 'help' command.
- ti learned to display list of commands alphabetically.
- Extract method 'handle_help' for use by execute! and parse_options!
  methods.
16c58eb
@CodeGnome CodeGnome Removed deprecated Gem::manage_gems from Rakefile.
- Closes http://github.com/schacon/ticgit/issues/#issue/1
- Rakefile learned that Gem::manage_gems was removed in rubygems r1307.
a58c818
@CodeGnome CodeGnome Major cleanup of ticgit.gemspec.
- Bumped revision to 0.3.7 so that the source version is higher than the
  totally different (but previously identically-incremented) version on
  Rubygems.
- Bumped spec date.
- Replaced all soft quotes with hard quotes.
- Sorted files list.
- Prettied up the arrays.
1117d12
@CodeGnome CodeGnome README file now provides greater detail.
- Added a prerequisites section.
- Addressed version issues that may affect certain users.
- Explained how to install git and ticgit gems without root access.
- Documented the -h flag accepted by many commands.
- Updated the authors section.
- Obfuscated the email addresses in the README.
    + GitHub and others display the README on the web, making the
      addresses spam-bait.
    + There are important reasons to use a valid email address in
      repositories and patches, but landing-page README files do not
      have the same needs.
7509467
@CodeGnome CodeGnome README file now provides greater detail.
- Added a prerequisites section.
- Addressed version issues that may affect certain users.
- Explained how to install git and ticgit gems without root access.
- Documented the -h flag accepted by many commands.
- Updated the authors section.
- Obfuscated the email addresses in the README.
    + GitHub and others display the README on the web, making the
      addresses spam-bait.
    + There are important reasons to use a valid email address in
      repositories and patches, but landing-page README files do not
      have the same needs.
c781d1b
@CodeGnome CodeGnome Simpler installation using bundler.
- Mostly automatic installation, as long as rubygems and bundler are
  present.
- Added Gemfile for bundler.
- Added minimum version requirements to Gemfile for git gem.
- Simplified installation instructions for both root and non-root users.
- Modified Rakefile extensively:
    - Automatic installation of bundled gems to meet dependencies.
    - Default task now builds and installs the current gem from source
      in one easy step.
    - Moved testing items into their own namespace.
    - Lots of formatting changes.
    - Authors section of README now references an external AUTHORS file.
- Obfuscated email addresses in AUTHORS file.
- Upstream rcov task remains broken.
b7a2260
@CodeGnome CodeGnome Improved feedback to users during gem building.
- Better messages to indicate status of gem build/install.
- Determining whether current version of non-bundled gem is already
  installed does not currently work; added to ToDo list.
91d6d5c
@CodeGnome CodeGnome Merge branch 'topic/bundler'
Conflicts:
	README

Conflicts caused by rebasing a misplaced commit. Resolved in favor of
the bundler topic branch.
b01a0e6
@CodeGnome CodeGnome Added sinatra and haml gems to Gemfile.
Sinatra and haml are required for proper operation of ticgitweb. They
will now be installed by the rake task if missing.
4979d87
@kballard kballard Support searching for multiple tags/states and for negating tags/states
-t and -s now take comma-separated lists. Prefixing an element with - means
reject all tickets that match that tag/state
c89b352
@CodeGnome CodeGnome Document installation of rake gem.
- Don't assume everyone already has rake installed.
- Experienced rubyists can skip the rake installation line or not, as
  they choose.
6910699
@CodeGnome CodeGnome Updated prerequisites section.
- Higher visibility for the dependency on rubygems.
- Made git dependency a little less verbose.
95992cf
@CodeGnome CodeGnome Updated prereqs: bundler wants rubygems >= 1.3.6
Documented the need for a newer version of rubygems because of a bundler
dependency.
137df03
@CodeGnome CodeGnome Added support for non-alphanumeric titles.
- Incorporated ticket_title patch from Debian maintainer Michael
  Schutte. [git://git.debian.org/~michi-guest/ticgit.git @ bcaff2c]
- Closes Debian bug 514282.
  [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514282]
350560c
@CodeGnome CodeGnome Automatically choose system/source library.
- bin/ti learned to detect if it was running inside a Git source tree.
- bin/ti now automatically prefers the source version of the ticgit
  library when run from inside the Git tree.
- Made path names OS-agnostic within by using File.join instead of
  hard-coded directory separators.
8308774
@CodeGnome CodeGnome Added Gemfile.lock to project.
- Ensures that gem versions and dependencies are identified within the
  project.
- Ensures that downstream packagers know what versions of each gem were
  tested together by the developers.
076cdd7
@CodeGnome CodeGnome Require sass explicitly in ticgitweb.
- Fixes missing CSS when rendering pages from ticgitweb.
- Sass appears to be installed by the haml gem, but isn't brought in
  automatically when haml is required.
05f962d
@CodeGnome CodeGnome Prepend source tree lib directory to LOAD_PATH.
Add the ticgit.rb library from the source tree to the front of the load
path. This allows ticgitweb to run without first creating and installing
a ticgit gem, which is important when testing multiple branches of
development.
253f646
@CodeGnome CodeGnome Munge LOAD_PATH to prefer source tree for ticgit.
- bin/ti learned an easier way to prefer the ticgit.rb library in the
  source tree over an installed gem.
- bin/ti now uses same trick as bin/ticgitweb (see commit 253f646).
c24e37e
@CodeGnome CodeGnome Simplification of gemspec.
- Removed optional fields, especially those prone to clobbering between
  forks. This should make maintaining the gemspec among multiple clones
  easier.
- Added dynamic date. Date will be updated on each rebuild of the gem.
- Added dynamic versioning based on seconds since epoch. Version will be
  incremented on each rebuild of the gem.
e2a0853
@jeffWelling
Collaborator

Rakefile has since been rewritten.
Closing issue.

@jeffWelling jeffWelling closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 2, 2010
  1. @CodeGnome
  2. @CodeGnome

    Added help command.

    CodeGnome authored
    - Closes issue #4: Where is `ti help`
      [http://github.com/schacon/ticgit/issues#issue/4]
    - ti learned the 'help' command.
    - ti learned to display list of commands alphabetically.
    - Extract method 'handle_help' for use by execute! and parse_options!
      methods.
  3. @CodeGnome

    Removed deprecated Gem::manage_gems from Rakefile.

    CodeGnome authored
    - Closes http://github.com/schacon/ticgit/issues/#issue/1
    - Rakefile learned that Gem::manage_gems was removed in rubygems r1307.
Commits on Sep 3, 2010
  1. @CodeGnome

    Major cleanup of ticgit.gemspec.

    CodeGnome authored
    - Bumped revision to 0.3.7 so that the source version is higher than the
      totally different (but previously identically-incremented) version on
      Rubygems.
    - Bumped spec date.
    - Replaced all soft quotes with hard quotes.
    - Sorted files list.
    - Prettied up the arrays.
  2. @CodeGnome

    README file now provides greater detail.

    CodeGnome authored
    - Added a prerequisites section.
    - Addressed version issues that may affect certain users.
    - Explained how to install git and ticgit gems without root access.
    - Documented the -h flag accepted by many commands.
    - Updated the authors section.
    - Obfuscated the email addresses in the README.
        + GitHub and others display the README on the web, making the
          addresses spam-bait.
        + There are important reasons to use a valid email address in
          repositories and patches, but landing-page README files do not
          have the same needs.
Commits on Sep 4, 2010
  1. @CodeGnome

    README file now provides greater detail.

    CodeGnome authored
    - Added a prerequisites section.
    - Addressed version issues that may affect certain users.
    - Explained how to install git and ticgit gems without root access.
    - Documented the -h flag accepted by many commands.
    - Updated the authors section.
    - Obfuscated the email addresses in the README.
        + GitHub and others display the README on the web, making the
          addresses spam-bait.
        + There are important reasons to use a valid email address in
          repositories and patches, but landing-page README files do not
          have the same needs.
  2. @CodeGnome

    Simpler installation using bundler.

    CodeGnome authored
    - Mostly automatic installation, as long as rubygems and bundler are
      present.
    - Added Gemfile for bundler.
    - Added minimum version requirements to Gemfile for git gem.
    - Simplified installation instructions for both root and non-root users.
    - Modified Rakefile extensively:
        - Automatic installation of bundled gems to meet dependencies.
        - Default task now builds and installs the current gem from source
          in one easy step.
        - Moved testing items into their own namespace.
        - Lots of formatting changes.
        - Authors section of README now references an external AUTHORS file.
    - Obfuscated email addresses in AUTHORS file.
    - Upstream rcov task remains broken.
  3. @CodeGnome

    Improved feedback to users during gem building.

    CodeGnome authored
    - Better messages to indicate status of gem build/install.
    - Determining whether current version of non-bundled gem is already
      installed does not currently work; added to ToDo list.
  4. @CodeGnome

    Merge branch 'topic/bundler'

    CodeGnome authored
    Conflicts:
    	README
    
    Conflicts caused by rebasing a misplaced commit. Resolved in favor of
    the bundler topic branch.
  5. @CodeGnome

    Added sinatra and haml gems to Gemfile.

    CodeGnome authored
    Sinatra and haml are required for proper operation of ticgitweb. They
    will now be installed by the rake task if missing.
  6. @kballard @CodeGnome

    Support searching for multiple tags/states and for negating tags/states

    kballard authored CodeGnome committed
    -t and -s now take comma-separated lists. Prefixing an element with - means
    reject all tickets that match that tag/state
Commits on Sep 6, 2010
  1. @CodeGnome

    Document installation of rake gem.

    CodeGnome authored
    - Don't assume everyone already has rake installed.
    - Experienced rubyists can skip the rake installation line or not, as
      they choose.
  2. @CodeGnome

    Updated prerequisites section.

    CodeGnome authored
    - Higher visibility for the dependency on rubygems.
    - Made git dependency a little less verbose.
  3. @CodeGnome

    Updated prereqs: bundler wants rubygems >= 1.3.6

    CodeGnome authored
    Documented the need for a newer version of rubygems because of a bundler
    dependency.
Commits on Sep 9, 2010
  1. @CodeGnome

    Added support for non-alphanumeric titles.

    CodeGnome authored
    - Incorporated ticket_title patch from Debian maintainer Michael
      Schutte. [git://git.debian.org/~michi-guest/ticgit.git @ bcaff2c]
    - Closes Debian bug 514282.
      [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514282]
Commits on Sep 10, 2010
  1. @CodeGnome

    Automatically choose system/source library.

    CodeGnome authored
    - bin/ti learned to detect if it was running inside a Git source tree.
    - bin/ti now automatically prefers the source version of the ticgit
      library when run from inside the Git tree.
    - Made path names OS-agnostic within by using File.join instead of
      hard-coded directory separators.
  2. @CodeGnome

    Added Gemfile.lock to project.

    CodeGnome authored
    - Ensures that gem versions and dependencies are identified within the
      project.
    - Ensures that downstream packagers know what versions of each gem were
      tested together by the developers.
  3. @CodeGnome

    Require sass explicitly in ticgitweb.

    CodeGnome authored
    - Fixes missing CSS when rendering pages from ticgitweb.
    - Sass appears to be installed by the haml gem, but isn't brought in
      automatically when haml is required.
  4. @CodeGnome

    Prepend source tree lib directory to LOAD_PATH.

    CodeGnome authored
    Add the ticgit.rb library from the source tree to the front of the load
    path. This allows ticgitweb to run without first creating and installing
    a ticgit gem, which is important when testing multiple branches of
    development.
  5. @CodeGnome

    Munge LOAD_PATH to prefer source tree for ticgit.

    CodeGnome authored
    - bin/ti learned an easier way to prefer the ticgit.rb library in the
      source tree over an installed gem.
    - bin/ti now uses same trick as bin/ticgitweb (see commit 253f646).
  6. @CodeGnome

    Simplification of gemspec.

    CodeGnome authored
    - Removed optional fields, especially those prone to clobbering between
      forks. This should make maintaining the gemspec among multiple clones
      easier.
    - Added dynamic date. Date will be updated on each rebuild of the gem.
    - Added dynamic versioning based on seconds since epoch. Version will be
      incremented on each rebuild of the gem.
This page is out of date. Refresh to see the latest.
View
5 AUTHORS
@@ -0,0 +1,5 @@
+Adam <pope -AT- shifteleven.com>
+James Healy <jimmy -AT- deefa.com>
+Magnus Holm <judofyr -AT- gmail.com>
+Scott Chacon <schacon -AT- gmail.com>
+Todd A. Jacobs <codegnome.consulting+ticgit -AT- gmail.com>
View
7 Gemfile
@@ -0,0 +1,7 @@
+source :rubygems
+
+gem 'rake'
+gem 'rspec'
+gem 'git', '>= 1.0.5'
+gem 'sinatra'
+gem 'haml'
View
20 Gemfile.lock
@@ -0,0 +1,20 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ git (1.2.5)
+ haml (3.0.18)
+ rack (1.2.1)
+ rake (0.8.7)
+ rspec (1.3.0)
+ sinatra (1.0)
+ rack (>= 1.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ git (>= 1.0.5)
+ haml
+ rake
+ rspec
+ sinatra
View
63 README
@@ -1,39 +1,68 @@
TicGit Distributed Ticketing System
===================================
-
This project provides a ticketing system built on Git that is kept in a
separate branch in your projects Git repository.
-Installing
+
+Prerequisites
===================================
-You will need the 'git' gem (ver 1.0.5) to use this. Then you can run :
+This README assumes that you already have a recent version of RubyGems
+installed on your system. Older versions, such as the one available on
+Debian 5.0.5, will not work out of the box with some of the new gem
+repositories. In addition, Bundler requires RubyGems >= 1.3.6. If you
+are running an older version of RubyGems, you may need to get the latest
+rubygems package from http://rubygems.org/ before being able to complete
+the installation.
-rake
-sudo gem install pkg/ticgit-0.1.0.gem
+You must also have a recent version of the Git revision control system
+installed. If it is not available through your package manager, you can
+download the latest Git source code from http://git-scm.com/ instead.
-Usage
+Installing
===================================
-See http://github.com/schacon/ticgit/wikis for a bunch of examples
+Install the rake and bundler gems, and then run rake from the top of the
+source tree to install TicGit. To install as root:
+
+ sudo gem install rake
+ sudo gem install bundler
+ sudo rake
-ti list - show all tickets
+If you do not have root access, or do not wish to make system changes
+without going through your distribution's package manager, you can place
+the following into your $HOME/.bashrc file:
-ti show - show details of a specific ticket
+ export GEM_HOME=~/gems
+ export RUBYOPT=rubygems
+ export PATH=$HOME/gems/bin:$PATH
-ti new - create a new ticket
+Source your .bashrc, and you should now be able to install gems into a
+non-system directory without root privileges:
-ti checkout - checkout a ticket
+ gem install rake
+ gem install bundler
+ rake
-ti state - change a ticket state (open, resolved, invalid, hold)
-ti comment - add a comment to a ticket
+Usage
+===================================
+See http://github.com/schacon/ticgit/wikis for a bunch of examples. For
+a quick start, here is a brief explanation of the basic commands:
-ti tag - add or delete a tag from a ticket
+ ti help - show all available commands
+ ti assign - change to whom a ticket is assigned
+ ti checkout - checkout a ticket
+ ti comment - add a comment to a ticket
+ ti list - show all tickets
+ ti new - create a new ticket
+ ti show - show details of a specific ticket
+ ti state - change a ticket state (open, resolved, invalid, hold)
+ ti tag - add or delete a tag from a ticket
-ti assign - change to whom a ticket is assigned
+Most commands can also take an -h flag for additional detail about
+command-specific options.
Authors
===================================
-Scott Chacon (schacon@gmail.com)
-
+See AUTHORS file.
View
51 Rakefile
@@ -1,30 +1,46 @@
require 'rubygems'
-Gem::manage_gems
+require 'bundler'
+
+unless system 'bundle check'
+ exit 1 unless system 'bundle install'
+end
+
+require 'bundler/setup'
require 'rake/gempackagetask'
require 'spec/rake/spectask'
-spec = eval(File.read('ticgit.gemspec'))
-
-Rake::GemPackageTask.new(spec) do |pkg|
- pkg.need_tar = true
-end
+namespace :bundle do
+ desc 'Install all required gems.'
+ task :install do
+ system 'bundle install'
+ end
-desc "Run all specs in spec directory"
-Spec::Rake::SpecTask.new(:spec) do |t|
- t.spec_files = FileList['spec/**/*_spec.rb']
- t.spec_opts = ['--color']
+ desc 'List bundled gems.'
+ task :show do
+ system 'bundle show'
+ end
end
-namespace :spec do
+namespace :test do
+ desc "Run all specs in spec directory"
+ Spec::Rake::SpecTask.new(:spec) do |t|
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.spec_opts = ['--color']
+ end
desc "Run rcov on the spec files"
Spec::Rake::SpecTask.new(:coverage) do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ['--color']
t.rcov = true
- t.rcov_opts = ['--exclude', 'spec\/spec,bin\/spec,examples,\/var\/lib\/gems,\/Library\/Ruby,\.autotest']
+ t.rcov_opts = ['--exclude',
+ 'spec\/spec,bin\/spec,examples,\/var\/lib\/gems,\/Library\/Ruby,\.autotest']
end
+end
+spec = eval(File.read('ticgit.gemspec'))
+Rake::GemPackageTask.new(spec) do |pkg|
+ pkg.need_tar = true
end
desc "Clean out the coverage and pkg directories"
@@ -34,6 +50,13 @@ task :clean do
rm Dir.glob('ticgit*gem')
end
-task :default => "pkg/#{spec.name}-#{spec.version}.gem" do
- puts "generated latest version"
+task :make => "pkg/#{spec.name}-#{spec.version}.gem" do
+ puts "Generating #{spec.name}-#{spec.version}.gem"
+end
+
+task :install do
+ puts "Installing #{spec.name}-#{spec.version}.gem ..."
+ system "gem install pkg/#{spec.name}-#{spec.version}.gem"
end
+
+task :default => [:make, :install]
View
10 bin/ti
@@ -6,6 +6,12 @@
#
require 'rubygems'
+require 'fileutils'
+
+# Add the library from the source tree to the front of the load path.
+# This allows ti to run without first installing a ticgit gem, which is
+# important when testing multiple branches of development.
+$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require 'ticgit'
-#require File.dirname(__FILE__) + '/../lib/ticgit'
-TicGit::CLI.execute
+
+TicGit::CLI.execute
View
11 bin/ticgitweb
@@ -8,7 +8,12 @@
# author : Scott Chacon (schacon@gmail.com)
#
-%w(rubygems sinatra git ticgit haml).each do |dependency|
+# Add the library from the source tree to the front of the load path.
+# This allows ticgitweb to run without first installing a ticgit gem,
+# which is important when testing multiple branches of development.
+$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
+
+%w(rubygems sinatra git ticgit haml sass).each do |dependency|
begin
require dependency
rescue LoadError => e
@@ -154,7 +159,7 @@ def list(title = 'all')
%td
%a{:href => "/ticket/#{t.ticket_id}" }
%code= t.ticket_id[0,6]
- %td= t.title
+ %td&= t.title
%td{:class => t.state}= t.state
%td= t.opened.strftime("%m/%d")
%td= t.assigned_name
@@ -167,7 +172,7 @@ end
def show
layout('ticket', %q{
%center
- %h1= @ticket.title
+ %h1&= @ticket.title
%form{:action => "/a/add_tags/#{@ticket.ticket_id}", :method => 'POST'}
%table
View
44 lib/ticgit/base.rb
@@ -1,6 +1,7 @@
require 'logger'
require 'fileutils'
require 'yaml'
+require 'set'
module TicGit
class NoRepoFound < StandardError;end
@@ -97,14 +98,37 @@ def ticket_list(options = {})
options = c.merge(options)
end
end
-
+
if options[:list]
# TODO : this is a hack and i need to fix it
config['list_options'].each do |name, opts|
puts name + "\t" + opts.inspect
end
return false
- end
+ end
+
+ if options.size == 0
+ # default list
+ options[:state] = 'open'
+ end
+
+ # :tag, :state, :assigned
+ if t = options[:tags]
+ t = {false => Set.new, true => Set.new}.merge t.classify { |x| x[0,1] != "-" }
+ t[false].map! { |x| x[1..-1] }
+ ts = ts.reject { |tic| t[true].intersection(tic.tags).empty? } unless t[true].empty?
+ ts = ts.select { |tic| t[false].intersection(tic.tags).empty? } unless t[false].empty?
+ end
+ if s = options[:states]
+ s = {false => Set.new, true => Set.new}.merge s.classify { |x| x[0,1] != "-" }
+ s[true].map! { |x| Regexp.new(x, Regexp::IGNORECASE) }
+ s[false].map! { |x| Regexp.new(x[1..-1], Regexp::IGNORECASE) }
+ ts = ts.select { |tic| s[true].any? { |st| tic.state =~ st } } unless s[true].empty?
+ ts = ts.reject { |tic| s[false].any? { |st| tic.state =~ st } } unless s[false].empty?
+ end
+ if a = options[:assigned]
+ ts = ts.select { |tic| tic.assigned =~ Regexp.new(a, Regexp::IGNORECASE) }
+ end
# SORTING
if field = options[:order]
@@ -122,22 +146,6 @@ def ticket_list(options = {})
# default list
ts = ts.sort { |a, b| a.opened <=> b.opened }
end
-
- if options.size == 0
- # default list
- options[:state] = 'open'
- end
-
- # :tag, :state, :assigned
- if t = options[:tag]
- ts = ts.select { |tag| tag.tags.include?(t) }
- end
- if s = options[:state]
- ts = ts.select { |tag| tag.state =~ /#{s}/ }
- end
- if a = options[:assigned]
- ts = ts.select { |tag| tag.assigned =~ /#{a}/ }
- end
if save = options[:save]
options.delete(:save)
View
69 lib/ticgit/cli.rb
@@ -1,5 +1,6 @@
require 'ticgit'
require 'optparse'
+require 'set'
# used Cap as a model for this - thanks Jamis
@@ -29,26 +30,28 @@ def initialize(args)
def execute!
case action
- when 'list':
- handle_ticket_list
- when 'state'
- handle_ticket_state
- when 'assign'
- handle_ticket_assign
- when 'show'
- handle_ticket_show
- when 'new'
- handle_ticket_new
- when 'checkout', 'co'
- handle_ticket_checkout
- when 'comment'
- handle_ticket_comment
- when 'tag'
- handle_ticket_tag
- when 'recent'
- handle_ticket_recent
- when 'milestone'
- handle_ticket_milestone
+ when 'help':
+ handle_help
+ when 'list':
+ handle_ticket_list
+ when 'state'
+ handle_ticket_state
+ when 'assign'
+ handle_ticket_assign
+ when 'show'
+ handle_ticket_show
+ when 'new'
+ handle_ticket_new
+ when 'checkout', 'co'
+ handle_ticket_checkout
+ when 'comment'
+ handle_ticket_comment
+ when 'tag'
+ handle_ticket_tag
+ when 'recent'
+ handle_ticket_recent
+ when 'milestone'
+ handle_ticket_milestone
else
puts 'not a command'
end
@@ -91,6 +94,12 @@ def parse_ticket_tag
end.parse!
end
+ def handle_help
+ warn 'Please specify at least one action to execute:'
+ puts ' assign checkout comment help list new show state tag'
+ exit
+ end
+
def handle_ticket_tag
parse_ticket_tag
@@ -211,11 +220,17 @@ def parse_ticket_list
opts.on("-o ORDER", "--order ORDER", "Field to order by - one of : assigned,state,date") do |v|
@options[:order] = v
end
- opts.on("-t TAG", "--tag TAG", "List only tickets with specific tag") do |v|
- @options[:tag] = v
+ opts.on("-t TAG[,TAG]", "--tags TAG[,TAG]", Array,
+ "List only tickets with specific tag(s)",
+ "Prefix the tag with '-' to negate") do |v|
+ @options[:tags] ||= Set.new
+ @options[:tags].merge v
end
- opts.on("-s STATE", "--state STATE", "List only tickets in a specific state") do |v|
- @options[:state] = v
+ opts.on("-s STATE[,STATE]", "--states STATE[,STATE]", Array,
+ "List only tickets in a specific state(s)",
+ "Prefix the state with '-' to negate") do |v|
+ @options[:states] ||= Set.new
+ @options[:states].merge v
end
opts.on("-a ASSIGNED", "--assigned ASSIGNED", "List only tickets assigned to someone") do |v|
@options[:assigned] = v
@@ -371,9 +386,7 @@ def get_editor_message(message_file = nil)
def parse_options! #:nodoc:
if args.empty?
- warn "Please specify at least one action to execute."
- puts " list state show new checkout comment tag assign "
- exit
+ handle_help
end
@action = args.first
@@ -393,4 +406,4 @@ def just(value, size, side = 'l')
end
end
-end
+end
View
6 lib/ticgit/ticket.rb
@@ -41,6 +41,8 @@ def self.open(base, ticket_name, ticket_hash, options = {})
ticket_hash['files'].each do |fname, value|
if fname == 'TICKET_ID'
tid = value
+ elsif fname == 'TICKET_TITLE'
+ t.title = base.git.gblob(value).contents
else
# matching
data = fname.split('_')
@@ -78,6 +80,7 @@ def save_new
Dir.mkdir(ticket_name)
Dir.chdir(ticket_name) do
base.new_file('TICKET_ID', ticket_name)
+ base.new_file('TICKET_TITLE', title)
base.new_file('ASSIGNED_' + email, email)
base.new_file('STATE_' + state, state)
@@ -98,7 +101,6 @@ def save_new
end
end
end
-
base.git.add
base.git.commit("added ticket #{ticket_name}")
end
@@ -211,4 +213,4 @@ def self.create_ticket_name(title)
end
-end
+end
View
27 ticgit.gemspec
@@ -1,18 +1,21 @@
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
- s.name = "ticgit"
- s.version = "0.3.6"
- s.date = "2008-05-10"
- s.author = "Scott Chacon"
- s.email = "schacon@gmail.com"
- s.summary = "A distributed ticketing system for Git projects."
- s.files = ["lib/ticgit/base.rb", "lib/ticgit/cli.rb", "lib/ticgit/comment.rb", "lib/ticgit/ticket.rb", "lib/ticgit.rb", "bin/ti", "bin/ticgitweb"]
-
+ s.name = 'ticgit'
+ s.version = "0.3.7.#{Time.now.to_i}"
+ s.date = Time.now.strftime '%Y-%m-%d'
+ s.summary = 'A distributed ticketing system for Git projects.'
+ s.files = %w[bin/ti
+ bin/ticgitweb
+ lib/ticgit.rb
+ lib/ticgit/base.rb
+ lib/ticgit/cli.rb
+ lib/ticgit/comment.rb
+ lib/ticgit/ticket.rb]
s.bindir = 'bin'
- s.executables = ["ti", "ticgitweb"]
- s.default_executable = %q{ti}
- s.homepage = "http://github/schacon/ticgit"
+ s.executables = %w[ti ticgitweb]
+ s.default_executable = 'ti'
- s.require_paths = ["lib", "bin"]
+ s.add_dependency('git', '>= 1.0.5')
+ s.require_paths = %w[lib bin]
s.specification_version = 2 if s.respond_to? :specification_version=
end
Something went wrong with that request. Please try again.