vim-jar 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1042) hide show
  1. data/.gitignore +4 -0
  2. data/.rspec +2 -0
  3. data/.rvmrc +1 -0
  4. data/Gemfile +4 -0
  5. data/Gemfile.lock +44 -0
  6. data/README.md +25 -0
  7. data/Rakefile +2 -0
  8. data/TODO.otl +28 -0
  9. data/bin/vim-jar +62 -0
  10. data/bundler/ruby/1.8/bin/autospec +19 -0
  11. data/bundler/ruby/1.8/bin/autotest +21 -0
  12. data/bundler/ruby/1.8/bin/htmldiff +19 -0
  13. data/bundler/ruby/1.8/bin/ldiff +19 -0
  14. data/bundler/ruby/1.8/bin/multigem +21 -0
  15. data/bundler/ruby/1.8/bin/multiruby +21 -0
  16. data/bundler/ruby/1.8/bin/multiruby_setup +21 -0
  17. data/bundler/ruby/1.8/bin/rdebug +19 -0
  18. data/bundler/ruby/1.8/bin/rspec +19 -0
  19. data/bundler/ruby/1.8/bin/unit_diff +21 -0
  20. data/bundler/ruby/1.8/bin/vim-jar +19 -0
  21. data/bundler/ruby/1.8/bin/zentest +21 -0
  22. data/bundler/ruby/1.8/gems/RubyInline-3.8.6/History.txt +392 -0
  23. data/bundler/ruby/1.8/gems/RubyInline-3.8.6/Manifest.txt +12 -0
  24. data/bundler/ruby/1.8/gems/RubyInline-3.8.6/README.txt +139 -0
  25. data/bundler/ruby/1.8/gems/RubyInline-3.8.6/Rakefile +38 -0
  26. data/bundler/ruby/1.8/gems/RubyInline-3.8.6/demo/fastmath.rb +27 -0
  27. data/bundler/ruby/1.8/gems/RubyInline-3.8.6/demo/hello.rb +13 -0
  28. data/bundler/ruby/1.8/gems/RubyInline-3.8.6/example.rb +86 -0
  29. data/bundler/ruby/1.8/gems/RubyInline-3.8.6/example2.rb +34 -0
  30. data/bundler/ruby/1.8/gems/RubyInline-3.8.6/lib/inline.rb +878 -0
  31. data/bundler/ruby/1.8/gems/RubyInline-3.8.6/test/test_inline.rb +1051 -0
  32. data/bundler/ruby/1.8/gems/RubyInline-3.8.6/tutorial/example1.rb +63 -0
  33. data/bundler/ruby/1.8/gems/RubyInline-3.8.6/tutorial/example2.rb +96 -0
  34. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/.autotest +21 -0
  35. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/History.txt +709 -0
  36. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/Manifest.txt +35 -0
  37. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/README.txt +109 -0
  38. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/Rakefile +59 -0
  39. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/articles/Article.css +721 -0
  40. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/articles/getting_started_with_autotest.html +533 -0
  41. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/articles/how_to_use_zentest.txt +393 -0
  42. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/bin/autotest +55 -0
  43. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/bin/multigem +4 -0
  44. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/bin/multiruby +76 -0
  45. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/bin/multiruby_setup +74 -0
  46. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/bin/unit_diff +37 -0
  47. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/bin/zentest +28 -0
  48. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/example.txt +42 -0
  49. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/example1.rb +7 -0
  50. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/example2.rb +15 -0
  51. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/example_dot_autotest.rb +12 -0
  52. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/autotest/autoupdate.rb +26 -0
  53. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/autotest/once.rb +9 -0
  54. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/autotest/rcov.rb +27 -0
  55. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/autotest/restart.rb +11 -0
  56. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/autotest/timestamp.rb +9 -0
  57. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/autotest.rb +658 -0
  58. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/focus.rb +21 -0
  59. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/functional_test_matrix.rb +92 -0
  60. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/multiruby.rb +412 -0
  61. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/unit_diff.rb +274 -0
  62. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/zentest.rb +562 -0
  63. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/zentest_mapping.rb +117 -0
  64. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/test/test_autotest.rb +477 -0
  65. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/test/test_focus.rb +35 -0
  66. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/test/test_unit_diff.rb +343 -0
  67. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/test/test_zentest.rb +566 -0
  68. data/bundler/ruby/1.8/gems/ZenTest-4.4.0/test/test_zentest_mapping.rb +242 -0
  69. data/bundler/ruby/1.8/gems/columnize-0.3.2/AUTHORS +1 -0
  70. data/bundler/ruby/1.8/gems/columnize-0.3.2/COPYING +340 -0
  71. data/bundler/ruby/1.8/gems/columnize-0.3.2/ChangeLog +101 -0
  72. data/bundler/ruby/1.8/gems/columnize-0.3.2/Makefile +8 -0
  73. data/bundler/ruby/1.8/gems/columnize-0.3.2/NEWS +32 -0
  74. data/bundler/ruby/1.8/gems/columnize-0.3.2/README +39 -0
  75. data/bundler/ruby/1.8/gems/columnize-0.3.2/Rakefile +84 -0
  76. data/bundler/ruby/1.8/gems/columnize-0.3.2/lib/Makefile +7 -0
  77. data/bundler/ruby/1.8/gems/columnize-0.3.2/lib/columnize.rb +247 -0
  78. data/bundler/ruby/1.8/gems/columnize-0.3.2/lib/version.rb +3 -0
  79. data/bundler/ruby/1.8/gems/columnize-0.3.2/test/test-columnize.rb +81 -0
  80. data/bundler/ruby/1.8/gems/curb-0.7.8/.require_paths +3 -0
  81. data/bundler/ruby/1.8/gems/curb-0.7.8/LICENSE +51 -0
  82. data/bundler/ruby/1.8/gems/curb-0.7.8/README +158 -0
  83. data/bundler/ruby/1.8/gems/curb-0.7.8/Rakefile +316 -0
  84. data/bundler/ruby/1.8/gems/curb-0.7.8/doc.rb +42 -0
  85. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/Makefile +157 -0
  86. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/conftest.dSYM/Contents/Info.plist +20 -0
  87. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/conftest.dSYM/Contents/Resources/DWARF/conftest +0 -0
  88. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb.c +373 -0
  89. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb.h +52 -0
  90. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb.o +0 -0
  91. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_config.h +64 -0
  92. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_core.bundle +0 -0
  93. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_easy.c +3379 -0
  94. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_easy.h +84 -0
  95. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_easy.o +0 -0
  96. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_errors.c +637 -0
  97. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_errors.h +129 -0
  98. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_errors.o +0 -0
  99. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_macros.h +155 -0
  100. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_multi.c +519 -0
  101. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_multi.h +26 -0
  102. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_multi.o +0 -0
  103. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_postfield.c +522 -0
  104. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_postfield.h +40 -0
  105. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_postfield.o +0 -0
  106. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_upload.c +80 -0
  107. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_upload.h +30 -0
  108. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/curb_upload.o +0 -0
  109. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/extconf.rb +177 -0
  110. data/bundler/ruby/1.8/gems/curb-0.7.8/ext/mkmf.log +1088 -0
  111. data/bundler/ruby/1.8/gems/curb-0.7.8/lib/curb.rb +255 -0
  112. data/bundler/ruby/1.8/gems/curb-0.7.8/lib/curb_core.bundle +0 -0
  113. data/bundler/ruby/1.8/gems/curb-0.7.8/lib/curl.rb +2 -0
  114. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/alltests.rb +3 -0
  115. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/bug_curb_easy_blocks_ruby_threads.rb +52 -0
  116. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/bug_curb_easy_post_with_string_no_content_length_header.rb +83 -0
  117. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/bug_instance_post_differs_from_class_post.rb +53 -0
  118. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/bug_multi_segfault.rb +14 -0
  119. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/bug_postfields_crash.rb +26 -0
  120. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/bug_postfields_crash2.rb +57 -0
  121. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/bug_require_last_or_segfault.rb +40 -0
  122. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/bugtests.rb +9 -0
  123. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/helper.rb +182 -0
  124. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/mem_check.rb +65 -0
  125. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/require_last_or_segfault_script.rb +36 -0
  126. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/tc_curl_download.rb +32 -0
  127. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/tc_curl_easy.rb +830 -0
  128. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/tc_curl_multi.rb +461 -0
  129. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/tc_curl_postfield.rb +143 -0
  130. data/bundler/ruby/1.8/gems/curb-0.7.8/tests/unittests.rb +2 -0
  131. data/bundler/ruby/1.8/gems/curl-multi-0.2/History.txt +7 -0
  132. data/bundler/ruby/1.8/gems/curl-multi-0.2/License.txt +676 -0
  133. data/bundler/ruby/1.8/gems/curl-multi-0.2/Manifest.txt +25 -0
  134. data/bundler/ruby/1.8/gems/curl-multi-0.2/README.txt +7 -0
  135. data/bundler/ruby/1.8/gems/curl-multi-0.2/Rakefile +4 -0
  136. data/bundler/ruby/1.8/gems/curl-multi-0.2/config/hoe.rb +71 -0
  137. data/bundler/ruby/1.8/gems/curl-multi-0.2/config/requirements.rb +17 -0
  138. data/bundler/ruby/1.8/gems/curl-multi-0.2/lib/curl-multi/version.rb +23 -0
  139. data/bundler/ruby/1.8/gems/curl-multi-0.2/lib/curl-multi.rb +374 -0
  140. data/bundler/ruby/1.8/gems/curl-multi-0.2/lib/uri-extensions.rb +34 -0
  141. data/bundler/ruby/1.8/gems/curl-multi-0.2/log/debug.log +0 -0
  142. data/bundler/ruby/1.8/gems/curl-multi-0.2/script/destroy +14 -0
  143. data/bundler/ruby/1.8/gems/curl-multi-0.2/script/generate +14 -0
  144. data/bundler/ruby/1.8/gems/curl-multi-0.2/script/txt2html +74 -0
  145. data/bundler/ruby/1.8/gems/curl-multi-0.2/setup.rb +1585 -0
  146. data/bundler/ruby/1.8/gems/curl-multi-0.2/tasks/deployment.rake +34 -0
  147. data/bundler/ruby/1.8/gems/curl-multi-0.2/tasks/environment.rake +7 -0
  148. data/bundler/ruby/1.8/gems/curl-multi-0.2/tasks/website.rake +17 -0
  149. data/bundler/ruby/1.8/gems/curl-multi-0.2/test/test_curl-multi.rb +34 -0
  150. data/bundler/ruby/1.8/gems/curl-multi-0.2/test/test_helper.rb +2 -0
  151. data/bundler/ruby/1.8/gems/curl-multi-0.2/website/index.html +129 -0
  152. data/bundler/ruby/1.8/gems/curl-multi-0.2/website/index.txt +65 -0
  153. data/bundler/ruby/1.8/gems/curl-multi-0.2/website/javascripts/rounded_corners_lite.inc.js +285 -0
  154. data/bundler/ruby/1.8/gems/curl-multi-0.2/website/stylesheets/screen.css +138 -0
  155. data/bundler/ruby/1.8/gems/curl-multi-0.2/website/template.rhtml +48 -0
  156. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/ChangeLog +46 -0
  157. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/Install +6 -0
  158. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/README +76 -0
  159. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/Rakefile +116 -0
  160. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/bin/htmldiff +112 -0
  161. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/bin/ldiff +45 -0
  162. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/lib/diff/lcs/array.rb +21 -0
  163. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/lib/diff/lcs/block.rb +51 -0
  164. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/lib/diff/lcs/callbacks.rb +322 -0
  165. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/lib/diff/lcs/change.rb +169 -0
  166. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/lib/diff/lcs/hunk.rb +257 -0
  167. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/lib/diff/lcs/ldiff.rb +226 -0
  168. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/lib/diff/lcs/string.rb +19 -0
  169. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/lib/diff/lcs.rb +1105 -0
  170. data/bundler/ruby/1.8/gems/diff-lcs-1.1.2/tests/00test.rb +626 -0
  171. data/bundler/ruby/1.8/gems/fakefs-0.2.1/.gitignore +1 -0
  172. data/bundler/ruby/1.8/gems/fakefs-0.2.1/CONTRIBUTORS +12 -0
  173. data/bundler/ruby/1.8/gems/fakefs-0.2.1/LICENSE +20 -0
  174. data/bundler/ruby/1.8/gems/fakefs-0.2.1/README.markdown +101 -0
  175. data/bundler/ruby/1.8/gems/fakefs-0.2.1/Rakefile +47 -0
  176. data/bundler/ruby/1.8/gems/fakefs-0.2.1/lib/fakefs/base.rb +38 -0
  177. data/bundler/ruby/1.8/gems/fakefs-0.2.1/lib/fakefs/dir.rb +114 -0
  178. data/bundler/ruby/1.8/gems/fakefs-0.2.1/lib/fakefs/fake/dir.rb +45 -0
  179. data/bundler/ruby/1.8/gems/fakefs-0.2.1/lib/fakefs/fake/file.rb +79 -0
  180. data/bundler/ruby/1.8/gems/fakefs-0.2.1/lib/fakefs/fake/symlink.rb +32 -0
  181. data/bundler/ruby/1.8/gems/fakefs-0.2.1/lib/fakefs/file.rb +282 -0
  182. data/bundler/ruby/1.8/gems/fakefs-0.2.1/lib/fakefs/file_system.rb +136 -0
  183. data/bundler/ruby/1.8/gems/fakefs-0.2.1/lib/fakefs/fileutils.rb +129 -0
  184. data/bundler/ruby/1.8/gems/fakefs-0.2.1/lib/fakefs/safe.rb +11 -0
  185. data/bundler/ruby/1.8/gems/fakefs-0.2.1/lib/fakefs/spec_helpers.rb +46 -0
  186. data/bundler/ruby/1.8/gems/fakefs-0.2.1/lib/fakefs/version.rb +9 -0
  187. data/bundler/ruby/1.8/gems/fakefs-0.2.1/lib/fakefs.rb +3 -0
  188. data/bundler/ruby/1.8/gems/fakefs-0.2.1/spec/fakefs/spec_helpers_spec.rb +57 -0
  189. data/bundler/ruby/1.8/gems/fakefs-0.2.1/spec/spec.opts +1 -0
  190. data/bundler/ruby/1.8/gems/fakefs-0.2.1/spec/spec_helper.rb +3 -0
  191. data/bundler/ruby/1.8/gems/fakefs-0.2.1/test/fake/file_test.rb +88 -0
  192. data/bundler/ruby/1.8/gems/fakefs-0.2.1/test/fake/symlink_test.rb +12 -0
  193. data/bundler/ruby/1.8/gems/fakefs-0.2.1/test/fakefs_test.rb +1251 -0
  194. data/bundler/ruby/1.8/gems/fakefs-0.2.1/test/file/stat_test.rb +70 -0
  195. data/bundler/ruby/1.8/gems/fakefs-0.2.1/test/safe_test.rb +42 -0
  196. data/bundler/ruby/1.8/gems/fakefs-0.2.1/test/verify.rb +27 -0
  197. data/bundler/ruby/1.8/gems/fuubar-0.0.2/.gitignore +3 -0
  198. data/bundler/ruby/1.8/gems/fuubar-0.0.2/.rspec +2 -0
  199. data/bundler/ruby/1.8/gems/fuubar-0.0.2/Gemfile +4 -0
  200. data/bundler/ruby/1.8/gems/fuubar-0.0.2/Gemfile.lock +31 -0
  201. data/bundler/ruby/1.8/gems/fuubar-0.0.2/LICENSE +3 -0
  202. data/bundler/ruby/1.8/gems/fuubar-0.0.2/README.textile +18 -0
  203. data/bundler/ruby/1.8/gems/fuubar-0.0.2/fuubar.gemspec +23 -0
  204. data/bundler/ruby/1.8/gems/fuubar-0.0.2/lib/fuubar.rb +69 -0
  205. data/bundler/ruby/1.8/gems/fuubar-0.0.2/spec/fuubar_spec.rb +150 -0
  206. data/bundler/ruby/1.8/gems/fuubar-0.0.2/spec/spec_helper.rb +3 -0
  207. data/bundler/ruby/1.8/gems/linecache-0.43/AUTHORS +1 -0
  208. data/bundler/ruby/1.8/gems/linecache-0.43/COPYING +340 -0
  209. data/bundler/ruby/1.8/gems/linecache-0.43/ChangeLog +317 -0
  210. data/bundler/ruby/1.8/gems/linecache-0.43/NEWS +29 -0
  211. data/bundler/ruby/1.8/gems/linecache-0.43/README +38 -0
  212. data/bundler/ruby/1.8/gems/linecache-0.43/Rakefile +166 -0
  213. data/bundler/ruby/1.8/gems/linecache-0.43/VERSION +1 -0
  214. data/bundler/ruby/1.8/gems/linecache-0.43/ext/Makefile +157 -0
  215. data/bundler/ruby/1.8/gems/linecache-0.43/ext/extconf.rb +16 -0
  216. data/bundler/ruby/1.8/gems/linecache-0.43/ext/trace_nums.bundle +0 -0
  217. data/bundler/ruby/1.8/gems/linecache-0.43/ext/trace_nums.c +716 -0
  218. data/bundler/ruby/1.8/gems/linecache-0.43/ext/trace_nums.h +111 -0
  219. data/bundler/ruby/1.8/gems/linecache-0.43/ext/trace_nums.o +0 -0
  220. data/bundler/ruby/1.8/gems/linecache-0.43/lib/linecache.rb +399 -0
  221. data/bundler/ruby/1.8/gems/linecache-0.43/lib/trace_nums.bundle +0 -0
  222. data/bundler/ruby/1.8/gems/linecache-0.43/lib/tracelines.rb +47 -0
  223. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/begin1.rb +3 -0
  224. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/begin2.rb +3 -0
  225. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/begin3.rb +6 -0
  226. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/block1.rb +7 -0
  227. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/block2.rb +4 -0
  228. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/case1.rb +6 -0
  229. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/case2.rb +5 -0
  230. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/case3.rb +5 -0
  231. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/case4.rb +4 -0
  232. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/case5.rb +10 -0
  233. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/class1.rb +5 -0
  234. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/comments1.rb +6 -0
  235. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/def1.rb +9 -0
  236. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/each1.rb +3 -0
  237. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/end.rb +3 -0
  238. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/for1.rb +4 -0
  239. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/if1.rb +4 -0
  240. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/if2.rb +4 -0
  241. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/if3.rb +9 -0
  242. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/if4.rb +14 -0
  243. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/if5.rb +7 -0
  244. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/if6.rb +4 -0
  245. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/if7.rb +8 -0
  246. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/match.rb +3 -0
  247. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/match3.rb +5 -0
  248. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/match3a.rb +6 -0
  249. data/bundler/ruby/1.8/gems/linecache-0.43/test/data/not-lit.rb +6 -0
  250. data/bundler/ruby/1.8/gems/linecache-0.43/test/lnum-diag.rb +130 -0
  251. data/bundler/ruby/1.8/gems/linecache-0.43/test/parse-show.rb +14 -0
  252. data/bundler/ruby/1.8/gems/linecache-0.43/test/rcov-bug.rb +10 -0
  253. data/bundler/ruby/1.8/gems/linecache-0.43/test/short-file +2 -0
  254. data/bundler/ruby/1.8/gems/linecache-0.43/test/test-linecache.rb +151 -0
  255. data/bundler/ruby/1.8/gems/linecache-0.43/test/test-lnum.rb +36 -0
  256. data/bundler/ruby/1.8/gems/linecache-0.43/test/test-tracelines.rb +41 -0
  257. data/bundler/ruby/1.8/gems/rr-1.0.2/CHANGES +260 -0
  258. data/bundler/ruby/1.8/gems/rr-1.0.2/Gemfile +6 -0
  259. data/bundler/ruby/1.8/gems/rr-1.0.2/LICENSE +22 -0
  260. data/bundler/ruby/1.8/gems/rr-1.0.2/README.rdoc +385 -0
  261. data/bundler/ruby/1.8/gems/rr-1.0.2/Rakefile +88 -0
  262. data/bundler/ruby/1.8/gems/rr-1.0.2/VERSION.yml +5 -0
  263. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/adapters/rr_methods.rb +146 -0
  264. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/adapters/rspec.rb +61 -0
  265. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/adapters/test_unit.rb +31 -0
  266. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/blank_slate.rb +17 -0
  267. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/class_instance_method_defined.rb +9 -0
  268. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double.rb +154 -0
  269. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/child_double_definition_create.rb +27 -0
  270. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/double_definition.rb +367 -0
  271. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/double_definition_create.rb +139 -0
  272. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/double_definition_create_blank_slate.rb +26 -0
  273. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/double_injections/any_instance_of.rb +28 -0
  274. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/double_injections/instance.rb +16 -0
  275. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/double_injection/any_instance_of.rb +30 -0
  276. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/double_injection/double_injection_strategy.rb +10 -0
  277. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/double_injection/instance.rb +17 -0
  278. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/implementation/implementation_strategy.rb +10 -0
  279. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/implementation/proxy.rb +60 -0
  280. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/implementation/reimplementation.rb +14 -0
  281. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/implementation/strongly_typed_reimplementation.rb +15 -0
  282. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/strategy.rb +43 -0
  283. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/strategy_methods.rb +53 -0
  284. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/verification/dont_allow.rb +31 -0
  285. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/verification/mock.rb +42 -0
  286. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/verification/stub.rb +43 -0
  287. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_definitions/strategies/verification/verification_strategy.rb +10 -0
  288. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/double_matches.rb +42 -0
  289. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/errors/argument_equality_error.rb +6 -0
  290. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/errors/double_definition_error.rb +6 -0
  291. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/errors/double_not_found_error.rb +6 -0
  292. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/errors/double_order_error.rb +6 -0
  293. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/errors/rr_error.rb +20 -0
  294. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/errors/spy_verification_errors/double_injection_not_found_error.rb +8 -0
  295. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/errors/spy_verification_errors/invocation_count_error.rb +8 -0
  296. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/errors/spy_verification_errors/spy_verification_error.rb +8 -0
  297. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/errors/subject_does_not_implement_method_error.rb +6 -0
  298. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/errors/subject_has_different_arity_error.rb +6 -0
  299. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/errors/times_called_error.rb +6 -0
  300. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/expectations/any_argument_expectation.rb +21 -0
  301. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/expectations/argument_equality_expectation.rb +41 -0
  302. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/expectations/times_called_expectation.rb +57 -0
  303. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/hash_with_object_id_key.rb +46 -0
  304. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/injections/double_injection.rb +213 -0
  305. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/injections/injection.rb +33 -0
  306. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/injections/method_missing_injection.rb +68 -0
  307. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/injections/singleton_method_added_injection.rb +72 -0
  308. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/method_dispatches/base_method_dispatch.rb +84 -0
  309. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/method_dispatches/method_dispatch.rb +59 -0
  310. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/method_dispatches/method_missing_dispatch.rb +61 -0
  311. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/proc_from_block.rb +7 -0
  312. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/recorded_calls.rb +103 -0
  313. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/space.rb +112 -0
  314. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/spy_verification.rb +48 -0
  315. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/spy_verification_proxy.rb +13 -0
  316. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/times_called_matchers/any_times_matcher.rb +18 -0
  317. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/times_called_matchers/at_least_matcher.rb +15 -0
  318. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/times_called_matchers/at_most_matcher.rb +23 -0
  319. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/times_called_matchers/integer_matcher.rb +19 -0
  320. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/times_called_matchers/never_matcher.rb +23 -0
  321. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/times_called_matchers/non_terminal.rb +27 -0
  322. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/times_called_matchers/proc_matcher.rb +11 -0
  323. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/times_called_matchers/range_matcher.rb +21 -0
  324. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/times_called_matchers/terminal.rb +20 -0
  325. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/times_called_matchers/times_called_matcher.rb +44 -0
  326. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/anything.rb +18 -0
  327. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/boolean.rb +23 -0
  328. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/duck_type.rb +32 -0
  329. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/hash_including.rb +29 -0
  330. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/is_a.rb +25 -0
  331. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/numeric.rb +13 -0
  332. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/range.rb +7 -0
  333. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/regexp.rb +7 -0
  334. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/satisfy.rb +26 -0
  335. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers.rb +158 -0
  336. data/bundler/ruby/1.8/gems/rr-1.0.2/lib/rr.rb +99 -0
  337. data/bundler/ruby/1.8/gems/rr-1.0.2/scratch.rb +118 -0
  338. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/api/any_instance_of/all_instances_of_spec.rb +12 -0
  339. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/api/any_instance_of/any_instance_of_spec.rb +47 -0
  340. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/api/any_instance_of/instance_of_spec.rb +12 -0
  341. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/api/dont_allow/dont_allow_after_stub_spec.rb +14 -0
  342. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/api/mock/mock_spec.rb +193 -0
  343. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/api/proxy/proxy_spec.rb +86 -0
  344. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/api/spy/spy_spec.rb +49 -0
  345. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/api/strong/strong_spec.rb +87 -0
  346. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/api/stub/stub_spec.rb +152 -0
  347. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/core_spec_suite.rb +19 -0
  348. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/environment_fixture_setup.rb +8 -0
  349. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/proc_from_block_spec.rb +14 -0
  350. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/adapters/rr_methods_argument_matcher_spec.rb +67 -0
  351. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/adapters/rr_methods_creator_spec.rb +137 -0
  352. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/adapters/rr_methods_space_spec.rb +98 -0
  353. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/adapters/rr_methods_spec_helper.rb +11 -0
  354. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/adapters/rr_methods_times_matcher_spec.rb +13 -0
  355. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/double_definitions/child_double_definition_creator_spec.rb +112 -0
  356. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/double_definitions/double_definition_create_blank_slate_spec.rb +91 -0
  357. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/double_definitions/double_definition_create_spec.rb +443 -0
  358. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/double_injection/double_injection_spec.rb +546 -0
  359. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/double_injection/double_injection_verify_spec.rb +29 -0
  360. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/errors/rr_error_spec.rb +67 -0
  361. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/any_argument_expectation_spec.rb +47 -0
  362. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/anything_argument_equality_expectation_spec.rb +14 -0
  363. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/argument_equality_expectation_spec.rb +135 -0
  364. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/boolean_argument_equality_expectation_spec.rb +34 -0
  365. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/hash_including_argument_equality_expectation_spec.rb +82 -0
  366. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/hash_including_spec.rb +17 -0
  367. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/satisfy_argument_equality_expectation_spec.rb +59 -0
  368. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/satisfy_spec.rb +14 -0
  369. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_any_times_spec.rb +22 -0
  370. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb +37 -0
  371. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_at_most_spec.rb +43 -0
  372. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_helper.rb +15 -0
  373. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_integer_spec.rb +58 -0
  374. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_proc_spec.rb +35 -0
  375. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_range_spec.rb +39 -0
  376. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/rspec/invocation_matcher_spec.rb +279 -0
  377. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/rspec/rspec_adapter_spec.rb +63 -0
  378. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/rspec/rspec_backtrace_tweaking_spec.rb +31 -0
  379. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/rspec/rspec_backtrace_tweaking_spec_fixture.rb +11 -0
  380. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/rspec/rspec_usage_spec.rb +86 -0
  381. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/space/hash_with_object_id_key_spec.rb +88 -0
  382. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/space/space_spec.rb +587 -0
  383. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/test_unit/test_helper.rb +7 -0
  384. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/test_unit/test_unit_backtrace_test.rb +36 -0
  385. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/test_unit/test_unit_integration_test.rb +59 -0
  386. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/times_called_matchers/any_times_matcher_spec.rb +47 -0
  387. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/times_called_matchers/at_least_matcher_spec.rb +55 -0
  388. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/times_called_matchers/at_most_matcher_spec.rb +70 -0
  389. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/times_called_matchers/integer_matcher_spec.rb +70 -0
  390. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/times_called_matchers/proc_matcher_spec.rb +55 -0
  391. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/times_called_matchers/range_matcher_spec.rb +76 -0
  392. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/times_called_matchers/times_called_matcher_spec.rb +118 -0
  393. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/wildcard_matchers/anything_spec.rb +24 -0
  394. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/wildcard_matchers/boolean_spec.rb +36 -0
  395. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/wildcard_matchers/duck_type_spec.rb +52 -0
  396. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/wildcard_matchers/is_a_spec.rb +32 -0
  397. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/wildcard_matchers/numeric_spec.rb +32 -0
  398. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/wildcard_matchers/range_spec.rb +35 -0
  399. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/wildcard_matchers/regexp_spec.rb +43 -0
  400. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rr_spec.rb +28 -0
  401. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/rspec_spec_suite.rb +17 -0
  402. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/spec_helper.rb +37 -0
  403. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/spec_suite.rb +48 -0
  404. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/spy_verification_spec.rb +129 -0
  405. data/bundler/ruby/1.8/gems/rr-1.0.2/spec/test_unit_spec_suite.rb +21 -0
  406. data/bundler/ruby/1.8/gems/rspec-2.1.0/.document +2 -0
  407. data/bundler/ruby/1.8/gems/rspec-2.1.0/.gitignore +7 -0
  408. data/bundler/ruby/1.8/gems/rspec-2.1.0/Gemfile +7 -0
  409. data/bundler/ruby/1.8/gems/rspec-2.1.0/License.txt +22 -0
  410. data/bundler/ruby/1.8/gems/rspec-2.1.0/README.markdown +47 -0
  411. data/bundler/ruby/1.8/gems/rspec-2.1.0/Rakefile +16 -0
  412. data/bundler/ruby/1.8/gems/rspec-2.1.0/lib/rspec/version.rb +5 -0
  413. data/bundler/ruby/1.8/gems/rspec-2.1.0/lib/rspec.rb +4 -0
  414. data/bundler/ruby/1.8/gems/rspec-2.1.0/rspec.gemspec +29 -0
  415. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/.document +5 -0
  416. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/.gitignore +11 -0
  417. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/.treasure_map.rb +23 -0
  418. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/Gemfile +31 -0
  419. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/Guardfile +5 -0
  420. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/History.markdown +104 -0
  421. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/License.txt +22 -0
  422. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/README.markdown +95 -0
  423. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/Rakefile +71 -0
  424. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/Upgrade.markdown +289 -0
  425. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/autotest/discover.rb +2 -0
  426. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/bin/autospec +13 -0
  427. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/bin/rspec +25 -0
  428. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/cucumber.yml +2 -0
  429. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/README.markdown +19 -0
  430. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/command_line/configure.feature +20 -0
  431. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/command_line/example_name_option.feature +86 -0
  432. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/command_line/exit_status.feature +52 -0
  433. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/command_line/line_number_appended_to_path.feature +106 -0
  434. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/command_line/line_number_option.feature +45 -0
  435. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/command_line/rake_task.feature +68 -0
  436. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/command_line/tag.feature +74 -0
  437. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/configuration/custom_settings.feature +84 -0
  438. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/configuration/fail_fast.feature +77 -0
  439. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/configuration/read_options_from_file.feature +74 -0
  440. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/example_groups/basic_structure.feature +54 -0
  441. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/example_groups/shared_example_group.feature +177 -0
  442. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/filtering/exclusion_filters.feature +115 -0
  443. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/filtering/implicit_filters.feature +166 -0
  444. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/filtering/inclusion_filters.feature +83 -0
  445. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/filtering/run_all_when_everything_filtered.feature +46 -0
  446. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/formatters/custom_formatter.feature +32 -0
  447. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/hooks/around_hooks.feature +320 -0
  448. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/hooks/before_and_after_hooks.feature +432 -0
  449. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/metadata/described_class.feature +17 -0
  450. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/mock_framework_integration/use_flexmock.feature +23 -0
  451. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/mock_framework_integration/use_mocha.feature +23 -0
  452. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/mock_framework_integration/use_rr.feature +23 -0
  453. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/mock_framework_integration/use_rspec.feature +23 -0
  454. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/pending/pending_examples.feature +216 -0
  455. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/spec_files/arbitrary_file_suffix.feature +13 -0
  456. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/step_definitions/additional_cli_steps.rb +11 -0
  457. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/subject/attribute_of_subject.feature +52 -0
  458. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/subject/explicit_subject.feature +62 -0
  459. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/subject/implicit_receiver.feature +29 -0
  460. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/subject/implicit_subject.feature +30 -0
  461. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/features/support/env.rb +1 -0
  462. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/autotest/rspec2.rb +66 -0
  463. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/autorun.rb +2 -0
  464. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/backward_compatibility.rb +48 -0
  465. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/command_line.rb +35 -0
  466. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/command_line_configuration.rb +62 -0
  467. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/configuration.rb +401 -0
  468. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/configuration_options.rb +98 -0
  469. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/deprecation.rb +45 -0
  470. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/drb_command_line.rb +29 -0
  471. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/errors.rb +14 -0
  472. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/example.rb +139 -0
  473. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/example_group.rb +311 -0
  474. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/expecting/with_rspec.rb +11 -0
  475. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/extensions/instance_eval_with_args.rb +39 -0
  476. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/extensions/kernel.rb +5 -0
  477. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/extensions/module_eval_with_args.rb +34 -0
  478. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/extensions/object.rb +14 -0
  479. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/extensions.rb +4 -0
  480. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/formatters/base_formatter.rb +162 -0
  481. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/formatters/base_text_formatter.rb +151 -0
  482. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/formatters/documentation_formatter.rb +71 -0
  483. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/formatters/helpers.rb +28 -0
  484. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/formatters/html_formatter.rb +351 -0
  485. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/formatters/progress_formatter.rb +32 -0
  486. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/formatters/snippet_extractor.rb +52 -0
  487. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/formatters/text_mate_formatter.rb +20 -0
  488. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/hooks.rb +134 -0
  489. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/let.rb +101 -0
  490. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/load_path.rb +3 -0
  491. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/metadata.rb +175 -0
  492. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/mocking/with_absolutely_nothing.rb +11 -0
  493. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/mocking/with_flexmock.rb +25 -0
  494. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/mocking/with_mocha.rb +21 -0
  495. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/mocking/with_rr.rb +25 -0
  496. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/mocking/with_rspec.rb +21 -0
  497. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/option_parser.rb +122 -0
  498. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/pending.rb +28 -0
  499. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/rake_task.rb +196 -0
  500. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/reporter.rb +79 -0
  501. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/ruby_project.rb +44 -0
  502. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/runner.rb +61 -0
  503. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/shared_example_group.rb +52 -0
  504. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/subject.rb +170 -0
  505. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/version.rb +7 -0
  506. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core/world.rb +102 -0
  507. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/core.rb +62 -0
  508. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/monkey/spork/test_framework/rspec.rb +7 -0
  509. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/lib/rspec/monkey.rb +1 -0
  510. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/rspec-core.gemspec +38 -0
  511. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/script/console +8 -0
  512. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/autotest/failed_results_re_spec.rb +20 -0
  513. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/autotest/rspec_spec.rb +123 -0
  514. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/command_line_configuration_spec.rb +26 -0
  515. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/command_line_spec.rb +134 -0
  516. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/command_line_spec_output.txt +0 -0
  517. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/configuration_options_spec.rb +311 -0
  518. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/configuration_spec.rb +662 -0
  519. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/deprecations_spec.rb +45 -0
  520. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/drb_command_line_spec.rb +159 -0
  521. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/example_group_spec.rb +787 -0
  522. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/example_spec.rb +160 -0
  523. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/base_formatter_spec.rb +36 -0
  524. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/base_text_formatter_spec.rb +160 -0
  525. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/documentation_formatter_spec.rb +66 -0
  526. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/helpers_spec.rb +46 -0
  527. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/html_formatted-1.8.6.html +296 -0
  528. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +285 -0
  529. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/html_formatted-1.8.7.html +296 -0
  530. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/html_formatted-1.9.1.html +303 -0
  531. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/html_formatted-1.9.2.html +303 -0
  532. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/html_formatter_spec.rb +81 -0
  533. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/progress_formatter_spec.rb +31 -0
  534. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/snippet_extractor_spec.rb +18 -0
  535. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/text_mate_formatted-1.8.6.html +296 -0
  536. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +280 -0
  537. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +296 -0
  538. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/text_mate_formatted-1.9.1.html +303 -0
  539. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +303 -0
  540. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/formatters/text_mate_formatter_spec.rb +84 -0
  541. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/hooks_filtering_spec.rb +124 -0
  542. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/hooks_spec.rb +57 -0
  543. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/kernel_extensions_spec.rb +9 -0
  544. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/let_spec.rb +42 -0
  545. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/metadata_spec.rb +285 -0
  546. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/option_parser_spec.rb +39 -0
  547. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/pending_example_spec.rb +226 -0
  548. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/rake_task_spec.rb +141 -0
  549. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/reporter_spec.rb +70 -0
  550. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/resources/a_bar.rb +0 -0
  551. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/resources/a_foo.rb +0 -0
  552. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/resources/a_spec.rb +1 -0
  553. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/resources/custom_example_group_runner.rb +14 -0
  554. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/resources/formatter_specs.rb +54 -0
  555. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/resources/utf8_encoded.rb +8 -0
  556. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/ruby_project_spec.rb +24 -0
  557. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/runner_spec.rb +47 -0
  558. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/shared_example_group_spec.rb +152 -0
  559. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/subject_spec.rb +78 -0
  560. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/world_spec.rb +174 -0
  561. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core_spec.rb +31 -0
  562. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/ruby_forker.rb +13 -0
  563. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/spec_helper.rb +70 -0
  564. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/support/matchers.rb +44 -0
  565. data/bundler/ruby/1.8/gems/rspec-core-2.1.0/specs.watchr +58 -0
  566. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/.document +5 -0
  567. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/.gitignore +10 -0
  568. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/Gemfile +21 -0
  569. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/History.markdown +54 -0
  570. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/License.txt +22 -0
  571. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/README.markdown +33 -0
  572. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/Rakefile +70 -0
  573. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/Upgrade.markdown +53 -0
  574. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/cucumber.yml +3 -0
  575. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/README.markdown +18 -0
  576. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/expectations/attribute_of_subject.feature +19 -0
  577. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/expectations/customized_message.feature +54 -0
  578. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/expectations/diffing.feature +85 -0
  579. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/expectations/implicit_docstrings.feature +52 -0
  580. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/access_running_example.feature +53 -0
  581. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/be_within.feature +43 -0
  582. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/define_diffable_matcher.feature +27 -0
  583. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/define_matcher.feature +311 -0
  584. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/define_matcher_outside_rspec.feature +38 -0
  585. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/define_matcher_with_fluent_interface.feature +24 -0
  586. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/equality.feature +142 -0
  587. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/exist.feature +44 -0
  588. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/expect_change.feature +65 -0
  589. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/expect_error.feature +44 -0
  590. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/have.feature +103 -0
  591. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/include.feature +136 -0
  592. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/operators.feature +280 -0
  593. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/predicates.feature +128 -0
  594. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/respond_to.feature +78 -0
  595. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/satisfy.feature +31 -0
  596. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/throw_symbol.feature +85 -0
  597. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/types.feature +114 -0
  598. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/step_definitions/additional_cli_steps.rb +13 -0
  599. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/support/env.rb +1 -0
  600. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/test_frameworks/test_unit.feature +46 -0
  601. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/backward_compatibility.rb +16 -0
  602. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/deprecation.rb +36 -0
  603. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/differ.rb +62 -0
  604. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/errors.rb +12 -0
  605. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/extensions/array.rb +7 -0
  606. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/extensions/kernel.rb +52 -0
  607. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/extensions.rb +2 -0
  608. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/fail_with.rb +51 -0
  609. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/handler.rb +50 -0
  610. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations/version.rb +7 -0
  611. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/expectations.rb +39 -0
  612. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/be.rb +222 -0
  613. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/be_close.rb +17 -0
  614. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/be_instance_of.rb +26 -0
  615. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/be_kind_of.rb +26 -0
  616. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/be_within.rb +40 -0
  617. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/block_aliases.rb +18 -0
  618. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/change.rb +184 -0
  619. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/compatibility.rb +14 -0
  620. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/dsl.rb +21 -0
  621. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/eq.rb +50 -0
  622. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/eql.rb +45 -0
  623. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/equal.rb +53 -0
  624. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/errors.rb +5 -0
  625. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/exist.rb +16 -0
  626. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/extensions/instance_exec.rb +31 -0
  627. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/generated_descriptions.rb +36 -0
  628. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/has.rb +35 -0
  629. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/have.rb +151 -0
  630. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/include.rb +51 -0
  631. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/match.rb +21 -0
  632. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/match_array.rb +71 -0
  633. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/matcher.rb +161 -0
  634. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/method_missing.rb +9 -0
  635. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/operator_matcher.rb +87 -0
  636. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/pretty.rb +37 -0
  637. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/raise_error.rb +130 -0
  638. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/respond_to.rb +85 -0
  639. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/satisfy.rb +51 -0
  640. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/throw_symbol.rb +121 -0
  641. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers.rb +196 -0
  642. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec-expectations.rb +1 -0
  643. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/rspec-expectations.gemspec +27 -0
  644. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/expectations/differ_spec.rb +96 -0
  645. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/expectations/extensions/kernel_spec.rb +45 -0
  646. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/expectations/fail_with_spec.rb +70 -0
  647. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/expectations/handler_spec.rb +206 -0
  648. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/be_close_spec.rb +22 -0
  649. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/be_instance_of_spec.rb +36 -0
  650. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/be_kind_of_spec.rb +33 -0
  651. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/be_spec.rb +456 -0
  652. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/be_within_spec.rb +64 -0
  653. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/change_spec.rb +409 -0
  654. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/compatibility_spec.rb +28 -0
  655. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/description_generation_spec.rb +160 -0
  656. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/dsl_spec.rb +25 -0
  657. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/eq_spec.rb +38 -0
  658. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/eql_spec.rb +37 -0
  659. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/equal_spec.rb +57 -0
  660. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/exist_spec.rb +65 -0
  661. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/has_spec.rb +81 -0
  662. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/have_spec.rb +411 -0
  663. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/include_spec.rb +341 -0
  664. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/match_array_spec.rb +111 -0
  665. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/match_spec.rb +57 -0
  666. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/matcher_spec.rb +374 -0
  667. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/matchers_spec.rb +51 -0
  668. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/operator_matcher_spec.rb +215 -0
  669. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/raise_error_spec.rb +339 -0
  670. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/respond_to_spec.rb +292 -0
  671. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/satisfy_spec.rb +40 -0
  672. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/throw_symbol_spec.rb +113 -0
  673. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/spec_helper.rb +66 -0
  674. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/suite.rb +1 -0
  675. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/support/classes.rb +45 -0
  676. data/bundler/ruby/1.8/gems/rspec-expectations-2.1.0/specs.watchr +57 -0
  677. data/bundler/ruby/1.8/gems/rspec-instafail-0.1.4/Rakefile +20 -0
  678. data/bundler/ruby/1.8/gems/rspec-instafail-0.1.4/Readme.md +48 -0
  679. data/bundler/ruby/1.8/gems/rspec-instafail-0.1.4/VERSION +1 -0
  680. data/bundler/ruby/1.8/gems/rspec-instafail-0.1.4/lib/rspec/instafail/rspec_1.rb +27 -0
  681. data/bundler/ruby/1.8/gems/rspec-instafail-0.1.4/lib/rspec/instafail/rspec_2.rb +21 -0
  682. data/bundler/ruby/1.8/gems/rspec-instafail-0.1.4/lib/rspec/instafail.rb +9 -0
  683. data/bundler/ruby/1.8/gems/rspec-instafail-0.1.4/rspec-instafail.gemspec +51 -0
  684. data/bundler/ruby/1.8/gems/rspec-instafail-0.1.4/spec/instafail_spec.rb +77 -0
  685. data/bundler/ruby/1.8/gems/rspec-instafail-0.1.4/spec/rspec_1/Gemfile +2 -0
  686. data/bundler/ruby/1.8/gems/rspec-instafail-0.1.4/spec/rspec_1/Gemfile.lock +10 -0
  687. data/bundler/ruby/1.8/gems/rspec-instafail-0.1.4/spec/rspec_1/a_test.rb +21 -0
  688. data/bundler/ruby/1.8/gems/rspec-instafail-0.1.4/spec/rspec_2/Gemfile +2 -0
  689. data/bundler/ruby/1.8/gems/rspec-instafail-0.1.4/spec/rspec_2/Gemfile.lock +20 -0
  690. data/bundler/ruby/1.8/gems/rspec-instafail-0.1.4/spec/rspec_2/a_test.rb +21 -0
  691. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/.autotest +7 -0
  692. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/.document +5 -0
  693. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/.gitignore +10 -0
  694. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/Gemfile +18 -0
  695. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/History.markdown +33 -0
  696. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/License.txt +22 -0
  697. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/README.markdown +49 -0
  698. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/Rakefile +70 -0
  699. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/autotest/discover.rb +1 -0
  700. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/cucumber.yml +2 -0
  701. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/features/README.markdown +30 -0
  702. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/features/message_expectations/block_local_expectations.feature.pending +55 -0
  703. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/features/message_expectations/expect_message.feature +94 -0
  704. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/features/message_expectations/warn_when_expectation_is_set_on_nil.feature +50 -0
  705. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/features/outside_rspec/configuration.feature +82 -0
  706. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/features/stubs/simple_return_value.feature +55 -0
  707. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/features/stubs/stub_chain.feature +44 -0
  708. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/features/stubs/stub_implementation.feature +26 -0
  709. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/features/support/env.rb +2 -0
  710. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/argument_expectation.rb +48 -0
  711. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/argument_matchers.rb +233 -0
  712. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/error_generator.rb +97 -0
  713. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/errors.rb +10 -0
  714. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/extensions/instance_exec.rb +31 -0
  715. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/extensions/marshal.rb +25 -0
  716. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/extensions/object.rb +3 -0
  717. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/framework.rb +17 -0
  718. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/message_expectation.rb +341 -0
  719. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/method_double.rb +165 -0
  720. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/methods.rb +100 -0
  721. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/mock.rb +79 -0
  722. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/order_group.rb +29 -0
  723. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/proxy.rb +157 -0
  724. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/serialization.rb +26 -0
  725. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/space.rb +28 -0
  726. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/spec_methods.rb +53 -0
  727. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks/version.rb +7 -0
  728. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/rspec/mocks.rb +196 -0
  729. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/lib/spec/mocks.rb +2 -0
  730. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/rspec-mocks.gemspec +25 -0
  731. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/and_yield_spec.rb +114 -0
  732. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/any_number_of_times_spec.rb +36 -0
  733. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/argument_expectation_spec.rb +23 -0
  734. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/at_least_spec.rb +97 -0
  735. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/at_most_spec.rb +93 -0
  736. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/block_return_value_spec.rb +45 -0
  737. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/bug_report_10260_spec.rb +8 -0
  738. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/bug_report_10263_spec.rb +27 -0
  739. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/bug_report_11545_spec.rb +32 -0
  740. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/bug_report_496_spec.rb +17 -0
  741. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/bug_report_600_spec.rb +22 -0
  742. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/bug_report_7611_spec.rb +18 -0
  743. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/bug_report_7805_spec.rb +22 -0
  744. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/bug_report_8165_spec.rb +31 -0
  745. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/bug_report_8302_spec.rb +26 -0
  746. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/bug_report_830_spec.rb +21 -0
  747. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/bug_report_957_spec.rb +22 -0
  748. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/double_spec.rb +12 -0
  749. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/failing_argument_matchers_spec.rb +96 -0
  750. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/hash_including_matcher_spec.rb +90 -0
  751. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/hash_not_including_matcher_spec.rb +67 -0
  752. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/mock_ordering_spec.rb +94 -0
  753. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/mock_space_spec.rb +54 -0
  754. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/mock_spec.rb +661 -0
  755. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/multiple_return_value_spec.rb +133 -0
  756. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/nil_expectation_warning_spec.rb +63 -0
  757. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/null_object_mock_spec.rb +73 -0
  758. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/once_counts_spec.rb +53 -0
  759. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/options_hash_spec.rb +35 -0
  760. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/partial_mock_spec.rb +155 -0
  761. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/partial_mock_using_mocks_directly_spec.rb +94 -0
  762. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/passing_argument_matchers_spec.rb +145 -0
  763. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/precise_counts_spec.rb +52 -0
  764. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/record_messages_spec.rb +26 -0
  765. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/serialization_spec.rb +67 -0
  766. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/stash_spec.rb +27 -0
  767. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/stub_chain_spec.rb +114 -0
  768. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/stub_implementation_spec.rb +68 -0
  769. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/stub_spec.rb +232 -0
  770. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb +26 -0
  771. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks/twice_counts_spec.rb +67 -0
  772. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/rspec/mocks_spec.rb +51 -0
  773. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/spec/spec_helper.rb +52 -0
  774. data/bundler/ruby/1.8/gems/rspec-mocks-2.1.0/specs.watchr +57 -0
  775. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/.require_paths +2 -0
  776. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/AUTHORS +7 -0
  777. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/CHANGES +349 -0
  778. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/ChangeLog +5926 -0
  779. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/LICENSE +23 -0
  780. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/README +114 -0
  781. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/Rakefile +311 -0
  782. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/VERSION +3 -0
  783. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/bin/rdebug +416 -0
  784. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/command.rb +267 -0
  785. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/breakpoints.rb +155 -0
  786. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/catchpoint.rb +55 -0
  787. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/condition.rb +49 -0
  788. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/continue.rb +38 -0
  789. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/control.rb +107 -0
  790. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/disassemble.RB +38 -0
  791. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/display.rb +120 -0
  792. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/edit.rb +48 -0
  793. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/enable.rb +202 -0
  794. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/eval.rb +179 -0
  795. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/finish.rb +42 -0
  796. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/frame.rb +302 -0
  797. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/help.rb +61 -0
  798. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/info.rb +472 -0
  799. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/irb.rb +193 -0
  800. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/kill.rb +50 -0
  801. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/list.rb +94 -0
  802. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/method.rb +84 -0
  803. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/quit.rb +44 -0
  804. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/raise.RB +41 -0
  805. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/reload.rb +40 -0
  806. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/save.rb +90 -0
  807. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/set.rb +237 -0
  808. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/show.rb +251 -0
  809. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/source.RB +44 -0
  810. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/stepping.rb +81 -0
  811. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/threads.rb +189 -0
  812. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/tmate.rb +36 -0
  813. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/trace.rb +57 -0
  814. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/variables.rb +199 -0
  815. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/debugger.rb +5 -0
  816. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/helper.rb +74 -0
  817. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/interface.rb +260 -0
  818. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/processor.rb +556 -0
  819. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug.rb +179 -0
  820. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/doc/rdebug.1 +241 -0
  821. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/rdbg.rb +33 -0
  822. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/runner.sh +7 -0
  823. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/base/base.rb +74 -0
  824. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/base/binding.rb +31 -0
  825. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/base/catchpoint.rb +26 -0
  826. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/base/load.rb +40 -0
  827. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/base/reload_bug.rb +8 -0
  828. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/bp_loop_issue.rb +3 -0
  829. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/brkpt-class-bug.rb +8 -0
  830. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/classes.rb +11 -0
  831. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/cli/commands/catchpoint_test.rb +36 -0
  832. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/cli/commands/unit/regexp.rb +42 -0
  833. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/config.yaml +8 -0
  834. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/annotate.cmd +29 -0
  835. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/annotate.right +139 -0
  836. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/break_bad.cmd +18 -0
  837. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/break_bad.right +28 -0
  838. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/break_loop_bug.cmd +5 -0
  839. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/break_loop_bug.right +15 -0
  840. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/breakpoints.cmd +38 -0
  841. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/breakpoints.right +98 -0
  842. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/brkpt-class-bug.cmd +9 -0
  843. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/brkpt-class-bug.right +18 -0
  844. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/catch.cmd +17 -0
  845. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/catch.right +39 -0
  846. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/condition.cmd +29 -0
  847. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/condition.right +67 -0
  848. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/ctrl.cmd +23 -0
  849. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/ctrl.right +69 -0
  850. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/display.cmd +24 -0
  851. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/display.right +44 -0
  852. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/dollar-0.right +2 -0
  853. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/dollar-0a.right +2 -0
  854. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/dollar-0b.right +2 -0
  855. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/edit.cmd +12 -0
  856. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/edit.right +19 -0
  857. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/emacs_basic.cmd +43 -0
  858. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/emacs_basic.right +106 -0
  859. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/enable.cmd +20 -0
  860. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/enable.right +36 -0
  861. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/except-bug1.cmd +7 -0
  862. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/except-bug1.right +13 -0
  863. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/file-with-space.cmd +7 -0
  864. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/file-with-space.right +9 -0
  865. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/finish.cmd +16 -0
  866. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/finish.right +31 -0
  867. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/frame.cmd +32 -0
  868. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/frame.right +66 -0
  869. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/help.cmd +20 -0
  870. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/help.right +21 -0
  871. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/history.right +7 -0
  872. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/info-thread.cmd +13 -0
  873. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/info-thread.right +37 -0
  874. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/info-var-bug2.cmd +5 -0
  875. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/info-var-bug2.right +10 -0
  876. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/info-var.cmd +23 -0
  877. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/info-var.right +52 -0
  878. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/info.cmd +22 -0
  879. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/info.right +84 -0
  880. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/linetrace.cmd +6 -0
  881. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/linetrace.right +32 -0
  882. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/linetracep.cmd +7 -0
  883. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/linetracep.right +25 -0
  884. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/list.cmd +19 -0
  885. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/list.right +127 -0
  886. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/method.cmd +10 -0
  887. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/method.right +21 -0
  888. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/methodsig.cmd +10 -0
  889. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/methodsig.right +20 -0
  890. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/noquit.right +1 -0
  891. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/output.cmd +6 -0
  892. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/output.right +31 -0
  893. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/pm-bug.cmd +7 -0
  894. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/pm-bug.right +12 -0
  895. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/post-mortem-next.cmd +8 -0
  896. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/post-mortem-next.right +14 -0
  897. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/post-mortem-osx.right +31 -0
  898. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/post-mortem.cmd +13 -0
  899. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/post-mortem.right +32 -0
  900. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/quit.cmd +6 -0
  901. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/quit.right +0 -0
  902. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/raise.cmd +11 -0
  903. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/raise.right +26 -0
  904. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/save.cmd +33 -0
  905. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/save.right +59 -0
  906. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/setshow.cmd +46 -0
  907. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/setshow.right +80 -0
  908. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/source.cmd +5 -0
  909. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/source.right +15 -0
  910. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/stepping.cmd +21 -0
  911. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/stepping.right +50 -0
  912. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/test-init-cygwin.right +7 -0
  913. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/test-init-osx.right +4 -0
  914. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/test-init.right +5 -0
  915. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/data/trace.right +23 -0
  916. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/dollar-0.rb +5 -0
  917. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/except-bug1.rb +4 -0
  918. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/except-bug2.rb +7 -0
  919. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/file with space.rb +1 -0
  920. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/gcd-dbg-nox.rb +31 -0
  921. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/gcd-dbg.rb +30 -0
  922. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/gcd.rb +18 -0
  923. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/helper.rb +149 -0
  924. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/info-var-bug.rb +47 -0
  925. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/info-var-bug2.rb +2 -0
  926. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/null.rb +1 -0
  927. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/output.rb +2 -0
  928. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/pm-base.rb +22 -0
  929. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/pm-bug.rb +3 -0
  930. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/pm.rb +11 -0
  931. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/raise.rb +3 -0
  932. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/rdebug-save.1 +7 -0
  933. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/scope-test.rb +8 -0
  934. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/tdebug.rb +252 -0
  935. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-annotate.rb +25 -0
  936. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-break-bad.rb +36 -0
  937. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-breakpoints.rb +25 -0
  938. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-brkpt-class-bug.rb +26 -0
  939. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-catch.rb +25 -0
  940. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-condition.rb +25 -0
  941. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-ctrl.rb +55 -0
  942. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-display.rb +26 -0
  943. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-dollar-0.rb +45 -0
  944. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-edit.rb +26 -0
  945. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-emacs-basic.rb +26 -0
  946. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-enable.rb +25 -0
  947. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-except-bug1.rb +31 -0
  948. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-file-with-space.rb +30 -0
  949. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-finish.rb +34 -0
  950. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-frame.rb +34 -0
  951. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-help.rb +60 -0
  952. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-hist.rb +68 -0
  953. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-info-thread.rb +32 -0
  954. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-info-var.rb +47 -0
  955. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-info.rb +26 -0
  956. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-init.rb +49 -0
  957. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-list.rb +25 -0
  958. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-method.rb +34 -0
  959. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-output.rb +26 -0
  960. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-pm.rb +59 -0
  961. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-quit.rb +30 -0
  962. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-raise.rb +25 -0
  963. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-save.rb +31 -0
  964. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-setshow.rb +25 -0
  965. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-source.rb +25 -0
  966. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-stepping.rb +26 -0
  967. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/test-trace.rb +63 -0
  968. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/thread1.rb +26 -0
  969. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/trunc-call.rb +31 -0
  970. data/bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/tvar.rb +3 -0
  971. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/AUTHORS +7 -0
  972. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/CHANGES +349 -0
  973. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/LICENSE +23 -0
  974. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/README +114 -0
  975. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/Rakefile +311 -0
  976. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/VERSION +3 -0
  977. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/ext/Makefile +157 -0
  978. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/ext/breakpoint.c +582 -0
  979. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/ext/breakpoint.o +0 -0
  980. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/ext/extconf.rb +20 -0
  981. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/ext/ruby_debug.bundle +0 -0
  982. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/ext/ruby_debug.c +2326 -0
  983. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/ext/ruby_debug.h +123 -0
  984. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/ext/ruby_debug.o +0 -0
  985. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/ext/win32/Makefile +157 -0
  986. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/ext/win32/breakpoint.o +0 -0
  987. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/ext/win32/ruby_debug.o +0 -0
  988. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/ext/win32/ruby_debug.so +0 -0
  989. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/lib/ChangeLog +1162 -0
  990. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/lib/ruby-debug-base.rb +301 -0
  991. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/lib/ruby_debug.bundle +0 -0
  992. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/test/base/base.rb +74 -0
  993. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/test/base/binding.rb +31 -0
  994. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/test/base/catchpoint.rb +26 -0
  995. data/bundler/ruby/1.8/gems/ruby-debug-base-0.10.4/test/base/reload_bug.rb +8 -0
  996. data/bundler/ruby/1.8/gems/ruby-progressbar-0.0.9/GPL_LICENSE +340 -0
  997. data/bundler/ruby/1.8/gems/ruby-progressbar-0.0.9/README.md +91 -0
  998. data/bundler/ruby/1.8/gems/ruby-progressbar-0.0.9/RUBY_LICENSE +53 -0
  999. data/bundler/ruby/1.8/gems/ruby-progressbar-0.0.9/lib/progressbar.rb +237 -0
  1000. data/bundler/ruby/1.8/gems/ruby-progressbar-0.0.9/test.rb +116 -0
  1001. data/bundler/ruby/1.8/specifications/RubyInline-3.8.6.gemspec +52 -0
  1002. data/bundler/ruby/1.8/specifications/ZenTest-4.4.0.gemspec +59 -0
  1003. data/bundler/ruby/1.8/specifications/columnize-0.3.2.gemspec +48 -0
  1004. data/bundler/ruby/1.8/specifications/curb-0.7.8.gemspec +32 -0
  1005. data/bundler/ruby/1.8/specifications/curl-multi-0.2.gemspec +39 -0
  1006. data/bundler/ruby/1.8/specifications/diff-lcs-1.1.2.gemspec +34 -0
  1007. data/bundler/ruby/1.8/specifications/fakefs-0.2.1.gemspec +30 -0
  1008. data/bundler/ruby/1.8/specifications/fuubar-0.0.2.gemspec +38 -0
  1009. data/bundler/ruby/1.8/specifications/linecache-0.43.gemspec +33 -0
  1010. data/bundler/ruby/1.8/specifications/rr-1.0.2.gemspec +31 -0
  1011. data/bundler/ruby/1.8/specifications/rspec-2.1.0.gemspec +39 -0
  1012. data/bundler/ruby/1.8/specifications/rspec-core-2.1.0.gemspec +44 -0
  1013. data/bundler/ruby/1.8/specifications/rspec-expectations-2.1.0.gemspec +34 -0
  1014. data/bundler/ruby/1.8/specifications/rspec-instafail-0.1.4.gemspec +28 -0
  1015. data/bundler/ruby/1.8/specifications/rspec-mocks-2.1.0.gemspec +31 -0
  1016. data/bundler/ruby/1.8/specifications/ruby-debug-0.10.4.gemspec +39 -0
  1017. data/bundler/ruby/1.8/specifications/ruby-debug-base-0.10.4.gemspec +39 -0
  1018. data/bundler/ruby/1.8/specifications/ruby-progressbar-0.0.9.gemspec +27 -0
  1019. data/lib/vim-jar/cli.rb +94 -0
  1020. data/lib/vim-jar/config.rb +59 -0
  1021. data/lib/vim-jar/importer/github.rb +18 -0
  1022. data/lib/vim-jar/importer.rb +51 -0
  1023. data/lib/vim-jar/installer/base.rb +9 -0
  1024. data/lib/vim-jar/installer/git.rb +19 -0
  1025. data/lib/vim-jar/installer.rb +7 -0
  1026. data/lib/vim-jar/plugin/git.rb +32 -0
  1027. data/lib/vim-jar/plugin.rb +65 -0
  1028. data/lib/vim-jar/plugins.yml +2673 -0
  1029. data/lib/vim-jar/version.rb +5 -0
  1030. data/lib/vim-jar.rb +24 -0
  1031. data/script/github_crawler.rb +76 -0
  1032. data/spec/spec_helper.rb +21 -0
  1033. data/spec/vim-jar/config_spec.rb +70 -0
  1034. data/spec/vim-jar/importer/github_spec.rb +12 -0
  1035. data/spec/vim-jar/importer/pages/vim-rails-github.html +975 -0
  1036. data/spec/vim-jar/importer_spec.rb +58 -0
  1037. data/spec/vim-jar/plugin_spec.rb +39 -0
  1038. data/spec/vim-jar/plugin_ymls/blank.yml +6 -0
  1039. data/spec/vim-jar/plugin_ymls/rails-vim.yml +7 -0
  1040. data/spec/vim-jar_test.rb +17 -0
  1041. data/vim-jar.gemspec +28 -0
  1042. metadata +1185 -0
