fixed the stupid addressable bug, also started playing with 1.9.2...sorry for the spaced out commit
This commit is contained in:
parent
f06b645b9c
commit
2f6a11f018
6 changed files with 11 additions and 25 deletions
9
Gemfile
9
Gemfile
|
|
@ -1,19 +1,16 @@
|
||||||
source 'http://rubygems.org'
|
source 'http://rubygems.org'
|
||||||
|
source 'http://gemcutter.org'
|
||||||
|
|
||||||
gem 'rails', '3.0.0.beta4'
|
gem 'rails', '3.0.0.beta4'
|
||||||
gem 'mongrel'
|
|
||||||
gem 'thin'
|
gem 'thin'
|
||||||
gem 'em-http-request'
|
gem 'em-http-request', :require => "em-http"
|
||||||
gem 'addressable'
|
gem 'addressable', :require => "addressable/uri"
|
||||||
gem "mongoid", :git => "git://github.com/durran/mongoid.git"
|
gem "mongoid", :git => "git://github.com/durran/mongoid.git"
|
||||||
gem "bson_ext", "1.0.1"
|
gem "bson_ext", "1.0.1"
|
||||||
gem "haml"
|
gem "haml"
|
||||||
gem "devise", :git => "git://github.com/plataformatec/devise.git"
|
gem "devise", :git => "git://github.com/plataformatec/devise.git"
|
||||||
gem 'roxml', :git => "git://github.com/Empact/roxml.git"
|
gem 'roxml', :git => "git://github.com/Empact/roxml.git"
|
||||||
|
|
||||||
|
|
||||||
gem 'dm-core' #:(
|
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem 'rspec', '>= 2.0.0.beta.12'
|
gem 'rspec', '>= 2.0.0.beta.12'
|
||||||
gem 'rspec-rails', ">= 2.0.0.beta.8"
|
gem 'rspec-rails', ">= 2.0.0.beta.8"
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ class Friend
|
||||||
validates_presence_of :username, :url
|
validates_presence_of :username, :url
|
||||||
validates_format_of :url, :with =>
|
validates_format_of :url, :with =>
|
||||||
/^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix
|
/^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix
|
||||||
|
|
||||||
|
#validate {self.url ! = User.first.url}
|
||||||
|
|
||||||
before_validation :clean_url
|
before_validation :clean_url
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
class Post
|
class Post
|
||||||
require 'lib/common'
|
require_relative '../../lib/common'
|
||||||
|
|
||||||
|
|
||||||
# XML accessors must always preceed mongo field tags
|
# XML accessors must always preceed mongo field tags
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
class StatusMessage < Post
|
class StatusMessage < Post
|
||||||
include StatusMessagesHelper
|
include StatusMessagesHelper
|
||||||
require 'lib/net/curl'
|
require_relative '../../lib/net/curl'
|
||||||
|
|
||||||
xml_name :status_message
|
xml_name :status_message
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,18 +17,4 @@
|
||||||
=link_to 'Destroy', status_message, :confirm => 'Are you sure?', :method => :delete
|
=link_to 'Destroy', status_message, :confirm => 'Are you sure?', :method => :delete
|
||||||
|
|
||||||
|
|
||||||
%h2 Friends
|
|
||||||
%table
|
|
||||||
%tr
|
|
||||||
%th username
|
|
||||||
%th url
|
|
||||||
- for friend in @friends
|
|
||||||
%tr
|
|
||||||
%td= friend.username
|
|
||||||
%td= friend.url
|
|
||||||
%td= link_to 'Show', friend
|
|
||||||
%td= link_to 'Destroy', friend, :confirm => 'Are you sure?', :method => :delete
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%p= link_to "New Status Message", new_status_message_path
|
%p= link_to "New Status Message", new_status_message_path
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
require 'addressable/uri'
|
# require 'addressable/uri'
|
||||||
require 'eventmachine'
|
# require 'eventmachine'
|
||||||
require 'em-http'
|
# require 'em-http'
|
||||||
|
|
||||||
class MessageHandler
|
class MessageHandler
|
||||||
|
|
||||||
|
|
@ -24,6 +24,7 @@ class MessageHandler
|
||||||
@queue.pop{ |query|
|
@queue.pop{ |query|
|
||||||
case query.type
|
case query.type
|
||||||
when :post
|
when :post
|
||||||
|
puts Addressable::URI::parse(query.destination).inspect
|
||||||
http = EventMachine::HttpRequest.new(query.destination).post :timeout => TIMEOUT, :body =>{:xml => query.body}
|
http = EventMachine::HttpRequest.new(query.destination).post :timeout => TIMEOUT, :body =>{:xml => query.body}
|
||||||
http.callback { process}
|
http.callback { process}
|
||||||
when :get
|
when :get
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue