Sha256: 281abf5166190f6ddc9d711eed39df1772550d348355b17eb45d5855385f6fa5

Contents?: true

Size: 948 Bytes

Versions: 3

Compression:

Stored size: 948 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"]
    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

3 entries across 3 versions & 1 rubygems

Version Path
ticketmaster-bugzilla-0.0.3 lib/ticketmaster-bugzilla.rb
ticketmaster-bugzilla-0.0.2 lib/ticketmaster-bugzilla.rb
ticketmaster-bugzilla-0.0.1 lib/ticketmaster-bugzilla.rb