Sha256: 24d079c08b2b38b05c2a7fb93745034ecfd1e971292ce93aa962ac659c24e069

Contents?: true

Size: 984 Bytes

Versions: 10

Compression:

Stored size: 984 Bytes

Contents

require 'rubyzilla'

module Rubyzilla
  class Product
    def bugs(attributes = {})
      if attributes.empty?
        attributes.merge!(:last_change_time => Time.now-30*24*60*60)
      end
      attributes.merge!(:product => self.name, :limit => 100)
      result = Bugzilla.server.call("Bug.search", attributes)
      result["bugs"].collect { |bug| Bug.new bug["id"] }
    end
  end

  class Bug
    def comments(attributes = {})
      if !attributes.has_key? :comment_ids
        attributes.merge!({:ids => [self.id]})
      end
      comments = []
      result = Bugzilla.server.call("Bug.comments", attributes)
      if attributes.has_key? :ids
        comments = result["bugs"]["#{self.id}"]["comments"]
      else
        attributes[:comment_ids].each { |comment_id| comments << result["comments"]["#{comment_id}"] }
      end
      comments
    end
  end
end

%w{ bugzilla ticket project comment }.each do |f|
  require File.dirname(__FILE__) + '/provider/' + f + '.rb';
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
taskmapper-bugzilla-0.4.0 lib/taskmapper-bugzilla.rb
taskmapper-bugzilla-0.3.0 lib/taskmapper-bugzilla.rb
ticketmaster-bugzilla-0.2.9 lib/ticketmaster-bugzilla.rb
ticketmaster-bugzilla-0.2.8 lib/ticketmaster-bugzilla.rb
ticketmaster-bugzilla-0.1.8 lib/ticketmaster-bugzilla.rb
ticketmaster-bugzilla-0.1.7 lib/ticketmaster-bugzilla.rb
ticketmaster-bugzilla-0.1.6 lib/ticketmaster-bugzilla.rb
ticketmaster-bugzilla-0.0.6 lib/ticketmaster-bugzilla.rb
ticketmaster-bugzilla-0.0.5 lib/ticketmaster-bugzilla.rb
ticketmaster-bugzilla-0.0.4 lib/ticketmaster-bugzilla.rb