Skip to content

Commit

Permalink
so this should make it work properly on 1.9x
Browse files Browse the repository at this point in the history
  • Loading branch information
imajes authored and rlivsey committed Nov 24, 2009
1 parent 8df2166 commit 159fe71
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/rspreedly/base.rb
Expand Up @@ -8,9 +8,12 @@ class Base
attr_reader :errors

def self.api_request(type, path, options={})
path = "/#{::RSpreedly::Config.site_name}#{path}"
site_name = RSpreedly::Config.site_name.class == Array ? RSpreedly::Config.site_name.first : RSpreedly::Config.site_name
api_key = RSpreedly::Config.api_key.class == Array ? RSpreedly::Config.api_key.first : RSpreedly::Config.api_key
path = "/#{site_name}#{path}"

options.merge!({
:basic_auth => {:username => RSpreedly::Config.api_key, :password => 'X'},
:basic_auth => {:username => api_key, :password => 'X'},
:headers => {"Content-Type" => 'application/xml'}
})
self.do_request(type, path, options)
Expand Down Expand Up @@ -79,7 +82,7 @@ def to_xml(opts={})
xml << "<#{tag}>" unless no_tag
xml << "<#{inner}>" if inner
self.instance_variables.each do |var|
name = var.gsub('@', '')
name = var.to_s.gsub('@', '')
next if exclude.include?(name.to_sym)
value = self.instance_variable_get(var)
if value.respond_to?(:to_xml)
Expand Down

0 comments on commit 159fe71

Please sign in to comment.