Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated the dummy provider to example version 0.3.0 changes
some minor bugfixes
- Loading branch information
Hong
committed
Jul 7, 2010
1 parent
b35a658
commit 1e805c0
Showing
13 changed files
with
61 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
%w{ | ||
rubygems | ||
hashie | ||
active_resource | ||
}.each {|lib| require lib } | ||
|
||
class TicketMaster | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module TicketMaster::Provider | ||
module Dummy | ||
# This is the Comment class for the Dummy provider | ||
class Comment < TicketMaster::Provider::Base::Comment | ||
|
||
|
||
def self.find_by_id(id) | ||
self.new({:id => id}) | ||
end | ||
|
||
def self.find_by_attributes(*options) | ||
[self.new(*options)] | ||
end | ||
|
||
# You don't need to define an initializer, this is only here to initialize dummy data | ||
def initialize(project_id, ticket_id, *options) | ||
data = {:id => rand(1000), :status => ['lol', 'rofl', 'lmao', 'lamo', 'haha', 'heh'][rand(6)], | ||
:priority => rand(10), :summary => 'Tickets ticket ticket ticket', :resolution => false, | ||
:created_at => Time.now, :updated_at => Time.now, :description => 'Ticket ticket ticket ticket laughing', | ||
:assignee => 'lol-man'} | ||
@system = :dummy | ||
super(data.merge(options.first || {})) | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters