tag:help.lighthouseapp.com,2008-09-20:/discussions/api-developers/68-lighthouserbbasecamprb-not-compatibleLighthouse: Discussion 2012-06-29T22:06:10Ztag:help.lighthouseapp.com,2008-09-20:Comment/453962009-01-23T00:20:00Z2009-01-23T00:20:00Zlighthouse.rb/basecamp.rb not compatible<div><p>I posted this to Lighthouse tickets but here might be a better
place for this question/issue.</p>
<p>I'm trying to integrate Basecamp and Lighthouse (to sync
Milestones) but basecamp.rb seems to interfere with lighthouse.rb.
Given this test file (and the attached basecamp.rb):</p>
<pre>
<code>require 'rubygems'
require 'yaml'
require 'lighthouse'
require 'basecamp'
#Lighthouse setup
#Login details have been changed. Insert your own here
Lighthouse.account = 'someaccount'
Lighthouse.token = '7d102aadfa3222afd8e487e766ff55cdf3b'
lh_ms = Lighthouse::Milestone.find(12345, :params => {:project_id => 45678 })
puts lh_ms.inspect
lh_ms.save</code>
</pre>
<p>It gives me this error:</p>
<pre>
<code>/Library/Ruby/Gems/1.8/gems/activeresource-2.2.2/lib/active_resource/formats/xml_format.rb:15:in `to_xml': wrong number of arguments (1 for 0) (ArgumentError)
from /Library/Ruby/Gems/1.8/gems/activeresource-2.2.2/lib/active_resource/formats/xml_format.rb:15:in `encode'
from /Library/Ruby/Gems/1.8/gems/activeresource-2.2.2/lib/active_resource/base.rb:896:in `encode'
from /Library/Ruby/Gems/1.8/gems/activeresource-2.2.2/lib/active_resource/base.rb:985:in `update'
from /Library/Ruby/Gems/1.8/gems/activeresource-2.2.2/lib/active_resource/base.rb:793:in `save_without_validation'
from /Library/Ruby/Gems/1.8/gems/activeresource-2.2.2/lib/active_resource/validations.rb:248:in `save'
from test.rb:12</code>
</pre>
<p>I know this isn't really a Lighthouse issue but any help in
working out what is going on would be appreciated.</p></div>Glen Barnestag:help.lighthouseapp.com,2008-09-20:Comment/453962009-02-11T14:41:37Z2009-02-11T14:41:37Zlighthouse.rb/basecamp.rb not compatible<div><p>I've encountered a connection / authentication problem using
both APIs because the Lighthouse API is overriding ActiveResource's
<em>authorization_header</em> method.</p>
<p>Commenting out lines 359-366 in lighthouse.rb solved the
problem. (since I'm using token authentication)</p>
<p>Maybe this is somehow related to your problem.</p>
<p>Cheers</p>
<p>Stefan</p></div>Stefan Schüßlertag:help.lighthouseapp.com,2008-09-20:Comment/453962009-02-11T17:57:18Z2009-02-11T17:57:18Zlighthouse.rb/basecamp.rb not compatible<div><p>Try swapping the order. The basecamp library overwrites
<code>Hash#to_xml</code> and makes it incompatible. This may be
tricky if both libraries make subtle differences to commonly used
methods.<br></p>
<p>I'll see if I can do something about the way the Lighthouse API
overrides the <code>authorization_header</code> method. Though, I
have no idea why this would affect Basecamp... its api client
library was written before the ActiveResource library was even a
twinkle in David's eye. However, I personally put in a lot of work
into ActiveResource to make the Lighthouse API client lib.</p></div>Ricktag:help.lighthouseapp.com,2008-09-20:Comment/453962009-02-11T18:29:25Z2009-02-11T18:29:25Zlighthouse.rb/basecamp.rb not compatible<div><p>Maybe Basecamp's ruby wrapper was updated. The current version
does use ActiveResource:
http://developer.37signals.com/basecamp/basecamp.rb</p></div>Stefan Schüßlertag:help.lighthouseapp.com,2008-09-20:Comment/453962009-02-11T18:47:01Z2009-02-11T18:47:01Zlighthouse.rb/basecamp.rb not compatible<div><p>stefan: oh that makes more sense... barnaclebarnes: try updating
the basecamp api and removing the authorization_header code as
stefan suggested.</p></div>Ricktag:help.lighthouseapp.com,2008-09-20:Comment/453962009-02-11T21:14:49Z2009-02-11T21:14:49Zlighthouse.rb/basecamp.rb not compatible<div><p>Updating basecamp.rb to the latest version and removing the
reference to authorization_headerin lighthouse.rb seems to have
work. Thanks for the pointers.</p></div>Glen Barnes