wrest 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. data/CHANGELOG +34 -0
  2. data/README.rdoc +16 -10
  3. data/Rakefile +361 -123
  4. data/VERSION.yml +2 -2
  5. data/examples/delicious.rb +17 -7
  6. data/examples/facebook.rb +101 -0
  7. data/examples/keep_alive.rb +37 -0
  8. data/examples/twitter.rb +3 -3
  9. data/examples/twitter_public_timeline.rb +11 -4
  10. data/examples/wow_realm_status.rb +8 -2
  11. data/{spec/functional/sample_rails_app/public/favicon.ico → init.rb} +0 -0
  12. data/lib/wrest/components/{attributes_container → container}/alias_accessors.rb +4 -4
  13. data/lib/wrest/components/{attributes_container → container}/typecaster.rb +1 -1
  14. data/lib/wrest/components/{attributes_container.rb → container.rb} +46 -16
  15. data/lib/wrest/components/mutators.rb +4 -4
  16. data/lib/wrest/components/translators/json.rb +2 -2
  17. data/lib/wrest/components/translators/xml.rb +3 -2
  18. data/lib/wrest/components/translators.rb +3 -3
  19. data/lib/wrest/components.rb +3 -3
  20. data/lib/wrest/core_ext/hash.rb +1 -1
  21. data/lib/wrest/core_ext/string.rb +1 -1
  22. data/lib/wrest/curl/delete.rb +23 -0
  23. data/lib/wrest/curl/get.rb +23 -0
  24. data/lib/wrest/curl/options.rb +16 -0
  25. data/lib/wrest/curl/post.rb +23 -0
  26. data/lib/wrest/curl/put.rb +23 -0
  27. data/lib/wrest/curl/request.rb +95 -0
  28. data/lib/wrest/curl/response.rb +63 -0
  29. data/lib/wrest/curl/session.rb +57 -0
  30. data/lib/wrest/curl.rb +49 -0
  31. data/lib/wrest/exceptions.rb +16 -1
  32. data/lib/wrest/http_shared/headers.rb +350 -0
  33. data/lib/wrest/http_shared/standard_headers.rb +21 -0
  34. data/lib/wrest/http_shared/standard_tokens.rb +18 -0
  35. data/lib/wrest/http_shared.rb +24 -0
  36. data/lib/wrest/native/connection_factory.rb +23 -0
  37. data/lib/wrest/{http → native}/delete.rb +1 -1
  38. data/lib/wrest/{http → native}/get.rb +1 -1
  39. data/lib/wrest/{http → native}/options.rb +1 -1
  40. data/lib/wrest/{http → native}/post.rb +1 -1
  41. data/lib/wrest/{http → native}/put.rb +1 -1
  42. data/lib/wrest/{http → native}/redirection.rb +4 -1
  43. data/lib/wrest/{http → native}/request.rb +32 -20
  44. data/lib/wrest/{http → native}/response.rb +12 -4
  45. data/lib/wrest/native/session.rb +57 -0
  46. data/lib/wrest/native.rb +32 -0
  47. data/lib/wrest/resource/base.rb +1 -1
  48. data/lib/wrest/resource.rb +1 -1
  49. data/lib/wrest/test/request_patches.rb +5 -0
  50. data/lib/wrest/test.rb +1 -0
  51. data/lib/wrest/uri.rb +31 -3
  52. data/lib/wrest/version.rb +2 -2
  53. data/lib/wrest.rb +52 -16
  54. data/spec/unit/spec_helper.rb +12 -3
  55. data/spec/unit/wrest/components/attributes_container/alias_accessors_spec.rb +2 -2
  56. data/spec/unit/wrest/components/attributes_container/typecaster_spec.rb +6 -6
  57. data/spec/unit/wrest/components/attributes_container_spec.rb +44 -12
  58. data/spec/unit/wrest/components/translators/xml_spec.rb +7 -3
  59. data/spec/unit/wrest/curl/request_spec.rb +19 -0
  60. data/spec/unit/wrest/curl/response_spec.rb +16 -0
  61. data/spec/unit/wrest/http/response_spec.rb +17 -38
  62. data/spec/unit/wrest/{http → native}/redirection_spec.rb +5 -5
  63. data/spec/unit/wrest/{http → native}/request_spec.rb +15 -14
  64. data/spec/unit/wrest/native/response_spec.rb +72 -0
  65. data/spec/unit/wrest/native/session_spec.rb +74 -0
  66. data/spec/unit/wrest/resource/base_spec.rb +2 -2
  67. data/spec/unit/wrest/uri_spec.rb +51 -11
  68. data/wrest.gemspec +164 -0
  69. metadata +51 -165
  70. data/lib/wrest/http.rb +0 -25
  71. data/spec/functional/sample_rails_app/README +0 -3
  72. data/spec/functional/sample_rails_app/Rakefile +0 -10
  73. data/spec/functional/sample_rails_app/app/controllers/application_controller.rb +0 -10
  74. data/spec/functional/sample_rails_app/app/controllers/lead_bottles_controller.rb +0 -7
  75. data/spec/functional/sample_rails_app/app/helpers/application_helper.rb +0 -3
  76. data/spec/functional/sample_rails_app/app/models/bottle.rb +0 -3
  77. data/spec/functional/sample_rails_app/app/models/glass_bottle.rb +0 -3
  78. data/spec/functional/sample_rails_app/app/models/lead_bottle.rb +0 -3
  79. data/spec/functional/sample_rails_app/config/boot.rb +0 -110
  80. data/spec/functional/sample_rails_app/config/database.yml +0 -16
  81. data/spec/functional/sample_rails_app/config/environment.rb +0 -42
  82. data/spec/functional/sample_rails_app/config/environments/development.rb +0 -17
  83. data/spec/functional/sample_rails_app/config/environments/production.rb +0 -28
  84. data/spec/functional/sample_rails_app/config/environments/test.rb +0 -28
  85. data/spec/functional/sample_rails_app/config/initializers/backtrace_silencers.rb +0 -7
  86. data/spec/functional/sample_rails_app/config/initializers/inflections.rb +0 -10
  87. data/spec/functional/sample_rails_app/config/initializers/mime_types.rb +0 -5
  88. data/spec/functional/sample_rails_app/config/initializers/new_rails_defaults.rb +0 -19
  89. data/spec/functional/sample_rails_app/config/initializers/session_store.rb +0 -15
  90. data/spec/functional/sample_rails_app/config/locales/en.yml +0 -5
  91. data/spec/functional/sample_rails_app/config/routes.rb +0 -3
  92. data/spec/functional/sample_rails_app/db/development.sqlite3 +0 -0
  93. data/spec/functional/sample_rails_app/db/migrate/20090319115628_create_bottle.rb +0 -13
  94. data/spec/functional/sample_rails_app/db/schema.rb +0 -20
  95. data/spec/functional/sample_rails_app/db/test.sqlite3 +0 -0
  96. data/spec/functional/sample_rails_app/log/development.log +0 -1
  97. data/spec/functional/sample_rails_app/public/404.html +0 -30
  98. data/spec/functional/sample_rails_app/public/422.html +0 -30
  99. data/spec/functional/sample_rails_app/public/500.html +0 -30
  100. data/spec/functional/sample_rails_app/public/images/rails.png +0 -0
  101. data/spec/functional/sample_rails_app/public/index.html +0 -275
  102. data/spec/functional/sample_rails_app/public/robots.txt +0 -5
  103. data/spec/functional/sample_rails_app/script/about +0 -4
  104. data/spec/functional/sample_rails_app/script/autospec +0 -6
  105. data/spec/functional/sample_rails_app/script/console +0 -3
  106. data/spec/functional/sample_rails_app/script/dbconsole +0 -3
  107. data/spec/functional/sample_rails_app/script/destroy +0 -3
  108. data/spec/functional/sample_rails_app/script/generate +0 -3
  109. data/spec/functional/sample_rails_app/script/performance/benchmarker +0 -3
  110. data/spec/functional/sample_rails_app/script/performance/profiler +0 -3
  111. data/spec/functional/sample_rails_app/script/plugin +0 -3
  112. data/spec/functional/sample_rails_app/script/runner +0 -3
  113. data/spec/functional/sample_rails_app/script/server +0 -3
  114. data/spec/functional/sample_rails_app/script/spec +0 -10
  115. data/spec/functional/sample_rails_app/script/spec_server +0 -9
  116. data/spec/functional/sample_rails_app/test/performance/browsing_test.rb +0 -9
  117. data/spec/functional/sample_rails_app/test/test_helper.rb +0 -38
  118. data/spec/functional/sample_rails_app/tmtags +0 -2559
  119. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/MIT-LICENSE +0 -20
  120. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/README.rdoc +0 -100
  121. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/Rakefile +0 -18
  122. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/init.rb +0 -5
  123. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/install.rb +0 -1
  124. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/base.rb +0 -140
  125. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/controllers/resources.rb +0 -16
  126. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/controllers/resources_controller.rb +0 -26
  127. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/controllers/routes_controller.rb +0 -16
  128. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/core_extensions/api.rb +0 -26
  129. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/core_extensions/exception.rb +0 -23
  130. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/core_extensions/from_json.rb +0 -15
  131. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/dispatch.rb +0 -235
  132. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/models/resourced_route.rb +0 -84
  133. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/query.rb +0 -337
  134. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/render/html.rb +0 -50
  135. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/render/json.rb +0 -75
  136. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/render/xml.rb +0 -65
  137. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/render.rb +0 -63
  138. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/retrieve.rb +0 -74
  139. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/version.rb +0 -9
  140. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full.rb +0 -14
  141. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/base_spec.rb +0 -88
  142. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/controllers/resources_spec.rb +0 -29
  143. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/dispatch_spec.rb +0 -262
  144. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/models/resourced_route_spec.rb +0 -62
  145. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/query/parameter_spec.rb +0 -57
  146. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/query_spec.rb +0 -462
  147. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/render/html_spec.rb +0 -4
  148. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/render/json_spec.rb +0 -107
  149. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/render/xml_spec.rb +0 -98
  150. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/render_spec.rb +0 -5
  151. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/retrieve_spec.rb +0 -173
  152. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/spec_helper.rb +0 -98
  153. data/spec/functional/sample_rails_app/vendor/plugins/resource_full/uninstall.rb +0 -1
  154. data/spec/functional/spec_helper.rb +0 -0
data/wrest.gemspec ADDED
@@ -0,0 +1,164 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{wrest}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Sidu Ponnappa"]
12
+ s.date = %q{2009-12-21}
13
+ s.description = %q{Wrest is a HTTP and REST client library which allows you to quickly build well encapsulated, object oriented wrappers around any web service.}
14
+ s.email = %q{ckponnappa@gmail.com}
15
+ s.executables = ["wrest", "jwrest"]
16
+ s.extra_rdoc_files = [
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ "CHANGELOG",
21
+ "README.rdoc",
22
+ "Rakefile",
23
+ "VERSION.yml",
24
+ "bin/jwrest",
25
+ "bin/wrest",
26
+ "bin/wrest_shell.rb",
27
+ "examples/delicious.rb",
28
+ "examples/facebook.rb",
29
+ "examples/keep_alive.rb",
30
+ "examples/redirection.rb",
31
+ "examples/twitter.rb",
32
+ "examples/twitter_public_timeline.rb",
33
+ "examples/wow_realm_status.rb",
34
+ "init.rb",
35
+ "lib/wrest.rb",
36
+ "lib/wrest/components.rb",
37
+ "lib/wrest/components/container.rb",
38
+ "lib/wrest/components/container/alias_accessors.rb",
39
+ "lib/wrest/components/container/typecaster.rb",
40
+ "lib/wrest/components/mutators.rb",
41
+ "lib/wrest/components/mutators/base.rb",
42
+ "lib/wrest/components/mutators/camel_to_snake_case.rb",
43
+ "lib/wrest/components/mutators/xml_mini_type_caster.rb",
44
+ "lib/wrest/components/mutators/xml_simple_type_caster.rb",
45
+ "lib/wrest/components/translators.rb",
46
+ "lib/wrest/components/translators/content_types.rb",
47
+ "lib/wrest/components/translators/json.rb",
48
+ "lib/wrest/components/translators/xml.rb",
49
+ "lib/wrest/core_ext/hash.rb",
50
+ "lib/wrest/core_ext/hash/conversions.rb",
51
+ "lib/wrest/core_ext/string.rb",
52
+ "lib/wrest/core_ext/string/conversions.rb",
53
+ "lib/wrest/curl.rb",
54
+ "lib/wrest/curl/delete.rb",
55
+ "lib/wrest/curl/get.rb",
56
+ "lib/wrest/curl/options.rb",
57
+ "lib/wrest/curl/post.rb",
58
+ "lib/wrest/curl/put.rb",
59
+ "lib/wrest/curl/request.rb",
60
+ "lib/wrest/curl/response.rb",
61
+ "lib/wrest/curl/session.rb",
62
+ "lib/wrest/exceptions.rb",
63
+ "lib/wrest/http_shared.rb",
64
+ "lib/wrest/http_shared/headers.rb",
65
+ "lib/wrest/http_shared/standard_headers.rb",
66
+ "lib/wrest/http_shared/standard_tokens.rb",
67
+ "lib/wrest/native.rb",
68
+ "lib/wrest/native/connection_factory.rb",
69
+ "lib/wrest/native/delete.rb",
70
+ "lib/wrest/native/get.rb",
71
+ "lib/wrest/native/options.rb",
72
+ "lib/wrest/native/post.rb",
73
+ "lib/wrest/native/put.rb",
74
+ "lib/wrest/native/redirection.rb",
75
+ "lib/wrest/native/request.rb",
76
+ "lib/wrest/native/response.rb",
77
+ "lib/wrest/native/session.rb",
78
+ "lib/wrest/resource.rb",
79
+ "lib/wrest/resource/base.rb",
80
+ "lib/wrest/resource/collection.rb",
81
+ "lib/wrest/resource/state.rb",
82
+ "lib/wrest/test.rb",
83
+ "lib/wrest/test/request_patches.rb",
84
+ "lib/wrest/uri.rb",
85
+ "lib/wrest/uri_template.rb",
86
+ "lib/wrest/version.rb",
87
+ "spec/custom_matchers/custom_matchers.rb",
88
+ "spec/rcov.opts",
89
+ "spec/spec.opts",
90
+ "spec/unit/spec_helper.rb",
91
+ "spec/unit/wrest/components/attributes_container/alias_accessors_spec.rb",
92
+ "spec/unit/wrest/components/attributes_container/typecaster_spec.rb",
93
+ "spec/unit/wrest/components/attributes_container_spec.rb",
94
+ "spec/unit/wrest/components/mutators/base_spec.rb",
95
+ "spec/unit/wrest/components/mutators/camel_to_snake_spec.rb",
96
+ "spec/unit/wrest/components/mutators/xml_mini_type_caster_spec.rb",
97
+ "spec/unit/wrest/components/mutators/xml_simple_type_caster_spec.rb",
98
+ "spec/unit/wrest/components/mutators_spec.rb",
99
+ "spec/unit/wrest/components/translators/xml_spec.rb",
100
+ "spec/unit/wrest/components/translators_spec.rb",
101
+ "spec/unit/wrest/core_ext/hash/conversions_spec.rb",
102
+ "spec/unit/wrest/core_ext/string/conversions_spec.rb",
103
+ "spec/unit/wrest/curl/request_spec.rb",
104
+ "spec/unit/wrest/curl/response_spec.rb",
105
+ "spec/unit/wrest/http/response_spec.rb",
106
+ "spec/unit/wrest/native/redirection_spec.rb",
107
+ "spec/unit/wrest/native/request_spec.rb",
108
+ "spec/unit/wrest/native/response_spec.rb",
109
+ "spec/unit/wrest/native/session_spec.rb",
110
+ "spec/unit/wrest/resource/base_spec.rb",
111
+ "spec/unit/wrest/uri_spec.rb",
112
+ "spec/unit/wrest/uri_template_spec.rb",
113
+ "wrest.gemspec"
114
+ ]
115
+ s.homepage = %q{http://github.com/kaiwren/wrest}
116
+ s.rdoc_options = ["--charset=UTF-8"]
117
+ s.require_paths = ["lib"]
118
+ s.rubyforge_project = %q{wrest}
119
+ s.rubygems_version = %q{1.3.5}
120
+ s.summary = %q{REST client library for Ruby.}
121
+ s.test_files = [
122
+ "spec/custom_matchers/custom_matchers.rb",
123
+ "spec/unit/spec_helper.rb",
124
+ "spec/unit/wrest/components/attributes_container/alias_accessors_spec.rb",
125
+ "spec/unit/wrest/components/attributes_container/typecaster_spec.rb",
126
+ "spec/unit/wrest/components/attributes_container_spec.rb",
127
+ "spec/unit/wrest/components/mutators/base_spec.rb",
128
+ "spec/unit/wrest/components/mutators/camel_to_snake_spec.rb",
129
+ "spec/unit/wrest/components/mutators/xml_mini_type_caster_spec.rb",
130
+ "spec/unit/wrest/components/mutators/xml_simple_type_caster_spec.rb",
131
+ "spec/unit/wrest/components/mutators_spec.rb",
132
+ "spec/unit/wrest/components/translators/xml_spec.rb",
133
+ "spec/unit/wrest/components/translators_spec.rb",
134
+ "spec/unit/wrest/core_ext/hash/conversions_spec.rb",
135
+ "spec/unit/wrest/core_ext/string/conversions_spec.rb",
136
+ "spec/unit/wrest/curl/request_spec.rb",
137
+ "spec/unit/wrest/curl/response_spec.rb",
138
+ "spec/unit/wrest/http/response_spec.rb",
139
+ "spec/unit/wrest/native/redirection_spec.rb",
140
+ "spec/unit/wrest/native/request_spec.rb",
141
+ "spec/unit/wrest/native/response_spec.rb",
142
+ "spec/unit/wrest/native/session_spec.rb",
143
+ "spec/unit/wrest/resource/base_spec.rb",
144
+ "spec/unit/wrest/uri_spec.rb",
145
+ "spec/unit/wrest/uri_template_spec.rb"
146
+ ]
147
+
148
+ if s.respond_to? :specification_version then
149
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
150
+ s.specification_version = 3
151
+
152
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
153
+ s.add_runtime_dependency(%q<activesupport>, [">= 2.3.5"])
154
+ s.add_runtime_dependency(%q<json>, [">= 1.1.3"])
155
+ else
156
+ s.add_dependency(%q<activesupport>, [">= 2.3.5"])
157
+ s.add_dependency(%q<json>, [">= 1.1.3"])
158
+ end
159
+ else
160
+ s.add_dependency(%q<activesupport>, [">= 2.3.5"])
161
+ s.add_dependency(%q<json>, [">= 1.1.3"])
162
+ end
163
+ end
164
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sidu Ponnappa
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-09 00:00:00 +05:30
12
+ date: 2009-12-21 00:00:00 +05:30
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.3.2
23
+ version: 2.3.5
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
@@ -32,7 +32,7 @@ dependencies:
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.1.3
34
34
  version:
35
- description: Wrest is a REST client library which allows you to quickly build object oriented wrappers around any web service. It has two main components - Wrest Core and Wrest::Resource.
35
+ description: Wrest is a HTTP and REST client library which allows you to quickly build well encapsulated, object oriented wrappers around any web service.
36
36
  email: ckponnappa@gmail.com
37
37
  executables:
38
38
  - wrest
@@ -42,6 +42,7 @@ extensions: []
42
42
  extra_rdoc_files:
43
43
  - README.rdoc
44
44
  files:
45
+ - CHANGELOG
45
46
  - README.rdoc
46
47
  - Rakefile
47
48
  - VERSION.yml
@@ -49,15 +50,18 @@ files:
49
50
  - bin/wrest
50
51
  - bin/wrest_shell.rb
51
52
  - examples/delicious.rb
53
+ - examples/facebook.rb
54
+ - examples/keep_alive.rb
52
55
  - examples/redirection.rb
53
56
  - examples/twitter.rb
54
57
  - examples/twitter_public_timeline.rb
55
58
  - examples/wow_realm_status.rb
59
+ - init.rb
56
60
  - lib/wrest.rb
57
61
  - lib/wrest/components.rb
58
- - lib/wrest/components/attributes_container.rb
59
- - lib/wrest/components/attributes_container/alias_accessors.rb
60
- - lib/wrest/components/attributes_container/typecaster.rb
62
+ - lib/wrest/components/container.rb
63
+ - lib/wrest/components/container/alias_accessors.rb
64
+ - lib/wrest/components/container/typecaster.rb
61
65
  - lib/wrest/components/mutators.rb
62
66
  - lib/wrest/components/mutators/base.rb
63
67
  - lib/wrest/components/mutators/camel_to_snake_case.rb
@@ -71,109 +75,41 @@ files:
71
75
  - lib/wrest/core_ext/hash/conversions.rb
72
76
  - lib/wrest/core_ext/string.rb
73
77
  - lib/wrest/core_ext/string/conversions.rb
78
+ - lib/wrest/curl.rb
79
+ - lib/wrest/curl/delete.rb
80
+ - lib/wrest/curl/get.rb
81
+ - lib/wrest/curl/options.rb
82
+ - lib/wrest/curl/post.rb
83
+ - lib/wrest/curl/put.rb
84
+ - lib/wrest/curl/request.rb
85
+ - lib/wrest/curl/response.rb
86
+ - lib/wrest/curl/session.rb
74
87
  - lib/wrest/exceptions.rb
75
- - lib/wrest/http.rb
76
- - lib/wrest/http/delete.rb
77
- - lib/wrest/http/get.rb
78
- - lib/wrest/http/options.rb
79
- - lib/wrest/http/post.rb
80
- - lib/wrest/http/put.rb
81
- - lib/wrest/http/redirection.rb
82
- - lib/wrest/http/request.rb
83
- - lib/wrest/http/response.rb
88
+ - lib/wrest/http_shared.rb
89
+ - lib/wrest/http_shared/headers.rb
90
+ - lib/wrest/http_shared/standard_headers.rb
91
+ - lib/wrest/http_shared/standard_tokens.rb
92
+ - lib/wrest/native.rb
93
+ - lib/wrest/native/connection_factory.rb
94
+ - lib/wrest/native/delete.rb
95
+ - lib/wrest/native/get.rb
96
+ - lib/wrest/native/options.rb
97
+ - lib/wrest/native/post.rb
98
+ - lib/wrest/native/put.rb
99
+ - lib/wrest/native/redirection.rb
100
+ - lib/wrest/native/request.rb
101
+ - lib/wrest/native/response.rb
102
+ - lib/wrest/native/session.rb
84
103
  - lib/wrest/resource.rb
85
104
  - lib/wrest/resource/base.rb
86
105
  - lib/wrest/resource/collection.rb
87
106
  - lib/wrest/resource/state.rb
107
+ - lib/wrest/test.rb
108
+ - lib/wrest/test/request_patches.rb
88
109
  - lib/wrest/uri.rb
89
110
  - lib/wrest/uri_template.rb
90
111
  - lib/wrest/version.rb
91
112
  - spec/custom_matchers/custom_matchers.rb
92
- - spec/functional/sample_rails_app/README
93
- - spec/functional/sample_rails_app/Rakefile
94
- - spec/functional/sample_rails_app/app/controllers/application_controller.rb
95
- - spec/functional/sample_rails_app/app/controllers/lead_bottles_controller.rb
96
- - spec/functional/sample_rails_app/app/helpers/application_helper.rb
97
- - spec/functional/sample_rails_app/app/models/bottle.rb
98
- - spec/functional/sample_rails_app/app/models/glass_bottle.rb
99
- - spec/functional/sample_rails_app/app/models/lead_bottle.rb
100
- - spec/functional/sample_rails_app/config/boot.rb
101
- - spec/functional/sample_rails_app/config/database.yml
102
- - spec/functional/sample_rails_app/config/environment.rb
103
- - spec/functional/sample_rails_app/config/environments/development.rb
104
- - spec/functional/sample_rails_app/config/environments/production.rb
105
- - spec/functional/sample_rails_app/config/environments/test.rb
106
- - spec/functional/sample_rails_app/config/initializers/backtrace_silencers.rb
107
- - spec/functional/sample_rails_app/config/initializers/inflections.rb
108
- - spec/functional/sample_rails_app/config/initializers/mime_types.rb
109
- - spec/functional/sample_rails_app/config/initializers/new_rails_defaults.rb
110
- - spec/functional/sample_rails_app/config/initializers/session_store.rb
111
- - spec/functional/sample_rails_app/config/locales/en.yml
112
- - spec/functional/sample_rails_app/config/routes.rb
113
- - spec/functional/sample_rails_app/db/development.sqlite3
114
- - spec/functional/sample_rails_app/db/migrate/20090319115628_create_bottle.rb
115
- - spec/functional/sample_rails_app/db/schema.rb
116
- - spec/functional/sample_rails_app/db/test.sqlite3
117
- - spec/functional/sample_rails_app/log/development.log
118
- - spec/functional/sample_rails_app/public/404.html
119
- - spec/functional/sample_rails_app/public/422.html
120
- - spec/functional/sample_rails_app/public/500.html
121
- - spec/functional/sample_rails_app/public/favicon.ico
122
- - spec/functional/sample_rails_app/public/images/rails.png
123
- - spec/functional/sample_rails_app/public/index.html
124
- - spec/functional/sample_rails_app/public/robots.txt
125
- - spec/functional/sample_rails_app/script/about
126
- - spec/functional/sample_rails_app/script/autospec
127
- - spec/functional/sample_rails_app/script/console
128
- - spec/functional/sample_rails_app/script/dbconsole
129
- - spec/functional/sample_rails_app/script/destroy
130
- - spec/functional/sample_rails_app/script/generate
131
- - spec/functional/sample_rails_app/script/performance/benchmarker
132
- - spec/functional/sample_rails_app/script/performance/profiler
133
- - spec/functional/sample_rails_app/script/plugin
134
- - spec/functional/sample_rails_app/script/runner
135
- - spec/functional/sample_rails_app/script/server
136
- - spec/functional/sample_rails_app/script/spec
137
- - spec/functional/sample_rails_app/script/spec_server
138
- - spec/functional/sample_rails_app/test/performance/browsing_test.rb
139
- - spec/functional/sample_rails_app/test/test_helper.rb
140
- - spec/functional/sample_rails_app/tmtags
141
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/MIT-LICENSE
142
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/README.rdoc
143
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/Rakefile
144
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/init.rb
145
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/install.rb
146
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full.rb
147
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/base.rb
148
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/controllers/resources.rb
149
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/controllers/resources_controller.rb
150
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/controllers/routes_controller.rb
151
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/core_extensions/api.rb
152
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/core_extensions/exception.rb
153
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/core_extensions/from_json.rb
154
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/dispatch.rb
155
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/models/resourced_route.rb
156
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/query.rb
157
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/render.rb
158
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/render/html.rb
159
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/render/json.rb
160
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/render/xml.rb
161
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/retrieve.rb
162
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/version.rb
163
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/base_spec.rb
164
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/controllers/resources_spec.rb
165
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/dispatch_spec.rb
166
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/models/resourced_route_spec.rb
167
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/query/parameter_spec.rb
168
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/query_spec.rb
169
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/render/html_spec.rb
170
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/render/json_spec.rb
171
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/render/xml_spec.rb
172
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/render_spec.rb
173
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/retrieve_spec.rb
174
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/spec_helper.rb
175
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/uninstall.rb
176
- - spec/functional/spec_helper.rb
177
113
  - spec/rcov.opts
178
114
  - spec/spec.opts
179
115
  - spec/unit/spec_helper.rb
@@ -189,12 +125,17 @@ files:
189
125
  - spec/unit/wrest/components/translators_spec.rb
190
126
  - spec/unit/wrest/core_ext/hash/conversions_spec.rb
191
127
  - spec/unit/wrest/core_ext/string/conversions_spec.rb
192
- - spec/unit/wrest/http/redirection_spec.rb
193
- - spec/unit/wrest/http/request_spec.rb
128
+ - spec/unit/wrest/curl/request_spec.rb
129
+ - spec/unit/wrest/curl/response_spec.rb
194
130
  - spec/unit/wrest/http/response_spec.rb
131
+ - spec/unit/wrest/native/redirection_spec.rb
132
+ - spec/unit/wrest/native/request_spec.rb
133
+ - spec/unit/wrest/native/response_spec.rb
134
+ - spec/unit/wrest/native/session_spec.rb
195
135
  - spec/unit/wrest/resource/base_spec.rb
196
136
  - spec/unit/wrest/uri_spec.rb
197
137
  - spec/unit/wrest/uri_template_spec.rb
138
+ - wrest.gemspec
198
139
  has_rdoc: true
199
140
  homepage: http://github.com/kaiwren/wrest
200
141
  licenses: []
@@ -219,66 +160,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
160
  requirements: []
220
161
 
221
162
  rubyforge_project: wrest
222
- rubygems_version: 1.3.3
163
+ rubygems_version: 1.3.5
223
164
  signing_key:
224
165
  specification_version: 3
225
166
  summary: REST client library for Ruby.
226
167
  test_files:
227
168
  - spec/custom_matchers/custom_matchers.rb
228
- - spec/functional/sample_rails_app/app/controllers/application_controller.rb
229
- - spec/functional/sample_rails_app/app/controllers/lead_bottles_controller.rb
230
- - spec/functional/sample_rails_app/app/helpers/application_helper.rb
231
- - spec/functional/sample_rails_app/app/models/bottle.rb
232
- - spec/functional/sample_rails_app/app/models/glass_bottle.rb
233
- - spec/functional/sample_rails_app/app/models/lead_bottle.rb
234
- - spec/functional/sample_rails_app/config/boot.rb
235
- - spec/functional/sample_rails_app/config/environment.rb
236
- - spec/functional/sample_rails_app/config/environments/development.rb
237
- - spec/functional/sample_rails_app/config/environments/production.rb
238
- - spec/functional/sample_rails_app/config/environments/test.rb
239
- - spec/functional/sample_rails_app/config/initializers/backtrace_silencers.rb
240
- - spec/functional/sample_rails_app/config/initializers/inflections.rb
241
- - spec/functional/sample_rails_app/config/initializers/mime_types.rb
242
- - spec/functional/sample_rails_app/config/initializers/new_rails_defaults.rb
243
- - spec/functional/sample_rails_app/config/initializers/session_store.rb
244
- - spec/functional/sample_rails_app/config/routes.rb
245
- - spec/functional/sample_rails_app/db/migrate/20090319115628_create_bottle.rb
246
- - spec/functional/sample_rails_app/db/schema.rb
247
- - spec/functional/sample_rails_app/test/performance/browsing_test.rb
248
- - spec/functional/sample_rails_app/test/test_helper.rb
249
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/init.rb
250
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/install.rb
251
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/base.rb
252
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/controllers/resources.rb
253
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/controllers/resources_controller.rb
254
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/controllers/routes_controller.rb
255
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/core_extensions/api.rb
256
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/core_extensions/exception.rb
257
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/core_extensions/from_json.rb
258
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/dispatch.rb
259
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/models/resourced_route.rb
260
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/query.rb
261
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/render/html.rb
262
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/render/json.rb
263
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/render/xml.rb
264
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/render.rb
265
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/retrieve.rb
266
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full/version.rb
267
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/lib/resource_full.rb
268
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/base_spec.rb
269
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/controllers/resources_spec.rb
270
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/dispatch_spec.rb
271
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/models/resourced_route_spec.rb
272
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/query/parameter_spec.rb
273
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/query_spec.rb
274
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/render/html_spec.rb
275
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/render/json_spec.rb
276
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/render/xml_spec.rb
277
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/render_spec.rb
278
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/resource_full/retrieve_spec.rb
279
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/spec/spec_helper.rb
280
- - spec/functional/sample_rails_app/vendor/plugins/resource_full/uninstall.rb
281
- - spec/functional/spec_helper.rb
282
169
  - spec/unit/spec_helper.rb
283
170
  - spec/unit/wrest/components/attributes_container/alias_accessors_spec.rb
284
171
  - spec/unit/wrest/components/attributes_container/typecaster_spec.rb
@@ -292,14 +179,13 @@ test_files:
292
179
  - spec/unit/wrest/components/translators_spec.rb
293
180
  - spec/unit/wrest/core_ext/hash/conversions_spec.rb
294
181
  - spec/unit/wrest/core_ext/string/conversions_spec.rb
295
- - spec/unit/wrest/http/redirection_spec.rb
296
- - spec/unit/wrest/http/request_spec.rb
182
+ - spec/unit/wrest/curl/request_spec.rb
183
+ - spec/unit/wrest/curl/response_spec.rb
297
184
  - spec/unit/wrest/http/response_spec.rb
185
+ - spec/unit/wrest/native/redirection_spec.rb
186
+ - spec/unit/wrest/native/request_spec.rb
187
+ - spec/unit/wrest/native/response_spec.rb
188
+ - spec/unit/wrest/native/session_spec.rb
298
189
  - spec/unit/wrest/resource/base_spec.rb
299
190
  - spec/unit/wrest/uri_spec.rb
300
191
  - spec/unit/wrest/uri_template_spec.rb
301
- - examples/delicious.rb
302
- - examples/redirection.rb
303
- - examples/twitter.rb
304
- - examples/twitter_public_timeline.rb
305
- - examples/wow_realm_status.rb
data/lib/wrest/http.rb DELETED
@@ -1,25 +0,0 @@
1
- # Copyright 2009 Sidu Ponnappa
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- # Unless required by applicable law or agreed to in writing, software distributed under the License
7
- # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8
- # See the License for the specific language governing permissions and limitations under the License.
9
-
10
- module Wrest #:nodoc:
11
-
12
- # Contains all HTTP protocol related classes such as
13
- # Get, Post, Request, Response etc.
14
- module Http
15
- end
16
- end
17
-
18
- require "#{WREST_ROOT}/wrest/http/response"
19
- require "#{WREST_ROOT}/wrest/http/redirection"
20
- require "#{WREST_ROOT}/wrest/http/request"
21
- require "#{WREST_ROOT}/wrest/http/get"
22
- require "#{WREST_ROOT}/wrest/http/put"
23
- require "#{WREST_ROOT}/wrest/http/post"
24
- require "#{WREST_ROOT}/wrest/http/delete"
25
- require "#{WREST_ROOT}/wrest/http/options"
@@ -1,3 +0,0 @@
1
- == Wrest's Sample Rails App
2
-
3
- This dummy application is what Wrest's live functional tests run against. RESTful behaviour is supported by the {resource_full}[http://github.com/bguthrie/resource_full] plugin (see vendor/plugins inside the sample app).
@@ -1,10 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require(File.join(File.dirname(__FILE__), 'config', 'boot'))
5
-
6
- require 'rake'
7
- require 'rake/testtask'
8
- require 'rake/rdoctask'
9
-
10
- require 'tasks/rails'
@@ -1,10 +0,0 @@
1
- # Filters added to this controller apply to all controllers in the application.
2
- # Likewise, all the methods added will be available for all controllers.
3
-
4
- class ApplicationController < ActionController::Base
5
- helper :all # include all helpers, all the time
6
- # protect_from_forgery # See ActionController::RequestForgeryProtection for details
7
- # session :off
8
- # Scrub sensitive parameters from your log
9
- # filter_parameter_logging :password
10
- end
@@ -1,7 +0,0 @@
1
- class LeadBottlesController < ResourceFull::Base
2
- queryable_with :name, :fuzzy => true
3
-
4
-
5
- responds_to :xml
6
- responds_to :json
7
- end
@@ -1,3 +0,0 @@
1
- # Methods added to this helper will be available to all templates in the application.
2
- module ApplicationHelper
3
- end
@@ -1,3 +0,0 @@
1
- class Bottle < ActiveRecord::Base
2
- end
3
-
@@ -1,3 +0,0 @@
1
- class GlassBottle < Bottle
2
- end
3
-
@@ -1,3 +0,0 @@
1
- class LeadBottle < Bottle
2
- end
3
-