Created
January 29, 2010 22:06
-
-
Save anonymous/290194 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'active_resource' | |
TOKEN = '' | |
ROOT = 'https://' + TOKEN + ':[email protected]/' | |
class ActiveResource::Connection | |
def configure_http(http) | |
http = apply_ssl_options(http) | |
# Net::HTTP timeouts default to 60 seconds. | |
if @timeout | |
http.open_timeout = @timeout | |
http.read_timeout = @timeout | |
end | |
http.set_debug_output $stderr | |
http | |
end | |
end | |
ActiveSupport::Inflector.inflections do |inflect| | |
inflect.irregular 'task', 'task' | |
end | |
class Task < ActiveResource::Base | |
class << self | |
def element_path(id, prefix_options = {}, query_options = nil) | |
prefix_options, query_options = split_options(prefix_options) if query_options.nil? | |
"#{prefix(prefix_options)}#{collection_name}/#{id}#{query_string(query_options)}" | |
end | |
def collection_path(prefix_options = {}, query_options = nil) | |
prefix_options, query_options = split_options(prefix_options) if query_options.nil? | |
"#{prefix(prefix_options)}#{collection_name}#{query_string(query_options)}" | |
end | |
end | |
self.site = ROOT | |
end | |
Task.find(:all) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment