diff options
author | azul <azul@riseup.net> | 2013-12-22 06:33:21 -0800 |
---|---|---|
committer | azul <azul@riseup.net> | 2013-12-22 06:33:21 -0800 |
commit | 41dee6ee7242a731763bb1b75e12cc97403aa4a4 (patch) | |
tree | dfacb19930d1c28cf53fe041cc8151fe39fe358e /lib/tapicero/json_stream.rb | |
parent | 8104b882032a851604ba6a2a904c7e267523f158 (diff) | |
parent | e4df501035434cbb1920ccca21e489599b5ad382 (diff) |
Merge pull request #5 from azul/feature/use-couchrest-changes
Version 0.2.0: use CouchRest::Changes
Diffstat (limited to 'lib/tapicero/json_stream.rb')
-rw-r--r-- | lib/tapicero/json_stream.rb | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/tapicero/json_stream.rb b/lib/tapicero/json_stream.rb deleted file mode 100644 index 64b160f..0000000 --- a/lib/tapicero/json_stream.rb +++ /dev/null @@ -1,31 +0,0 @@ -require 'net/http' -require 'uri' -require 'yajl' - -# UNUSED: We're currently using couchrest instead as that is what we use all -# over the place. It internally uses curl to fetch the stream. -# -# Since Yajl HTTP Stream will go a way in version 2.0 here's a simple substitude. -# -module Tapicero - class JsonStream - - def self.get(url, options, &block) - uri = URI(url) - parser = Yajl::Parser.new(options) - parser.on_parse_complete = block - Net::HTTP.start(uri.host, uri.port) do |http| - request = Net::HTTP::Get.new uri.request_uri - - - http.request request do |response| - response.read_body do |chunk| - parser << chunk - end - end - end - - end - end -end - |