Permalink
Browse files

Merge pull request #5 from hybridgroup/master

Update to tm-rally
  • Loading branch information...
simeonwillbanks committed Sep 16, 2011
2 parents 9908880 + a86bdc1 commit 467ed230170672d3e3b6681e4ddb187ea865fe9f
Showing with 112 additions and 53 deletions.
  1. +1 −0 .rvmrc
  2. +1 −1 Gemfile
  3. +25 −18 Gemfile.lock
  4. +19 −6 README.md
  5. +2 −2 Rakefile
  6. +1 −1 VERSION
  7. +10 −3 lib/provider/comment.rb
  8. +10 −2 lib/provider/project.rb
  9. +12 −3 lib/provider/rally.rb
  10. +10 −2 lib/provider/ticket.rb
  11. +8 −4 spec/ticketmaster-rally_spec.rb
  12. +13 −11 ticketmaster-rally.gemspec
View
1 .rvmrc
@@ -0,0 +1 @@
+rvm 1.8.7@ticketmaster-rally --create
View
@@ -6,7 +6,7 @@ source "http://rubygems.org"
# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
-gem "ticketmaster"
+gem "ticketmaster", "0.6.6"
gem "rally_rest_api", "~> 1.0.3"
group :development do
View
@@ -1,30 +1,32 @@
GEM
remote: http://rubygems.org/
specs:
- activemodel (3.0.3)
- activesupport (= 3.0.3)
+ activemodel (3.0.9)
+ activesupport (= 3.0.9)
builder (~> 2.1.2)
- i18n (~> 0.4)
- activeresource (3.0.3)
- activemodel (= 3.0.3)
- activesupport (= 3.0.3)
- activesupport (3.0.3)
+ i18n (~> 0.5.0)
+ activeresource (3.0.9)
+ activemodel (= 3.0.9)
+ activesupport (= 3.0.9)
+ activesupport (3.0.9)
archive-tar-minitar (0.5.2)
builder (2.1.2)
- columnize (0.3.2)
+ columnize (0.3.4)
diff-lcs (1.1.2)
git (1.2.5)
- hashie (0.3.0)
+ hashie (1.0.0)
i18n (0.5.0)
jeweler (1.5.2)
bundler (~> 1.0.0)
git (>= 1.2.5)
rake
- linecache (0.43)
- linecache19 (0.5.11)
+ linecache (0.46)
+ rbx-require-relative (> 0.0.4)
+ linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
- rake (0.8.7)
+ rake (0.9.2)
rally_rest_api (1.0.3)
+ rbx-require-relative (0.0.5)
rcov (0.9.9)
rspec (2.3.0)
rspec-core (~> 2.3.0)
@@ -39,24 +41,29 @@ GEM
ruby-debug-base (~> 0.10.4.0)
ruby-debug-base (0.10.4)
linecache (>= 0.3)
- ruby-debug-base19 (0.11.24)
+ ruby-debug-base19 (0.11.25)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby_core_source (>= 0.1.4)
ruby-debug19 (0.11.6)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby-debug-base19 (>= 0.11.19)
- ruby_core_source (0.1.4)
+ ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
- ticketmaster (0.5.2)
+ ticketmaster (0.6.6)
+ activeresource
activeresource (>= 2.3.2)
+ activesupport
activesupport (>= 2.3.2)
- hashie (<= 0.3.0)
- yard (0.7.1)
+ hashie (= 1.0.0)
+ hashie
+ jeweler
+ yard (0.7.2)
PLATFORMS
ruby
+ x86-mingw32
DEPENDENCIES
bundler (~> 1.0.0)
@@ -66,5 +73,5 @@ DEPENDENCIES
rspec (~> 2.3.0)
ruby-debug
ruby-debug19
- ticketmaster
+ ticketmaster (= 0.6.6)
yard (~> 0.7.0)
View
@@ -5,7 +5,10 @@ This is a provider for [ticketmaster](http://ticketrb.com). It provides interope
# Usage and Examples
First we have to instantiate a new ticketmaster instance, your Rally installation should have api access enable:
- rally = TicketMaster.new(:rally, {:username=> 'foo', :password => "bar", :url => "https://community.rallydev.com/slm"})
+
+ rally = TicketMaster.new(:rally, {:username=> 'foo',
+ :password => "bar",
+ :url => "https://community.rallydev.com/slm"})
If you do not pass in the url, username and password, you won't get any information.
@@ -21,16 +24,26 @@ If you do not pass in the url, username and password, you won't get any informat
## Finding Tickets(Defects,Tasks)
-Coming Soon
+ # Ticket with ID of 1
+ ticket = project.ticket(1)
+ # Tickets with ID's of 1 and 2
+ tickets = project.tickets([1,2])
+ # All tickets
+ tickets = project.tickets
## Open Tickets
-Coming Soon
+ # Create a new ticket
+ ticket = project.ticket!(:title => 'New Ticket',
+ :description => 'Description')
## Finding comments
-
-Coming Soon
-
+
+ # Finding all comments
+ comments = ticket.comments
+ # Finding a comment with ID 1
+ comment = ticket.comment(1)
+
## Requirements
* rubygems (obviously)
View
@@ -17,8 +17,8 @@ Jeweler::Tasks.new do |gem|
gem.license = "MIT"
gem.summary = %Q{Ticketmaster provider for Rally's Ruby REST API}
gem.description = %Q{This is a provider for ticketmaster. It provides interoperability with Rally and it's project planning system through the ticketmaster gem}
- gem.email = ["sfw@simeonfosterwillbanks.com", "rob@notch8.com"]
- gem.authors = ["Simeon F. Willbanks", "Rob Kaufman"]
+ gem.email = ["sfw@simeonfosterwillbanks.com", "rob@notch8.com", "george.rafael@gmail.com"]
+ gem.authors = ["Simeon F. Willbanks", "Rob Kaufman", "Rafael George"]
# Include your dependencies below. Runtime dependencies are required when using your gem,
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
View
@@ -1 +1 @@
-0.1.0
+0.1.2
View
@@ -18,21 +18,28 @@ def initialize(*object)
project_id = args.shift
ticket_id = args.shift
@system_data = {:client => comment}
- creation_date_parsed = Time.parse(comment.creation_date)
hash = {
:oid => comment.oid,
:project_id => project_id,
:ticket_id => ticket_id,
:author => comment.user_name,
:body => comment.text,
- :created_at => creation_date_parsed,
- :updated_at => creation_date_parsed,
+ :created_at => comment.creation_date,
+ :updated_at => comment.creation_date,
:post_number => comment.post_number,
}
super(hash)
end
end
+ def created_at
+ Time.parse(self[:created_at])
+ end
+
+ def updated_at
+ Time.parse(self[:updated_at])
+ end
+
# Rally REST API aliases String and Fixnum :to_q :to_s
# However, it does not alias Bignum
# If a ID is a Bignum, the API will throw undefined method
View
@@ -18,13 +18,21 @@ def initialize(*object)
hash = {:oid => project.oid,
:name => project.name,
:description => project.description,
- :created_at => Time.parse(project.creation_date),
+ :created_at => project.creation_date,
# Rally Project object does not have a modified time
- :updated_at => Time.parse(project.creation_date)}
+ :updated_at => project.creation_date}
super hash
end
end
+ def created_at
+ Time.parse(self[:created_at])
+ end
+
+ def updated_at
+ Time.parse(self[:updated_at])
+ end
+
# Rally REST API aliases String and Fixnum :to_q :to_s
# However, it does not alias Bignum
# If a ID is a Bignum, the API will throw undefined method
View
@@ -18,20 +18,29 @@ def authorize(auth = {})
end
TicketMaster::Provider::Rally.rally = RallyRestAPI.new(:username => auth.username,
:password => auth.password,
- :base_url => auth.url,
- :logger => RALLY_LOGGER_PATH ? Logger.new(RALLY_LOGGER_PATH) : nil)
+ :base_url => auth.url)
+
end
# declare needed overloaded methods here
+ def valid?
+ begin
+ TicketMaster::Provider::Rally.rally.find_all(:project).first
+ true
+ rescue
+ false
+ end
+ end
+
def self.rally=(rally_instance)
@rally = rally_instance
end
def self.rally
@rally
end
-
+
end
end
View
@@ -31,8 +31,8 @@ def initialize(*object)
:requestor => ticket.submitted_by,
:resolution => ticket.schedule_state,
:status => ticket.state,
- :created_at => Time.parse(ticket.creation_date),
- :updated_at => Time.parse(ticket.last_update_date)
+ :created_at => ticket.creation_date,
+ :updated_at => ticket.last_update_date
}
# Rally optional attributes
hash[:assignee] = ticket.owner if ticket.owner
@@ -48,6 +48,14 @@ def initialize(*object)
super(hash)
end
end
+
+ def created_at
+ Time.parse(self[:created_at])
+ end
+
+ def updated_at
+ Time.parse(self[:updated_at])
+ end
# Rally REST API aliases String and Fixnum :to_q :to_s
# However, it does not alias Bignum
@@ -2,22 +2,26 @@
describe "Ticketmaster::Provider::Rally" do
- before(:all) do
+ before(:each) do
@auth = {:url => 'https://community.rallydev.com/slm',
:username => 'ticketmaster-rally@simeonfosterwillbanks.com',
:password => 'Password'}
+ @ticketmaster = TicketMaster.new(:rally, @auth)
end
it "should be able to instantiate a new instance directly" do
@ticketmaster = TicketMaster::Provider::Rally.new(@auth)
@ticketmaster.should be_an_instance_of(TicketMaster)
@ticketmaster.should be_a_kind_of(TicketMaster::Provider::Rally)
end
-
+
it "should be able to instantiate a new instance from parent" do
- @ticketmaster = TicketMaster.new(:rally, @auth)
@ticketmaster.should be_an_instance_of(TicketMaster)
@ticketmaster.should be_a_kind_of(TicketMaster::Provider::Rally)
end
-
+
+ it "should be a valid instance" do
+ @ticketmaster.valid?.should be_true
+ end
+
end
View
@@ -5,20 +5,21 @@
Gem::Specification.new do |s|
s.name = %q{ticketmaster-rally}
- s.version = "0.1.0"
+ s.version = "0.1.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = [%q{Simeon F. Willbanks}, %q{Rob Kaufman}]
- s.date = %q{2011-06-07}
+ s.authors = ["Simeon F. Willbanks", "Rob Kaufman", "Rafael George"]
+ s.date = %q{2011-08-02}
s.description = %q{This is a provider for ticketmaster. It provides interoperability with Rally and it's project planning system through the ticketmaster gem}
- s.email = [%q{sfw@simeonfosterwillbanks.com}, %q{rob@notch8.com}]
+ s.email = ["sfw@simeonfosterwillbanks.com", "rob@notch8.com", "george.rafael@gmail.com"]
s.extra_rdoc_files = [
"LICENSE.txt",
"README.md"
]
s.files = [
".document",
".rspec",
+ ".rvmrc",
"Gemfile",
"Gemfile.lock",
"LICENSE.txt",
@@ -36,12 +37,13 @@ Gem::Specification.new do |s|
"spec/projects_spec.rb",
"spec/spec_helper.rb",
"spec/ticketmaster-rally_spec.rb",
- "spec/tickets_spec.rb"
+ "spec/tickets_spec.rb",
+ "ticketmaster-rally.gemspec"
]
s.homepage = %q{http://github.com/simeonwillbanks/ticketmaster-rally}
- s.licenses = [%q{MIT}]
- s.require_paths = [%q{lib}]
- s.rubygems_version = %q{1.8.5}
+ s.licenses = ["MIT"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.6.1}
s.summary = %q{Ticketmaster provider for Rally's Ruby REST API}
s.test_files = [
"spec/comments_spec.rb",
@@ -55,7 +57,7 @@ Gem::Specification.new do |s|
s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<ticketmaster>, [">= 0"])
+ s.add_runtime_dependency(%q<ticketmaster>, ["= 0.6.6"])
s.add_runtime_dependency(%q<rally_rest_api>, ["~> 1.0.3"])
s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
s.add_development_dependency(%q<yard>, ["~> 0.7.0"])
@@ -65,7 +67,7 @@ Gem::Specification.new do |s|
s.add_development_dependency(%q<ruby-debug>, [">= 0"])
s.add_development_dependency(%q<ruby-debug19>, [">= 0"])
else
- s.add_dependency(%q<ticketmaster>, [">= 0"])
+ s.add_dependency(%q<ticketmaster>, ["= 0.6.6"])
s.add_dependency(%q<rally_rest_api>, ["~> 1.0.3"])
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
s.add_dependency(%q<yard>, ["~> 0.7.0"])
@@ -76,7 +78,7 @@ Gem::Specification.new do |s|
s.add_dependency(%q<ruby-debug19>, [">= 0"])
end
else
- s.add_dependency(%q<ticketmaster>, [">= 0"])
+ s.add_dependency(%q<ticketmaster>, ["= 0.6.6"])
s.add_dependency(%q<rally_rest_api>, ["~> 1.0.3"])
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
s.add_dependency(%q<yard>, ["~> 0.7.0"])

0 comments on commit 467ed23

Please sign in to comment.