@@ -0,0 +1,3379 @@
1
+ /* curb_easy.c - Curl easy mode
2
+ * Copyright (c)2006 Ross Bamford.
3
+ * Licensed under the Ruby License. See LICENSE for details.
4
+ *
5
+ * $Id: curb_easy.c 30 2006-12-09 12:30:24Z roscopeco $
6
+ */
7
+ #include "curb_easy.h"
8
+ #include "curb_errors.h"
9
+ #include "curb_postfield.h"
10
+ #include "curb_upload.h"
11
+ #include "curb_multi.h"
12
+
13
+ #include <errno.h>
14
+ #include <string.h>
15
+
16
+ extern VALUE mCurl;
17
+
18
+ static VALUE idCall;
19
+ static VALUE idJoin;
20
+ static VALUE rbstrAmp;
21
+
22
+ #ifdef RDOC_NEVER_DEFINED
23
+ mCurl = rb_define_module("Curl");
24
+ #endif
25
+
26
+ VALUE cCurlEasy;
27
+
28
+
29
+ /* ================== CURL HANDLER FUNCS ==============*/
30
+
31
+ /* These handle both body and header data */
32
+ static size_t default_data_handler(char *stream,
33
+ size_t size,
34
+ size_t nmemb,
35
+ VALUE out) {
36
+ rb_str_buf_cat(out, stream, size * nmemb);
37
+ return size * nmemb;
38
+ }
39
+
40
+ // size_t function( void *ptr, size_t size, size_t nmemb, void *stream);
41
+ static size_t read_data_handler(void *ptr,
42
+ size_t size,
43
+ size_t nmemb,
44
+ ruby_curl_easy *rbce) {
45
+ VALUE upload = rb_easy_get("upload");
46
+ size_t read_bytes = (size*nmemb);
47
+ VALUE stream = ruby_curl_upload_stream_get(upload);
48
+
49
+ if (rb_respond_to(stream, rb_intern("read"))) {//if (rb_respond_to(stream, rb_intern("to_s"))) {
50
+ /* copy read_bytes from stream into ptr */
51
+ VALUE str = rb_funcall(stream, rb_intern("read"), 1, rb_int_new(read_bytes) );
52
+ if( str != Qnil ) {
53
+ memcpy(ptr, RSTRING_PTR(str), RSTRING_LEN(str));
54
+ return RSTRING_LEN(str);
55
+ }
56
+ else {
57
+ return 0;
58
+ }
59
+ }
60
+ else if (rb_respond_to(stream, rb_intern("to_s"))) {
61
+ ruby_curl_upload *rbcu;
62
+ VALUE str;
63
+ size_t len;
64
+ size_t remaining;
65
+ char *str_ptr;
66
+ Data_Get_Struct(upload, ruby_curl_upload, rbcu);
67
+ str = rb_funcall(stream, rb_intern("to_s"), 0);
68
+ len = RSTRING_LEN(str);
69
+ remaining = len - rbcu->offset;
70
+ str_ptr = RSTRING_PTR(str);
71
+
72
+ if( remaining < read_bytes ) {
73
+ if( remaining > 0 ) {
74
+ memcpy(ptr, str_ptr+rbcu->offset, remaining);
75
+ read_bytes = remaining;
76
+ rbcu->offset += remaining;
77
+ }
78
+ return remaining;
79
+ }
80
+ else if( remaining > read_bytes ) { // read_bytes <= remaining - send what we can fit in the buffer(ptr)
81
+ memcpy(ptr, str_ptr+rbcu->offset, read_bytes);
82
+ rbcu->offset += read_bytes;
83
+ }
84
+ else { // they're equal
85
+ memcpy(ptr, str_ptr+rbcu->offset, --read_bytes);
86
+ rbcu->offset += read_bytes;
87
+ }
88
+ return read_bytes;
89
+ }
90
+ else {
91
+ return 0;
92
+ }
93
+ }
94
+
95
+ static size_t proc_data_handler(char *stream,
96
+ size_t size,
97
+ size_t nmemb,
98
+ VALUE proc) {
99
+ VALUE procret;
100
+
101
+ procret = rb_funcall(proc, idCall, 1, rb_str_new(stream, size * nmemb));
102
+
103
+ switch (rb_type(procret)) {
104
+ case T_FIXNUM:
105
+ return FIX2LONG(procret);
106
+ case T_BIGNUM:
107
+ return NUM2LONG(procret);
108
+ default:
109
+ rb_warn("Curl data handlers should return the number of bytes read as an Integer");
110
+ return size * nmemb;
111
+ }
112
+ }
113
+
114
+ static int proc_progress_handler(VALUE proc,
115
+ double dltotal,
116
+ double dlnow,
117
+ double ultotal,
118
+ double ulnow) {
119
+ VALUE procret;
120
+
121
+ procret = rb_funcall(proc, idCall, 4, rb_float_new(dltotal),
122
+ rb_float_new(dlnow),
123
+ rb_float_new(ultotal),
124
+ rb_float_new(ulnow));
125
+
126
+ return(((procret == Qfalse) || (procret == Qnil)) ? -1 : 0);
127
+ }
128
+
129
+ static int proc_debug_handler(CURL *curl,
130
+ curl_infotype type,
131
+ char *data,
132
+ size_t data_len,
133
+ VALUE proc) {
134
+ rb_funcall(proc, idCall, 2, INT2FIX(type), rb_str_new(data, data_len));
135
+ return 0;
136
+ }
137
+
138
+ /* ================== MARK/FREE FUNC ==================*/
139
+ void curl_easy_mark(ruby_curl_easy *rbce) {
140
+ rb_gc_mark(rbce->opts);
141
+ if (!NIL_P(rbce->multi)) { rb_gc_mark(rbce->multi); }
142
+ }
143
+
144
+ static void ruby_curl_easy_free(ruby_curl_easy *rbce) {
145
+ if (rbce->curl_headers) {
146
+ curl_slist_free_all(rbce->curl_headers);
147
+ }
148
+
149
+ if (rbce->curl_ftp_commands) {
150
+ curl_slist_free_all(rbce->curl_ftp_commands);
151
+ }
152
+
153
+ if (rbce->curl) {
154
+ curl_easy_cleanup(rbce->curl);
155
+ }
156
+ }
157
+
158
+ void curl_easy_free(ruby_curl_easy *rbce) {
159
+ ruby_curl_easy_free(rbce);
160
+ free(rbce);
161
+ }
162
+
163
+
164
+ /* ================= ALLOC METHODS ====================*/
165
+
166
+ static void ruby_curl_easy_zero(ruby_curl_easy *rbce) {
167
+ rbce->opts = rb_hash_new();
168
+
169
+ rbce->curl_headers = NULL;
170
+ rbce->curl_ftp_commands = NULL;
171
+
172
+ /* various-typed opts */
173
+ rbce->local_port = 0;
174
+ rbce->local_port_range = 0;
175
+ rbce->proxy_port = 0;
176
+ rbce->proxy_type = -1;
177
+ rbce->http_auth_types = 0;
178
+ rbce->proxy_auth_types = 0;
179
+ rbce->max_redirs = -1;
180
+ rbce->timeout = 0;
181
+ rbce->connect_timeout = 0;
182
+ rbce->dns_cache_timeout = 60;
183
+ rbce->ftp_response_timeout = 0;
184
+ rbce->ssl_version = -1;
185
+ rbce->use_ssl = -1;
186
+ rbce->ftp_filemethod = -1;
187
+
188
+ /* bool opts */
189
+ rbce->proxy_tunnel = 0;
190
+ rbce->fetch_file_time = 0;
191
+ rbce->ssl_verify_peer = 1;
192
+ rbce->ssl_verify_host = 1;
193
+ rbce->header_in_body = 0;
194
+ rbce->use_netrc = 0;
195
+ rbce->follow_location = 0;
196
+ rbce->unrestricted_auth = 0;
197
+ rbce->verbose = 0;
198
+ rbce->multipart_form_post = 0;
199
+ rbce->enable_cookies = 0;
200
+ }
201
+
202
+ /*
203
+ * call-seq:
204
+ * Curl::Easy.new => #&lt;Curl::Easy...&gt;
205
+ * Curl::Easy.new(url = nil) => #&lt;Curl::Easy...&gt;
206
+ * Curl::Easy.new(url = nil) { |self| ... } => #&lt;Curl::Easy...&gt;
207
+ *
208
+ * Create a new Curl::Easy instance, optionally supplying the URL.
209
+ * The block form allows further configuration to be supplied before
210
+ * the instance is returned.
211
+ */
212
+ static VALUE ruby_curl_easy_new(int argc, VALUE *argv, VALUE klass) {
213
+ CURLcode ecode;
214
+ VALUE url, blk;
215
+ VALUE new_curl;
216
+ ruby_curl_easy *rbce;
217
+
218
+ rb_scan_args(argc, argv, "01&", &url, &blk);
219
+
220
+ rbce = ALLOC(ruby_curl_easy);
221
+
222
+ /* handler */
223
+ rbce->curl = curl_easy_init();
224
+ if (!rbce->curl) {
225
+ rb_raise(eCurlErrFailedInit, "Failed to initialize easy handle");
226
+ }
227
+
228
+ rbce->multi = Qnil;
229
+
230
+ ruby_curl_easy_zero(rbce);
231
+
232
+ rb_easy_set("url", url);
233
+
234
+ new_curl = Data_Wrap_Struct(klass, curl_easy_mark, curl_easy_free, rbce);
235
+
236
+ /* set the new_curl pointer to the curl handle */
237
+ ecode = curl_easy_setopt(rbce->curl, CURLOPT_PRIVATE, (void*)new_curl);
238
+ if (ecode != CURLE_OK) {
239
+ raise_curl_easy_error_exception(ecode);
240
+ }
241
+
242
+ if (blk != Qnil) {
243
+ rb_funcall(blk, idCall, 1, new_curl);
244
+ }
245
+
246
+ return new_curl;
247
+ }
248
+
249
+ /*
250
+ * call-seq:
251
+ * easy.clone => #&lt;easy clone&gt;
252
+ * easy.dup => #&lt;easy clone&gt;
253
+ *
254
+ * Clone this Curl::Easy instance, creating a new instance.
255
+ * This method duplicates the underlying CURL* handle.
256
+ */
257
+ static VALUE ruby_curl_easy_clone(VALUE self) {
258
+ ruby_curl_easy *rbce, *newrbce;
259
+
260
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
261
+
262
+ newrbce = ALLOC(ruby_curl_easy);
263
+ memcpy(newrbce, rbce, sizeof(ruby_curl_easy));
264
+ newrbce->curl = curl_easy_duphandle(rbce->curl);
265
+ newrbce->curl_headers = NULL;
266
+ newrbce->curl_ftp_commands = NULL;
267
+
268
+ return Data_Wrap_Struct(cCurlEasy, curl_easy_mark, curl_easy_free, newrbce);
269
+ }
270
+
271
+ /*
272
+ * call-seq:
273
+ * easy.close => nil
274
+ *
275
+ * Close the Curl::Easy instance. Any open connections are closed
276
+ * The easy handle is reinitialized. If a previous multi handle was
277
+ * open it is set to nil and will be cleared after a GC.
278
+ */
279
+ static VALUE ruby_curl_easy_close(VALUE self) {
280
+ CURLcode ecode;
281
+ ruby_curl_easy *rbce;
282
+
283
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
284
+
285
+ ruby_curl_easy_free(rbce);
286
+
287
+ /* reinit the handle */
288
+ rbce->curl = curl_easy_init();
289
+ if (!rbce->curl) {
290
+ rb_raise(eCurlErrFailedInit, "Failed to initialize easy handle");
291
+ }
292
+
293
+ rbce->multi = Qnil;
294
+
295
+ ruby_curl_easy_zero(rbce);
296
+
297
+ /* give the new curl handle a reference back to the ruby object */
298
+ ecode = curl_easy_setopt(rbce->curl, CURLOPT_PRIVATE, (void*)self);
299
+ if (ecode != CURLE_OK) {
300
+ raise_curl_easy_error_exception(ecode);
301
+ }
302
+
303
+ return Qnil;
304
+ }
305
+
306
+ /*
307
+ * call-seq:
308
+ * easy.reset => Hash
309
+ *
310
+ * Reset the Curl::Easy instance, clears out all settings.
311
+ *
312
+ * from http://curl.haxx.se/libcurl/c/curl_easy_reset.html
313
+ * Re-initializes all options previously set on a specified CURL handle to the default values. This puts back the handle to the same state as it was in when it was just created with curl_easy_init(3).
314
+ * It does not change the following information kept in the handle: live connections, the Session ID cache, the DNS cache, the cookies and shares.
315
+ *
316
+ * The return value contains all settings stored.
317
+ */
318
+ static VALUE ruby_curl_easy_reset(VALUE self) {
319
+ CURLcode ecode;
320
+ ruby_curl_easy *rbce;
321
+ VALUE opts_dup;
322
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
323
+ opts_dup = rb_funcall(rbce->opts, rb_intern("dup"), 0);
324
+
325
+ curl_easy_reset(rbce->curl);
326
+ ruby_curl_easy_zero(rbce);
327
+
328
+ /* rest clobbers the private setting, so reset it to self */
329
+ ecode = curl_easy_setopt(rbce->curl, CURLOPT_PRIVATE, (void*)self);
330
+ if (ecode != CURLE_OK) {
331
+ raise_curl_easy_error_exception(ecode);
332
+ }
333
+
334
+ return opts_dup;
335
+ }
336
+
337
+
338
+ /* ================ OBJ ATTRIBUTES ==================*/
339
+
340
+ /*
341
+ * call-seq:
342
+ * easy.url = "http://some.url/" => "http://some.url/"
343
+ *
344
+ * Set the URL for subsequent calls to +perform+. It is acceptable
345
+ * (and even recommended) to reuse Curl::Easy instances by reassigning
346
+ * the URL between calls to +perform+.
347
+ */
348
+ static VALUE ruby_curl_easy_url_set(VALUE self, VALUE url) {
349
+ CURB_OBJECT_HSETTER(ruby_curl_easy, url);
350
+ }
351
+
352
+ /*
353
+ * call-seq:
354
+ * easy.url => string
355
+ *
356
+ * Obtain the URL that will be used by subsequent calls to +perform+.
357
+ */
358
+ static VALUE ruby_curl_easy_url_get(VALUE self) {
359
+ CURB_OBJECT_HGETTER(ruby_curl_easy, url);
360
+ }
361
+
362
+ /*
363
+ * call-seq:
364
+ * easy.proxy_url = string => string
365
+ *
366
+ * Set the URL of the HTTP proxy to use for subsequent calls to +perform+.
367
+ * The URL should specify the the host name or dotted IP address. To specify
368
+ * port number in this string, append :[port] to the end of the host name.
369
+ * The proxy string may be prefixed with [protocol]:// since any such prefix
370
+ * will be ignored. The proxy's port number may optionally be specified with
371
+ * the separate option proxy_port .
372
+ *
373
+ * When you tell the library to use an HTTP proxy, libcurl will transparently
374
+ * convert operations to HTTP even if you specify an FTP URL etc. This may have
375
+ * an impact on what other features of the library you can use, such as
376
+ * FTP specifics that don't work unless you tunnel through the HTTP proxy. Such
377
+ * tunneling is activated with proxy_tunnel = true.
378
+ *
379
+ * libcurl respects the environment variables *http_proxy*, *ftp_proxy*,
380
+ * *all_proxy* etc, if any of those is set. The proxy_url option does however
381
+ * override any possibly set environment variables.
382
+ *
383
+ * Starting with libcurl 7.14.1, the proxy host string given in environment
384
+ * variables can be specified the exact same way as the proxy can be set with
385
+ * proxy_url, including protocol prefix (http://) and embedded user + password.
386
+ */
387
+ static VALUE ruby_curl_easy_proxy_url_set(VALUE self, VALUE proxy_url) {
388
+ CURB_OBJECT_HSETTER(ruby_curl_easy, proxy_url);
389
+ }
390
+
391
+ /*
392
+ * call-seq:
393
+ * easy.proxy_url => string
394
+ *
395
+ * Obtain the HTTP Proxy URL that will be used by subsequent calls to +perform+.
396
+ */
397
+ static VALUE ruby_curl_easy_proxy_url_get(VALUE self) {
398
+ CURB_OBJECT_HGETTER(ruby_curl_easy, proxy_url);
399
+ }
400
+
401
+ /*
402
+ * call-seq:
403
+ * easy.headers = "Header: val" => "Header: val"
404
+ * easy.headers = {"Header" => "val" ..., "Header" => "val"} => {"Header: val", ...}
405
+ * easy.headers = ["Header: val" ..., "Header: val"] => ["Header: val", ...]
406
+ *
407
+ * Set custom HTTP headers for following requests. This can be used to add
408
+ * custom headers, or override standard headers used by libcurl. It defaults to a
409
+ * Hash.
410
+ *
411
+ * For example to set a standard or custom header:
412
+ *
413
+ * easy.headers["MyHeader"] = "myval"
414
+ *
415
+ * To remove a standard header (this is useful when removing libcurls default
416
+ * 'Expect: 100-Continue' header when using HTTP form posts):
417
+ *
418
+ * easy.headers["Expect"] = ''
419
+ *
420
+ * Anything passed to libcurl as a header will be converted to a string during
421
+ * the perform step.
422
+ */
423
+ static VALUE ruby_curl_easy_headers_set(VALUE self, VALUE headers) {
424
+ CURB_OBJECT_HSETTER(ruby_curl_easy, headers);
425
+ }
426
+
427
+ /*
428
+ * call-seq:
429
+ * easy.headers => Hash, Array or Str
430
+ *
431
+ * Obtain the custom HTTP headers for following requests.
432
+ */
433
+ static VALUE ruby_curl_easy_headers_get(VALUE self) {
434
+ ruby_curl_easy *rbce;
435
+ VALUE headers;
436
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
437
+ headers = rb_easy_get("headers");//rb_hash_aref(rbce->opts, rb_intern("headers"));
438
+ if (headers == Qnil) { headers = rb_easy_set("headers", rb_hash_new()); }
439
+ return headers;
440
+ }
441
+
442
+ /*
443
+ * call-seq:
444
+ * easy.interface = string => string
445
+ *
446
+ * Set the interface name to use as the outgoing network interface.
447
+ * The name can be an interface name, an IP address or a host name.
448
+ */
449
+ static VALUE ruby_curl_easy_interface_set(VALUE self, VALUE interface_hm) {
450
+ CURB_OBJECT_HSETTER(ruby_curl_easy, interface_hm);
451
+ }
452
+
453
+ /*
454
+ * call-seq:
455
+ * easy.interface => string
456
+ *
457
+ * Obtain the interface name that is used as the outgoing network interface.
458
+ * The name can be an interface name, an IP address or a host name.
459
+ */
460
+ static VALUE ruby_curl_easy_interface_get(VALUE self) {
461
+ CURB_OBJECT_HGETTER(ruby_curl_easy, interface_hm);
462
+ }
463
+
464
+ /*
465
+ * call-seq:
466
+ * easy.userpwd = string => string
467
+ *
468
+ * Set the username/password string to use for subsequent calls to +perform+.
469
+ * The supplied string should have the form "username:password"
470
+ */
471
+ static VALUE ruby_curl_easy_userpwd_set(VALUE self, VALUE userpwd) {
472
+ CURB_OBJECT_HSETTER(ruby_curl_easy, userpwd);
473
+ }
474
+
475
+ /*
476
+ * call-seq:
477
+ * easy.userpwd => string
478
+ *
479
+ * Obtain the username/password string that will be used for subsequent
480
+ * calls to +perform+.
481
+ */
482
+ static VALUE ruby_curl_easy_userpwd_get(VALUE self) {
483
+ CURB_OBJECT_HGETTER(ruby_curl_easy, userpwd);
484
+ }
485
+
486
+ /*
487
+ * call-seq:
488
+ * easy.proxypwd = string => string
489
+ *
490
+ * Set the username/password string to use for proxy connection during
491
+ * subsequent calls to +perform+. The supplied string should have the
492
+ * form "username:password"
493
+ */
494
+ static VALUE ruby_curl_easy_proxypwd_set(VALUE self, VALUE proxypwd) {
495
+ CURB_OBJECT_HSETTER(ruby_curl_easy, proxypwd);
496
+ }
497
+
498
+ /*
499
+ * call-seq:
500
+ * easy.proxypwd => string
501
+ *
502
+ * Obtain the username/password string that will be used for proxy
503
+ * connection during subsequent calls to +perform+. The supplied string
504
+ * should have the form "username:password"
505
+ */
506
+ static VALUE ruby_curl_easy_proxypwd_get(VALUE self) {
507
+ CURB_OBJECT_HGETTER(ruby_curl_easy, proxypwd);
508
+ }
509
+
510
+
511
+ /*
512
+ * call-seq:
513
+ * easy.cookies = "name1=content1; name2=content2;" => string
514
+ *
515
+ * Set cookies to be sent by this Curl::Easy instance. The format of the string should
516
+ * be NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie should contain.
517
+ * Set multiple cookies in one string like this: "name1=content1; name2=content2;" etc.
518
+ */
519
+ static VALUE ruby_curl_easy_cookies_set(VALUE self, VALUE cookies) {
520
+ CURB_OBJECT_HSETTER(ruby_curl_easy, cookies);
521
+ }
522
+
523
+ /*
524
+ * call-seq:
525
+ * easy.cookies => "name1=content1; name2=content2;"
526
+ *
527
+ * Obtain the cookies for this Curl::Easy instance.
528
+ */
529
+ static VALUE ruby_curl_easy_cookies_get(VALUE self) {
530
+ CURB_OBJECT_HGETTER(ruby_curl_easy, cookies);
531
+ }
532
+
533
+ /*
534
+ * call-seq:
535
+ * easy.cookiefile = string => string
536
+ *
537
+ * Set a file that contains cookies to be sent in subsequent requests by this Curl::Easy instance.
538
+ *
539
+ * *Note* that you must set enable_cookies true to enable the cookie
540
+ * engine, or this option will be ignored.
541
+ */
542
+ static VALUE ruby_curl_easy_cookiefile_set(VALUE self, VALUE cookiefile) {
543
+ CURB_OBJECT_HSETTER(ruby_curl_easy, cookiefile);
544
+ }
545
+
546
+ /*
547
+ * call-seq:
548
+ * easy.cookiefile => string
549
+ *
550
+ * Obtain the cookiefile file for this Curl::Easy instance.
551
+ */
552
+ static VALUE ruby_curl_easy_cookiefile_get(VALUE self) {
553
+ CURB_OBJECT_HGETTER(ruby_curl_easy, cookiefile);
554
+ }
555
+
556
+ /*
557
+ * call-seq:
558
+ * easy.cookiejar = string => string
559
+ *
560
+ * Set a cookiejar file to use for this Curl::Easy instance.
561
+ * Cookies from the response will be written into this file.
562
+ *
563
+ * *Note* that you must set enable_cookies true to enable the cookie
564
+ * engine, or this option will be ignored.
565
+ */
566
+ static VALUE ruby_curl_easy_cookiejar_set(VALUE self, VALUE cookiejar) {
567
+ CURB_OBJECT_HSETTER(ruby_curl_easy, cookiejar);
568
+ }
569
+
570
+ /*
571
+ * call-seq:
572
+ * easy.cookiejar => string
573
+ *
574
+ * Obtain the cookiejar file to use for this Curl::Easy instance.
575
+ */
576
+ static VALUE ruby_curl_easy_cookiejar_get(VALUE self) {
577
+ CURB_OBJECT_HGETTER(ruby_curl_easy, cookiejar);
578
+ }
579
+
580
+ /*
581
+ * call-seq:
582
+ * easy.cert = string => ""
583
+ *
584
+ * Set a cert file to use for this Curl::Easy instance. This file
585
+ * will be used to validate SSL connections.
586
+ *
587
+ */
588
+ static VALUE ruby_curl_easy_cert_set(VALUE self, VALUE cert) {
589
+ CURB_OBJECT_HSETTER(ruby_curl_easy, cert);
590
+ }
591
+
592
+ /*
593
+ * call-seq:
594
+ * easy.cert => string
595
+ *
596
+ * Obtain the cert file to use for this Curl::Easy instance.
597
+ */
598
+ static VALUE ruby_curl_easy_cert_get(VALUE self) {
599
+ CURB_OBJECT_HGETTER(ruby_curl_easy, cert);
600
+ }
601
+
602
+ /*
603
+ * call-seq:
604
+ * easy.cert_key = "cert_key.file" => ""
605
+ *
606
+ * Set a cert key to use for this Curl::Easy instance. This file
607
+ * will be used to validate SSL certificates.
608
+ *
609
+ */
610
+ static VALUE ruby_curl_easy_cert_key_set(VALUE self, VALUE cert_key) {
611
+ CURB_OBJECT_HSETTER(ruby_curl_easy, cert_key);
612
+ }
613
+
614
+ /*
615
+ * call-seq:
616
+ * easy.cert_key => "cert_key.file"
617
+ *
618
+ * Obtain the cert key file to use for this Curl::Easy instance.
619
+ */
620
+ static VALUE ruby_curl_easy_cert_key_get(VALUE self) {
621
+ CURB_OBJECT_HGETTER(ruby_curl_easy, cert_key);
622
+ }
623
+
624
+ /*
625
+ * call-seq:
626
+ * easy.cacert = string => ""
627
+ *
628
+ * Set a cacert bundle to use for this Curl::Easy instance. This file
629
+ * will be used to validate SSL certificates.
630
+ *
631
+ */
632
+ static VALUE ruby_curl_easy_cacert_set(VALUE self, VALUE cacert) {
633
+ CURB_OBJECT_HSETTER(ruby_curl_easy, cacert);
634
+ }
635
+
636
+ /*
637
+ * call-seq:
638
+ * easy.cacert => string
639
+ *
640
+ * Obtain the cacert file to use for this Curl::Easy instance.
641
+ */
642
+ static VALUE ruby_curl_easy_cacert_get(VALUE self) {
643
+ CURB_OBJECT_HGETTER(ruby_curl_easy, cacert);
644
+ }
645
+
646
+ /*
647
+ * call-seq:
648
+ * easy.certpassword = string => ""
649
+ *
650
+ * Set a password used to open the specified cert
651
+ */
652
+ static VALUE ruby_curl_easy_certpassword_set(VALUE self, VALUE certpassword) {
653
+ CURB_OBJECT_HSETTER(ruby_curl_easy, certpassword);
654
+ }
655
+
656
+ /*
657
+ * call-seq:
658
+ * easy.certtype = "PEM|DER" => ""
659
+ *
660
+ * Set a cert type to use for this Curl::Easy instance.
661
+ * Default is PEM
662
+ *
663
+ */
664
+ static VALUE ruby_curl_easy_certtype_set(VALUE self, VALUE certtype) {
665
+ CURB_OBJECT_HSETTER(ruby_curl_easy, certtype);
666
+ }
667
+
668
+ /*
669
+ * call-seq:
670
+ * easy.certtype => string
671
+ *
672
+ * Obtain the cert type used for this Curl::Easy instance
673
+ */
674
+ static VALUE ruby_curl_easy_certtype_get(VALUE self) {
675
+ CURB_OBJECT_HGETTER(ruby_curl_easy, certtype);
676
+ }
677
+
678
+ /*
679
+ * call-seq:
680
+ * easy.encoding = string => string
681
+ *
682
+ * Set the accepted encoding types, curl will handle all of the decompression
683
+ *
684
+ */
685
+ static VALUE ruby_curl_easy_encoding_set(VALUE self, VALUE encoding) {
686
+ CURB_OBJECT_HSETTER(ruby_curl_easy, encoding);
687
+ }
688
+ /*
689
+ * call-seq:
690
+ * easy.encoding => string
691
+ *
692
+ * Get the set encoding types
693
+ *
694
+ */
695
+ static VALUE ruby_curl_easy_encoding_get(VALUE self) {
696
+ CURB_OBJECT_HGETTER(ruby_curl_easy, encoding);
697
+ }
698
+
699
+ /*
700
+ * call-seq:
701
+ * easy.useragent = "Ruby/Curb" => ""
702
+ *
703
+ * Set the user agent string for this Curl::Easy instance
704
+ *
705
+ */
706
+ static VALUE ruby_curl_easy_useragent_set(VALUE self, VALUE useragent) {
707
+ CURB_OBJECT_HSETTER(ruby_curl_easy, useragent);
708
+ }
709
+
710
+ /*
711
+ * call-seq:
712
+ * easy.useragent => "Ruby/Curb"
713
+ *
714
+ * Obtain the user agent string used for this Curl::Easy instance
715
+ */
716
+ static VALUE ruby_curl_easy_useragent_get(VALUE self) {
717
+ CURB_OBJECT_HGETTER(ruby_curl_easy, useragent);
718
+ }
719
+
720
+ /*
721
+ * call-seq:
722
+ * easy.post_body = "some=form%20data&to=send" => string or nil
723
+ *
724
+ * Sets the POST body of this Curl::Easy instance. This is expected to be
725
+ * URL encoded; no additional processing or encoding is done on the string.
726
+ * The content-type header will be set to application/x-www-form-urlencoded.
727
+ *
728
+ * This is handy if you want to perform a POST against a Curl::Multi instance.
729
+ */
730
+ static VALUE ruby_curl_easy_post_body_set(VALUE self, VALUE post_body) {
731
+ ruby_curl_easy *rbce;
732
+ CURL *curl;
733
+
734
+ char *data;
735
+ long len;
736
+
737
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
738
+
739
+ curl = rbce->curl;
740
+
741
+ if ( post_body == Qnil ) {
742
+ //rbce->postdata_buffer = Qnil;
743
+ rb_easy_del("postdata_buffer");
744
+
745
+ } else {
746
+ data = StringValuePtr(post_body);
747
+ len = RSTRING_LEN(post_body);
748
+
749
+ // Store the string, since it has to hang around for the duration of the
750
+ // request. See CURLOPT_POSTFIELDS in the libcurl docs.
751
+ //rbce->postdata_buffer = post_body;
752
+ rb_easy_set("postdata_buffer", post_body);
753
+
754
+ curl_easy_setopt(curl, CURLOPT_POST, 1);
755
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
756
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, len);
757
+
758
+ return post_body;
759
+ }
760
+
761
+ return Qnil;
762
+ }
763
+
764
+ /*
765
+ * call-seq:
766
+ * easy.post_body => string or nil
767
+ *
768
+ * Obtain the POST body used in this Curl::Easy instance.
769
+ */
770
+ static VALUE ruby_curl_easy_post_body_get(VALUE self) {
771
+ CURB_OBJECT_HGETTER(ruby_curl_easy, postdata_buffer);
772
+ }
773
+
774
+ /*
775
+ * call-seq:
776
+ * easy.put_data = data => ""
777
+ *
778
+ * Points this Curl::Easy instance to data to be uploaded via PUT. This
779
+ * sets the request to a PUT type request - useful if you want to PUT via
780
+ * a multi handle.
781
+ */
782
+ static VALUE ruby_curl_easy_put_data_set(VALUE self, VALUE data) {
783
+ ruby_curl_easy *rbce;
784
+ CURL *curl;
785
+ VALUE upload;
786
+ VALUE headers;
787
+
788
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
789
+
790
+ upload = ruby_curl_upload_new(cCurlUpload);
791
+ ruby_curl_upload_stream_set(upload,data);
792
+
793
+ curl = rbce->curl;
794
+ rb_easy_set("upload", upload); /* keep the upload object alive as long as
795
+ the easy handle is active or until the upload
796
+ is complete or terminated... */
797
+
798
+ curl_easy_setopt(curl, CURLOPT_NOBODY,0);
799
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
800
+ curl_easy_setopt(curl, CURLOPT_READFUNCTION, (curl_read_callback)read_data_handler);
801
+ curl_easy_setopt(curl, CURLOPT_READDATA, rbce);
802
+
803
+ /*
804
+ * we need to set specific headers for the PUT to work... so
805
+ * convert the internal headers structure to a HASH if one is set
806
+ */
807
+ if (!rb_easy_nil("headers")) {
808
+ if (rb_easy_type_check("headers", T_ARRAY) || rb_easy_type_check("headers", T_STRING)) {
809
+ rb_raise(rb_eRuntimeError, "Must set headers as a HASH to modify the headers in an PUT request");
810
+ }
811
+ }
812
+
813
+ // exit fast if the payload is empty
814
+ if (NIL_P(data)) { return data; }
815
+
816
+ headers = rb_easy_get("headers");
817
+ if( headers == Qnil ) {
818
+ headers = rb_hash_new();
819
+ }
820
+
821
+ if (rb_respond_to(data, rb_intern("read"))) {
822
+ VALUE stat = rb_funcall(data, rb_intern("stat"), 0);
823
+ if( stat ) {
824
+ VALUE size;
825
+ if( rb_hash_aref(headers, rb_str_new2("Expect")) == Qnil ) {
826
+ rb_hash_aset(headers, rb_str_new2("Expect"), rb_str_new2(""));
827
+ }
828
+ size = rb_funcall(stat, rb_intern("size"), 0);
829
+ curl_easy_setopt(curl, CURLOPT_INFILESIZE, FIX2INT(size));
830
+ }
831
+ else if( rb_hash_aref(headers, rb_str_new2("Transfer-Encoding")) == Qnil ) {
832
+ rb_hash_aset(headers, rb_str_new2("Transfer-Encoding"), rb_str_new2("chunked"));
833
+ }
834
+ }
835
+ else if (rb_respond_to(data, rb_intern("to_s"))) {
836
+ curl_easy_setopt(curl, CURLOPT_INFILESIZE, RSTRING_LEN(data));
837
+ if( rb_hash_aref(headers, rb_str_new2("Expect")) == Qnil ) {
838
+ rb_hash_aset(headers, rb_str_new2("Expect"), rb_str_new2(""));
839
+ }
840
+ }
841
+ else {
842
+ rb_raise(rb_eRuntimeError, "PUT data must respond to read or to_s");
843
+ }
844
+ rb_easy_set("headers",headers);
845
+
846
+ // if we made it this far, all should be well.
847
+ return data;
848
+ }
849
+
850
+ /*
851
+ * call-seq:
852
+ * easy.ftp_commands = ["CWD /", "MKD directory"] => ["CWD /", ...]
853
+ *
854
+ * Explicitly sets the list of commands to execute on the FTP server when calling perform
855
+ */
856
+ static VALUE ruby_curl_easy_ftp_commands_set(VALUE self, VALUE ftp_commands) {
857
+ CURB_OBJECT_HSETTER(ruby_curl_easy, ftp_commands);
858
+ }
859
+
860
+ /*
861
+ * call-seq
862
+ * easy.ftp_commands => array or nil
863
+ */
864
+ static VALUE ruby_curl_easy_ftp_commands_get(VALUE self) {
865
+ CURB_OBJECT_HGETTER(ruby_curl_easy, ftp_commands);
866
+ }
867
+
868
+ /* ================== IMMED ATTRS ==================*/
869
+
870
+ /*
871
+ * call-seq:
872
+ * easy.local_port = fixnum or nil => fixnum or nil
873
+ *
874
+ * Set the local port that will be used for the following +perform+ calls.
875
+ *
876
+ * Passing +nil+ will return to the default behaviour (no local port
877
+ * preference).
878
+ *
879
+ * This option is ignored if compiled against libcurl < 7.15.2.
880
+ */
881
+ static VALUE ruby_curl_easy_local_port_set(VALUE self, VALUE local_port) {
882
+ CURB_IMMED_PORT_SETTER(ruby_curl_easy, local_port, "port");
883
+ }
884
+
885
+ /*
886
+ * call-seq:
887
+ * easy.local_port => fixnum or nil
888
+ *
889
+ * Obtain the local port that will be used for the following +perform+ calls.
890
+ *
891
+ * This option is ignored if compiled against libcurl < 7.15.2.
892
+ */
893
+ static VALUE ruby_curl_easy_local_port_get(VALUE self) {
894
+ CURB_IMMED_PORT_GETTER(ruby_curl_easy, local_port);
895
+ }
896
+
897
+ /*
898
+ * call-seq:
899
+ * easy.local_port_range = fixnum or nil => fixnum or nil
900
+ *
901
+ * Set the local port range that will be used for the following +perform+
902
+ * calls. This is a number (between 0 and 65535) that determines how far
903
+ * libcurl may deviate from the supplied +local_port+ in order to find
904
+ * an available port.
905
+ *
906
+ * If you set +local_port+ it's also recommended that you set this, since
907
+ * it is fairly likely that your specified port will be unavailable.
908
+ *
909
+ * This option is ignored if compiled against libcurl < 7.15.2.
910
+ */
911
+ static VALUE ruby_curl_easy_local_port_range_set(VALUE self, VALUE local_port_range) {
912
+ CURB_IMMED_PORT_SETTER(ruby_curl_easy, local_port_range, "port range");
913
+ }
914
+
915
+ /*
916
+ * call-seq:
917
+ * easy.local_port_range => fixnum or nil
918
+ *
919
+ * Obtain the local port range that will be used for the following +perform+
920
+ * calls.
921
+ *
922
+ * This option is ignored if compiled against libcurl < 7.15.2.
923
+ */
924
+ static VALUE ruby_curl_easy_local_port_range_get(VALUE self) {
925
+ CURB_IMMED_PORT_GETTER(ruby_curl_easy, local_port_range);
926
+ }
927
+
928
+ /*
929
+ * call-seq:
930
+ * easy.proxy_port = fixnum or nil => fixnum or nil
931
+ *
932
+ * Set the proxy port that will be used for the following +perform+ calls.
933
+ */
934
+ static VALUE ruby_curl_easy_proxy_port_set(VALUE self, VALUE proxy_port) {
935
+ CURB_IMMED_PORT_SETTER(ruby_curl_easy, proxy_port, "port");
936
+ }
937
+
938
+ /*
939
+ * call-seq:
940
+ * easy.proxy_port => fixnum or nil
941
+ *
942
+ * Obtain the proxy port that will be used for the following +perform+ calls.
943
+ */
944
+ static VALUE ruby_curl_easy_proxy_port_get(VALUE self) {
945
+ CURB_IMMED_PORT_GETTER(ruby_curl_easy, proxy_port);
946
+ }
947
+
948
+ /*
949
+ * call-seq:
950
+ * easy.proxy_type = fixnum or nil => fixnum or nil
951
+ *
952
+ * Set the proxy type that will be used for the following +perform+ calls.
953
+ * This should be one of the Curl::CURLPROXY constants.
954
+ */
955
+ static VALUE ruby_curl_easy_proxy_type_set(VALUE self, VALUE proxy_type) {
956
+ CURB_IMMED_SETTER(ruby_curl_easy, proxy_type, -1);
957
+ }
958
+
959
+ /*
960
+ * call-seq:
961
+ * easy.proxy_type => fixnum or nil
962
+ *
963
+ * Obtain the proxy type that will be used for the following +perform+ calls.
964
+ */
965
+ static VALUE ruby_curl_easy_proxy_type_get(VALUE self) {
966
+ CURB_IMMED_GETTER(ruby_curl_easy, proxy_type, -1);
967
+ }
968
+
969
+ #if defined(HAVE_CURLAUTH_DIGEST_IE)
970
+ #define CURL_HTTPAUTH_STR_TO_NUM(node) \
971
+ (!strncmp("basic",node,5)) ? CURLAUTH_BASIC : \
972
+ (!strncmp("digest_ie",node,9)) ? CURLAUTH_DIGEST_IE : \
973
+ (!strncmp("digest",node,6)) ? CURLAUTH_DIGEST : \
974
+ (!strncmp("gssnegotiate",node,12)) ? CURLAUTH_GSSNEGOTIATE : \
975
+ (!strncmp("ntlm",node,4)) ? CURLAUTH_NTLM : \
976
+ (!strncmp("any",node,3)) ? CURLAUTH_ANY : \
977
+ (!strncmp("anysafe",node,7)) ? CURLAUTH_ANYSAFE : 0
978
+ #else
979
+ #define CURL_HTTPAUTH_STR_TO_NUM(node) \
980
+ (!strncmp("basic",node,5)) ? CURLAUTH_BASIC : \
981
+ (!strncmp("digest",node,6)) ? CURLAUTH_DIGEST : \
982
+ (!strncmp("gssnegotiate",node,12)) ? CURLAUTH_GSSNEGOTIATE : \
983
+ (!strncmp("ntlm",node,4)) ? CURLAUTH_NTLM : \
984
+ (!strncmp("any",node,3)) ? CURLAUTH_ANY : \
985
+ (!strncmp("anysafe",node,7)) ? CURLAUTH_ANYSAFE : 0
986
+ #endif
987
+ /*
988
+ * call-seq:
989
+ * easy.http_auth_types = fixnum or nil => fixnum or nil
990
+ * easy.http_auth_types = [:basic,:digest,:digest_ie,:gssnegotiate, :ntlm, :any, :anysafe]
991
+ *
992
+ * Set the HTTP authentication types that may be used for the following
993
+ * +perform+ calls. This is a bitmap made by ORing together the
994
+ * Curl::CURLAUTH constants.
995
+ */
996
+ static VALUE ruby_curl_easy_http_auth_types_set(int argc, VALUE *argv, VALUE self) {//VALUE self, VALUE http_auth_types) {
997
+ ruby_curl_easy *rbce;
998
+ VALUE args_ary;
999
+ int i, len;
1000
+ char* node = NULL;
1001
+ long mask = 0x000000;
1002
+
1003
+ rb_scan_args(argc, argv, "*", &args_ary);
1004
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
1005
+ len = RARRAY_LEN(args_ary);
1006
+
1007
+ if (len == 1 && (TYPE(rb_ary_entry(args_ary,0)) == T_FIXNUM || rb_ary_entry(args_ary,0) == Qnil)) {
1008
+ if (rb_ary_entry(args_ary,0) == Qnil) {
1009
+ rbce->http_auth_types = 0;
1010
+ }
1011
+ else {
1012
+ rbce->http_auth_types = NUM2INT(rb_ary_entry(args_ary,0));
1013
+ }
1014
+ }
1015
+ else {
1016
+ // we could have multiple values, but they should be symbols
1017
+ node = RSTRING_PTR(rb_funcall(rb_ary_entry(args_ary,0),rb_intern("to_s"),0));
1018
+ mask = CURL_HTTPAUTH_STR_TO_NUM(node);
1019
+ for( i = 1; i < len; ++i ) {
1020
+ node = RSTRING_PTR(rb_funcall(rb_ary_entry(args_ary,i),rb_intern("to_s"),0));
1021
+ mask |= CURL_HTTPAUTH_STR_TO_NUM(node);
1022
+ }
1023
+ rbce->http_auth_types = mask;
1024
+ }
1025
+ return INT2NUM(rbce->http_auth_types);
1026
+ }
1027
+
1028
+ /*
1029
+ * call-seq:
1030
+ * easy.http_auth_types => fixnum or nil
1031
+ *
1032
+ * Obtain the HTTP authentication types that may be used for the following
1033
+ * +perform+ calls.
1034
+ */
1035
+ static VALUE ruby_curl_easy_http_auth_types_get(VALUE self) {
1036
+ CURB_IMMED_GETTER(ruby_curl_easy, http_auth_types, 0);
1037
+ }
1038
+
1039
+ /*
1040
+ * call-seq:
1041
+ * easy.proxy_auth_types = fixnum or nil => fixnum or nil
1042
+ *
1043
+ * Set the proxy authentication types that may be used for the following
1044
+ * +perform+ calls. This is a bitmap made by ORing together the
1045
+ * Curl::CURLAUTH constants.
1046
+ */
1047
+ static VALUE ruby_curl_easy_proxy_auth_types_set(VALUE self, VALUE proxy_auth_types) {
1048
+ CURB_IMMED_SETTER(ruby_curl_easy, proxy_auth_types, 0);
1049
+ }
1050
+
1051
+ /*
1052
+ * call-seq:
1053
+ * easy.proxy_auth_types => fixnum or nil
1054
+ *
1055
+ * Obtain the proxy authentication types that may be used for the following
1056
+ * +perform+ calls.
1057
+ */
1058
+ static VALUE ruby_curl_easy_proxy_auth_types_get(VALUE self) {
1059
+ CURB_IMMED_GETTER(ruby_curl_easy, proxy_auth_types, 0);
1060
+ }
1061
+
1062
+ /*
1063
+ * call-seq:
1064
+ * easy.max_redirects = fixnum or nil => fixnum or nil
1065
+ *
1066
+ * Set the maximum number of redirections to follow in the following +perform+
1067
+ * calls. Set to nil or -1 allow an infinite number (the default). Setting this
1068
+ * option only makes sense if +follow_location+ is also set true.
1069
+ *
1070
+ * With libcurl >= 7.15.1, setting this to 0 will cause libcurl to refuse any
1071
+ * redirect.
1072
+ */
1073
+ static VALUE ruby_curl_easy_max_redirects_set(VALUE self, VALUE max_redirs) {
1074
+ CURB_IMMED_SETTER(ruby_curl_easy, max_redirs, -1);
1075
+ }
1076
+
1077
+ /*
1078
+ * call-seq:
1079
+ * easy.max_redirects => fixnum or nil
1080
+ *
1081
+ * Obtain the maximum number of redirections to follow in the following
1082
+ * +perform+ calls.
1083
+ */
1084
+ static VALUE ruby_curl_easy_max_redirects_get(VALUE self) {
1085
+ CURB_IMMED_GETTER(ruby_curl_easy, max_redirs, -1);
1086
+ }
1087
+
1088
+ /*
1089
+ * call-seq:
1090
+ * easy.timeout = fixnum or nil => fixnum or nil
1091
+ *
1092
+ * Set the maximum time in seconds that you allow the libcurl transfer
1093
+ * operation to take. Normally, name lookups can take a considerable time
1094
+ * and limiting operations to less than a few minutes risk aborting
1095
+ * perfectly normal operations.
1096
+ *
1097
+ * Set to nil (or zero) to disable timeout (it will then only timeout
1098
+ * on the system's internal timeouts).
1099
+ */
1100
+ static VALUE ruby_curl_easy_timeout_set(VALUE self, VALUE timeout) {
1101
+ CURB_IMMED_SETTER(ruby_curl_easy, timeout, 0);
1102
+ }
1103
+
1104
+ /*
1105
+ * call-seq:
1106
+ * easy.timeout => fixnum or nil
1107
+ *
1108
+ * Obtain the maximum time in seconds that you allow the libcurl transfer
1109
+ * operation to take.
1110
+ */
1111
+ static VALUE ruby_curl_easy_timeout_get(VALUE self, VALUE timeout) {
1112
+ CURB_IMMED_GETTER(ruby_curl_easy, timeout, 0);
1113
+ }
1114
+
1115
+ /*
1116
+ * call-seq:
1117
+ * easy.connect_timeout = fixnum or nil => fixnum or nil
1118
+ *
1119
+ * Set the maximum time in seconds that you allow the connection to the
1120
+ * server to take. This only limits the connection phase, once it has
1121
+ * connected, this option is of no more use.
1122
+ *
1123
+ * Set to nil (or zero) to disable connection timeout (it will then only
1124
+ * timeout on the system's internal timeouts).
1125
+ */
1126
+ static VALUE ruby_curl_easy_connect_timeout_set(VALUE self, VALUE connect_timeout) {
1127
+ CURB_IMMED_SETTER(ruby_curl_easy, connect_timeout, 0);
1128
+ }
1129
+
1130
+ /*
1131
+ * call-seq:
1132
+ * easy.connect_timeout => fixnum or nil
1133
+ *
1134
+ * Obtain the maximum time in seconds that you allow the connection to the
1135
+ * server to take.
1136
+ */
1137
+ static VALUE ruby_curl_easy_connect_timeout_get(VALUE self, VALUE connect_timeout) {
1138
+ CURB_IMMED_GETTER(ruby_curl_easy, connect_timeout, 0);
1139
+ }
1140
+
1141
+ /*
1142
+ * call-seq:
1143
+ * easy.dns_cache_timeout = fixnum or nil => fixnum or nil
1144
+ *
1145
+ * Set the dns cache timeout in seconds. Name resolves will be kept in
1146
+ * memory for this number of seconds. Set to zero (0) to completely disable
1147
+ * caching, or set to nil (or -1) to make the cached entries remain forever.
1148
+ * By default, libcurl caches this info for 60 seconds.
1149
+ */
1150
+ static VALUE ruby_curl_easy_dns_cache_timeout_set(VALUE self, VALUE dns_cache_timeout) {
1151
+ CURB_IMMED_SETTER(ruby_curl_easy, dns_cache_timeout, -1);
1152
+ }
1153
+
1154
+ /*
1155
+ * call-seq:
1156
+ * easy.dns_cache_timeout => fixnum or nil
1157
+ *
1158
+ * Obtain the dns cache timeout in seconds.
1159
+ */
1160
+ static VALUE ruby_curl_easy_dns_cache_timeout_get(VALUE self, VALUE dns_cache_timeout) {
1161
+ CURB_IMMED_GETTER(ruby_curl_easy, dns_cache_timeout, -1);
1162
+ }
1163
+
1164
+ /*
1165
+ * call-seq:
1166
+ * easy.ftp_response_timeout = fixnum or nil => fixnum or nil
1167
+ *
1168
+ * Set a timeout period (in seconds) on the amount of time that the server
1169
+ * is allowed to take in order to generate a response message for a command
1170
+ * before the session is considered hung. While curl is waiting for a
1171
+ * response, this value overrides +timeout+. It is recommended that if used
1172
+ * in conjunction with +timeout+, you set +ftp_response_timeout+ to a value
1173
+ * smaller than +timeout+.
1174
+ *
1175
+ * Ignored if libcurl version is < 7.10.8.
1176
+ */
1177
+ static VALUE ruby_curl_easy_ftp_response_timeout_set(VALUE self, VALUE ftp_response_timeout) {
1178
+ CURB_IMMED_SETTER(ruby_curl_easy, ftp_response_timeout, 0);
1179
+ }
1180
+
1181
+ /*
1182
+ * call-seq:
1183
+ * easy.ftp_response_timeout => fixnum or nil
1184
+ *
1185
+ * Obtain the maximum time that libcurl will wait for FTP command responses.
1186
+ */
1187
+ static VALUE ruby_curl_easy_ftp_response_timeout_get(VALUE self, VALUE ftp_response_timeout) {
1188
+ CURB_IMMED_GETTER(ruby_curl_easy, ftp_response_timeout, 0);
1189
+ }
1190
+
1191
+ /*
1192
+ * call-seq:
1193
+ * easy.username = string => string
1194
+ *
1195
+ * Set the HTTP Authentication username.
1196
+ */
1197
+ static VALUE ruby_curl_easy_username_set(VALUE self, VALUE username) {
1198
+ #if HAVE_CURLOPT_USERNAME
1199
+ CURB_OBJECT_HSETTER(ruby_curl_easy, username);
1200
+ #else
1201
+ return Qnil;
1202
+ #endif
1203
+ }
1204
+
1205
+ /*
1206
+ * call-seq:
1207
+ * easy.username => string
1208
+ *
1209
+ * Get the current username
1210
+ */
1211
+ static VALUE ruby_curl_easy_username_get(VALUE self, VALUE username) {
1212
+ #if HAVE_CURLOPT_USERNAME
1213
+ CURB_OBJECT_HGETTER(ruby_curl_easy, username);
1214
+ #else
1215
+ return Qnil;
1216
+ #endif
1217
+ }
1218
+
1219
+ /*
1220
+ * call-seq:
1221
+ * easy.password = string => string
1222
+ *
1223
+ * Set the HTTP Authentication password.
1224
+ */
1225
+ static VALUE ruby_curl_easy_password_set(VALUE self, VALUE password) {
1226
+ #if HAVE_CURLOPT_PASSWORD
1227
+ CURB_OBJECT_HSETTER(ruby_curl_easy, password);
1228
+ #else
1229
+ return Qnil;
1230
+ #endif
1231
+ }
1232
+
1233
+ /*
1234
+ * call-seq:
1235
+ * easy.password => string
1236
+ *
1237
+ * Get the current password
1238
+ */
1239
+ static VALUE ruby_curl_easy_password_get(VALUE self, VALUE password) {
1240
+ #if HAVE_CURLOPT_PASSWORD
1241
+ CURB_OBJECT_HGETTER(ruby_curl_easy, password);
1242
+ #else
1243
+ return Qnil;
1244
+ #endif
1245
+ }
1246
+
1247
+ /*
1248
+ * call-seq:
1249
+ * easy.ssl_version = value => fixnum or nil
1250
+ *
1251
+ * Sets the version of SSL/TLS that libcurl will attempt to use. Valid
1252
+ * options are Curl::CURL_SSLVERSION_TLSv1, Curl::CURL_SSLVERSION::SSLv2,
1253
+ * Curl::CURL_SSLVERSION_SSLv3 and Curl::CURL_SSLVERSION_DEFAULT
1254
+ */
1255
+ static VALUE ruby_curl_easy_ssl_version_set(VALUE self, VALUE ssl_version) {
1256
+ CURB_IMMED_SETTER(ruby_curl_easy, ssl_version, -1);
1257
+ }
1258
+
1259
+ /*
1260
+ * call-seq:
1261
+ * easy.ssl_version => fixnum
1262
+ *
1263
+ * Get the version of SSL/TLS that libcurl will attempt to use.
1264
+ */
1265
+ static VALUE ruby_curl_easy_ssl_version_get(VALUE self, VALUE ssl_version) {
1266
+ CURB_IMMED_GETTER(ruby_curl_easy, ssl_version, -1);
1267
+ }
1268
+
1269
+ /*
1270
+ * call-seq:
1271
+ * easy.use_ssl = value => fixnum or nil
1272
+ *
1273
+ * Ensure libcurl uses SSL for FTP connections. Valid options are Curl::CURL_USESSL_NONE,
1274
+ * Curl::CURL_USESSL_TRY, Curl::CURL_USESSL_CONTROL, and Curl::CURL_USESSL_ALL.
1275
+ */
1276
+ static VALUE ruby_curl_easy_use_ssl_set(VALUE self, VALUE use_ssl) {
1277
+ CURB_IMMED_SETTER(ruby_curl_easy, use_ssl, -1);
1278
+ }
1279
+
1280
+ /*
1281
+ * call-seq:
1282
+ * easy.use_ssl => fixnum
1283
+ *
1284
+ * Get the desired level for using SSL on FTP connections.
1285
+ */
1286
+ static VALUE ruby_curl_easy_use_ssl_get(VALUE self, VALUE use_ssl) {
1287
+ CURB_IMMED_GETTER(ruby_curl_easy, use_ssl, -1);
1288
+ }
1289
+
1290
+ /*
1291
+ * call-seq:
1292
+ * easy.ftp_filemethod = value => fixnum or nil
1293
+ *
1294
+ * Controls how libcurl reaches files on the server. Valid options are Curl::CURL_MULTICWD,
1295
+ * Curl::CURL_NOCWD, and Curl::CURL_SINGLECWD (see libcurl docs for CURLOPT_FTP_METHOD).
1296
+ */
1297
+ static VALUE ruby_curl_easy_ftp_filemethod_set(VALUE self, VALUE ftp_filemethod) {
1298
+ CURB_IMMED_SETTER(ruby_curl_easy, ftp_filemethod, -1);
1299
+ }
1300
+
1301
+ /*
1302
+ * call-seq
1303
+ * easy.ftp_filemethod => fixnum
1304
+ *
1305
+ * Get the configuration for how libcurl will reach files on the server.
1306
+ */
1307
+ static VALUE ruby_curl_easy_ftp_filemethod_get(VALUE self, VALUE ftp_filemethod) {
1308
+ CURB_IMMED_GETTER(ruby_curl_easy, ftp_filemethod, -1);
1309
+ }
1310
+
1311
+ /* ================== BOOL ATTRS ===================*/
1312
+
1313
+ /*
1314
+ * call-seq:
1315
+ * easy.proxy_tunnel = boolean => boolean
1316
+ *
1317
+ * Configure whether this Curl instance will use proxy tunneling.
1318
+ */
1319
+ static VALUE ruby_curl_easy_proxy_tunnel_set(VALUE self, VALUE proxy_tunnel) {
1320
+ CURB_BOOLEAN_SETTER(ruby_curl_easy, proxy_tunnel);
1321
+ }
1322
+
1323
+ /*
1324
+ * call-seq:
1325
+ * easy.proxy_tunnel? => boolean
1326
+ *
1327
+ * Determine whether this Curl instance will use proxy tunneling.
1328
+ */
1329
+ static VALUE ruby_curl_easy_proxy_tunnel_q(VALUE self) {
1330
+ CURB_BOOLEAN_GETTER(ruby_curl_easy, proxy_tunnel);
1331
+ }
1332
+
1333
+ /*
1334
+ * call-seq:
1335
+ * easy.fetch_file_time = boolean => boolean
1336
+ *
1337
+ * Configure whether this Curl instance will fetch remote file
1338
+ * times, if available.
1339
+ */
1340
+ static VALUE ruby_curl_easy_fetch_file_time_set(VALUE self, VALUE fetch_file_time) {
1341
+ CURB_BOOLEAN_SETTER(ruby_curl_easy, fetch_file_time);
1342
+ }
1343
+
1344
+ /*
1345
+ * call-seq:
1346
+ * easy.fetch_file_time? => boolean
1347
+ *
1348
+ * Determine whether this Curl instance will fetch remote file
1349
+ * times, if available.
1350
+ */
1351
+ static VALUE ruby_curl_easy_fetch_file_time_q(VALUE self) {
1352
+ CURB_BOOLEAN_GETTER(ruby_curl_easy, fetch_file_time);
1353
+ }
1354
+
1355
+ /*
1356
+ * call-seq:
1357
+ * easy.ssl_verify_peer = boolean => boolean
1358
+ *
1359
+ * Configure whether this Curl instance will verify the SSL peer
1360
+ * certificate. When true (the default), and the verification fails to
1361
+ * prove that the certificate is authentic, the connection fails. When
1362
+ * false, the connection succeeds regardless.
1363
+ *
1364
+ * Authenticating the certificate is not by itself very useful. You
1365
+ * typically want to ensure that the server, as authentically identified
1366
+ * by its certificate, is the server you mean to be talking to.
1367
+ * The ssl_verify_host? options controls that.
1368
+ */
1369
+ static VALUE ruby_curl_easy_ssl_verify_peer_set(VALUE self, VALUE ssl_verify_peer) {
1370
+ CURB_BOOLEAN_SETTER(ruby_curl_easy, ssl_verify_peer);
1371
+ }
1372
+
1373
+ /*
1374
+ * call-seq:
1375
+ * easy.ssl_verify_peer? => boolean
1376
+ *
1377
+ * Determine whether this Curl instance will verify the SSL peer
1378
+ * certificate.
1379
+ */
1380
+ static VALUE ruby_curl_easy_ssl_verify_peer_q(VALUE self) {
1381
+ CURB_BOOLEAN_GETTER(ruby_curl_easy, ssl_verify_peer);
1382
+ }
1383
+
1384
+ /*
1385
+ * call-seq:
1386
+ * easy.ssl_verify_host = boolean => boolean
1387
+ *
1388
+ * Configure whether this Curl instance will verify that the server cert
1389
+ * is for the server it is known as. When true (the default) the server
1390
+ * certificate must indicate that the server is the server to which you
1391
+ * meant to connect, or the connection fails. When false, the connection
1392
+ * will succeed regardless of the names in the certificate.
1393
+ *
1394
+ * this option controls is of the identity that the server claims.
1395
+ * The server could be lying. To control lying, see ssl_verify_peer? .
1396
+ */
1397
+ static VALUE ruby_curl_easy_ssl_verify_host_set(VALUE self, VALUE ssl_verify_host) {
1398
+ CURB_BOOLEAN_SETTER(ruby_curl_easy, ssl_verify_host);
1399
+ }
1400
+
1401
+ /*
1402
+ * call-seq:
1403
+ * easy.ssl_verify_host? => boolean
1404
+ *
1405
+ * Determine whether this Curl instance will verify that the server cert
1406
+ * is for the server it is known as.
1407
+ */
1408
+ static VALUE ruby_curl_easy_ssl_verify_host_q(VALUE self) {
1409
+ CURB_BOOLEAN_GETTER(ruby_curl_easy, ssl_verify_host);
1410
+ }
1411
+
1412
+ /*
1413
+ * call-seq:
1414
+ * easy.header_in_body = boolean => boolean
1415
+ *
1416
+ * Configure whether this Curl instance will return HTTP headers
1417
+ * combined with body data. If this option is set true, both header
1418
+ * and body data will go to +body_str+ (or the configured +on_body+ handler).
1419
+ */
1420
+ static VALUE ruby_curl_easy_header_in_body_set(VALUE self, VALUE header_in_body) {
1421
+ CURB_BOOLEAN_SETTER(ruby_curl_easy, header_in_body);
1422
+ }
1423
+
1424
+ /*
1425
+ * call-seq:
1426
+ * easy.header_in_body? => boolean
1427
+ *
1428
+ * Determine whether this Curl instance will verify the SSL peer
1429
+ * certificate.
1430
+ */
1431
+ static VALUE ruby_curl_easy_header_in_body_q(VALUE self) {
1432
+ CURB_BOOLEAN_GETTER(ruby_curl_easy, header_in_body);
1433
+ }
1434
+
1435
+ /*
1436
+ * call-seq:
1437
+ * easy.use_netrc = boolean => boolean
1438
+ *
1439
+ * Configure whether this Curl instance will use data from the user's
1440
+ * .netrc file for FTP connections.
1441
+ */
1442
+ static VALUE ruby_curl_easy_use_netrc_set(VALUE self, VALUE use_netrc) {
1443
+ CURB_BOOLEAN_SETTER(ruby_curl_easy, use_netrc);
1444
+ }
1445
+
1446
+ /*
1447
+ * call-seq:
1448
+ * easy.use_netrc? => boolean
1449
+ *
1450
+ * Determine whether this Curl instance will use data from the user's
1451
+ * .netrc file for FTP connections.
1452
+ */
1453
+ static VALUE ruby_curl_easy_use_netrc_q(VALUE self) {
1454
+ CURB_BOOLEAN_GETTER(ruby_curl_easy, use_netrc);
1455
+ }
1456
+
1457
+ /*
1458
+ * call-seq:
1459
+ * easy.follow_location = boolean => boolean
1460
+ *
1461
+ * Configure whether this Curl instance will follow Location: headers
1462
+ * in HTTP responses. Redirects will only be followed to the extent
1463
+ * specified by +max_redirects+.
1464
+ */
1465
+ static VALUE ruby_curl_easy_follow_location_set(VALUE self, VALUE follow_location) {
1466
+ CURB_BOOLEAN_SETTER(ruby_curl_easy, follow_location);
1467
+ }
1468
+ /*
1469
+ * call-seq:
1470
+ *
1471
+ * easy = Curl::Easy.new
1472
+ * easy.autoreferer=true
1473
+ */
1474
+ static VALUE ruby_curl_easy_autoreferer_set(VALUE self, VALUE autoreferer) {
1475
+ ruby_curl_easy *rbce;
1476
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
1477
+
1478
+ if (Qtrue == autoreferer) {
1479
+ curl_easy_setopt(rbce->curl, CURLOPT_AUTOREFERER, 1);
1480
+ }
1481
+ else {
1482
+ curl_easy_setopt(rbce->curl, CURLOPT_AUTOREFERER, 0);
1483
+ }
1484
+
1485
+ return autoreferer;
1486
+ }
1487
+
1488
+ /*
1489
+ * call-seq:
1490
+ * easy.follow_location? => boolean
1491
+ *
1492
+ * Determine whether this Curl instance will follow Location: headers
1493
+ * in HTTP responses.
1494
+ */
1495
+ static VALUE ruby_curl_easy_follow_location_q(VALUE self) {
1496
+ CURB_BOOLEAN_GETTER(ruby_curl_easy, follow_location);
1497
+ }
1498
+
1499
+ /*
1500
+ * call-seq:
1501
+ * easy.unrestricted_auth = boolean => boolean
1502
+ *
1503
+ * Configure whether this Curl instance may use any HTTP authentication
1504
+ * method available when necessary.
1505
+ */
1506
+ static VALUE ruby_curl_easy_unrestricted_auth_set(VALUE self, VALUE unrestricted_auth) {
1507
+ CURB_BOOLEAN_SETTER(ruby_curl_easy, unrestricted_auth);
1508
+ }
1509
+
1510
+ /*
1511
+ * call-seq:
1512
+ * easy.unrestricted_auth? => boolean
1513
+ *
1514
+ * Determine whether this Curl instance may use any HTTP authentication
1515
+ * method available when necessary.
1516
+ */
1517
+ static VALUE ruby_curl_easy_unrestricted_auth_q(VALUE self) {
1518
+ CURB_BOOLEAN_GETTER(ruby_curl_easy, unrestricted_auth);
1519
+ }
1520
+
1521
+ /*
1522
+ * call-seq:
1523
+ * easy.verbose = boolean => boolean
1524
+ *
1525
+ * Configure whether this Curl instance gives verbose output to STDERR
1526
+ * during transfers. Ignored if this instance has an on_debug handler.
1527
+ */
1528
+ static VALUE ruby_curl_easy_verbose_set(VALUE self, VALUE verbose) {
1529
+ CURB_BOOLEAN_SETTER(ruby_curl_easy, verbose);
1530
+ }
1531
+
1532
+ /*
1533
+ * call-seq:
1534
+ * easy.verbose? => boolean
1535
+ *
1536
+ * Determine whether this Curl instance gives verbose output to STDERR
1537
+ * during transfers.
1538
+ */
1539
+ static VALUE ruby_curl_easy_verbose_q(VALUE self) {
1540
+ CURB_BOOLEAN_GETTER(ruby_curl_easy, verbose);
1541
+ }
1542
+
1543
+ /*
1544
+ * call-seq:
1545
+ * easy.multipart_form_post = boolean => boolean
1546
+ *
1547
+ * Configure whether this Curl instance uses multipart/formdata content
1548
+ * type for HTTP POST requests. If this is false (the default), then the
1549
+ * application/x-www-form-urlencoded content type is used for the form
1550
+ * data.
1551
+ *
1552
+ * If this is set true, you must pass one or more PostField instances
1553
+ * to the http_post method - no support for posting multipart forms from
1554
+ * a string is provided.
1555
+ */
1556
+ static VALUE ruby_curl_easy_multipart_form_post_set(VALUE self, VALUE multipart_form_post)
1557
+ {
1558
+ CURB_BOOLEAN_SETTER(ruby_curl_easy, multipart_form_post);
1559
+ }
1560
+
1561
+ /*
1562
+ * call-seq:
1563
+ * easy.multipart_form_post? => boolean
1564
+ *
1565
+ * Determine whether this Curl instance uses multipart/formdata content
1566
+ * type for HTTP POST requests.
1567
+ */
1568
+ static VALUE ruby_curl_easy_multipart_form_post_q(VALUE self) {
1569
+ CURB_BOOLEAN_GETTER(ruby_curl_easy, multipart_form_post);
1570
+ }
1571
+
1572
+ /*
1573
+ * call-seq:
1574
+ * easy.enable_cookies = boolean => boolean
1575
+ *
1576
+ * Configure whether the libcurl cookie engine is enabled for this Curl::Easy
1577
+ * instance.
1578
+ */
1579
+ static VALUE ruby_curl_easy_enable_cookies_set(VALUE self, VALUE enable_cookies)
1580
+ {
1581
+ CURB_BOOLEAN_SETTER(ruby_curl_easy, enable_cookies);
1582
+ }
1583
+
1584
+ /*
1585
+ * call-seq:
1586
+ * easy.enable_cookies? => boolean
1587
+ *
1588
+ * Determine whether the libcurl cookie engine is enabled for this
1589
+ * Curl::Easy instance.
1590
+ */
1591
+ static VALUE ruby_curl_easy_enable_cookies_q(VALUE self) {
1592
+ CURB_BOOLEAN_GETTER(ruby_curl_easy, enable_cookies);
1593
+ }
1594
+
1595
+ /* ================= EVENT PROCS ================== */
1596
+
1597
+ /*
1598
+ * call-seq:
1599
+ * easy.on_body { |body_data| ... } => &lt;old handler&gt;
1600
+ *
1601
+ * Assign or remove the +on_body+ handler for this Curl::Easy instance.
1602
+ * To remove a previously-supplied handler, call this method with no
1603
+ * attached block.
1604
+ *
1605
+ * The +on_body+ handler is called for each chunk of response body passed back
1606
+ * by libcurl during +perform+. It should perform any processing necessary,
1607
+ * and return the actual number of bytes handled. Normally, this will
1608
+ * equal the length of the data string, and CURL will continue processing.
1609
+ * If the returned length does not equal the input length, CURL will abort
1610
+ * the processing with a Curl::Err::AbortedByCallbackError.
1611
+ */
1612
+ static VALUE ruby_curl_easy_on_body_set(int argc, VALUE *argv, VALUE self) {
1613
+ CURB_HANDLER_PROC_HSETTER(ruby_curl_easy, body_proc);
1614
+ }
1615
+
1616
+ /*
1617
+ * call-seq:
1618
+ * easy.on_success { |easy| ... } => &lt;old handler&gt;
1619
+ *
1620
+ * Assign or remove the +on_success+ handler for this Curl::Easy instance.
1621
+ * To remove a previously-supplied handler, call this method with no
1622
+ * attached block.
1623
+ *
1624
+ * The +on_success+ handler is called when the request is finished with a
1625
+ * status of 20x
1626
+ */
1627
+ static VALUE ruby_curl_easy_on_success_set(int argc, VALUE *argv, VALUE self) {
1628
+ CURB_HANDLER_PROC_HSETTER(ruby_curl_easy, success_proc);
1629
+ }
1630
+
1631
+ /*
1632
+ * call-seq:
1633
+ * easy.on_failure {|easy,code| ... } => &lt;old handler&gt;
1634
+ *
1635
+ * Assign or remove the +on_failure+ handler for this Curl::Easy instance.
1636
+ * To remove a previously-supplied handler, call this method with no
1637
+ * attached block.
1638
+ *
1639
+ * The +on_failure+ handler is called when the request is finished with a
1640
+ * status of 50x
1641
+ */
1642
+ static VALUE ruby_curl_easy_on_failure_set(int argc, VALUE *argv, VALUE self) {
1643
+ CURB_HANDLER_PROC_HSETTER(ruby_curl_easy, failure_proc);
1644
+ }
1645
+
1646
+ /*
1647
+ * call-seq:
1648
+ * easy.on_complete {|easy| ... } => &lt;old handler&gt;
1649
+ *
1650
+ * Assign or remove the +on_complete+ handler for this Curl::Easy instance.
1651
+ * To remove a previously-supplied handler, call this method with no
1652
+ * attached block.
1653
+ *
1654
+ * The +on_complete+ handler is called when the request is finished.
1655
+ */
1656
+ static VALUE ruby_curl_easy_on_complete_set(int argc, VALUE *argv, VALUE self) {
1657
+ CURB_HANDLER_PROC_HSETTER(ruby_curl_easy, complete_proc);
1658
+ }
1659
+
1660
+ /*
1661
+ * call-seq:
1662
+ * easy.on_header { |header_data| ... } => &lt;old handler&gt;
1663
+ *
1664
+ * Assign or remove the +on_header+ handler for this Curl::Easy instance.
1665
+ * To remove a previously-supplied handler, call this method with no
1666
+ * attached block.
1667
+ *
1668
+ * The +on_header+ handler is called for each chunk of response header passed
1669
+ * back by libcurl during +perform+. The semantics are the same as for the
1670
+ * block supplied to +on_body+.
1671
+ */
1672
+ static VALUE ruby_curl_easy_on_header_set(int argc, VALUE *argv, VALUE self) {
1673
+ CURB_HANDLER_PROC_HSETTER(ruby_curl_easy, header_proc);
1674
+ }
1675
+
1676
+ /*
1677
+ * call-seq:
1678
+ * easy.on_progress { |dl_total, dl_now, ul_total, ul_now| ... } => &lt;old handler&gt;
1679
+ *
1680
+ * Assign or remove the +on_progress+ handler for this Curl::Easy instance.
1681
+ * To remove a previously-supplied handler, call this method with no
1682
+ * attached block.
1683
+ *
1684
+ * The +on_progress+ handler is called regularly by libcurl (approximately once
1685
+ * per second) during transfers to allow the application to receive progress
1686
+ * information. There is no guarantee that the reported progress will change
1687
+ * between calls.
1688
+ *
1689
+ * The result of the block call determines whether libcurl continues the transfer.
1690
+ * Returning a non-true value (i.e. nil or false) will cause the transfer to abort,
1691
+ * throwing a Curl::Err::AbortedByCallbackError.
1692
+ */
1693
+ static VALUE ruby_curl_easy_on_progress_set(int argc, VALUE *argv, VALUE self) {
1694
+ CURB_HANDLER_PROC_HSETTER(ruby_curl_easy, progress_proc);
1695
+ }
1696
+
1697
+ /*
1698
+ * call-seq:
1699
+ * easy.on_debug { |type, data| ... } => &lt;old handler&gt;
1700
+ *
1701
+ * Assign or remove the +on_debug+ handler for this Curl::Easy instance.
1702
+ * To remove a previously-supplied handler, call this method with no
1703
+ * attached block.
1704
+ *
1705
+ * The +on_debug+ handler, if configured, will receive detailed information
1706
+ * from libcurl during the perform call. This can be useful for debugging.
1707
+ * Setting a debug handler overrides libcurl's internal handler, disabling
1708
+ * any output from +verbose+, if set.
1709
+ *
1710
+ * The type argument will match one of the Curl::Easy::CURLINFO_XXXX
1711
+ * constants, and specifies the kind of information contained in the
1712
+ * data. The data is passed as a String.
1713
+ */
1714
+ static VALUE ruby_curl_easy_on_debug_set(int argc, VALUE *argv, VALUE self) {
1715
+ CURB_HANDLER_PROC_HSETTER(ruby_curl_easy, debug_proc);
1716
+ }
1717
+
1718
+
1719
+ /* =================== PERFORM =====================*/
1720
+
1721
+ /***********************************************
1722
+ * This is an rb_iterate callback used to set up http headers.
1723
+ */
1724
+ static VALUE cb_each_http_header(VALUE header, struct curl_slist **list) {
1725
+ VALUE header_str = Qnil;
1726
+
1727
+ //rb_p(header);
1728
+
1729
+ if (rb_type(header) == T_ARRAY) {
1730
+ // we're processing a hash, header is [name, val]
1731
+ VALUE name, value;
1732
+
1733
+ name = rb_obj_as_string(rb_ary_entry(header, 0));
1734
+ value = rb_obj_as_string(rb_ary_entry(header, 1));
1735
+
1736
+ // This is a bit inefficient, but we don't want to be modifying
1737
+ // the actual values in the original hash.
1738
+ header_str = rb_str_plus(name, rb_str_new2(": "));
1739
+ header_str = rb_str_plus(header_str, value);
1740
+ } else {
1741
+ header_str = rb_obj_as_string(header);
1742
+ }
1743
+
1744
+ //rb_p(header_str);
1745
+
1746
+ *list = curl_slist_append(*list, StringValuePtr(header_str));
1747
+ return header_str;
1748
+ }
1749
+
1750
+ /***********************************************
1751
+ * This is an rb_iterate callback used to set up ftp commands.
1752
+ */
1753
+ static VALUE cb_each_ftp_command(VALUE ftp_command, struct curl_slist **list) {
1754
+ VALUE ftp_command_string = rb_obj_as_string(ftp_command);
1755
+ *list = curl_slist_append(*list, StringValuePtr(ftp_command));
1756
+
1757
+ return ftp_command_string;
1758
+ }
1759
+
1760
+ /***********************************************
1761
+ *
1762
+ * Setup a connection
1763
+ *
1764
+ * Always returns Qtrue, rb_raise on error.
1765
+ */
1766
+ VALUE ruby_curl_easy_setup( ruby_curl_easy *rbce ) {
1767
+ // TODO this could do with a bit of refactoring...
1768
+ CURL *curl;
1769
+ VALUE url, _url = rb_easy_get("url");
1770
+ struct curl_slist **hdrs = &(rbce->curl_headers);
1771
+ struct curl_slist **cmds = &(rbce->curl_ftp_commands);
1772
+
1773
+ curl = rbce->curl;
1774
+
1775
+ if (_url == Qnil) {
1776
+ rb_raise(eCurlErrError, "No URL supplied");
1777
+ }
1778
+
1779
+ url = rb_check_string_type(_url);
1780
+
1781
+ // Need to configure the handler as per settings in rbce
1782
+ curl_easy_setopt(curl, CURLOPT_URL, StringValuePtr(url));
1783
+
1784
+ // network stuff and auth
1785
+ if (!rb_easy_nil("interface_hm")) {
1786
+ curl_easy_setopt(curl, CURLOPT_INTERFACE, rb_easy_get_str("interface_hm"));
1787
+ } else {
1788
+ curl_easy_setopt(curl, CURLOPT_INTERFACE, NULL);
1789
+ }
1790
+
1791
+ #if HAVE_CURLOPT_USERNAME == 1 && HAVE_CURLOPT_PASSWORD == 1
1792
+ if (!rb_easy_nil("username")) {
1793
+ curl_easy_setopt(curl, CURLOPT_USERNAME, rb_easy_get_str("username"));
1794
+ } else {
1795
+ curl_easy_setopt(curl, CURLOPT_USERNAME, NULL);
1796
+ }
1797
+ if (!rb_easy_nil("password")) {
1798
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, rb_easy_get_str("password"));
1799
+ }
1800
+ else {
1801
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, NULL);
1802
+ }
1803
+ #endif
1804
+
1805
+ if (!rb_easy_nil("userpwd")) {
1806
+ curl_easy_setopt(curl, CURLOPT_USERPWD, rb_easy_get_str("userpwd"));
1807
+ #if HAVE_CURLOPT_USERNAME == 1
1808
+ } else if (rb_easy_nil("username") && rb_easy_nil("password")) { /* don't set this even to NULL if we have set username and password */
1809
+ #else
1810
+ } else {
1811
+ #endif
1812
+ curl_easy_setopt(curl, CURLOPT_USERPWD, NULL);
1813
+ }
1814
+
1815
+ if (!rb_easy_nil("proxy_url")) {
1816
+ curl_easy_setopt(curl, CURLOPT_PROXY, rb_easy_get_str("proxy_url"));
1817
+ } else {
1818
+ curl_easy_setopt(curl, CURLOPT_PROXY, NULL);
1819
+ }
1820
+
1821
+ if (!rb_easy_nil("proxypwd")) {
1822
+ curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, rb_easy_get_str("proxy_pwd"));
1823
+ } else {
1824
+ curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, NULL);
1825
+ }
1826
+
1827
+ // body/header procs
1828
+ if (!rb_easy_nil("body_proc")) {
1829
+ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, (curl_write_callback)&proc_data_handler);
1830
+ curl_easy_setopt(curl, CURLOPT_WRITEDATA, rb_easy_get("body_proc"));//rbce->body_proc);
1831
+ /* clear out the body_data if it was set */
1832
+ rb_easy_del("body_data");
1833
+ } else {
1834
+ VALUE body_buffer = rb_easy_set("body_data", rb_str_buf_new(32768));
1835
+ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, (curl_write_callback)&default_data_handler);
1836
+ curl_easy_setopt(curl, CURLOPT_WRITEDATA, body_buffer);
1837
+ }
1838
+
1839
+ if (!rb_easy_nil("header_proc")) {
1840
+ curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, (curl_write_callback)&proc_data_handler);
1841
+ curl_easy_setopt(curl, CURLOPT_HEADERDATA, rb_easy_get("header_proc"));
1842
+ /* clear out the header_data if it was set */
1843
+ rb_easy_del("header_data");
1844
+ } else {
1845
+ VALUE header_buffer = rb_easy_set("header_data", rb_str_buf_new(16384));
1846
+ curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, (curl_write_callback)&default_data_handler);
1847
+ curl_easy_setopt(curl, CURLOPT_HEADERDATA, header_buffer);
1848
+ }
1849
+
1850
+ /* encoding */
1851
+ if (!rb_easy_nil("encoding")) {
1852
+ curl_easy_setopt(curl, CURLOPT_ENCODING, rb_easy_get_str("encoding"));
1853
+ }
1854
+
1855
+ // progress and debug procs
1856
+ if (!rb_easy_nil("progress_proc")) {
1857
+ curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, (curl_progress_callback)&proc_progress_handler);
1858
+ curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, rb_easy_get("progress_proc"));
1859
+ curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
1860
+ } else {
1861
+ curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
1862
+ }
1863
+
1864
+ if (!rb_easy_nil("debug_proc")) {
1865
+ curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, (curl_debug_callback)&proc_debug_handler);
1866
+ curl_easy_setopt(curl, CURLOPT_DEBUGDATA, rb_easy_get("debug_proc"));
1867
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
1868
+ } else {
1869
+ // have to remove handler to re-enable standard verbosity
1870
+ curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, NULL);
1871
+ curl_easy_setopt(curl, CURLOPT_DEBUGDATA, NULL);
1872
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, rbce->verbose);
1873
+ }
1874
+
1875
+ /* general opts */
1876
+
1877
+ curl_easy_setopt(curl, CURLOPT_HEADER, rbce->header_in_body);
1878
+ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, rbce->follow_location);
1879
+ curl_easy_setopt(curl, CURLOPT_MAXREDIRS, rbce->max_redirs);
1880
+
1881
+ curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, rbce->proxy_tunnel);
1882
+ curl_easy_setopt(curl, CURLOPT_FILETIME, rbce->fetch_file_time);
1883
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, rbce->ssl_verify_peer);
1884
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, rbce->ssl_verify_peer);
1885
+
1886
+ if ((rbce->use_netrc != Qnil) && (rbce->use_netrc != Qfalse)) {
1887
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, CURL_NETRC_OPTIONAL);
1888
+ } else {
1889
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, CURL_NETRC_IGNORED);
1890
+ }
1891
+
1892
+ curl_easy_setopt(curl, CURLOPT_UNRESTRICTED_AUTH, rbce->unrestricted_auth);
1893
+
1894
+ curl_easy_setopt(curl, CURLOPT_TIMEOUT, rbce->timeout);
1895
+ curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, rbce->connect_timeout);
1896
+ curl_easy_setopt(curl, CURLOPT_DNS_CACHE_TIMEOUT, rbce->dns_cache_timeout);
1897
+
1898
+ #if LIBCURL_VERSION_NUM >= 0x070a08
1899
+ curl_easy_setopt(curl, CURLOPT_FTP_RESPONSE_TIMEOUT, rbce->ftp_response_timeout);
1900
+ #else
1901
+ if (rbce->ftp_response_timeout > 0) {
1902
+ rb_warn("Installed libcurl is too old to support ftp_response_timeout");
1903
+ }
1904
+ #endif
1905
+
1906
+ // Set up localport / proxy port
1907
+ // FIXME these won't get returned to default if they're unset Ruby
1908
+ if (rbce->proxy_port > 0) {
1909
+ curl_easy_setopt(curl, CURLOPT_PROXYPORT, rbce->proxy_port);
1910
+ }
1911
+
1912
+ if (rbce->local_port > 0) {
1913
+ #if LIBCURL_VERSION_NUM >= 0x070f02
1914
+ curl_easy_setopt(curl, CURLOPT_LOCALPORT, rbce->local_port);
1915
+
1916
+ if (rbce->local_port_range > 0) {
1917
+ curl_easy_setopt(curl, CURLOPT_LOCALPORTRANGE, rbce->local_port_range);
1918
+ }
1919
+ #else
1920
+ rb_warn("Installed libcurl is too old to support local_port");
1921
+ #endif
1922
+ }
1923
+
1924
+ if (rbce->proxy_type != -1) {
1925
+ #if LIBCURL_VERSION_NUM >= 0x070a00
1926
+ if (rbce->proxy_type == -2) {
1927
+ rb_warn("Installed libcurl is too old to support the selected proxy type");
1928
+ } else {
1929
+ curl_easy_setopt(curl, CURLOPT_PROXYTYPE, rbce->proxy_type);
1930
+ }
1931
+ } else {
1932
+ curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
1933
+ #else
1934
+ rb_warn("Installed libcurl is too old to support proxy_type");
1935
+ #endif
1936
+ }
1937
+
1938
+ if (rbce->http_auth_types > 0) {
1939
+ #if LIBCURL_VERSION_NUM >= 0x070a06
1940
+ curl_easy_setopt(curl, CURLOPT_HTTPAUTH, rbce->http_auth_types);
1941
+ } else {
1942
+ curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
1943
+ #else
1944
+ rb_warn("Installed libcurl is too old to support http_auth_types");
1945
+ #endif
1946
+ }
1947
+
1948
+ if (rbce->proxy_auth_types > 0) {
1949
+ #if LIBCURL_VERSION_NUM >= 0x070a07
1950
+ curl_easy_setopt(curl, CURLOPT_PROXYAUTH, rbce->proxy_auth_types);
1951
+ } else {
1952
+ curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
1953
+ #else
1954
+ rb_warn("Installed libcurl is too old to support proxy_auth_types");
1955
+ #endif
1956
+ }
1957
+
1958
+ /* Set up HTTP cookie handling if necessary
1959
+ FIXME this may not get disabled if it's enabled, the disabled again from ruby.
1960
+ */
1961
+ if (rbce->enable_cookies) {
1962
+ if (!rb_easy_nil("cookiejar")) {
1963
+ curl_easy_setopt(curl, CURLOPT_COOKIEJAR, rb_easy_get_str("cookiejar"));
1964
+ }
1965
+
1966
+ if (!rb_easy_nil("cookiefile")) {
1967
+ curl_easy_setopt(curl, CURLOPT_COOKIEFILE, rb_easy_get_str("cookiefile"));
1968
+ } else {
1969
+ curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* "" = magic to just enable */
1970
+ }
1971
+ }
1972
+
1973
+ if (!rb_easy_nil("cookies")) {
1974
+ curl_easy_setopt(curl, CURLOPT_COOKIE, rb_easy_get_str("cookies"));
1975
+ }
1976
+
1977
+ /* Set up HTTPS cert handling if necessary */
1978
+ if (!rb_easy_nil("cert")) {
1979
+ curl_easy_setopt(curl, CURLOPT_SSLCERTTYPE, rb_easy_get_str("certtype"));
1980
+ curl_easy_setopt(curl, CURLOPT_SSLCERT, rb_easy_get_str("cert"));
1981
+ if (!rb_easy_nil("certpassword")) {
1982
+ curl_easy_setopt(curl, CURLOPT_SSLCERTPASSWD, rb_easy_get_str("certpassword"));
1983
+ }
1984
+ if (!rb_easy_nil("cert_key")) {
1985
+ curl_easy_setopt(curl, CURLOPT_SSLKEY, rb_easy_get_str("cert_key"));
1986
+ }
1987
+ }
1988
+ if (!rb_easy_nil("cacert")) {
1989
+ #ifdef HAVE_CURL_CONFIG_CA
1990
+ curl_easy_setopt(curl, CURLOPT_CAINFO, CURL_CONFIG_CA);
1991
+ #else
1992
+ curl_easy_setopt(curl, CURLOPT_CAINFO, "/usr/local/share/curl/curl-ca-bundle.crt");
1993
+ #endif
1994
+ }
1995
+
1996
+ #ifdef CURL_VERSION_SSL
1997
+ if (rbce->ssl_version > 0) {
1998
+ curl_easy_setopt(curl, CURLOPT_SSLVERSION, rbce->ssl_version);
1999
+ }
2000
+
2001
+ if (rbce->use_ssl > 0) {
2002
+ curl_easy_setopt(curl, CURB_FTPSSL, rbce->use_ssl);
2003
+ }
2004
+ #else
2005
+ if (rbce->ssl_version > 0 || rbce->use_ssl > 0) {
2006
+ rb_warn("libcurl is not configured with SSL support");
2007
+ }
2008
+ #endif
2009
+
2010
+ if (rbce->ftp_filemethod > 0) {
2011
+ curl_easy_setopt(curl, CURLOPT_FTP_FILEMETHOD, rbce->ftp_filemethod);
2012
+ }
2013
+
2014
+ /* Set the user-agent string if specified */
2015
+ if (!rb_easy_nil("useragent")) {
2016
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, rb_easy_get_str("useragent"));
2017
+ }
2018
+
2019
+ /* Setup HTTP headers if necessary */
2020
+ curl_easy_setopt(curl, CURLOPT_HTTPHEADER, NULL); // XXX: maybe we shouldn't be clearing this?
2021
+
2022
+ if (!rb_easy_nil("headers")) {
2023
+ if (rb_easy_type_check("headers", T_ARRAY) || rb_easy_type_check("headers", T_HASH)) {
2024
+ rb_iterate(rb_each, rb_easy_get("headers"), cb_each_http_header, (VALUE)hdrs);
2025
+ } else {
2026
+ VALUE headers_str = rb_obj_as_string(rb_easy_get("headers"));
2027
+ *hdrs = curl_slist_append(*hdrs, StringValuePtr(headers_str));
2028
+ }
2029
+
2030
+ if (*hdrs) {
2031
+ curl_easy_setopt(curl, CURLOPT_HTTPHEADER, *hdrs);
2032
+ }
2033
+ }
2034
+
2035
+ /* Setup FTP commands if necessary */
2036
+ if (!rb_easy_nil("ftp_commands")) {
2037
+ if (rb_easy_type_check("ftp_commands", T_ARRAY)) {
2038
+ rb_iterate(rb_each, rb_easy_get("ftp_commands"), cb_each_ftp_command, (VALUE)cmds);
2039
+ }
2040
+
2041
+ if (*cmds) {
2042
+ curl_easy_setopt(curl, CURLOPT_QUOTE, *cmds);
2043
+ }
2044
+ }
2045
+
2046
+ return Qnil;
2047
+ }
2048
+ /***********************************************
2049
+ *
2050
+ * Clean up a connection
2051
+ *
2052
+ * Always returns Qtrue.
2053
+ */
2054
+ VALUE ruby_curl_easy_cleanup( VALUE self, ruby_curl_easy *rbce ) {
2055
+
2056
+ CURL *curl = rbce->curl;
2057
+ struct curl_slist *headers = rbce->curl_headers;
2058
+ // Free everything up
2059
+ if (headers) {
2060
+ curl_slist_free_all(headers);
2061
+ rbce->curl_headers = NULL;
2062
+ }
2063
+
2064
+ struct curl_slist *ftp_commands = rbce->curl_ftp_commands;
2065
+ if (ftp_commands) {
2066
+ curl_slist_free_all(ftp_commands);
2067
+ rbce->curl_ftp_commands = NULL;
2068
+ }
2069
+
2070
+ // clean up a PUT request's curl options.
2071
+ if (!rb_easy_nil("upload")) {
2072
+ rb_easy_del("upload"); // set the upload object to Qnil to let the GC clean up
2073
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 0);
2074
+ curl_easy_setopt(curl, CURLOPT_READFUNCTION, NULL);
2075
+ curl_easy_setopt(curl, CURLOPT_READDATA, NULL);
2076
+ curl_easy_setopt(curl, CURLOPT_INFILESIZE, 0);
2077
+ }
2078
+
2079
+ return Qnil;
2080
+ }
2081
+
2082
+ /***********************************************
2083
+ *
2084
+ * This is the main worker for the perform methods (get, post, head, put).
2085
+ * It's not surfaced as a Ruby method - instead, the individual request
2086
+ * methods are responsible for setting up stuff specific to that type,
2087
+ * then calling this to handle common stuff and do the perform.
2088
+ *
2089
+ * Always returns Qtrue, rb_raise on error.
2090
+ *
2091
+ */
2092
+ static VALUE handle_perform(VALUE self, ruby_curl_easy *rbce) {
2093
+
2094
+ VALUE ret;
2095
+
2096
+ /* reuse existing multi handle for this easy handle */
2097
+ if (NIL_P(rbce->multi)) {
2098
+ rbce->multi = ruby_curl_multi_new(cCurlMulti);
2099
+ }
2100
+ rb_funcall(rbce->multi, rb_intern("add"), 1, self );
2101
+ ret = rb_funcall(rbce->multi, rb_intern("perform"), 0);
2102
+
2103
+ /* check for errors in the easy response and raise exceptions if anything went wrong and their is no on_failure handler */
2104
+ if (rbce->last_result != 0 && rb_easy_nil("failure_proc")) {
2105
+ raise_curl_easy_error_exception(rbce->last_result);
2106
+ }
2107
+
2108
+ return ret;
2109
+ }
2110
+
2111
+ /*
2112
+ * call-seq:
2113
+ * easy.http_get => true
2114
+ *
2115
+ * GET the currently configured URL using the current options set for
2116
+ * this Curl::Easy instance. This method always returns true, or raises
2117
+ * an exception (defined under Curl::Err) on error.
2118
+ */
2119
+ static VALUE ruby_curl_easy_perform_get(VALUE self) {
2120
+ ruby_curl_easy *rbce;
2121
+ CURL *curl;
2122
+
2123
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2124
+ curl = rbce->curl;
2125
+
2126
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, NULL);
2127
+ curl_easy_setopt(curl, CURLOPT_HTTPGET, 1);
2128
+
2129
+ return handle_perform(self,rbce);
2130
+ }
2131
+
2132
+ /*
2133
+ * Common implementation of easy.http(verb) and easy.http_delete
2134
+ */
2135
+ static VALUE ruby_curl_easy_perform_verb_str(VALUE self, char *verb) {
2136
+ ruby_curl_easy *rbce;
2137
+ CURL *curl;
2138
+ VALUE retval;
2139
+
2140
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2141
+ curl = rbce->curl;
2142
+
2143
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, verb);
2144
+
2145
+ retval = handle_perform(self,rbce);
2146
+
2147
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, NULL);
2148
+
2149
+ return retval;
2150
+ }
2151
+
2152
+ /*
2153
+ * call-seq:
2154
+ * easy.http_delete
2155
+ *
2156
+ * DELETE the currently configured URL using the current options set for
2157
+ * this Curl::Easy instance. This method always returns true, or raises
2158
+ * an exception (defined under Curl::Err) on error.
2159
+ */
2160
+ static VALUE ruby_curl_easy_perform_delete(VALUE self) {
2161
+ return ruby_curl_easy_perform_verb_str(self, "DELETE");
2162
+ }
2163
+
2164
+ /*
2165
+ * call-seq:
2166
+ * easy.http(verb)
2167
+ *
2168
+ * Send an HTTP request with method set to verb, using the current options set for this Curl::Easy instance.
2169
+ * This method always returns true or raises an exception (defined under Curl::Err) on error.
2170
+ */
2171
+ static VALUE ruby_curl_easy_perform_verb(VALUE self, VALUE verb) {
2172
+ VALUE str_verb;
2173
+ if (rb_type(verb) == T_STRING) {
2174
+ return ruby_curl_easy_perform_verb_str(self, RSTRING_PTR(verb));
2175
+ }
2176
+ else if (rb_respond_to(verb,rb_intern("to_s"))) {
2177
+ str_verb = rb_funcall(verb, rb_intern("to_s"), 0);
2178
+ return ruby_curl_easy_perform_verb_str(self, RSTRING_PTR(str_verb));
2179
+ }
2180
+ else {
2181
+ rb_raise(rb_eRuntimeError, "Invalid HTTP VERB, must response to 'to_s'");
2182
+ }
2183
+ }
2184
+
2185
+ /*
2186
+ * call-seq:
2187
+ * easy.perform => true
2188
+ *
2189
+ * Transfer the currently configured URL using the options set for this
2190
+ * Curl::Easy instance. If this is an HTTP URL, it will be transferred via
2191
+ * the GET or HEAD request method.
2192
+ */
2193
+ static VALUE ruby_curl_easy_perform(VALUE self) {
2194
+ ruby_curl_easy *rbce;
2195
+
2196
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2197
+
2198
+ return handle_perform(self,rbce);
2199
+ }
2200
+
2201
+ /*
2202
+ * call-seq:
2203
+ * easy.http_post("url=encoded%20form%20data;and=so%20on") => true
2204
+ * easy.http_post("url=encoded%20form%20data", "and=so%20on", ...) => true
2205
+ * easy.http_post("url=encoded%20form%20data", Curl::PostField, "and=so%20on", ...) => true
2206
+ * easy.http_post(Curl::PostField, Curl::PostField ..., Curl::PostField) => true
2207
+ *
2208
+ * POST the specified formdata to the currently configured URL using
2209
+ * the current options set for this Curl::Easy instance. This method
2210
+ * always returns true, or raises an exception (defined under
2211
+ * Curl::Err) on error.
2212
+ *
2213
+ * The Content-type of the POST is determined by the current setting
2214
+ * of multipart_form_post? , according to the following rules:
2215
+ * * When false (the default): the form will be POSTed with a
2216
+ * content-type of 'application/x-www-form-urlencoded', and any of the
2217
+ * four calling forms may be used.
2218
+ * * When true: the form will be POSTed with a content-type of
2219
+ * 'multipart/formdata'. Only the last calling form may be used,
2220
+ * i.e. only PostField instances may be POSTed. In this mode,
2221
+ * individual fields' content-types are recognised, and file upload
2222
+ * fields are supported.
2223
+ *
2224
+ */
2225
+ static VALUE ruby_curl_easy_perform_post(int argc, VALUE *argv, VALUE self) {
2226
+ ruby_curl_easy *rbce;
2227
+ CURL *curl;
2228
+ int i;
2229
+ VALUE args_ary;
2230
+
2231
+ rb_scan_args(argc, argv, "*", &args_ary);
2232
+
2233
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2234
+ curl = rbce->curl;
2235
+
2236
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, NULL);
2237
+
2238
+ if (rbce->multipart_form_post) {
2239
+ VALUE ret;
2240
+ struct curl_httppost *first = NULL, *last = NULL;
2241
+
2242
+ // Make the multipart form
2243
+ for (i = 0; i < argc; i++) {
2244
+ if (rb_obj_is_instance_of(argv[i], cCurlPostField)) {
2245
+ append_to_form(argv[i], &first, &last);
2246
+ } else {
2247
+ rb_raise(eCurlErrInvalidPostField, "You must use PostFields only with multipart form posts");
2248
+ return Qnil;
2249
+ }
2250
+ }
2251
+
2252
+ curl_easy_setopt(curl, CURLOPT_POST, 0);
2253
+ curl_easy_setopt(curl, CURLOPT_HTTPPOST, first);
2254
+ ret = handle_perform(self,rbce);
2255
+ curl_formfree(first);
2256
+
2257
+ return ret;
2258
+ } else {
2259
+ VALUE post_body = Qnil;
2260
+ /* TODO: check for PostField.file and raise error before to_s fails */
2261
+ if ((post_body = rb_funcall(args_ary, idJoin, 1, rbstrAmp)) == Qnil) {
2262
+ rb_raise(eCurlErrError, "Failed to join arguments");
2263
+ return Qnil;
2264
+ } else {
2265
+ /* if the function call above returns an empty string because no additional arguments were passed this makes sure
2266
+ a previously set easy.post_body = "arg=foo&bar=bin" will be honored */
2267
+ if( post_body != Qnil && rb_type(post_body) == T_STRING && RSTRING_LEN(post_body) > 0 ) {
2268
+ ruby_curl_easy_post_body_set(self, post_body);
2269
+ }
2270
+
2271
+ /* if post body is not defined, set it so we enable POST header, even though the request body is empty */
2272
+ if( rb_easy_nil("postdata_buffer") ) {
2273
+ ruby_curl_easy_post_body_set(self, post_body);
2274
+ }
2275
+
2276
+ return handle_perform(self,rbce);
2277
+ }
2278
+ }
2279
+ }
2280
+
2281
+ /*
2282
+ * call-seq:
2283
+ * easy.http_head => true
2284
+ *
2285
+ * Request headers from the currently configured URL using the HEAD
2286
+ * method and current options set for this Curl::Easy instance. This
2287
+ * method always returns true, or raises an exception (defined under
2288
+ * Curl::Err) on error.
2289
+ *
2290
+ */
2291
+ static VALUE ruby_curl_easy_perform_head(VALUE self) {
2292
+ ruby_curl_easy *rbce;
2293
+ CURL *curl;
2294
+ VALUE ret;
2295
+
2296
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2297
+ curl = rbce->curl;
2298
+
2299
+ curl_easy_setopt(curl, CURLOPT_NOBODY, 1);
2300
+
2301
+ ret = handle_perform(self,rbce);
2302
+
2303
+ curl_easy_setopt(curl, CURLOPT_NOBODY, 0);
2304
+ return ret;
2305
+ }
2306
+
2307
+ /*
2308
+ *call-seq:
2309
+ * easy = Curl::Easy.new("url") do|c|
2310
+ * c.head = true
2311
+ * end
2312
+ * easy.perform
2313
+ */
2314
+ static VALUE ruby_curl_easy_set_head_option(VALUE self, VALUE onoff) {
2315
+ ruby_curl_easy *rbce;
2316
+
2317
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2318
+
2319
+ if( onoff == Qtrue ) {
2320
+ curl_easy_setopt(rbce->curl, CURLOPT_NOBODY, 1);
2321
+ }
2322
+ else {
2323
+ curl_easy_setopt(rbce->curl, CURLOPT_NOBODY, 0);
2324
+ }
2325
+
2326
+ return onoff;
2327
+ }
2328
+ /*
2329
+ *call-seq:
2330
+ *
2331
+ * easy = Curl::Easy.new("url")
2332
+ * easy.version = Curl::HTTP_1_1
2333
+ * easy.version = Curl::HTTP_1_0
2334
+ * easy.version = Curl::HTTP_NONE
2335
+ *
2336
+ */
2337
+ static VALUE ruby_curl_easy_set_version(VALUE self, VALUE version) {
2338
+ ruby_curl_easy *rbce;
2339
+ //fprintf(stderr,"CURL_HTTP_VERSION_1_1: %d, CURL_HTTP_VERSION_1_0: %d, CURL_HTTP_VERSION_NONE: %d\n", CURL_HTTP_VERSION_1_1, CURL_HTTP_VERSION_1_0, CURL_HTTP_VERSION_NONE);
2340
+
2341
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2342
+
2343
+ curl_easy_setopt(rbce->curl, CURLOPT_HTTP_VERSION, FIX2INT(version));
2344
+
2345
+ return version;
2346
+ }
2347
+ /*
2348
+ * call-seq:
2349
+ *
2350
+ * easy = Curl::Easy.new
2351
+ * easy.nosignal = true
2352
+ */
2353
+ static VALUE ruby_curl_easy_set_nosignal(VALUE self, VALUE onoff) {
2354
+ ruby_curl_easy *rbce;
2355
+
2356
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2357
+
2358
+ curl_easy_setopt(rbce->curl, CURLOPT_NOSIGNAL, (Qtrue == onoff) ? 1 : 0);
2359
+
2360
+ return onoff;
2361
+ }
2362
+ /*
2363
+ *call-seq:
2364
+ * easy = Curl::Easy.new("url") do|c|
2365
+ * c.delete = true
2366
+ * end
2367
+ * easy.perform
2368
+ */
2369
+ static VALUE ruby_curl_easy_set_delete_option(VALUE self, VALUE onoff) {
2370
+ ruby_curl_easy *rbce;
2371
+
2372
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2373
+
2374
+ if( onoff == Qtrue ) {
2375
+ curl_easy_setopt(rbce->curl, CURLOPT_CUSTOMREQUEST, "DELETE");
2376
+ }
2377
+ else {
2378
+ curl_easy_setopt(rbce->curl, CURLOPT_CUSTOMREQUEST, NULL);
2379
+ }
2380
+
2381
+ return onoff;
2382
+ }
2383
+
2384
+ /*
2385
+ * call-seq:
2386
+ * easy.http_put(data) => true
2387
+ *
2388
+ * PUT the supplied data to the currently configured URL using the
2389
+ * current options set for this Curl::Easy instance. This method always
2390
+ * returns true, or raises an exception (defined under Curl::Err) on error.
2391
+ */
2392
+ static VALUE ruby_curl_easy_perform_put(VALUE self, VALUE data) {
2393
+ ruby_curl_easy *rbce;
2394
+ CURL *curl;
2395
+
2396
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2397
+ curl = rbce->curl;
2398
+
2399
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, NULL);
2400
+ ruby_curl_easy_put_data_set(self, data);
2401
+
2402
+ return handle_perform(self, rbce);
2403
+ }
2404
+
2405
+ /*
2406
+ * call-seq:
2407
+ * Curl::Easy.http_put(url, data) {|c| ... }
2408
+ *
2409
+ * see easy.http_put
2410
+ */
2411
+ static VALUE ruby_curl_easy_class_perform_put(VALUE klass, VALUE url, VALUE data) {
2412
+ VALUE c = ruby_curl_easy_new(1, &url, klass);
2413
+ ruby_curl_easy_perform_put(c, data);
2414
+ return c;
2415
+ }
2416
+
2417
+ /* =================== DATA FUNCS =============== */
2418
+
2419
+ /*
2420
+ * call-seq:
2421
+ * easy.body_str => "response body"
2422
+ *
2423
+ * Return the response body from the previous call to +perform+. This
2424
+ * is populated by the default +on_body+ handler - if you supply
2425
+ * your own body handler, this string will be empty.
2426
+ */
2427
+ static VALUE ruby_curl_easy_body_str_get(VALUE self) {
2428
+ CURB_OBJECT_HGETTER(ruby_curl_easy, body_data);
2429
+ }
2430
+
2431
+ /*
2432
+ * call-seq:
2433
+ * easy.header_str => "response header"
2434
+ *
2435
+ * Return the response header from the previous call to +perform+. This
2436
+ * is populated by the default +on_header+ handler - if you supply
2437
+ * your own header handler, this string will be empty.
2438
+ */
2439
+ static VALUE ruby_curl_easy_header_str_get(VALUE self) {
2440
+ CURB_OBJECT_HGETTER(ruby_curl_easy, header_data);
2441
+ }
2442
+
2443
+
2444
+ /* ============== LASTCONN INFO FUNCS ============ */
2445
+
2446
+ /*
2447
+ * call-seq:
2448
+ * easy.last_effective_url => "http://some.url" or nil
2449
+ *
2450
+ * Retrieve the last effective URL used by this instance.
2451
+ * This is the URL used in the last +perform+ call,
2452
+ * and may differ from the value of easy.url.
2453
+ */
2454
+ static VALUE ruby_curl_easy_last_effective_url_get(VALUE self) {
2455
+ ruby_curl_easy *rbce;
2456
+ char* url;
2457
+
2458
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2459
+ curl_easy_getinfo(rbce->curl, CURLINFO_EFFECTIVE_URL, &url);
2460
+
2461
+ if (url && url[0]) { // curl returns empty string if none
2462
+ return rb_str_new2(url);
2463
+ } else {
2464
+ return Qnil;
2465
+ }
2466
+ }
2467
+
2468
+ /*
2469
+ * call-seq:
2470
+ * easy.response_code => fixnum
2471
+ *
2472
+ * Retrieve the last received HTTP or FTP code. This will be zero
2473
+ * if no server response code has been received. Note that a proxy's
2474
+ * CONNECT response should be read with +http_connect_code+
2475
+ * and not this method.
2476
+ */
2477
+ static VALUE ruby_curl_easy_response_code_get(VALUE self) {
2478
+ ruby_curl_easy *rbce;
2479
+ long code;
2480
+
2481
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2482
+ #ifdef HAVE_CURLINFO_RESPONSE_CODE
2483
+ curl_easy_getinfo(rbce->curl, CURLINFO_RESPONSE_CODE, &code);
2484
+ #else
2485
+ // old libcurl
2486
+ curl_easy_getinfo(rbce->curl, CURLINFO_HTTP_CODE, &code);
2487
+ #endif
2488
+
2489
+ return LONG2NUM(code);
2490
+ }
2491
+
2492
+ #if defined(HAVE_CURLINFO_PRIMARY_IP)
2493
+ /*
2494
+ * call-seq:
2495
+ * easy.primary_ip => "xx.xx.xx.xx" or nil
2496
+ *
2497
+ * Retrieve the resolved IP of the most recent connection
2498
+ * done with this curl handle. This string may be IPv6 if
2499
+ * that's enabled. This feature requires curl 7.19.x and above
2500
+ */
2501
+ static VALUE ruby_curl_easy_primary_ip_get(VALUE self) {
2502
+ ruby_curl_easy *rbce;
2503
+ char* ip;
2504
+
2505
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2506
+ curl_easy_getinfo(rbce->curl, CURLINFO_PRIMARY_IP, &ip);
2507
+
2508
+ if (ip && ip[0]) { // curl returns empty string if none
2509
+ return rb_str_new2(ip);
2510
+ } else {
2511
+ return Qnil;
2512
+ }
2513
+ }
2514
+ #endif
2515
+
2516
+ /*
2517
+ * call-seq:
2518
+ * easy.http_connect_code => fixnum
2519
+ *
2520
+ * Retrieve the last received proxy response code to a CONNECT request.
2521
+ */
2522
+ static VALUE ruby_curl_easy_http_connect_code_get(VALUE self) {
2523
+ ruby_curl_easy *rbce;
2524
+ long code;
2525
+
2526
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2527
+ curl_easy_getinfo(rbce->curl, CURLINFO_HTTP_CONNECTCODE, &code);
2528
+
2529
+ return LONG2NUM(code);
2530
+ }
2531
+
2532
+ /*
2533
+ * call-seq:
2534
+ * easy.file_time => fixnum
2535
+ *
2536
+ * Retrieve the remote time of the retrieved document (in number of
2537
+ * seconds since 1 jan 1970 in the GMT/UTC time zone). If you get -1,
2538
+ * it can be because of many reasons (unknown, the server hides it
2539
+ * or the server doesn't support the command that tells document time
2540
+ * etc) and the time of the document is unknown.
2541
+ *
2542
+ * Note that you must tell the server to collect this information
2543
+ * before the transfer is made, by setting +fetch_file_time?+ to true,
2544
+ * or you will unconditionally get a -1 back.
2545
+ *
2546
+ * This requires libcurl 7.5 or higher - otherwise -1 is unconditionally
2547
+ * returned.
2548
+ */
2549
+ static VALUE ruby_curl_easy_file_time_get(VALUE self) {
2550
+ #ifdef HAVE_CURLINFO_FILETIME
2551
+ ruby_curl_easy *rbce;
2552
+ long time;
2553
+
2554
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2555
+ curl_easy_getinfo(rbce->curl, CURLINFO_FILETIME, &time);
2556
+
2557
+ return LONG2NUM(time);
2558
+ #else
2559
+ rb_warn("Installed libcurl is too old to support file_time");
2560
+ return INT2FIX(0);
2561
+ #endif
2562
+ }
2563
+
2564
+ /*
2565
+ * call-seq:
2566
+ * easy.total_time => float
2567
+ *
2568
+ * Retrieve the total time in seconds for the previous transfer,
2569
+ * including name resolving, TCP connect etc.
2570
+ */
2571
+ static VALUE ruby_curl_easy_total_time_get(VALUE self) {
2572
+ ruby_curl_easy *rbce;
2573
+ double time;
2574
+
2575
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2576
+ curl_easy_getinfo(rbce->curl, CURLINFO_TOTAL_TIME, &time);
2577
+
2578
+ return rb_float_new(time);
2579
+ }
2580
+
2581
+ /*
2582
+ * call-seq:
2583
+ * easy.name_lookup_time => float
2584
+ *
2585
+ * Retrieve the time, in seconds, it took from the start until the
2586
+ * name resolving was completed.
2587
+ */
2588
+ static VALUE ruby_curl_easy_name_lookup_time_get(VALUE self) {
2589
+ ruby_curl_easy *rbce;
2590
+ double time;
2591
+
2592
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2593
+ curl_easy_getinfo(rbce->curl, CURLINFO_NAMELOOKUP_TIME, &time);
2594
+
2595
+ return rb_float_new(time);
2596
+ }
2597
+
2598
+ /*
2599
+ * call-seq:
2600
+ * easy.connect_time => float
2601
+ *
2602
+ * Retrieve the time, in seconds, it took from the start until the
2603
+ * connect to the remote host (or proxy) was completed.
2604
+ */
2605
+ static VALUE ruby_curl_easy_connect_time_get(VALUE self) {
2606
+ ruby_curl_easy *rbce;
2607
+ double time;
2608
+
2609
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2610
+ curl_easy_getinfo(rbce->curl, CURLINFO_CONNECT_TIME, &time);
2611
+
2612
+ return rb_float_new(time);
2613
+ }
2614
+
2615
+ /*
2616
+ * call-seq:
2617
+ * easy.pre_transfer_time => float
2618
+ *
2619
+ * Retrieve the time, in seconds, it took from the start until the
2620
+ * file transfer is just about to begin. This includes all pre-transfer
2621
+ * commands and negotiations that are specific to the particular protocol(s)
2622
+ * involved.
2623
+ */
2624
+ static VALUE ruby_curl_easy_pre_transfer_time_get(VALUE self) {
2625
+ ruby_curl_easy *rbce;
2626
+ double time;
2627
+
2628
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2629
+ curl_easy_getinfo(rbce->curl, CURLINFO_PRETRANSFER_TIME, &time);
2630
+
2631
+ return rb_float_new(time);
2632
+ }
2633
+
2634
+ /*
2635
+ * call-seq:
2636
+ * easy.start_transfer_time => float
2637
+ *
2638
+ * Retrieve the time, in seconds, it took from the start until the first byte
2639
+ * is just about to be transferred. This includes the +pre_transfer_time+ and
2640
+ * also the time the server needs to calculate the result.
2641
+ */
2642
+ static VALUE ruby_curl_easy_start_transfer_time_get(VALUE self) {
2643
+ ruby_curl_easy *rbce;
2644
+ double time;
2645
+
2646
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2647
+ curl_easy_getinfo(rbce->curl, CURLINFO_STARTTRANSFER_TIME, &time);
2648
+
2649
+ return rb_float_new(time);
2650
+ }
2651
+
2652
+ /*
2653
+ * call-seq:
2654
+ * easy.redirect_time => float
2655
+ *
2656
+ * Retrieve the total time, in seconds, it took for all redirection steps
2657
+ * include name lookup, connect, pretransfer and transfer before final
2658
+ * transaction was started. +redirect_time+ contains the complete
2659
+ * execution time for multiple redirections.
2660
+ *
2661
+ * Requires libcurl 7.9.7 or higher, otherwise -1 is always returned.
2662
+ */
2663
+ static VALUE ruby_curl_easy_redirect_time_get(VALUE self) {
2664
+ #ifdef HAVE_CURLINFO_REDIRECT_TIME
2665
+ ruby_curl_easy *rbce;
2666
+ double time;
2667
+
2668
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2669
+ curl_easy_getinfo(rbce->curl, CURLINFO_REDIRECT_TIME, &time);
2670
+
2671
+ return rb_float_new(time);
2672
+ #else
2673
+ rb_warn("Installed libcurl is too old to support redirect_time");
2674
+ return rb_float_new(-1);
2675
+ #endif
2676
+ }
2677
+
2678
+ /*
2679
+ * call-seq:
2680
+ * easy.redirect_count => integer
2681
+ *
2682
+ * Retrieve the total number of redirections that were actually followed.
2683
+ *
2684
+ * Requires libcurl 7.9.7 or higher, otherwise -1 is always returned.
2685
+ */
2686
+ static VALUE ruby_curl_easy_redirect_count_get(VALUE self) {
2687
+ #ifdef HAVE_CURLINFO_REDIRECT_COUNT
2688
+ ruby_curl_easy *rbce;
2689
+ long count;
2690
+
2691
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2692
+ curl_easy_getinfo(rbce->curl, CURLINFO_REDIRECT_COUNT, &count);
2693
+
2694
+ return LONG2NUM(count);
2695
+ #else
2696
+ rb_warn("Installed libcurl is too old to support redirect_count");
2697
+ return INT2FIX(-1);
2698
+ #endif
2699
+
2700
+ }
2701
+
2702
+ /*
2703
+ * call-seq:
2704
+ * easy.uploaded_bytes => float
2705
+ *
2706
+ * Retrieve the total amount of bytes that were uploaded in the
2707
+ * preceeding transfer.
2708
+ */
2709
+ static VALUE ruby_curl_easy_uploaded_bytes_get(VALUE self) {
2710
+ ruby_curl_easy *rbce;
2711
+ double bytes;
2712
+
2713
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2714
+ curl_easy_getinfo(rbce->curl, CURLINFO_SIZE_UPLOAD, &bytes);
2715
+
2716
+ return rb_float_new(bytes);
2717
+ }
2718
+
2719
+ /*
2720
+ * call-seq:
2721
+ * easy.downloaded_bytes => float
2722
+ *
2723
+ * Retrieve the total amount of bytes that were downloaded in the
2724
+ * preceeding transfer.
2725
+ */
2726
+ static VALUE ruby_curl_easy_downloaded_bytes_get(VALUE self) {
2727
+ ruby_curl_easy *rbce;
2728
+ double bytes;
2729
+
2730
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2731
+ curl_easy_getinfo(rbce->curl, CURLINFO_SIZE_DOWNLOAD, &bytes);
2732
+
2733
+ return rb_float_new(bytes);
2734
+ }
2735
+
2736
+ /*
2737
+ * call-seq:
2738
+ * easy.upload_speed => float
2739
+ *
2740
+ * Retrieve the average upload speed that curl measured for the
2741
+ * preceeding complete upload.
2742
+ */
2743
+ static VALUE ruby_curl_easy_upload_speed_get(VALUE self) {
2744
+ ruby_curl_easy *rbce;
2745
+ double bytes;
2746
+
2747
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2748
+ curl_easy_getinfo(rbce->curl, CURLINFO_SPEED_UPLOAD, &bytes);
2749
+
2750
+ return rb_float_new(bytes);
2751
+ }
2752
+
2753
+ /*
2754
+ * call-seq:
2755
+ * easy.download_speed => float
2756
+ *
2757
+ * Retrieve the average download speed that curl measured for
2758
+ * the preceeding complete download.
2759
+ */
2760
+ static VALUE ruby_curl_easy_download_speed_get(VALUE self) {
2761
+ ruby_curl_easy *rbce;
2762
+ double bytes;
2763
+
2764
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2765
+ curl_easy_getinfo(rbce->curl, CURLINFO_SPEED_DOWNLOAD, &bytes);
2766
+
2767
+ return rb_float_new(bytes);
2768
+ }
2769
+
2770
+ /*
2771
+ * call-seq:
2772
+ * easy.header_size => fixnum
2773
+ *
2774
+ * Retrieve the total size of all the headers received in the
2775
+ * preceeding transfer.
2776
+ */
2777
+ static VALUE ruby_curl_easy_header_size_get(VALUE self) {
2778
+ ruby_curl_easy *rbce;
2779
+ long size;
2780
+
2781
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2782
+ curl_easy_getinfo(rbce->curl, CURLINFO_HEADER_SIZE, &size);
2783
+
2784
+ return LONG2NUM(size);
2785
+ }
2786
+
2787
+ /*
2788
+ * call-seq:
2789
+ * easy.request_size => fixnum
2790
+ *
2791
+ * Retrieve the total size of the issued requests. This is so far
2792
+ * only for HTTP requests. Note that this may be more than one request
2793
+ * if +follow_location?+ is true.
2794
+ */
2795
+ static VALUE ruby_curl_easy_request_size_get(VALUE self) {
2796
+ ruby_curl_easy *rbce;
2797
+ long size;
2798
+
2799
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2800
+ curl_easy_getinfo(rbce->curl, CURLINFO_REQUEST_SIZE, &size);
2801
+
2802
+ return LONG2NUM(size);
2803
+ }
2804
+
2805
+ /*
2806
+ * call-seq:
2807
+ * easy.ssl_verify_result => integer
2808
+ *
2809
+ * Retrieve the result of the certification verification that was requested
2810
+ * (by setting +ssl_verify_peer?+ to +true+).
2811
+ */
2812
+ static VALUE ruby_curl_easy_ssl_verify_result_get(VALUE self) {
2813
+ ruby_curl_easy *rbce;
2814
+ long result;
2815
+
2816
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2817
+ curl_easy_getinfo(rbce->curl, CURLINFO_SSL_VERIFYRESULT, &result);
2818
+
2819
+ return LONG2NUM(result);
2820
+ }
2821
+
2822
+ /* TODO CURLINFO_SSL_ENGINES
2823
+
2824
+ Pass the address of a 'struct curl_slist *' to receive a linked-list of OpenSSL crypto-engines supported. Note that engines are normally implemented in separate dynamic libraries. Hence not all the returned engines may be available at run-time. NOTE: you must call curl_slist_free_all(3) on the list pointer once you're done with it, as libcurl will not free the data for you. (Added in 7.12.3)
2825
+ */
2826
+
2827
+ /*
2828
+ * call-seq:
2829
+ * easy.downloaded_content_length => float
2830
+ *
2831
+ * Retrieve the content-length of the download. This is the value read
2832
+ * from the Content-Length: field.
2833
+ */
2834
+ static VALUE ruby_curl_easy_downloaded_content_length_get(VALUE self) {
2835
+ ruby_curl_easy *rbce;
2836
+ double bytes;
2837
+
2838
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2839
+ curl_easy_getinfo(rbce->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &bytes);
2840
+
2841
+ return rb_float_new(bytes);
2842
+ }
2843
+
2844
+ /*
2845
+ * call-seq:
2846
+ * easy.uploaded_content_length => float
2847
+ *
2848
+ * Retrieve the content-length of the upload.
2849
+ */
2850
+ static VALUE ruby_curl_easy_uploaded_content_length_get(VALUE self) {
2851
+ ruby_curl_easy *rbce;
2852
+ double bytes;
2853
+
2854
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2855
+ curl_easy_getinfo(rbce->curl, CURLINFO_CONTENT_LENGTH_UPLOAD, &bytes);
2856
+
2857
+ return rb_float_new(bytes);
2858
+ }
2859
+
2860
+ /*
2861
+ * call-seq:
2862
+ * easy.content_type => "content/type" or nil
2863
+ *
2864
+ * Retrieve the content-type of the downloaded object. This is the value read
2865
+ * from the Content-Type: field. If you get +nil+, it means that the server
2866
+ * didn't send a valid Content-Type header or that the protocol used doesn't
2867
+ * support this.
2868
+ */
2869
+ static VALUE ruby_curl_easy_content_type_get(VALUE self) {
2870
+ ruby_curl_easy *rbce;
2871
+ char* type;
2872
+
2873
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2874
+ curl_easy_getinfo(rbce->curl, CURLINFO_CONTENT_TYPE, &type);
2875
+
2876
+ if (type && type[0]) { // curl returns empty string if none
2877
+ return rb_str_new2(type);
2878
+ } else {
2879
+ return Qnil;
2880
+ }
2881
+ }
2882
+
2883
+
2884
+ /* NOT REQUIRED?
2885
+ CURLINFO_PRIVATE
2886
+
2887
+ Pass a pointer to a 'char *' to receive the pointer to the private data associated with the curl handle (set with the CURLOPT_PRIVATE option to curl_easy_setopt(3)). (Added in 7.10.3)
2888
+ */
2889
+
2890
+ /* TODO these will need constants setting up too for checking the bits.
2891
+ *
2892
+ * Alternatively, could return an object that wraps the long, and has
2893
+ * question methods to query the auth types. Could return long from to_i(nt)
2894
+ *
2895
+ CURLINFO_HTTPAUTH_AVAIL
2896
+
2897
+ Pass a pointer to a long to receive a bitmask indicating the authentication method(s) available. The meaning of the bits is explained in the CURLOPT_HTTPAUTH option for curl_easy_setopt(3). (Added in 7.10.8)
2898
+
2899
+ CURLINFO_PROXYAUTH_AVAIL
2900
+
2901
+ Pass a pointer to a long to receive a bitmask indicating the authentication method(s) available for your proxy authentication. (Added in 7.10.8)
2902
+ */
2903
+
2904
+ /*
2905
+ * call-seq:
2906
+ * easy.os_errno => integer
2907
+ *
2908
+ * Retrieve the errno variable from a connect failure (requires
2909
+ * libcurl 7.12.2 or higher, otherwise 0 is always returned).
2910
+ */
2911
+ static VALUE ruby_curl_easy_os_errno_get(VALUE self) {
2912
+ #ifdef HAVE_CURLINFO_OS_ERRNO
2913
+ ruby_curl_easy *rbce;
2914
+ long result;
2915
+
2916
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2917
+ curl_easy_getinfo(rbce->curl, CURLINFO_OS_ERRNO, &result);
2918
+
2919
+ return LONG2NUM(result);
2920
+ #else
2921
+ rb_warn("Installed libcurl is too old to support os_errno");
2922
+ return INT2FIX(0);
2923
+ #endif
2924
+ }
2925
+
2926
+ /*
2927
+ * call-seq:
2928
+ * easy.num_connects => integer
2929
+ *
2930
+ * Retrieve the number of new connections libcurl had to create to achieve
2931
+ * the previous transfer (only the successful connects are counted).
2932
+ * Combined with +redirect_count+ you are able to know how many times libcurl
2933
+ * successfully reused existing connection(s) or not.
2934
+ *
2935
+ * See the Connection Options of curl_easy_setopt(3) to see how libcurl tries
2936
+ * to make persistent connections to save time.
2937
+ *
2938
+ * (requires libcurl 7.12.3 or higher, otherwise -1 is always returned).
2939
+ */
2940
+ static VALUE ruby_curl_easy_num_connects_get(VALUE self) {
2941
+ #ifdef HAVE_CURLINFO_NUM_CONNECTS
2942
+ ruby_curl_easy *rbce;
2943
+ long result;
2944
+
2945
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2946
+ curl_easy_getinfo(rbce->curl, CURLINFO_NUM_CONNECTS, &result);
2947
+
2948
+ return LONG2NUM(result);
2949
+ #else
2950
+ rb_warn("Installed libcurl is too old to support num_connects");
2951
+ return INT2FIX(-1);
2952
+ #endif
2953
+ }
2954
+
2955
+
2956
+ /* TODO this needs to be implemented.
2957
+
2958
+ CURLINFO_COOKIELIST
2959
+
2960
+ Pass a pointer to a 'struct curl_slist *' to receive a linked-list of all cookies cURL knows (expired ones, too). Don't forget to curl_slist_free_all(3) the list after it has been used. If there are no cookies (cookies for the handle have not been enabled or simply none have been received) 'struct curl_slist *' will be set to point to NULL. (Added in 7.14.1)
2961
+ */
2962
+
2963
+ /* TODO this needs to be implemented. Could probably support CONNECT_ONLY by having this
2964
+ * return an open Socket or something.
2965
+ *
2966
+ CURLINFO_LASTSOCKET
2967
+
2968
+ Pass a pointer to a long to receive the last socket used by this curl session. If the socket is no longer valid, -1 is returned. When you finish working with the socket, you must call curl_easy_cleanup() as usual and let libcurl close the socket and cleanup other resources associated with the handle. This is typically used in combination with CURLOPT_CONNECT_ONLY. (Added in 7.15.2)
2969
+ */
2970
+
2971
+ /*
2972
+ * call-seq:
2973
+ * easy.ftp_entry_path => "C:\ftp\root\" or nil
2974
+ *
2975
+ * Retrieve the path of the entry path. That is the initial path libcurl ended
2976
+ * up in when logging on to the remote FTP server. This returns +nil+ if
2977
+ * something is wrong.
2978
+ *
2979
+ * (requires libcurl 7.15.4 or higher, otherwise +nil+ is always returned).
2980
+ */
2981
+ static VALUE ruby_curl_easy_ftp_entry_path_get(VALUE self) {
2982
+ #ifdef HAVE_CURLINFO_FTP_ENTRY_PATH
2983
+ ruby_curl_easy *rbce;
2984
+ char* path = NULL;
2985
+
2986
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
2987
+ curl_easy_getinfo(rbce->curl, CURLINFO_FTP_ENTRY_PATH, &path);
2988
+
2989
+ if (path && path[0]) { // curl returns NULL or empty string if none
2990
+ return rb_str_new2(path);
2991
+ } else {
2992
+ return Qnil;
2993
+ }
2994
+ #else
2995
+ rb_warn("Installed libcurl is too old to support num_connects");
2996
+ return Qnil;
2997
+ #endif
2998
+ }
2999
+
3000
+ /*
3001
+ * call-seq:
3002
+ * easy.inspect => "#<Curl::Easy http://google.com/>"
3003
+ */
3004
+ static VALUE ruby_curl_easy_inspect(VALUE self) {
3005
+ char buf[64];
3006
+ ruby_curl_easy *rbce;
3007
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
3008
+ /* if we don't have a url set... we'll crash... */
3009
+ if( !rb_easy_nil("url") && rb_easy_type_check("url", T_STRING)) {
3010
+ VALUE url = rb_easy_get("url");
3011
+ size_t len = 13+((RSTRING_LEN(url) > 50) ? 50 : RSTRING_LEN(url));
3012
+ /* "#<Net::HTTP http://www.google.com/:80 open=false>" */
3013
+ memcpy(buf,"#<Curl::Easy ", 13);
3014
+ memcpy(buf+13,RSTRING_PTR(url), (len - 13));
3015
+ buf[len++] = '>';
3016
+ return rb_str_new(buf,len);
3017
+ }
3018
+ return rb_str_new2("#<Curl::Easy>");
3019
+ }
3020
+
3021
+
3022
+ /* ================== ESCAPING FUNCS ==============*/
3023
+
3024
+ /*
3025
+ * call-seq:
3026
+ * easy.escape("some text") => "some%20text"
3027
+ *
3028
+ * Convert the given input string to a URL encoded string and return
3029
+ * the result. All input characters that are not a-z, A-Z or 0-9 are
3030
+ * converted to their "URL escaped" version (%NN where NN is a
3031
+ * two-digit hexadecimal number).
3032
+ */
3033
+ static VALUE ruby_curl_easy_escape(VALUE self, VALUE svalue) {
3034
+ ruby_curl_easy *rbce;
3035
+ char *result;
3036
+ VALUE rresult;
3037
+ VALUE str = svalue;
3038
+
3039
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
3040
+
3041
+ /* NOTE: make sure the value is a string, if not call to_s */
3042
+ if( rb_type(str) != T_STRING ) { str = rb_funcall(str,rb_intern("to_s"),0); }
3043
+
3044
+ #if (LIBCURL_VERSION_NUM >= 0x070f04)
3045
+ result = (char*)curl_easy_escape(rbce->curl, StringValuePtr(str), RSTRING_LEN(str));
3046
+ #else
3047
+ result = (char*)curl_escape(StringValuePtr(str), RSTRING_LEN(str));
3048
+ #endif
3049
+
3050
+ rresult = rb_str_new2(result);
3051
+ curl_free(result);
3052
+
3053
+ return rresult;
3054
+ }
3055
+
3056
+ /*
3057
+ * call-seq:
3058
+ * easy.unescape("some%20text") => "some text"
3059
+ *
3060
+ * Convert the given URL encoded input string to a "plain string" and return
3061
+ * the result. All input characters that are URL encoded (%XX where XX is a
3062
+ * two-digit hexadecimal number) are converted to their binary versions.
3063
+ */
3064
+ static VALUE ruby_curl_easy_unescape(VALUE self, VALUE str) {
3065
+ ruby_curl_easy *rbce;
3066
+ int rlen;
3067
+ char *result;
3068
+ VALUE rresult;
3069
+
3070
+ Data_Get_Struct(self, ruby_curl_easy, rbce);
3071
+
3072
+ #if (LIBCURL_VERSION_NUM >= 0x070f04)
3073
+ result = (char*)curl_easy_unescape(rbce->curl, StringValuePtr(str), RSTRING_LEN(str), &rlen);
3074
+ #else
3075
+ result = (char*)curl_unescape(StringValuePtr(str), RSTRING_LEN(str));
3076
+ rlen = strlen(result);
3077
+ #endif
3078
+
3079
+ rresult = rb_str_new(result, rlen);
3080
+ curl_free(result);
3081
+
3082
+ return rresult;
3083
+ }
3084
+
3085
+
3086
+ /* ================= CLASS METHODS ==================*/
3087
+
3088
+ /*
3089
+ * call-seq:
3090
+ * Curl::Easy.perform(url) { |easy| ... } => #&lt;Curl::Easy...&gt;
3091
+ *
3092
+ * Convenience method that creates a new Curl::Easy instance with
3093
+ * the specified URL and calls the general +perform+ method, before returning
3094
+ * the new instance. For HTTP URLs, this is equivalent to calling +http_get+.
3095
+ *
3096
+ * If a block is supplied, the new instance will be yielded just prior to
3097
+ * the +http_get+ call.
3098
+ */
3099
+ static VALUE ruby_curl_easy_class_perform(int argc, VALUE *argv, VALUE klass) {
3100
+ VALUE c = ruby_curl_easy_new(argc, argv, klass);
3101
+
3102
+ if (rb_block_given_p()) {
3103
+ rb_yield(c);
3104
+ }
3105
+
3106
+ ruby_curl_easy_perform(c);
3107
+ return c;
3108
+ }
3109
+
3110
+ /*
3111
+ * call-seq:
3112
+ * Curl::Easy.http_get(url) { |easy| ... } => #&lt;Curl::Easy...&gt;
3113
+ *
3114
+ * Convenience method that creates a new Curl::Easy instance with
3115
+ * the specified URL and calls +http_get+, before returning the new instance.
3116
+ *
3117
+ * If a block is supplied, the new instance will be yielded just prior to
3118
+ * the +http_get+ call.
3119
+ */
3120
+ static VALUE ruby_curl_easy_class_perform_get(int argc, VALUE *argv, VALUE klass) {
3121
+ VALUE c = ruby_curl_easy_new(argc, argv, klass);
3122
+
3123
+ ruby_curl_easy_perform_get(c);
3124
+ return c;
3125
+ }
3126
+
3127
+ /*
3128
+ * call-seq:
3129
+ * Curl::Easy.http_delete(url) { |easy| ... } => #&lt;Curl::Easy...&gt;
3130
+ *
3131
+ * Convenience method that creates a new Curl::Easy instance with
3132
+ * the specified URL and calls +http_delete+, before returning the new instance.
3133
+ *
3134
+ * If a block is supplied, the new instance will be yielded just prior to
3135
+ * the +http_delete+ call.
3136
+ */
3137
+ static VALUE ruby_curl_easy_class_perform_delete(int argc, VALUE *argv, VALUE klass) {
3138
+ VALUE c = ruby_curl_easy_new(argc, argv, klass);
3139
+
3140
+ ruby_curl_easy_perform_delete(c);
3141
+ return c;
3142
+ }
3143
+
3144
+ /*
3145
+ * call-seq:
3146
+ * Curl::Easy.http_head(url) { |easy| ... } => #&lt;Curl::Easy...&gt;
3147
+ *
3148
+ * Convenience method that creates a new Curl::Easy instance with
3149
+ * the specified URL and calls +http_head+, before returning the new instance.
3150
+ *
3151
+ * If a block is supplied, the new instance will be yielded just prior to
3152
+ * the +http_head+ call.
3153
+ */
3154
+ static VALUE ruby_curl_easy_class_perform_head(int argc, VALUE *argv, VALUE klass) {
3155
+ VALUE c = ruby_curl_easy_new(argc, argv, klass);
3156
+
3157
+ ruby_curl_easy_perform_head(c);
3158
+
3159
+ return c;
3160
+ }
3161
+
3162
+ // TODO: add convenience method for http_post
3163
+
3164
+ /*
3165
+ * call-seq:
3166
+ * Curl::Easy.http_post(url, "some=urlencoded%20form%20data&and=so%20on") => true
3167
+ * Curl::Easy.http_post(url, "some=urlencoded%20form%20data", "and=so%20on", ...) => true
3168
+ * Curl::Easy.http_post(url, "some=urlencoded%20form%20data", Curl::PostField, "and=so%20on", ...) => true
3169
+ * Curl::Easy.http_post(url, Curl::PostField, Curl::PostField ..., Curl::PostField) => true
3170
+ *
3171
+ * POST the specified formdata to the currently configured URL using
3172
+ * the current options set for this Curl::Easy instance. This method
3173
+ * always returns true, or raises an exception (defined under
3174
+ * Curl::Err) on error.
3175
+ *
3176
+ * If you wish to use multipart form encoding, you'll need to supply a block
3177
+ * in order to set multipart_form_post true. See #http_post for more
3178
+ * information.
3179
+ */
3180
+ static VALUE ruby_curl_easy_class_perform_post(int argc, VALUE *argv, VALUE klass) {
3181
+ VALUE url, fields;
3182
+ VALUE c;
3183
+
3184
+ rb_scan_args(argc, argv, "1*", &url, &fields);
3185
+
3186
+ c = ruby_curl_easy_new(1, &url, klass);
3187
+
3188
+ if (argc > 1) {
3189
+ ruby_curl_easy_perform_post(argc - 1, &argv[1], c);
3190
+ } else {
3191
+ ruby_curl_easy_perform_post(0, NULL, c);
3192
+ }
3193
+
3194
+ return c;
3195
+ }
3196
+
3197
+
3198
+ /* =================== INIT LIB =====================*/
3199
+ void init_curb_easy() {
3200
+ idCall = rb_intern("call");
3201
+ idJoin = rb_intern("join");
3202
+
3203
+ rbstrAmp = rb_str_new2("&");
3204
+ rb_global_variable(&rbstrAmp);
3205
+
3206
+ cCurlEasy = rb_define_class_under(mCurl, "Easy", rb_cObject);
3207
+
3208
+ /* Class methods */
3209
+ rb_define_singleton_method(cCurlEasy, "new", ruby_curl_easy_new, -1);
3210
+ rb_define_singleton_method(cCurlEasy, "perform", ruby_curl_easy_class_perform, -1);
3211
+ rb_define_singleton_method(cCurlEasy, "http_delete", ruby_curl_easy_class_perform_delete, -1);
3212
+ rb_define_singleton_method(cCurlEasy, "http_get", ruby_curl_easy_class_perform_get, -1);
3213
+ rb_define_singleton_method(cCurlEasy, "http_post", ruby_curl_easy_class_perform_post, -1);
3214
+ rb_define_singleton_method(cCurlEasy, "http_head", ruby_curl_easy_class_perform_head, -1);
3215
+ rb_define_singleton_method(cCurlEasy, "http_put", ruby_curl_easy_class_perform_put, 2);
3216
+
3217
+ /* Attributes for config next perform */
3218
+ rb_define_method(cCurlEasy, "url=", ruby_curl_easy_url_set, 1);
3219
+ rb_define_method(cCurlEasy, "url", ruby_curl_easy_url_get, 0);
3220
+ rb_define_method(cCurlEasy, "proxy_url=", ruby_curl_easy_proxy_url_set, 1);
3221
+ rb_define_method(cCurlEasy, "proxy_url", ruby_curl_easy_proxy_url_get, 0);
3222
+ rb_define_method(cCurlEasy, "headers=", ruby_curl_easy_headers_set, 1);
3223
+ rb_define_method(cCurlEasy, "headers", ruby_curl_easy_headers_get, 0);
3224
+ rb_define_method(cCurlEasy, "interface=", ruby_curl_easy_interface_set, 1);
3225
+ rb_define_method(cCurlEasy, "interface", ruby_curl_easy_interface_get, 0);
3226
+ rb_define_method(cCurlEasy, "userpwd=", ruby_curl_easy_userpwd_set, 1);
3227
+ rb_define_method(cCurlEasy, "userpwd", ruby_curl_easy_userpwd_get, 0);
3228
+ rb_define_method(cCurlEasy, "proxypwd=", ruby_curl_easy_proxypwd_set, 1);
3229
+ rb_define_method(cCurlEasy, "proxypwd", ruby_curl_easy_proxypwd_get, 0);
3230
+ rb_define_method(cCurlEasy, "cookies=", ruby_curl_easy_cookies_set, 1);
3231
+ rb_define_method(cCurlEasy, "cookies", ruby_curl_easy_cookies_get, 0);
3232
+ rb_define_method(cCurlEasy, "cookiefile=", ruby_curl_easy_cookiefile_set, 1);
3233
+ rb_define_method(cCurlEasy, "cookiefile", ruby_curl_easy_cookiefile_get, 0);
3234
+ rb_define_method(cCurlEasy, "cookiejar=", ruby_curl_easy_cookiejar_set, 1);
3235
+ rb_define_method(cCurlEasy, "cookiejar", ruby_curl_easy_cookiejar_get, 0);
3236
+ rb_define_method(cCurlEasy, "cert=", ruby_curl_easy_cert_set, 1);
3237
+ rb_define_method(cCurlEasy, "cert", ruby_curl_easy_cert_get, 0);
3238
+ rb_define_method(cCurlEasy, "cert_key=", ruby_curl_easy_cert_key_set, 1);
3239
+ rb_define_method(cCurlEasy, "cert_key", ruby_curl_easy_cert_key_get, 0);
3240
+ rb_define_method(cCurlEasy, "cacert=", ruby_curl_easy_cacert_set, 1);
3241
+ rb_define_method(cCurlEasy, "cacert", ruby_curl_easy_cacert_get, 0);
3242
+ rb_define_method(cCurlEasy, "certpassword=", ruby_curl_easy_certpassword_set, 1);
3243
+ rb_define_method(cCurlEasy, "certtype=", ruby_curl_easy_certtype_set, 1);
3244
+ rb_define_method(cCurlEasy, "certtype", ruby_curl_easy_certtype_get, 0);
3245
+ rb_define_method(cCurlEasy, "encoding=", ruby_curl_easy_encoding_set, 1);
3246
+ rb_define_method(cCurlEasy, "encoding", ruby_curl_easy_encoding_get, 0);
3247
+ rb_define_method(cCurlEasy, "useragent=", ruby_curl_easy_useragent_set, 1);
3248
+ rb_define_method(cCurlEasy, "useragent", ruby_curl_easy_useragent_get, 0);
3249
+ rb_define_method(cCurlEasy, "post_body=", ruby_curl_easy_post_body_set, 1);
3250
+ rb_define_method(cCurlEasy, "post_body", ruby_curl_easy_post_body_get, 0);
3251
+ rb_define_method(cCurlEasy, "put_data=", ruby_curl_easy_put_data_set, 1);
3252
+ rb_define_method(cCurlEasy, "ftp_commands=", ruby_curl_easy_ftp_commands_set, 1);
3253
+ rb_define_method(cCurlEasy, "ftp_commands", ruby_curl_easy_ftp_commands_get, 0);
3254
+
3255
+ rb_define_method(cCurlEasy, "local_port=", ruby_curl_easy_local_port_set, 1);
3256
+ rb_define_method(cCurlEasy, "local_port", ruby_curl_easy_local_port_get, 0);
3257
+ rb_define_method(cCurlEasy, "local_port_range=", ruby_curl_easy_local_port_range_set, 1);
3258
+ rb_define_method(cCurlEasy, "local_port_range", ruby_curl_easy_local_port_range_get, 0);
3259
+ rb_define_method(cCurlEasy, "proxy_port=", ruby_curl_easy_proxy_port_set, 1);
3260
+ rb_define_method(cCurlEasy, "proxy_port", ruby_curl_easy_proxy_port_get, 0);
3261
+ rb_define_method(cCurlEasy, "proxy_type=", ruby_curl_easy_proxy_type_set, 1);
3262
+ rb_define_method(cCurlEasy, "proxy_type", ruby_curl_easy_proxy_type_get, 0);
3263
+ rb_define_method(cCurlEasy, "http_auth_types=", ruby_curl_easy_http_auth_types_set, -1);
3264
+ rb_define_method(cCurlEasy, "http_auth_types", ruby_curl_easy_http_auth_types_get, 0);
3265
+ rb_define_method(cCurlEasy, "proxy_auth_types=", ruby_curl_easy_proxy_auth_types_set, 1);
3266
+ rb_define_method(cCurlEasy, "proxy_auth_types", ruby_curl_easy_proxy_auth_types_get, 0);
3267
+ rb_define_method(cCurlEasy, "max_redirects=", ruby_curl_easy_max_redirects_set, 1);
3268
+ rb_define_method(cCurlEasy, "max_redirects", ruby_curl_easy_max_redirects_get, 0);
3269
+ rb_define_method(cCurlEasy, "timeout=", ruby_curl_easy_timeout_set, 1);
3270
+ rb_define_method(cCurlEasy, "timeout", ruby_curl_easy_timeout_get, 0);
3271
+ rb_define_method(cCurlEasy, "connect_timeout=", ruby_curl_easy_connect_timeout_set, 1);
3272
+ rb_define_method(cCurlEasy, "connect_timeout", ruby_curl_easy_connect_timeout_get, 0);
3273
+ rb_define_method(cCurlEasy, "dns_cache_timeout=", ruby_curl_easy_dns_cache_timeout_set, 1);
3274
+ rb_define_method(cCurlEasy, "dns_cache_timeout", ruby_curl_easy_dns_cache_timeout_get, 0);
3275
+ rb_define_method(cCurlEasy, "ftp_response_timeout=", ruby_curl_easy_ftp_response_timeout_set, 1);
3276
+ rb_define_method(cCurlEasy, "ftp_response_timeout", ruby_curl_easy_ftp_response_timeout_get, 0);
3277
+ rb_define_method(cCurlEasy, "ssl_version=", ruby_curl_easy_ssl_version_set, 1);
3278
+ rb_define_method(cCurlEasy, "ssl_version", ruby_curl_easy_ssl_version_get, 0);
3279
+ rb_define_method(cCurlEasy, "use_ssl=", ruby_curl_easy_use_ssl_set, 1);
3280
+ rb_define_method(cCurlEasy, "use_ssl", ruby_curl_easy_use_ssl_get, 0);
3281
+ rb_define_method(cCurlEasy, "ftp_filemethod=", ruby_curl_easy_ftp_filemethod_set, 1);
3282
+ rb_define_method(cCurlEasy, "ftp_filemethod", ruby_curl_easy_ftp_filemethod_get, 0);
3283
+
3284
+ rb_define_method(cCurlEasy, "username=", ruby_curl_easy_username_set, 1);
3285
+ rb_define_method(cCurlEasy, "username", ruby_curl_easy_username_get, 0);
3286
+ rb_define_method(cCurlEasy, "password=", ruby_curl_easy_password_set, 1);
3287
+ rb_define_method(cCurlEasy, "password", ruby_curl_easy_password_get, 0);
3288
+
3289
+ rb_define_method(cCurlEasy, "proxy_tunnel=", ruby_curl_easy_proxy_tunnel_set, 1);
3290
+ rb_define_method(cCurlEasy, "proxy_tunnel?", ruby_curl_easy_proxy_tunnel_q, 0);
3291
+ rb_define_method(cCurlEasy, "fetch_file_time=", ruby_curl_easy_fetch_file_time_set, 1);
3292
+ rb_define_method(cCurlEasy, "fetch_file_time?", ruby_curl_easy_fetch_file_time_q, 0);
3293
+ rb_define_method(cCurlEasy, "ssl_verify_peer=", ruby_curl_easy_ssl_verify_peer_set, 1);
3294
+ rb_define_method(cCurlEasy, "ssl_verify_peer?", ruby_curl_easy_ssl_verify_peer_q, 0);
3295
+ rb_define_method(cCurlEasy, "ssl_verify_host=", ruby_curl_easy_ssl_verify_host_set, 1);
3296
+ rb_define_method(cCurlEasy, "ssl_verify_host?", ruby_curl_easy_ssl_verify_host_q, 0);
3297
+ rb_define_method(cCurlEasy, "header_in_body=", ruby_curl_easy_header_in_body_set, 1);
3298
+ rb_define_method(cCurlEasy, "header_in_body?", ruby_curl_easy_header_in_body_q, 0);
3299
+ rb_define_method(cCurlEasy, "use_netrc=", ruby_curl_easy_use_netrc_set, 1);
3300
+ rb_define_method(cCurlEasy, "use_netrc?", ruby_curl_easy_use_netrc_q, 0);
3301
+ rb_define_method(cCurlEasy, "follow_location=", ruby_curl_easy_follow_location_set, 1);
3302
+ rb_define_method(cCurlEasy, "follow_location?", ruby_curl_easy_follow_location_q, 0);
3303
+ rb_define_method(cCurlEasy, "autoreferer=", ruby_curl_easy_autoreferer_set, 1);
3304
+ rb_define_method(cCurlEasy, "unrestricted_auth=", ruby_curl_easy_unrestricted_auth_set, 1);
3305
+ rb_define_method(cCurlEasy, "unrestricted_auth?", ruby_curl_easy_unrestricted_auth_q, 0);
3306
+ rb_define_method(cCurlEasy, "verbose=", ruby_curl_easy_verbose_set, 1);
3307
+ rb_define_method(cCurlEasy, "verbose?", ruby_curl_easy_verbose_q, 0);
3308
+ rb_define_method(cCurlEasy, "multipart_form_post=", ruby_curl_easy_multipart_form_post_set, 1);
3309
+ rb_define_method(cCurlEasy, "multipart_form_post?", ruby_curl_easy_multipart_form_post_q, 0);
3310
+ rb_define_method(cCurlEasy, "enable_cookies=", ruby_curl_easy_enable_cookies_set, 1);
3311
+ rb_define_method(cCurlEasy, "enable_cookies?", ruby_curl_easy_enable_cookies_q, 0);
3312
+
3313
+ rb_define_method(cCurlEasy, "on_body", ruby_curl_easy_on_body_set, -1);
3314
+ rb_define_method(cCurlEasy, "on_header", ruby_curl_easy_on_header_set, -1);
3315
+ rb_define_method(cCurlEasy, "on_progress", ruby_curl_easy_on_progress_set, -1);
3316
+ rb_define_method(cCurlEasy, "on_debug", ruby_curl_easy_on_debug_set, -1);
3317
+ rb_define_method(cCurlEasy, "on_success", ruby_curl_easy_on_success_set, -1);
3318
+ rb_define_method(cCurlEasy, "on_failure", ruby_curl_easy_on_failure_set, -1);
3319
+ rb_define_method(cCurlEasy, "on_complete", ruby_curl_easy_on_complete_set, -1);
3320
+
3321
+ rb_define_method(cCurlEasy, "perform", ruby_curl_easy_perform, 0);
3322
+ rb_define_method(cCurlEasy, "http", ruby_curl_easy_perform_verb, 1);
3323
+ rb_define_method(cCurlEasy, "http_delete", ruby_curl_easy_perform_delete, 0);
3324
+ rb_define_method(cCurlEasy, "http_get", ruby_curl_easy_perform_get, 0);
3325
+ rb_define_method(cCurlEasy, "http_post", ruby_curl_easy_perform_post, -1);
3326
+ rb_define_method(cCurlEasy, "http_head", ruby_curl_easy_perform_head, 0);
3327
+ rb_define_method(cCurlEasy, "http_put", ruby_curl_easy_perform_put, 1);
3328
+ rb_define_method(cCurlEasy, "head=", ruby_curl_easy_set_head_option, 1);
3329
+ rb_define_method(cCurlEasy, "delete=", ruby_curl_easy_set_delete_option, 1);
3330
+ rb_define_method(cCurlEasy, "version=", ruby_curl_easy_set_version, 1);
3331
+ rb_define_const(mCurl, "HTTP_1_1", LONG2NUM(CURL_HTTP_VERSION_1_1));
3332
+ rb_define_const(mCurl, "HTTP_1_0", LONG2NUM(CURL_HTTP_VERSION_1_0));
3333
+ rb_define_const(mCurl, "HTTP_NONE", LONG2NUM(CURL_HTTP_VERSION_NONE));
3334
+ rb_define_method(cCurlEasy, "nosignal=", ruby_curl_easy_set_nosignal, 1);
3335
+
3336
+ /* Post-perform info methods */
3337
+ rb_define_method(cCurlEasy, "body_str", ruby_curl_easy_body_str_get, 0);
3338
+ rb_define_method(cCurlEasy, "header_str", ruby_curl_easy_header_str_get, 0);
3339
+
3340
+ rb_define_method(cCurlEasy, "last_effective_url", ruby_curl_easy_last_effective_url_get, 0);
3341
+ rb_define_method(cCurlEasy, "response_code", ruby_curl_easy_response_code_get, 0);
3342
+ #if defined(HAVE_CURLINFO_PRIMARY_IP)
3343
+ rb_define_method(cCurlEasy, "primary_ip", ruby_curl_easy_primary_ip_get, 0);
3344
+ #endif
3345
+ rb_define_method(cCurlEasy, "http_connect_code", ruby_curl_easy_http_connect_code_get, 0);
3346
+ rb_define_method(cCurlEasy, "file_time", ruby_curl_easy_file_time_get, 0);
3347
+ rb_define_method(cCurlEasy, "total_time", ruby_curl_easy_total_time_get, 0);
3348
+ rb_define_method(cCurlEasy, "name_lookup_time", ruby_curl_easy_name_lookup_time_get, 0);
3349
+ rb_define_method(cCurlEasy, "connect_time", ruby_curl_easy_connect_time_get, 0);
3350
+ rb_define_method(cCurlEasy, "pre_transfer_time", ruby_curl_easy_pre_transfer_time_get, 0);
3351
+ rb_define_method(cCurlEasy, "start_transfer_time", ruby_curl_easy_start_transfer_time_get, 0);
3352
+ rb_define_method(cCurlEasy, "redirect_time", ruby_curl_easy_redirect_time_get, 0);
3353
+ rb_define_method(cCurlEasy, "redirect_count", ruby_curl_easy_redirect_count_get, 0);
3354
+ rb_define_method(cCurlEasy, "downloaded_bytes", ruby_curl_easy_downloaded_bytes_get, 0);
3355
+ rb_define_method(cCurlEasy, "uploaded_bytes", ruby_curl_easy_uploaded_bytes_get, 0);
3356
+ rb_define_method(cCurlEasy, "download_speed", ruby_curl_easy_download_speed_get, 0);
3357
+ rb_define_method(cCurlEasy, "upload_speed", ruby_curl_easy_upload_speed_get, 0);
3358
+ rb_define_method(cCurlEasy, "header_size", ruby_curl_easy_header_size_get, 0);
3359
+ rb_define_method(cCurlEasy, "request_size", ruby_curl_easy_request_size_get, 0);
3360
+ rb_define_method(cCurlEasy, "ssl_verify_result", ruby_curl_easy_ssl_verify_result_get, 0);
3361
+ rb_define_method(cCurlEasy, "downloaded_content_length", ruby_curl_easy_downloaded_content_length_get, 0);
3362
+ rb_define_method(cCurlEasy, "uploaded_content_length", ruby_curl_easy_uploaded_content_length_get, 0);
3363
+ rb_define_method(cCurlEasy, "content_type", ruby_curl_easy_content_type_get, 0);
3364
+ rb_define_method(cCurlEasy, "os_errno", ruby_curl_easy_os_errno_get, 0);
3365
+ rb_define_method(cCurlEasy, "num_connects", ruby_curl_easy_num_connects_get, 0);
3366
+ rb_define_method(cCurlEasy, "ftp_entry_path", ruby_curl_easy_ftp_entry_path_get, 0);
3367
+
3368
+ rb_define_method(cCurlEasy, "close", ruby_curl_easy_close, 0);
3369
+ rb_define_method(cCurlEasy, "reset", ruby_curl_easy_reset, 0);
3370
+
3371
+ /* Curl utils */
3372
+ rb_define_method(cCurlEasy, "escape", ruby_curl_easy_escape, 1);
3373
+ rb_define_method(cCurlEasy, "unescape", ruby_curl_easy_unescape, 1);
3374
+
3375
+ /* Runtime support */
3376
+ rb_define_method(cCurlEasy, "clone", ruby_curl_easy_clone, 0);
3377
+ rb_define_alias(cCurlEasy, "dup", "clone");
3378
+ rb_define_method(cCurlEasy, "inspect", ruby_curl_easy_inspect, 0);
3379
+ }