Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

migrated over to using Streamly for direct HTTP access

  • Loading branch information...
commit 432eb8af9b90a1bdb44e73ed68cbc31b085a8685 1 parent b932785
@brianmario authored
Showing with 5 additions and 5 deletions.
  1. +1 −0  README.rdoc
  2. +1 −1  lib/freckle.rb
  3. +3 −4 lib/freckle/base.rb
View
1  README.rdoc
@@ -4,4 +4,5 @@ A basic API client for the Freckle API
== Dependencies
+* Streamly - http://github.com/brianmario/streamly
* yajl-ruby - http://github.com/brianmario/yajl-ruby
View
2  lib/freckle.rb
@@ -1,5 +1,5 @@
require 'yajl' unless defined?(Yajl)
-require 'uri' unless defined?(URI)
+require 'streamly' unless defined?(Streamly)
module Apis
module Freckle
View
7 lib/freckle/base.rb
@@ -1,9 +1,9 @@
module Apis
module Freckle
class Base
- def initialize(*args)
+ def initialize(args)
if args.is_a?(Hash)
- @site_url = args[:site_url]
+ @site_url = args[:username]
@token = args[:token]
elsif args.is_a?(Array)
@site_url = args[0]
@@ -31,8 +31,7 @@ def entries(force=false)
end
def get(url)
- uri = URI.parse('http://'+@site_url+'/api'+url+'?token='+@token)
- return Yajl::HttpStream.get(uri)
+ return Yajl::Parser.parse(Streamly.get('http://'+@site_url+'/api'+url+'?token='+@token))
end
protected
Please sign in to comment.
Something went wrong with that request. Please try again.