savon 0.7.9 → 0.8.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/.gitignore +9 -0
  2. data/.rspec +1 -0
  3. data/.yardopts +2 -0
  4. data/CHANGELOG.md +332 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE +20 -0
  7. data/README.md +37 -0
  8. data/Rakefile +28 -39
  9. data/autotest/discover.rb +1 -0
  10. data/lib/savon.rb +10 -31
  11. data/lib/savon/client.rb +116 -98
  12. data/lib/savon/core_ext/array.rb +36 -22
  13. data/lib/savon/core_ext/datetime.rb +15 -6
  14. data/lib/savon/core_ext/hash.rb +122 -94
  15. data/lib/savon/core_ext/object.rb +19 -11
  16. data/lib/savon/core_ext/string.rb +62 -57
  17. data/lib/savon/core_ext/symbol.rb +13 -5
  18. data/lib/savon/error.rb +6 -0
  19. data/lib/savon/global.rb +75 -0
  20. data/lib/savon/http/error.rb +42 -0
  21. data/lib/savon/soap.rb +8 -283
  22. data/lib/savon/soap/fault.rb +48 -0
  23. data/lib/savon/soap/request.rb +61 -0
  24. data/lib/savon/soap/response.rb +65 -0
  25. data/lib/savon/soap/xml.rb +132 -0
  26. data/lib/savon/version.rb +2 -2
  27. data/lib/savon/wsdl/document.rb +107 -0
  28. data/lib/savon/wsdl/parser.rb +90 -0
  29. data/lib/savon/wsdl/request.rb +35 -0
  30. data/lib/savon/wsse.rb +42 -104
  31. data/savon.gemspec +26 -0
  32. data/spec/fixtures/response/response_fixture.rb +26 -26
  33. data/spec/fixtures/response/xml/list.xml +18 -0
  34. data/spec/fixtures/wsdl/wsdl_fixture.rb +6 -0
  35. data/spec/fixtures/wsdl/wsdl_fixture.yml +4 -4
  36. data/spec/savon/client_spec.rb +274 -51
  37. data/spec/savon/core_ext/datetime_spec.rb +1 -1
  38. data/spec/savon/core_ext/hash_spec.rb +40 -4
  39. data/spec/savon/core_ext/object_spec.rb +1 -1
  40. data/spec/savon/core_ext/string_spec.rb +0 -12
  41. data/spec/savon/http/error_spec.rb +52 -0
  42. data/spec/savon/savon_spec.rb +90 -0
  43. data/spec/savon/soap/fault_spec.rb +80 -0
  44. data/spec/savon/soap/request_spec.rb +45 -0
  45. data/spec/savon/soap/response_spec.rb +153 -0
  46. data/spec/savon/soap/xml_spec.rb +249 -0
  47. data/spec/savon/soap_spec.rb +4 -177
  48. data/spec/savon/{wsdl_spec.rb → wsdl/document_spec.rb} +54 -17
  49. data/spec/savon/wsdl/request_spec.rb +15 -0
  50. data/spec/savon/wsse_spec.rb +123 -92
  51. data/spec/spec_helper.rb +19 -4
  52. data/spec/support/endpoint.rb +25 -0
  53. metadata +97 -97
  54. data/.autotest +0 -5
  55. data/CHANGELOG +0 -176
  56. data/README.rdoc +0 -64
  57. data/lib/savon/core_ext.rb +0 -8
  58. data/lib/savon/core_ext/net_http.rb +0 -19
  59. data/lib/savon/core_ext/uri.rb +0 -10
  60. data/lib/savon/logger.rb +0 -56
  61. data/lib/savon/request.rb +0 -138
  62. data/lib/savon/response.rb +0 -174
  63. data/lib/savon/wsdl.rb +0 -137
  64. data/lib/savon/wsdl_stream.rb +0 -85
  65. data/spec/basic_spec_helper.rb +0 -11
  66. data/spec/endpoint_helper.rb +0 -23
  67. data/spec/http_stubs.rb +0 -26
  68. data/spec/integration/http_basic_auth_spec.rb +0 -16
  69. data/spec/integration/server.rb +0 -51
  70. data/spec/savon/core_ext/net_http_spec.rb +0 -38
  71. data/spec/savon/core_ext/uri_spec.rb +0 -19
  72. data/spec/savon/request_spec.rb +0 -117
  73. data/spec/savon/response_spec.rb +0 -179
  74. data/spec/spec.opts +0 -4
