<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -24,14 +24,14 @@ class LighthouseBranch
     end
   end
   
-  def ticket(id)
+  def self.ticket(id)
     Lighthouse::Ticket.find(id, :params =&gt; { :project_id =&gt; @project.id })
   end
   
-  def self.branch_name
+  def self.branch_name(args)
     unless @branch_name
       if(Float(args.first) rescue false)
-        ticket_id = args.shift
+        ticket_id = args.shift.to_i
         @branch_name = &quot;#{ticket_id}-#{ticket(ticket_id).title.gsub(/[^\w ]/, '').gsub(/[^a-z0-9]+/i, '-').downcase}&quot;
       else
         @branch_name = repo.head.name
@@ -46,17 +46,19 @@ class LighthouseBranch
     
     command = :default
     if Command::Base.command_regexes.select{ |command| args.first =~ command }.empty?
-      ticket_id = branch_name.to_i
+      branch = branch_name(args)
+      ticket_id = branch.to_i
       if ticket_id == 0
         usage
         exit
       end
     else
       command = args.shift
-      ticket_id = branch_name.to_i
+      branch = branch_name(args)
+      ticket_id = branch.to_i
     end
     
-    Command::Base.invoke(command, branch_name, ticket_id, args)
+    Command::Base.invoke(command, branch, ticket_id, args)
   end
   
   def self.usage</diff>
      <filename>lib/lighthouse_branch.rb</filename>
    </modified>
    <modified>
      <diff>@@ -36,7 +36,7 @@ module Command
       if number_of_arguments.is_a?(Range)
         correct_arguments = number_of_arguments.member?(args.size)
       elsif number_of_arguments.is_a?(Fixnum)
-        correct_arguments = number_of_arguments == args.size
+        correct_arguments = (number_of_arguments == args.size)
       end
       
       if correct_arguments</diff>
      <filename>lib/lighthouse_branch/command/base.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d656b150fd3d21cb69a9d1ae2c84cc2752a467c3</id>
    </parent>
  </parents>
  <author>
    <name>Matt Pruitt</name>
    <email>guitsaru@gmail.com</email>
  </author>
  <url>http://github.com/guitsaru/lighthouse_branch/commit/c80d9c2a8855506bd0695e9a8d65c0c77b20860c</url>
  <id>c80d9c2a8855506bd0695e9a8d65c0c77b20860c</id>
  <committed-date>2009-06-23T19:28:48-07:00</committed-date>
  <authored-date>2009-06-23T19:26:31-07:00</authored-date>
  <message>Fixed commands with ticket_id.

[#2 tagged:'branch:2-create-command-classes']</message>
  <tree>92818e9337959750fd7d8d499450e238db51555a</tree>
  <committer>
    <name>Matt Pruitt</name>
    <email>guitsaru@gmail.com</email>
  </committer>
</commit>
