wrest 1.0.0.beta5 → 1.0.0.beta7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -18,6 +18,13 @@ Features under a numbered section are complete and available in the Wrest gem.
18
18
 
19
19
  == Current
20
20
 
21
+ == 1.0.0.beta7
22
+ * GH#46 Response.deserialise for Json responses
23
+
24
+ == 1.0.0.beta6
25
+ * GH#35 Wrest::UriTemplate extensions swallow existing path
26
+ * GH#41 Make Hash core_ext opt out
27
+
21
28
  == 1.0.0.beta5
22
29
  * GH#30 Replace rails app in spec/sample_rails_app with a lighter sinatra app
23
30
  * GH#37 Allow opting out of Adding to_uri to string
data/README.rdoc CHANGED
@@ -1,4 +1,4 @@
1
- = Wrest 1.0.0.beta4
1
+ = Wrest 1.0.0.beta7
2
2
 
3
3
  (c) Copyright 2009-2010 {Sidu Ponnappa}[http://blog.sidu.in]. All Rights Reserved.
4
4
 
@@ -147,10 +147,10 @@ You can launch the interactive Wrest shell by running bin/wrest if you have the
147
147
 
148
148
  == Contributors
149
149
 
150
- * Sidu Ponnappa : {kaiwren}[http://github.com/kaiwren]
151
- * Niranjan Paranjape : {achamian}[http://github.com/achamian]
152
- * Aakash Dharmadhkari : {aakashd}[http://github.com/aakashd]
153
- * Srushti : {srushti}[http://github.com/srushti]
154
- * Preethi Ramdev : {preethiramdev}[http://github.com/preethiramdev]
155
- * Nikhil Vallishayee : {preethiramdev}[http://github.com/preethiramdev]
156
- * Jacques Crocker: {railsjedi}[http://github.com/railsjedi]
150
+ * Sidu Ponnappa : {kaiwren}[http://github.com/kaiwren]
151
+ * Niranjan Paranjape : {achamian}[http://github.com/achamian]
152
+ * Aakash Dharmadhkari : {aakashd}[http://github.com/aakashd]
153
+ * Srushti : {srushti}[http://github.com/srushti]
154
+ * Preethi Ramdev : {preethiramdev}[http://github.com/preethiramdev]
155
+ * Nikhil Vallishayee : {nikhilvallishayee}[http://github.com/nikhilvallishayee]
156
+ * Jacques Crocker : {railsjedi}[http://github.com/railsjedi]
@@ -32,8 +32,9 @@ module Wrest
32
32
  end
33
33
  end
34
34
  end
35
-
35
+ require "#{Wrest::Root}/wrest/core_ext/hash"
36
36
  require "#{Wrest::Root}/wrest/components/mutators/base"
37
37
  require "#{Wrest::Root}/wrest/components/mutators/xml_simple_type_caster"
38
38
  require "#{Wrest::Root}/wrest/components/mutators/xml_mini_type_caster"
39
- require "#{Wrest::Root}/wrest/components/mutators/camel_to_snake_case"
39
+ require "#{Wrest::Root}/wrest/components/mutators/camel_to_snake_case"
40
+
@@ -13,7 +13,7 @@ module Wrest
13
13
  module Translators::Json
14
14
  extend self
15
15
 
16
- def deserialise(response)
16
+ def deserialise(response,options = {})
17
17
  ActiveSupport::JSON.decode(response.body)
18
18
  end
19
19
 
@@ -16,5 +16,4 @@ module Wrest
16
16
  end
17
17
 
18
18
  require "#{Wrest::Root}/wrest/components/container"
19
- require "#{Wrest::Root}/wrest/components/mutators"
20
- require "#{Wrest::Root}/wrest/components/translators"
19
+ require "#{Wrest::Root}/wrest/components/translators"
@@ -2,4 +2,4 @@ require "#{Wrest::Root}/wrest/core_ext/hash/conversions"
2
2
 
3
3
  class Hash #:nodoc:
4
4
  include Wrest::CoreExt::Hash::Conversions
5
- end
5
+ end
@@ -47,7 +47,7 @@ module Wrest
47
47
  end
48
48
 
49
49
  def [](path)
50
- UriTemplate.new(URI.join(uri_pattern,path).to_s)
50
+ UriTemplate.new(File.join(uri_pattern, path))
51
51
  end
52
52
 
53
53
  def ==(other)
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 = 'beta5'
16
+ BUILD = 'beta7'
17
17
 
18
18
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
19
19
 
@@ -0,0 +1,14 @@
1
+ #require 'nokogiri'
2
+ module Xml_Mini
3
+ module Nokogiri
4
+ module XPathFilter
5
+ #Enables filtering of an xml response using a specified xpath
6
+ #Returns all elements that match the xpath
7
+ def filter(xml_body,xpath)
8
+ doc = ::Nokogiri::XML(xml_body)
9
+ doc.xpath(xpath).to_a
10
+ end
11
+ end
12
+ end
13
+ end
14
+
@@ -0,0 +1,8 @@
1
+ require 'wrest/xml_mini/nokogiri/xpath_filter'
2
+ module ActiveSupport
3
+ module XmlMini_Nokogiri
4
+ XmlMini_Nokogiri.extend(Xml_Mini::Nokogiri::XPathFilter)
5
+ end
6
+ end
7
+
8
+
data/lib/wrest.rb CHANGED
@@ -80,7 +80,8 @@ RUBY_PLATFORM =~ /java/ ? gem('json-jruby', '>= 1.4.2') : gem('json', '>= 1.4.2'
80
80
  ActiveSupport::JSON.backend = "JSONGem"
81
81
 
82
82
 
83
- Dir["#{File.expand_path(File.dirname(__FILE__))}/wrest/core_ext/*.rb"].each { |file| require file }
83
+
84
+ require "#{Wrest::Root}/wrest/core_ext/string"
84
85
 
85
86
  # Load Wrest Core
86
87
  require "#{Wrest::Root}/wrest/version"
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrest
3
3
  version: !ruby/object:Gem::Version
4
- hash: -1848230055
5
4
  prerelease: true
6
5
  segments:
7
6
  - 1
8
7
  - 0
9
8
  - 0
10
- - beta5
11
- version: 1.0.0.beta5
9
+ - beta7
10
+ version: 1.0.0.beta7
12
11
  platform: ruby
13
12
  authors:
14
13
  - Sidu Ponnappa
@@ -17,7 +16,7 @@ autorequire:
17
16
  bindir: bin
18
17
  cert_chain: []
19
18
 
20
- date: 2010-09-19 00:00:00 +05:30
19
+ date: 2010-09-30 00:00:00 +05:30
21
20
  default_executable:
22
21
  dependencies:
23
22
  - !ruby/object:Gem::Dependency
@@ -28,7 +27,6 @@ dependencies:
28
27
  requirements:
29
28
  - - ~>
30
29
  - !ruby/object:Gem::Version
31
- hash: 62196431
32
30
  segments:
33
31
  - 2
34
32
  - 0
@@ -46,7 +44,6 @@ dependencies:
46
44
  requirements:
47
45
  - - ~>
48
46
  - !ruby/object:Gem::Version
49
- hash: 7
50
47
  segments:
51
48
  - 3
52
49
  - 0
@@ -62,7 +59,6 @@ dependencies:
62
59
  requirements:
63
60
  - - ~>
64
61
  - !ruby/object:Gem::Version
65
- hash: 15
66
62
  segments:
67
63
  - 2
68
64
  - 1
@@ -78,7 +74,6 @@ dependencies:
78
74
  requirements:
79
75
  - - ~>
80
76
  - !ruby/object:Gem::Version
81
- hash: 11
82
77
  segments:
83
78
  - 1
84
79
  - 4
@@ -96,64 +91,66 @@ extensions: []
96
91
  extra_rdoc_files:
97
92
  - README.rdoc
98
93
  files:
99
- - bin/wrest
100
94
  - bin/wrest_shell.rb
101
- - lib/wrest/components/container/alias_accessors.rb
102
- - lib/wrest/components/container/typecaster.rb
103
- - lib/wrest/components/container.rb
104
- - lib/wrest/components/mutators/base.rb
105
- - lib/wrest/components/mutators/camel_to_snake_case.rb
106
- - lib/wrest/components/mutators/xml_mini_type_caster.rb
107
- - lib/wrest/components/mutators/xml_simple_type_caster.rb
108
- - lib/wrest/components/mutators.rb
109
- - lib/wrest/components/translators/content_types.rb
110
- - lib/wrest/components/translators/json.rb
111
- - lib/wrest/components/translators/xml.rb
112
- - lib/wrest/components/translators.rb
113
- - lib/wrest/components.rb
95
+ - bin/wrest
96
+ - lib/wrest_no_ext.rb
97
+ - lib/wrest.rb
98
+ - lib/wrest/uri_template.rb
99
+ - lib/wrest/version.rb
100
+ - lib/wrest/xml_mini/nokogiri.rb
101
+ - lib/wrest/xml_mini/nokogiri/xpath_filter.rb
102
+ - lib/wrest/resource/state.rb
103
+ - lib/wrest/resource/base.rb
104
+ - lib/wrest/resource/collection.rb
105
+ - lib/wrest/test.rb
114
106
  - lib/wrest/core_ext/hash/conversions.rb
115
107
  - lib/wrest/core_ext/hash.rb
116
108
  - lib/wrest/core_ext/string/conversions.rb
117
109
  - lib/wrest/core_ext/string.rb
118
- - lib/wrest/curl/delete.rb
119
- - lib/wrest/curl/get.rb
120
- - lib/wrest/curl/options.rb
121
- - lib/wrest/curl/post.rb
122
- - lib/wrest/curl/put.rb
123
- - lib/wrest/curl/request.rb
124
- - lib/wrest/curl/response.rb
125
- - lib/wrest/curl/session.rb
126
110
  - lib/wrest/curl.rb
127
- - lib/wrest/exceptions.rb
128
- - lib/wrest/http_shared/headers.rb
129
- - lib/wrest/http_shared/standard_headers.rb
130
- - lib/wrest/http_shared/standard_tokens.rb
111
+ - lib/wrest/native.rb
131
112
  - lib/wrest/http_shared.rb
132
- - lib/wrest/multipart.rb
133
- - lib/wrest/native/connection_factory.rb
134
- - lib/wrest/native/delete.rb
135
- - lib/wrest/native/get.rb
113
+ - lib/wrest/native/session.rb
114
+ - lib/wrest/native/redirection.rb
115
+ - lib/wrest/native/response.rb
136
116
  - lib/wrest/native/options.rb
117
+ - lib/wrest/native/get.rb
118
+ - lib/wrest/native/connection_factory.rb
119
+ - lib/wrest/native/request.rb
137
120
  - lib/wrest/native/post.rb
138
- - lib/wrest/native/post_multipart.rb
139
- - lib/wrest/native/put.rb
140
121
  - lib/wrest/native/put_multipart.rb
141
- - lib/wrest/native/redirection.rb
142
- - lib/wrest/native/request.rb
143
- - lib/wrest/native/response.rb
144
- - lib/wrest/native/session.rb
145
- - lib/wrest/native.rb
146
- - lib/wrest/resource/base.rb
147
- - lib/wrest/resource/collection.rb
148
- - lib/wrest/resource/state.rb
122
+ - lib/wrest/native/put.rb
123
+ - lib/wrest/native/delete.rb
124
+ - lib/wrest/native/post_multipart.rb
125
+ - lib/wrest/uri.rb
126
+ - lib/wrest/components.rb
127
+ - lib/wrest/curl/session.rb
128
+ - lib/wrest/curl/response.rb
129
+ - lib/wrest/curl/options.rb
130
+ - lib/wrest/curl/get.rb
131
+ - lib/wrest/curl/request.rb
132
+ - lib/wrest/curl/post.rb
133
+ - lib/wrest/curl/put.rb
134
+ - lib/wrest/curl/delete.rb
135
+ - lib/wrest/exceptions.rb
136
+ - lib/wrest/components/translators/json.rb
137
+ - lib/wrest/components/translators/xml.rb
138
+ - lib/wrest/components/translators/content_types.rb
139
+ - lib/wrest/components/mutators.rb
140
+ - lib/wrest/components/translators.rb
141
+ - lib/wrest/components/container.rb
142
+ - lib/wrest/components/container/alias_accessors.rb
143
+ - lib/wrest/components/container/typecaster.rb
144
+ - lib/wrest/components/mutators/camel_to_snake_case.rb
145
+ - lib/wrest/components/mutators/xml_mini_type_caster.rb
146
+ - lib/wrest/components/mutators/base.rb
147
+ - lib/wrest/components/mutators/xml_simple_type_caster.rb
148
+ - lib/wrest/http_shared/standard_tokens.rb
149
+ - lib/wrest/http_shared/standard_headers.rb
150
+ - lib/wrest/http_shared/headers.rb
149
151
  - lib/wrest/resource.rb
150
152
  - lib/wrest/test/request_patches.rb
151
- - lib/wrest/test.rb
152
- - lib/wrest/uri.rb
153
- - lib/wrest/uri_template.rb
154
- - lib/wrest/version.rb
155
- - lib/wrest.rb
156
- - lib/wrest_no_ext.rb
153
+ - lib/wrest/multipart.rb
157
154
  - README.rdoc
158
155
  - CHANGELOG
159
156
  - LICENCE
@@ -171,7 +168,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
171
168
  requirements:
172
169
  - - ">="
173
170
  - !ruby/object:Gem::Version
174
- hash: 3
175
171
  segments:
176
172
  - 0
177
173
  version: "0"
@@ -180,7 +176,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
176
  requirements:
181
177
  - - ">="
182
178
  - !ruby/object:Gem::Version
183
- hash: 21
184
179
  segments:
185
180
  - 1
186
181
  - 3