@@ -0,0 +1,9 @@
1
+ .DS_Store
2
+ .yardoc
3
+ doc
4
+ coverage
5
+ tmp
6
+ *~
7
+ *.gem
8
+ .bundle
9
+ Gemfile.lock
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour
@@ -0,0 +1,2 @@
1
+ -
2
+ CHANGELOG.rdoc
@@ -0,0 +1,332 @@
1
+ ## 0.8.0.beta.1 (2010-10-29)
2
+
3
+ * Changed Savon::Client.new to accept a block instead of multiple Hash arguments. You can access the
4
+ wsdl, http and wsse objects inside the block to configure your client for a particular service.
5
+
6
+ # Instantiating a client to work with a WSDL document
7
+ client = Savon::Client.new do
8
+ wsdl.document = "http://example.com?wsdl"
9
+ end
10
+
11
+ # Directly accessing the SOAP endpoint
12
+ client = Savon::Client.new do
13
+ wsdl.endpoint = "http://example.com"
14
+ wsdl.namespace = "http://v1.example.com"
15
+ end
16
+
17
+ * Fix for issue #77 (Cache parsed WSDLs locally).
18
+ You can now use local WSDL documents:
19
+
20
+ client = Savon::Client.new do
21
+ wsdl.document = "../wsdl/service.xml"
22
+ end
23
+
24
+ * Changed the way SOAP requests are being dispatched. Instead of using method_missing, you now use
25
+ the new #request method, which also accepts a block for you to access the wsdl, http, wsse and
26
+ soap object. Please notice, that a new soap object is created for every request. So you can only
27
+ access it inside this block.
28
+
29
+ # A simple request to an :authenticate method
30
+ client.request :authenticate do
31
+ soap.body = { :id => 1 }
32
+ end
33
+
34
+ * The new Savon::Client#request method fixes issues #37, #61 and #64, which report problems with
35
+ namespacing the SOAP input tag and attaching attributes to it. Some usage examples:
36
+
37
+ client.request :get_user # Input tag: <getUser>
38
+ client.request :wsdl, "GetUser" # Input tag: <wsdl:GetUser>
39
+ client.request :get_user :active => true # Input tag: <getUser active="true">
40
+
41
+ * Savon's new #request method respects the given namespace. If you don't give it a namespace,
42
+ Savon will set the target namespace to "xmlns:wsdl". But if you do specify a namespace, it will
43
+ be set to the given Symbol.
44
+
45
+ * Refactored Savon to use the new HTTPI (http://rubygems.org/gems/httpi) gem.
46
+ HTTPI::Request replaces the Savon::Request, so please make sure to have a look
47
+ at the HTTPI library and let me know about any problems. Using HTTPI actually
48
+ fixes the following two issues.
49
+
50
+ * Savon now adds both "xmlns:xsd" and "xmlns:xsi" namespaces for you. Thanks Averell.
51
+ It also properly serializes nil values as xsi:nil = "true".
52
+
53
+ * Fix for issue #24 (HTTP Digest Authentication).
54
+ Instead of Net/HTTP, Savon now uses HTTPI to execute HTTP requests.
55
+ HTTPI defaults to use HTTPClient which supports HTTP digest authentication.
56
+
57
+ * Fix for issue #76 (Config setting for WSDL-free operation).
58
+ You now have to explicitly specify whether to use a WSDL document, when instantiating a client.
59
+
60
+ * Fix for issue #75 (Add response to SoapFault).
61
+ Both Savon::SOAP::Fault and Savon::HTTP::Error now contain the HTTPI::Response.
62
+ They also inherit from Savon::Error, making it easier to rescue both at the same time.
63
+
64
+ * Fix for issue #87 (Namespaced entries in the xml).
65
+ Thanks to Leonardo Borges.
66
+
67
+ * Fix for issue #81 (irb on Ruby 1.9.2 doesn't disable wsdl).
68
+ Replaced Savon::WSDL::Document#to_s with a #to_xml method.
69
+
70
+ * Fix for issues #85 and #88 (When gzip is enabled, binary data is logged).
71
+
72
+ * Fix for issue #80 (URI-reference is not quoted in Soapaction HTTP header).
73
+
74
+ * Fix for issue #60 (Savon::WSSE does not set wsu:Id attribute in wsse:UsernameToken tag).
75
+
76
+ * Fix for issue 96 (Savon doesn't guess upper_camelcased action).
77
+
78
+ * Removed global WSSE credentials. Authentication needs to be set up for each client instance.
79
+
80
+ * Started to remove quite a few core extensions.
81
+
82
+ ## 0.7.9 (2010-06-14)
83
+
84
+ * Fix for issue #53 (<tt>DateTime#to_soap_value</tt> assumes UTC).
85
+
86
+ ## 0.7.8 (2010-05-09)
87
+
88
+ * Fixed gemspec to include missing files in the gem.
89
+
90
+ ## 0.7.7 (2010-05-09)
91
+
92
+ * SOAP requests now start with a proper XML declaration.
93
+
94
+ * Added support for gzipped requests and responses (http://github.com/lucascs). While gzipped SOAP
95
+ responses are decoded automatically, you have to manually instruct Savon to gzip SOAP requests:
96
+
97
+ client = Savon::Client.new "http://example.com/UserService?wsdl", :gzip => true
98
+
99
+ * Fix for issue #51. Added the :soap_endpoint option to <tt>Savon::Client.new</tt> which lets you
100
+ specify a SOAP endpoint per client instance:
101
+
102
+ client = Savon::Client.new "http://example.com/UserService?wsdl",
103
+ :soap_endpoint => "http://localhost/UserService"
104
+
105
+ * Fix for issue #50. Savon still escapes special characters in SOAP request Hash values, but you can now
106
+ append an exclamation mark to Hash keys specifying that it's value should not be escaped.
107
+
108
+ ## 0.7.6 (2010-03-21)
109
+
110
+ * Moved documentation from the Github Wiki to the actual class files and established a much nicer
111
+ documentation combining examples and implementation (using Hanna) at: http://savon.rubiii.com
112
+
113
+ * Added <tt>Savon::Client#call</tt> as a workaround for dispatching calls to SOAP actions named after
114
+ existing methods. Fix for issue #48.
115
+
116
+ * Add support for specifying attributes for duplicate tags (via Hash values as Arrays). Fix for issue #45.
117
+
118
+ * Fix for issue #41 (Escape special characters (e.g. &) for XML requests).
119
+
120
+ * Fix for issue #39 and #49. Added <tt>Savon::SOAP#xml</tt> which let's you specify completely custom
121
+ SOAP request XML.
122
+
123
+ ## 0.7.5 (2010-02-19)
124
+
125
+ * Fix for issue #34 (soap_actions returns empty for wsdl12).
126
+
127
+ * Fix for issue #36 (Custom WSDL actions broken).
128
+
129
+ * Added feature requested in issue #35 (Setting an attribute on an element?).
130
+
131
+ * Changed the key for specifying the order of tags from :@inorder to :order!
132
+
133
+ ## 0.7.4 (2010-02-02)
134
+
135
+ * Fix for issue #33 (undefined method <tt>start_with?</tt>).
136
+
137
+ ## 0.7.3 (2010-01-31)
138
+
139
+ * Added support for Geotrust-style WSDL documents (Julian Kornberger <github.corny@digineo.de>).
140
+
141
+ * Make HTTP requests include path and query only. This was breaking requests via proxy as scheme and host
142
+ were repeated (Adrian Mugnolo <adrian@mugnolo.com>)
143
+
144
+ * Avoid warning on 1.8.7 and 1.9.1 (Adrian Mugnolo <adrian@mugnolo.com>).
145
+
146
+ * Fix for issue #29 (WSSE Created Bug?). Default to UTC to xs:dateTime value for WSSE authentication.
147
+
148
+ * Fix for issue #28 (Undefined Method ssl? on URI::Generic).
149
+
150
+ * Fix for issue #27 (http content-type defaults to utf-8). The Content-Type now defaults to UTF-8.
151
+
152
+ * Modification to allow assignment of an Array with an input name and an optional Hash of values to soap.input.
153
+ Patches issue #30 (stanleydrew <andrewmbenton@gmail.com>).
154
+
155
+ * Fix for issue #25 (header-tag should not be sent if not set).
156
+
157
+ ## 0.7.2 (2010-01-17)
158
+
159
+ * Exposed the Net::HTTP response (added by Kevin Ingolfsland). Use the "http" accessor (response.http) on your
160
+ Savon::Response to access the <tt>Net::HTTP</tt> response object.
161
+
162
+ * Fix for issue #21 (savon is stripping ?SOAP off the end of WSDL locations).
163
+
164
+ * Fix for issue #22 (<tt>REXML::ParseException</tt> parsing 401 Unauthorized response body).
165
+
166
+ * Fix for issue #19 (Unable to set attribute in name-spaced WSSE password element).
167
+
168
+ * Added support for global header and namespaces. See issue #9 (Setting headers and namespaces).
169
+
170
+ ## 0.7.1 (2010-01-10)
171
+
172
+ * The Hash of HTTP headers for SOAP calls is now public via <tt>Savon::Request#headers</tt>.
173
+ Patch for: http://github.com/rubiii/savon/issues/#issue/8
174
+
175
+ ## 0.7.0 (2010-01-09)
176
+
177
+ This version comes with several changes to the public API!
178
+ Pay attention to the following list and read the updated Wiki: http://wiki.github.com/rubiii/savon
179
+
180
+ * Changed how Savon::WSDL can be disabled. Instead of disabling the WSDL globally/per request via two
181
+ different methods, you now simply append an exclamation mark (!) to your SOAP call: client.get_all_users!
182
+ Make sure you know what you're doing because when the WSDL is disabled, Savon does not know about which
183
+ SOAP actions are valid and just dispatches everything.
184
+
185
+ * The Net::HTTP object used by Savon::Request to retrieve WSDL documents and execute SOAP calls is now public.
186
+ While this makes the library even more flexible, it also comes with two major changes:
187
+
188
+ * SSL client authentication needs to be defined directly on the <tt>Net::HTTP</tt> object:
189
+
190
+ client.request.http.client_cert = ...
191
+
192
+ I added a shortcut method for setting all options through a Hash similar to the previous implementation:
193
+
194
+ client.request.http.ssl_client_auth :client_cert => ...
195
+
196
+ * Open and read timeouts also need to be set on the <tt>Net::HTTP</tt> object:
197
+
198
+ client.request.http.open_timeout = 30
199
+ client.request.http.read_timeout = 30
200
+
201
+ * Please refer to the <tt>Net::HTTP</tt> documentation for more details:
202
+ http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html
203
+
204
+ * Thanks to JulianMorrison, Savon now supports HTTP basic authentication:
205
+
206
+ client.request.http.basic_auth "username", "password"
207
+
208
+ * Julian also added a way to explicitly specify the order of Hash keys and values, so you should now be able
209
+ to work with services requiring a specific order of input parameters while still using Hash input.
210
+
211
+ client.find_user { |soap| soap.body = { :name => "Lucy", :id => 666, :@inorder => [:id, :name] } }
212
+
213
+ * <tt>Savon::Response#to_hash</tt> now returns the content inside of "soap:Body" instead of trying to go one
214
+ level deeper and return it's content. The previous implementation only worked when the "soap:Body" element
215
+ contained a single child. See: http://github.com/rubiii/savon/issues#issue/17
216
+
217
+ * Added <tt>Savon::SOAP#namespace</tt> as a shortcut for setting the "xmlns:wsdl" namespace.
218
+
219
+ soap.namespace = "http://example.com"
220
+
221
+ ## 0.6.8 (2010-01-01)
222
+
223
+ * Improved specifications for various kinds of WSDL documents.
224
+
225
+ * Added support for SOAP endpoints which are different than the WSDL endpoint of a service.
226
+
227
+ * Changed how SOAP actions and inputs are retrieved from the WSDL documents. This might break a few existing
228
+ implementations, but makes Savon work well with even more services. If this change breaks your implementation,
229
+ please take a look at the +action+ and +input+ methods of the <tt>Savon::SOAP</tt> object.
230
+ One specific problem I know of is working with the createsend WSDL and its namespaced actions.
231
+
232
+ To make it work, call the SOAP action without namespace and specify the input manually:
233
+
234
+ client.get_api_key { |soap| soap.input = "User.GetApiKey" }
235
+
236
+ ## 0.6.7 (2009-12-18)
237
+
238
+ * Implemented support for a proxy server. The proxy URI can be set through an optional Hash of options passed
239
+ to instantiating <tt>Savon::Client</tt> (Dave Woodward <dave@futuremint.com>)
240
+
241
+ * Implemented support for SSL client authentication. Settings can be set through an optional Hash of arguments
242
+ passed to instantiating <tt>Savon::Client</tt> (colonhyphenp)
243
+
244
+ * Patch for issue #10 (Problem with operation tags without a namespace).
245
+
246
+ ## 0.6.6 (2009-12-14)
247
+
248
+ * Default to use the name of the SOAP action (the method called in a client) in lowerCamelCase for SOAP action
249
+ and input when Savon::WSDL is disabled. You still need to specify soap.action and maybe soap.input in case
250
+ your SOAP actions are named any different.
251
+
252
+ ## 0.6.5 (2009-12-13)
253
+
254
+ * Added an <tt>open_timeout</tt> method to <tt>Savon::Request</tt>.
255
+
256
+ ## 0.6.4 (2009-12-13)
257
+
258
+ * Refactored specs to be less unit-like.
259
+
260
+ * Added a getter for the <tt>Savon::Request</tt> to <tt>Savon::Client</tt> and a read_timeout setter for HTTP requests.
261
+
262
+ * wsdl.soap_actions now returns an Array of SOAP actions. For the previous "mapping" please use <tt>wsdl.operations</tt>.
263
+
264
+ * Replaced WSDL document with stream parsing.
265
+
266
+ Benchmarks (1000 SOAP calls):
267
+
268
+ user system total real
269
+ 0.6.4 72.180000 8.280000 80.460000 (750.799011)
270
+ 0.6.3 192.900000 19.630000 212.530000 (914.031865)
271
+
272
+ ## 0.6.3 (2009-12-11)
273
+
274
+ * Removing 2 ruby deprecation warnings for parenthesized arguments. (Dave Woodward <dave@futuremint.com>)
275
+
276
+ * Added global and per request options for disabling <tt>Savon::WSDL</tt>.
277
+
278
+ Benchmarks (1000 SOAP calls):
279
+
280
+ user system total real
281
+ WSDL 192.900000 19.630000 212.530000 (914.031865)
282
+ disabled WSDL 5.680000 1.340000 7.020000 (298.265318)
283
+
284
+ * Improved XPath expressions for parsing the WSDL document.
285
+
286
+ Benchmarks (1000 SOAP calls):
287
+
288
+ user system total real
289
+ 0.6.3 192.900000 19.630000 212.530000 (914.031865)
290
+ 0.6.2 574.720000 78.380000 653.100000 (1387.778539)
291
+
292
+ ## 0.6.2 (2009-12-06)
293
+
294
+ * Added support for changing the name of the SOAP input node.
295
+
296
+ * Added a CHANGELOG.
297
+
298
+ ## 0.6.1 (2009-12-06)
299
+
300
+ * Fixed a problem with WSSE credentials, where every request contained a WSSE authentication header.
301
+
302
+ ## 0.6.0 (2009-12-06)
303
+
304
+ * method_missing now yields the SOAP and WSSE objects to a given block.
305
+
306
+ * The response_process (which previously was a block passed to method_missing) was replaced by <tt>Savon::Response</tt>.
307
+
308
+ * Improved SOAP action handling (another problem that came up with issue #1).
309
+
310
+ ## 0.5.3 (2009-11-30)
311
+
312
+ * Patch for issue #2 (NoMethodError: undefined method <tt>invalid!</tt> for <tt>Savon::WSDL</tt>)
313
+
314
+ ## 0.5.2 (2009-11-30)
315
+
316
+ * Patch for issue #1 (Calls fail if api methods have periods in them)
317
+
318
+ ## 0.5.1 (2009-11-29)
319
+
320
+ * Optimized default response process.
321
+
322
+ * Added WSSE settings via defaults.
323
+
324
+ * Added SOAP fault and HTTP error handling.
325
+
326
+ * Improved documentation
327
+
328
+ * Added specs
329
+
330
+ ## 0.5.0 (2009-11-29)
331
+
332
+ * Complete rewrite and public release.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source :rubygems
2
+ gemspec
3
+
4
+ gem "httpclient", "~> 2.1.5"
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 Daniel Harrington
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,37 @@
1
+ Savon
2
+ =====
3
+
4
+ Heavy metal Ruby SOAP client
5
+
6
+ [Guide](http://rubiii.github.com/savon) | [Rubydoc](http://rubydoc.info/gems/savon) | [Wishlist](http://savon.uservoice.com) | [Bugs](http://github.com/rubiii/savon/issues)
7
+
8
+ Installation
9
+ ------------
10
+
11
+ Savon is available through [Rubygems](http://rubygems.org/gems/savon) and can be installed via:
12
+
13
+ $ gem install savon
14
+
15
+ Basic workflow
16
+ --------------
17
+
18
+ # Setting up a Savon::Client representing a SOAP service.
19
+ client = Savon::Client.new do
20
+ wsdl.document = "http://service.example.com?wsdl"
21
+ end
22
+
23
+ client.wsdl.soap_actions
24
+ # => [:create_user, :get_user, :get_all_users]
25
+
26
+ # Executing a SOAP request to call a "getUser" action.
27
+ response = client.request :get_user do
28
+ soap.body = { :id => 1 }
29
+ end
30
+
31
+ response.to_hash
32
+ # => { :get_user_response => { :first_name => "The", :last_name => "Hoff" } }
33
+
34
+ Excited to learn more?
35
+ ----------------------
36
+
37
+ Then you might want to go ahead and read the [Savon Guide](http://rubiii.github.com/savon).
data/Rakefile CHANGED
@@ -1,50 +1,39 @@
1
1
  require "rake"
2
- require "spec/rake/spectask"
3
- require "spec/rake/verify_rcov"
4
2
 
5
- task :default => :spec
6
-
7
- Spec::Rake::SpecTask.new do |spec|
8
- spec.spec_files = FileList["spec/{savon}/**/*_spec.rb"]
9
- spec.spec_opts << "--color"
10
- spec.libs += ["lib", "spec"]
11
- spec.rcov = true
12
- end
13
-
14
- RCov::VerifyTask.new(:spec_verify => :spec) do |verify|
15
- verify.threshold = 100.0
16
- verify.index_html = "rcov/index.html"
17
- end
18
-
19
- desc "Run integration specs using WEBrick"
20
- task :spec_integration do
21
- pid = fork { exec "ruby spec/integration/server.rb" }
22
- sleep 10 # wait until the server is actually ready
23
- begin
24
- task(:run_integration_spec).invoke
25
- ensure
26
- Process.kill "TERM", pid
27
- Process.wait pid
3
+ begin
4
+ require "yard"
5
+
6
+ YARD::Rake::YardocTask.new do |t|
7
+ t.files = ["README.md", "lib/**/*.rb"]
28
8
  end
9
+ rescue LoadError
10
+ desc message = %{"gem install yard" to generate documentation}
11
+ task("yard") { abort message }
29
12
  end
30
13
 
31
- desc "" # make this task invisible
32
- Spec::Rake::SpecTask.new(:run_integration_spec) do |spec|
33
- spec.spec_files = FileList["spec/{integration}/**/*_spec.rb"]
34
- spec.spec_opts << "--color"
35
- spec.libs += ["lib", "spec"]
14
+ begin
15
+ require "metric_fu"
16
+
17
+ MetricFu::Configuration.run do |c|
18
+ c.metrics = [:churn, :flog, :flay, :reek, :roodi, :saikuro] # :rcov seems to be broken
19
+ c.graphs = [:flog, :flay, :reek, :roodi]
20
+ c.flay = { :dirs_to_flay => ["lib"], :minimum_score => 20 }
21
+ c.rcov[:rcov_opts] << "-Ilib -Ispec"
22
+ end
23
+ rescue LoadError
24
+ desc message = %{"gem install metric_fu" to generate metrics}
25
+ task("metrics:all") { abort message }
36
26
  end
37
27
 
38
28
  begin
39
- require "hanna/rdoctask"
40
-
41
- Rake::RDocTask.new do |rdoc|
42
- rdoc.title = "Savon - Heavy metal Ruby SOAP client library"
43
- rdoc.rdoc_dir = "doc"
44
- rdoc.rdoc_files.include("**/*.rdoc").include("lib/**/*.rb")
45
- rdoc.options << "--line-numbers"
46
- rdoc.options << "--webcvs=http://github.com/rubiii/savon/tree/master/"
29
+ require "rspec/core/rake_task"
30
+
31
+ RSpec::Core::RakeTask.new do |t|
32
+ t.rspec_opts = %w(-fd -c)
47
33
  end
48
34
  rescue LoadError
49
- puts "'gem install hanna' for documentation"
35
+ desc message = %{"gem install rspec --pre" to run the specs}
36
+ task(:spec) { abort message }
50
37
  end
38
+
39
+ task :default => :spec