Remove stray puts

This commit is contained in:
Raphael Sofaer 2011-03-21 17:12:54 -07:00
parent 2b997e70c2
commit 85e0736e5b
2 changed files with 8 additions and 9 deletions

View file

@ -47,7 +47,6 @@ class ServicesController < ApplicationController
def finder def finder
service = current_user.services.where(:type => "Services::#{params[:provider].titleize}").first service = current_user.services.where(:type => "Services::#{params[:provider].titleize}").first
@friends = service ? service.finder(:remote => params[:remote]) : [] @friends = service ? service.finder(:remote => params[:remote]) : []
pp @friends.class
render :layout => false render :layout => false
end end

View file

@ -7,7 +7,7 @@ class WebfingerProfile
@links = {} @links = {}
set_fields set_fields
end end
def valid_diaspora_profile? def valid_diaspora_profile?
!(@webfinger_profile.nil? || @account.nil? || @links.nil? || @hcard.nil? || !(@webfinger_profile.nil? || @account.nil? || @links.nil? || @hcard.nil? ||
@guid.nil? || @public_key.nil? || @seed_location.nil? ) @guid.nil? || @public_key.nil? || @seed_location.nil? )
@ -17,12 +17,12 @@ class WebfingerProfile
def set_fields def set_fields
doc = Nokogiri::XML.parse(webfinger_profile) doc = Nokogiri::XML.parse(webfinger_profile)
account_string = doc.css('Subject').text.gsub('acct:', '').strip account_string = doc.css('Subject').text.gsub('acct:', '').strip
raise "account in profile(#{account_string}) and account requested (#{@account}) do not match" if account_string != @account raise "account in profile(#{account_string}) and account requested (#{@account}) do not match" if account_string != @account
doc.css('Link').each do |l| doc.css('Link').each do |l|
rel = text_of_attribute(l, 'rel') rel = text_of_attribute(l, 'rel')
href = text_of_attribute(l, 'href') href = text_of_attribute(l, 'href')
@links[rel] = href @links[rel] = href
@ -30,7 +30,7 @@ class WebfingerProfile
when "http://microformats.org/profile/hcard" when "http://microformats.org/profile/hcard"
@hcard = href @hcard = href
when "http://joindiaspora.com/guid" when "http://joindiaspora.com/guid"
@guid = href @guid = href
when "http://joindiaspora.com/seed_location" when "http://joindiaspora.com/seed_location"
@seed_location = href @seed_location = href
end end
@ -38,14 +38,14 @@ class WebfingerProfile
if doc.at('Link[rel=diaspora-public-key]') if doc.at('Link[rel=diaspora-public-key]')
begin begin
pubkey = text_of_attribute( doc.at('Link[rel=diaspora-public-key]'), 'href') pubkey = text_of_attribute( doc.at('Link[rel=diaspora-public-key]'), 'href')
@public_key = Base64.decode64 pubkey @public_key = Base64.decode64 pubkey
rescue Exception => e rescue Exception => e
puts "probally not diaspora..." Rails.logger.info(:event => :invalid_profile, :identifier => @account)
end end
end end
end end
def text_of_attribute(doc, attr) def text_of_attribute(doc, attr)
doc.attribute(attr) ? doc.attribute(attr).text : nil doc.attribute(attr) ? doc.attribute(attr).text : nil
end end