yql 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,9 @@
1
- === 0.1.1 2010-06-20
1
+ === 0.0.1 2010-06-20
2
2
 
3
3
  * 1 major enhancement:
4
- * Initial release
4
+ * Initial release
5
+
6
+ === 0.0.2 2010-06-20
7
+
8
+ * 1 bug fix:
9
+ * Fix CGI require directive that was giving Superclass cookie error when using with rails
@@ -2,6 +2,7 @@ History.txt
2
2
  Manifest.txt
3
3
  README.rdoc
4
4
  lib/yql.rb
5
- lib/yql/client.rb
6
5
  lib/yql/error.rb
6
+ lib/yql/response.rb
7
+ lib/yql/client.rb
7
8
  lib/yql/query_builder.rb
data/lib/yql.rb CHANGED
@@ -2,11 +2,11 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  require 'rubygems'
5
- require 'CGI'
5
+ require 'cgi'
6
6
  require 'net/http'
7
7
  require 'net/https'
8
8
  require 'rexml/document'
9
9
  require 'yql/error.rb'
10
- require 'yql/client.rb'
11
10
  require 'yql/query_builder.rb'
12
- require 'yql/response.rb'
11
+ require 'yql/response.rb'
12
+ require 'yql/client.rb'
@@ -0,0 +1,36 @@
1
+ module Yql
2
+
3
+ class Response
4
+
5
+ def initialize(response, format)
6
+ @response = response
7
+ @format = format
8
+ end
9
+
10
+ def show
11
+ raise Yql::ResponseFailure, body.inspect unless success?
12
+ output
13
+ end
14
+
15
+ def body
16
+ @response.body
17
+ end
18
+
19
+ def code
20
+ @response.code
21
+ end
22
+
23
+ def success?
24
+ code == '200'
25
+ end
26
+
27
+ private
28
+
29
+ def output
30
+ return body unless @format == 'xml'
31
+ REXML::Document.new(body)
32
+ end
33
+
34
+ end
35
+
36
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nasir Jamal
@@ -31,8 +31,9 @@ files:
31
31
  - Manifest.txt
32
32
  - README.rdoc
33
33
  - lib/yql.rb
34
- - lib/yql/client.rb
35
34
  - lib/yql/error.rb
35
+ - lib/yql/response.rb
36
+ - lib/yql/client.rb
36
37
  - lib/yql/query_builder.rb
37
38
  has_rdoc: true
38
39
  homepage: http://github.com/nas/yql