From 3b14e3c21f990bcaed28e2cf46ae1bc247c79468 Mon Sep 17 00:00:00 2001 From: Tracey Eubanks Date: Fri, 15 Jul 2011 14:44:11 -0600 Subject: [PATCH] saving state --- Gemfile | 1 + Gemfile.lock | 11 +++++++++++ app/models/issue_tracker.rb | 23 +++++++++++++---------- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 0063ef6..57f3206 100644 --- a/Gemfile +++ b/Gemfile @@ -11,6 +11,7 @@ gem 'redmine_client', :git => "git://github.com/oruen/redmine_client.git" gem 'mongoid_rails_migrations' gem 'useragent', '~> 0.3.1' gem 'pivotal-tracker' +gem 'ruby-fogbugz', :require => 'fogbugz', :path => '/Users/tracey/Development/gems/ruby-fogbugz' platform :ruby do gem 'bson_ext', '~> 1.2' diff --git a/Gemfile.lock b/Gemfile.lock index 953a539..623603a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,6 +5,13 @@ GIT redmine_client (0.0.1) activeresource (>= 2.3.0) +PATH + remote: /Users/tracey/Development/gems/ruby-fogbugz + specs: + ruby-fogbugz (0.0.3) + crack + typhoeus + GEM remote: http://rubygems.org/ specs: @@ -131,6 +138,9 @@ GEM thor (0.14.6) treetop (1.4.9) polyglot (>= 0.3.1) + typhoeus (0.2.4) + mime-types + mime-types tzinfo (0.3.26) useragent (0.3.1) warden (1.0.3) @@ -159,6 +169,7 @@ DEPENDENCIES redmine_client! rspec (~> 2.5) rspec-rails (~> 2.5) + ruby-fogbugz! thin useragent (~> 0.3.1) webmock diff --git a/app/models/issue_tracker.rb b/app/models/issue_tracker.rb index 9ade7d1..2b0f6ab 100644 --- a/app/models/issue_tracker.rb +++ b/app/models/issue_tracker.rb @@ -68,15 +68,18 @@ class IssueTracker end def create_fogbugz_issue err - FogBugz.account = account - FogBugz.token = api_token - FogBugz::Issue.site - issue = FogBugz::Issue.new(:project_id => project_id) - issue.subject = issue_title err - issue.body = self.class.fogbugz_body_template.result(binding) - issue.tags << 'errbit' - issue.save! - err.update_attribute :issue_link, "#{FogBugz::Issue.site.to_s.sub(/#{FogBugz::Issue.site.path}$/, '')}#{FogBugz::Issue.element_path(issue.id, :project => project_id}".sub(/\.xml$/, '') + fogbugz = Fogbugz::Interface.new(:email => email, :password => password, :uri => uri) + fogbugz.account = account + fogbugz.token = api_token + + issue = {} + issue['sTitle'] = issue_title err + issue['sProject'] = project_id + issue['sEvent'] = self.class.fogbugz_body_template.result(binding) + issue['sTags'] << 'errbit' + + fogbugz.command( + # err.update_attribute :issue_link, "#{FogBugz::Issue.site.to_s.sub(/#{FogBugz::Issue.site.path}$/, '')}#{FogBugz::Issue.element_path(issue.id, :project => project_id}".sub(/\.xml$/, '') end def issue_title err @@ -116,7 +119,7 @@ class IssueTracker end def fogbugz_body_template - @@fogbugz_body_template ||= ERB.new(File.read(Rails.root + "app/views/errs/fogbugz_body.txt.erb)) + @@fogbugz_body_template ||= ERB.new(File.read(Rails.root + "app/views/errs/fogbugz_body.txt.erb")) end end end -- libgit2 0.21.2