wrest 1.0.0.beta3-universal-java-1.6 → 1.0.0.beta4-universal-java-1.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -18,6 +18,9 @@ Features under a numbered section are complete and available in the Wrest gem.
18
18
 
19
19
  == Current
20
20
 
21
+ == 1.0.0.beta4
22
+ * GH#34 Wrest::Uri extensions swallow existing path
23
+
21
24
  == 1.0.0.beta3
22
25
  * GH#13 Works for get and delete with parameters appended to the uri string and
23
26
  with ? and no parameters appended to the uri string
data/README.rdoc CHANGED
@@ -1,4 +1,4 @@
1
- = Wrest 1.0.0.beta3
1
+ = Wrest 1.0.0.beta4
2
2
 
3
3
  (c) Copyright 2009-2010 {Sidu Ponnappa}[http://blog.sidu.in]. All Rights Reserved.
4
4
 
@@ -17,55 +17,38 @@ To receive notifications whenever new features are added to Wrest, please subscr
17
17
 
18
18
  For Facebook, Twitter, Delicious, GitHub and other API examples, see http://github.com/kaiwren/wrest/tree/master/examples
19
19
 
20
- == Installation
21
-
22
- The source is available at git://github.com/kaiwren/wrest.git
23
-
24
- To install the Wrest gem, do <tt>(sudo) gem install wrest --pre</tt>.
25
-
26
- Wrest is currently available as a gem for for Ruby and JRuby.
27
-
28
- === Shell
29
-
30
- You can launch the interactive Wrest shell by running bin/wrest if you have the source or invoking <tt>wrest</tt> from your prompt if you've installed the gem.
31
- $ wrest
32
- >> y 'http://twitter.com/statuses/public_timeline.json'.to_uri(:timeout => 5).get.deserialise
33
-
34
- === Library
35
-
36
- require 'rubygems'
37
- require 'wrest'
38
- y "http://search.yahooapis.com/NewsSearchService/V1/newsSearch".to_uri.get(
39
- :appid => 'YahooDemo',
40
- :output => 'xml',
41
- :query => 'India',
42
- :results=> '3',
43
- :start => '1'
44
- )
45
20
  === Basic Http Calls
46
21
 
47
22
  ==== GET
48
23
 
49
- A couple of ways to get Yahoo news as a hash map.
50
-
51
- * This example simply does a get on a uri and figures out the appropriate deserialiser using the content-type (in this case 'text/javascript', which uses Wrest::Translators::Json). See content_types.rb under lib/wrest/mappers/translators.
52
- "http://search.yahooapis.com/NewsSearchService/V1/newsSearch?appid=YahooDemo&output=json&query=India&results=3&start=1".to_uri.get.deserialise
53
-
54
- * This example does a get on a base uri with several parameters passed to it, resulting in a uri essentially the same as the one above. It also shows how you can specify a custom deserialiser to produce a hash-map from the response, as well as a hash mutator to clean up the deserialised hash.
55
- require 'rubygems'
56
- require 'wrest'
57
- include Wrest::Components
58
- y "http://search.yahooapis.com/NewsSearchService/V1/newsSearch".to_uri.get(
24
+ * Basic API calls
25
+
26
+ 'http://twitter.com/statuses/public_timeline.json'.to_uri.get.deserialise # works with json and xml out of the box
27
+
28
+ 'http://twitter.com/statuses/public_timeline.xml'.to_uri.get.deserialise # see lib/wrest/components/translators to add other formats
29
+ * Timeout support
30
+
31
+ 'http://twitter.com/statuses/public_timeline.json'.to_uri.get(:timeout => 5).body
32
+ * Redirect support
33
+
34
+ 'http://google.com'.to_uri(:follow_redirects => false).get
35
+
36
+ 'http://google.com'.to_uri(:follow_redirects_limit => 1).get
37
+ * More complex call with custom deserialiser
38
+
39
+ 'http://search.yahooapis.com/NewsSearchService/V1/newsSearch'.to_uri.get(
59
40
  :appid => 'YahooDemo',
60
41
  :output => 'xml',
61
42
  :query => 'India',
62
43
  :results=> '3',
63
44
  :start => '1'
64
45
  ).deserialise_using(
65
- Translators::Xml
66
- ).mutate_using(
67
- Mutators::XmlMiniTypeCaster.new
46
+ Wrest::Translators::Xml
68
47
  )
48
+ * Basic HTTP auth and URI extensions using Wrest::Uri#[]
49
+
50
+ base_uri = 'https://api.del.icio.us/v1'.to_uri(:username => 'kaiwren', :password => 'fupupp1es')
51
+ bookmarks = base_uri['/posts/get'].get.deserialise
69
52
 
70
53
  ==== DELETE
71
54
 
@@ -125,3 +108,17 @@ Wrest RDocs can be found at http://wrest.rubyforge.org
125
108
  == Roadmap
126
109
 
127
110
  Features that are planned, in progress or already implemented are documented in the {CHANGELOG}[http://github.com/kaiwren/wrest/tree/master/CHANGELOG] starting from version 0.0.8.
111
+
112
+ == Installation
113
+
114
+ The source is available at git://github.com/kaiwren/wrest.git
115
+
116
+ To install the Wrest gem, do <tt>(sudo) gem install wrest --pre</tt>.
117
+
118
+ Wrest is currently available as a gem for for Ruby and JRuby.
119
+
120
+ === Shell
121
+
122
+ You can launch the interactive Wrest shell by running bin/wrest if you have the source or invoking <tt>wrest</tt> from your prompt if you've installed the gem.
123
+ $ wrest
124
+ >> y 'http://twitter.com/statuses/public_timeline.json'.to_uri(:timeout => 5).get.deserialise
data/lib/wrest/uri.rb CHANGED
@@ -58,7 +58,7 @@ module Wrest #:nodoc:
58
58
  # uri = "https://localhost:3000/v1".to_uri(:username => 'foo', :password => 'bar')
59
59
  # uri['/oogas/1', {:username => 'meh', :password => 'baz'}].get
60
60
  def [](path, options = nil)
61
- Uri.new(URI.join(uri_string, path), options || @options)
61
+ Uri.new(uri + File.join(uri_path, path), options || @options)
62
62
  end
63
63
 
64
64
  # Clones a Uri, building a new instance with exactly the same uri string.
data/lib/wrest/version.rb CHANGED
@@ -13,7 +13,7 @@ module Wrest
13
13
  MAJOR = 1
14
14
  MINOR = 0
15
15
  TINY = 0
16
- BUILD = 'beta3'
16
+ BUILD = 'beta4'
17
17
 
18
18
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
19
19
 
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 1
7
7
  - 0
8
8
  - 0
9
- - beta3
10
- version: 1.0.0.beta3
9
+ - beta4
10
+ version: 1.0.0.beta4
11
11
  platform: universal-java-1.6
12
12
  authors:
13
13
  - Sidu Ponnappa
@@ -16,13 +16,14 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-09-15 00:00:00 +05:30
19
+ date: 2010-09-17 00:00:00 +05:30
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rspec
24
24
  prerelease: false
25
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
26
27
  requirements:
27
28
  - - ~>
28
29
  - !ruby/object:Gem::Version
@@ -39,6 +40,7 @@ dependencies:
39
40
  name: activesupport
40
41
  prerelease: false
41
42
  requirement: &id002 !ruby/object:Gem::Requirement
43
+ none: false
42
44
  requirements:
43
45
  - - ~>
44
46
  - !ruby/object:Gem::Version
@@ -53,6 +55,7 @@ dependencies:
53
55
  name: builder
54
56
  prerelease: false
55
57
  requirement: &id003 !ruby/object:Gem::Requirement
58
+ none: false
56
59
  requirements:
57
60
  - - ~>
58
61
  - !ruby/object:Gem::Version
@@ -67,6 +70,7 @@ dependencies:
67
70
  name: json-jruby
68
71
  prerelease: false
69
72
  requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
70
74
  requirements:
71
75
  - - ~>
72
76
  - !ruby/object:Gem::Version
@@ -82,6 +86,7 @@ dependencies:
82
86
  name: nokogiri
83
87
  prerelease: false
84
88
  requirement: &id005 !ruby/object:Gem::Requirement
89
+ none: false
85
90
  requirements:
86
91
  - - ~>
87
92
  - !ruby/object:Gem::Version
@@ -103,62 +108,62 @@ extensions: []
103
108
  extra_rdoc_files:
104
109
  - README.rdoc
105
110
  files:
106
- - bin/wrest_shell.rb
107
111
  - bin/wrest
112
+ - bin/wrest_shell.rb
108
113
  - lib/wrest.rb
109
- - lib/wrest/uri_template.rb
110
- - lib/wrest/version.rb
111
- - lib/wrest/test.rb
112
- - lib/wrest/curl.rb
113
- - lib/wrest/native.rb
114
- - lib/wrest/http_shared.rb
115
- - lib/wrest/uri.rb
116
114
  - lib/wrest/components.rb
115
+ - lib/wrest/curl.rb
117
116
  - lib/wrest/exceptions.rb
118
- - lib/wrest/resource.rb
117
+ - lib/wrest/http_shared.rb
119
118
  - lib/wrest/multipart.rb
120
- - lib/wrest/resource/state.rb
121
- - lib/wrest/resource/base.rb
122
- - lib/wrest/resource/collection.rb
123
- - lib/wrest/core_ext/hash.rb
124
- - lib/wrest/core_ext/string.rb
125
- - lib/wrest/core_ext/hash/conversions.rb
126
- - lib/wrest/core_ext/string/conversions.rb
127
- - lib/wrest/native/session.rb
128
- - lib/wrest/native/redirection.rb
129
- - lib/wrest/native/response.rb
130
- - lib/wrest/native/options.rb
131
- - lib/wrest/native/get.rb
132
- - lib/wrest/native/connection_factory.rb
133
- - lib/wrest/native/request.rb
134
- - lib/wrest/native/post.rb
135
- - lib/wrest/native/put_multipart.rb
136
- - lib/wrest/native/put.rb
137
- - lib/wrest/native/delete.rb
138
- - lib/wrest/native/post_multipart.rb
139
- - lib/wrest/curl/session.rb
140
- - lib/wrest/curl/response.rb
141
- - lib/wrest/curl/options.rb
142
- - lib/wrest/curl/get.rb
143
- - lib/wrest/curl/request.rb
144
- - lib/wrest/curl/post.rb
145
- - lib/wrest/curl/put.rb
146
- - lib/wrest/curl/delete.rb
119
+ - lib/wrest/native.rb
120
+ - lib/wrest/resource.rb
121
+ - lib/wrest/test.rb
122
+ - lib/wrest/uri.rb
123
+ - lib/wrest/uri_template.rb
124
+ - lib/wrest/version.rb
125
+ - lib/wrest/components/container.rb
147
126
  - lib/wrest/components/mutators.rb
148
127
  - lib/wrest/components/translators.rb
149
- - lib/wrest/components/container.rb
150
- - lib/wrest/components/translators/json.rb
151
- - lib/wrest/components/translators/xml.rb
152
- - lib/wrest/components/translators/content_types.rb
153
128
  - lib/wrest/components/container/alias_accessors.rb
154
129
  - lib/wrest/components/container/typecaster.rb
130
+ - lib/wrest/components/mutators/base.rb
155
131
  - lib/wrest/components/mutators/camel_to_snake_case.rb
156
132
  - lib/wrest/components/mutators/xml_mini_type_caster.rb
157
- - lib/wrest/components/mutators/base.rb
158
133
  - lib/wrest/components/mutators/xml_simple_type_caster.rb
159
- - lib/wrest/http_shared/standard_tokens.rb
160
- - lib/wrest/http_shared/standard_headers.rb
134
+ - lib/wrest/components/translators/content_types.rb
135
+ - lib/wrest/components/translators/json.rb
136
+ - lib/wrest/components/translators/xml.rb
137
+ - lib/wrest/core_ext/hash.rb
138
+ - lib/wrest/core_ext/string.rb
139
+ - lib/wrest/core_ext/hash/conversions.rb
140
+ - lib/wrest/core_ext/string/conversions.rb
141
+ - lib/wrest/curl/delete.rb
142
+ - lib/wrest/curl/get.rb
143
+ - lib/wrest/curl/options.rb
144
+ - lib/wrest/curl/post.rb
145
+ - lib/wrest/curl/put.rb
146
+ - lib/wrest/curl/request.rb
147
+ - lib/wrest/curl/response.rb
148
+ - lib/wrest/curl/session.rb
161
149
  - lib/wrest/http_shared/headers.rb
150
+ - lib/wrest/http_shared/standard_headers.rb
151
+ - lib/wrest/http_shared/standard_tokens.rb
152
+ - lib/wrest/native/connection_factory.rb
153
+ - lib/wrest/native/delete.rb
154
+ - lib/wrest/native/get.rb
155
+ - lib/wrest/native/options.rb
156
+ - lib/wrest/native/post.rb
157
+ - lib/wrest/native/post_multipart.rb
158
+ - lib/wrest/native/put.rb
159
+ - lib/wrest/native/put_multipart.rb
160
+ - lib/wrest/native/redirection.rb
161
+ - lib/wrest/native/request.rb
162
+ - lib/wrest/native/response.rb
163
+ - lib/wrest/native/session.rb
164
+ - lib/wrest/resource/base.rb
165
+ - lib/wrest/resource/collection.rb
166
+ - lib/wrest/resource/state.rb
162
167
  - lib/wrest/test/request_patches.rb
163
168
  - README.rdoc
164
169
  - CHANGELOG
@@ -173,6 +178,7 @@ rdoc_options:
173
178
  require_paths:
174
179
  - lib
175
180
  required_ruby_version: !ruby/object:Gem::Requirement
181
+ none: false
176
182
  requirements:
177
183
  - - ">="
178
184
  - !ruby/object:Gem::Version
@@ -180,6 +186,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
180
186
  - 0
181
187
  version: "0"
182
188
  required_rubygems_version: !ruby/object:Gem::Requirement
189
+ none: false
183
190
  requirements:
184
191
  - - ">="
185
192
  - !ruby/object:Gem::Version
@@ -192,7 +199,7 @@ requirements:
192
199
  - To use multipart post, install the 'multipart-post' gem.
193
200
  - To use curl as the http engine, install the 'patron' gem. This feature is not available (and should be unneccessary) on jruby.
194
201
  rubyforge_project: wrest
195
- rubygems_version: 1.3.6
202
+ rubygems_version: 1.3.7
196
203
  signing_key:
197
204
  specification_version: 3
198
205
  summary: Wrest is an elegant, object oriented HTTP client library.