logstash-output-scalyr 0.1.10.beta → 0.1.11.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (317) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/Gemfile +4 -0
  4. data/README.md +2 -2
  5. data/lib/logstash/outputs/scalyr.rb +94 -73
  6. data/lib/scalyr/common/client.rb +3 -1
  7. data/lib/scalyr/constants.rb +2 -0
  8. data/logstash-output-scalyr.gemspec +1 -1
  9. data/spec/logstash/outputs/scalyr_integration_spec.rb +119 -8
  10. data/spec/logstash/outputs/scalyr_spec.rb +9 -6
  11. data/vendor/bundle/jruby/2.5.0/cache/addressable-2.7.0.gem +0 -0
  12. data/vendor/bundle/jruby/2.5.0/cache/crack-0.4.5.gem +0 -0
  13. data/vendor/bundle/jruby/2.5.0/cache/hashdiff-1.0.1.gem +0 -0
  14. data/vendor/bundle/jruby/2.5.0/cache/public_suffix-4.0.6.gem +0 -0
  15. data/vendor/bundle/jruby/2.5.0/cache/rexml-3.2.5.gem +0 -0
  16. data/vendor/bundle/jruby/2.5.0/cache/webmock-3.13.0.gem +0 -0
  17. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/CHANGELOG.md +235 -0
  18. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/Gemfile +32 -0
  19. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/LICENSE.txt +202 -0
  20. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/README.md +121 -0
  21. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/Rakefile +34 -0
  22. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/data/unicode.data +0 -0
  23. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable.rb +4 -0
  24. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/idna.rb +27 -0
  25. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/idna/native.rb +61 -0
  26. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/idna/pure.rb +676 -0
  27. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/template.rb +1045 -0
  28. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/uri.rb +2529 -0
  29. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/version.rb +32 -0
  30. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/idna_spec.rb +300 -0
  31. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/net_http_compat_spec.rb +30 -0
  32. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/rack_mount_compat_spec.rb +106 -0
  33. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/security_spec.rb +59 -0
  34. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/template_spec.rb +1451 -0
  35. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/uri_spec.rb +6603 -0
  36. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/spec_helper.rb +24 -0
  37. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/clobber.rake +4 -0
  38. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/gem.rake +93 -0
  39. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/git.rake +47 -0
  40. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/metrics.rake +24 -0
  41. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/rspec.rake +23 -0
  42. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/yard.rake +29 -0
  43. data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack.rb +7 -0
  44. data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/json.rb +98 -0
  45. data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/util.rb +17 -0
  46. data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/version.rb +3 -0
  47. data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/xml.rb +238 -0
  48. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/Gemfile +8 -0
  49. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/LICENSE +19 -0
  50. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/README.md +276 -0
  51. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/Rakefile +18 -0
  52. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/changelog.md +100 -0
  53. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/hashdiff.gemspec +39 -0
  54. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff.rb +10 -0
  55. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/compare_hashes.rb +69 -0
  56. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/diff.rb +177 -0
  57. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/lcs.rb +66 -0
  58. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/lcs_compare_arrays.rb +32 -0
  59. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/linear_compare_array.rb +159 -0
  60. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/patch.rb +88 -0
  61. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/util.rb +155 -0
  62. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/version.rb +5 -0
  63. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/best_diff_spec.rb +75 -0
  64. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/diff_array_spec.rb +60 -0
  65. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/diff_spec.rb +360 -0
  66. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/lcs_spec.rb +76 -0
  67. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/linear_compare_array_spec.rb +50 -0
  68. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/patch_spec.rb +185 -0
  69. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/readme_spec.rb +15 -0
  70. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/util_spec.rb +116 -0
  71. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/spec_helper.rb +15 -0
  72. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/2.0-Upgrade.md +52 -0
  73. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/CHANGELOG.md +406 -0
  74. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/Gemfile +15 -0
  75. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/LICENSE.txt +22 -0
  76. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/README.md +207 -0
  77. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/Rakefile +51 -0
  78. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/SECURITY.md +104 -0
  79. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/bin/console +15 -0
  80. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/codecov.yml +12 -0
  81. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/data/list.txt +13380 -0
  82. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix.rb +179 -0
  83. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/domain.rb +235 -0
  84. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/errors.rb +41 -0
  85. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/list.rb +247 -0
  86. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/rule.rb +350 -0
  87. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/version.rb +13 -0
  88. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/public_suffix.gemspec +29 -0
  89. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/acceptance_test.rb +131 -0
  90. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_find.rb +66 -0
  91. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_find_all.rb +102 -0
  92. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_names.rb +91 -0
  93. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_select.rb +26 -0
  94. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_select_incremental.rb +25 -0
  95. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_valid.rb +101 -0
  96. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/domain_profiler.rb +12 -0
  97. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/find_profiler.rb +12 -0
  98. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/find_profiler_jp.rb +12 -0
  99. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/initialization_profiler.rb +11 -0
  100. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/list_profsize.rb +11 -0
  101. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/object_binsize.rb +57 -0
  102. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/psl_test.rb +52 -0
  103. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/test_helper.rb +18 -0
  104. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/tests.txt +98 -0
  105. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/domain_test.rb +106 -0
  106. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/errors_test.rb +25 -0
  107. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/list_test.rb +241 -0
  108. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/public_suffix_test.rb +188 -0
  109. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/rule_test.rb +222 -0
  110. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/LICENSE.txt +22 -0
  111. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/NEWS.md +178 -0
  112. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/README.md +48 -0
  113. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/context.rdoc +143 -0
  114. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/child.rdoc +87 -0
  115. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/document.rdoc +276 -0
  116. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/element.rdoc +602 -0
  117. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/node.rdoc +97 -0
  118. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/parent.rdoc +267 -0
  119. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/child_toc.rdoc +12 -0
  120. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/document_toc.rdoc +30 -0
  121. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/element_toc.rdoc +55 -0
  122. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/master_toc.rdoc +135 -0
  123. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/node_toc.rdoc +16 -0
  124. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/parent_toc.rdoc +25 -0
  125. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml.rb +3 -0
  126. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/attlistdecl.rb +63 -0
  127. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/attribute.rb +205 -0
  128. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/cdata.rb +68 -0
  129. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/child.rb +97 -0
  130. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/comment.rb +80 -0
  131. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/doctype.rb +311 -0
  132. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/document.rb +451 -0
  133. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/attlistdecl.rb +11 -0
  134. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/dtd.rb +47 -0
  135. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/elementdecl.rb +18 -0
  136. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/entitydecl.rb +57 -0
  137. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/notationdecl.rb +40 -0
  138. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/element.rb +2599 -0
  139. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/encoding.rb +51 -0
  140. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/entity.rb +171 -0
  141. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/formatters/default.rb +116 -0
  142. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/formatters/pretty.rb +142 -0
  143. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/formatters/transitive.rb +58 -0
  144. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/functions.rb +447 -0
  145. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/instruction.rb +79 -0
  146. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/light/node.rb +188 -0
  147. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/namespace.rb +59 -0
  148. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/node.rb +76 -0
  149. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/output.rb +30 -0
  150. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parent.rb +166 -0
  151. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parseexception.rb +52 -0
  152. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb +694 -0
  153. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/lightparser.rb +59 -0
  154. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/pullparser.rb +197 -0
  155. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/sax2parser.rb +273 -0
  156. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/streamparser.rb +61 -0
  157. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/treeparser.rb +101 -0
  158. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/ultralightparser.rb +57 -0
  159. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb +689 -0
  160. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/quickpath.rb +266 -0
  161. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/rexml.rb +37 -0
  162. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/sax2listener.rb +98 -0
  163. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/security.rb +28 -0
  164. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/source.rb +298 -0
  165. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/streamlistener.rb +93 -0
  166. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/text.rb +424 -0
  167. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/undefinednamespaceexception.rb +9 -0
  168. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/validation/relaxng.rb +539 -0
  169. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/validation/validation.rb +144 -0
  170. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/validation/validationexception.rb +10 -0
  171. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb +130 -0
  172. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb +85 -0
  173. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xpath.rb +81 -0
  174. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xpath_parser.rb +974 -0
  175. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/CHANGELOG.md +1894 -0
  176. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/Gemfile +9 -0
  177. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/LICENSE +20 -0
  178. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/README.md +1176 -0
  179. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/Rakefile +38 -0
  180. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock.rb +59 -0
  181. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/api.rb +109 -0
  182. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/assertion_failure.rb +11 -0
  183. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/callback_registry.rb +35 -0
  184. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/config.rb +18 -0
  185. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/cucumber.rb +10 -0
  186. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/deprecation.rb +9 -0
  187. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/errors.rb +17 -0
  188. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/async_http_client_adapter.rb +216 -0
  189. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/curb_adapter.rb +351 -0
  190. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +231 -0
  191. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/excon_adapter.rb +165 -0
  192. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_lib_adapter.rb +7 -0
  193. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb +19 -0
  194. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/client.rb +17 -0
  195. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/request.rb +16 -0
  196. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/response.rb +64 -0
  197. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/streamer.rb +29 -0
  198. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/webmock.rb +68 -0
  199. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb_adapter.rb +37 -0
  200. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/httpclient_adapter.rb +259 -0
  201. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/manticore_adapter.rb +145 -0
  202. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/net_http.rb +385 -0
  203. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/net_http_response.rb +34 -0
  204. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/patron_adapter.rb +130 -0
  205. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +174 -0
  206. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/any_arg_matcher.rb +13 -0
  207. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_argument_matcher.rb +21 -0
  208. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_excluding_matcher.rb +15 -0
  209. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_including_matcher.rb +17 -0
  210. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/minitest.rb +41 -0
  211. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rack_response.rb +69 -0
  212. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_body_diff.rb +64 -0
  213. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_execution_verifier.rb +77 -0
  214. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_pattern.rb +405 -0
  215. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_registry.rb +35 -0
  216. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_signature.rb +54 -0
  217. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_signature_snippet.rb +61 -0
  218. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_stub.rb +100 -0
  219. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/response.rb +159 -0
  220. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/responses_sequence.rb +40 -0
  221. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec.rb +42 -0
  222. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers.rb +27 -0
  223. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/request_pattern_matcher.rb +78 -0
  224. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/webmock_matcher.rb +67 -0
  225. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/stub_registry.rb +82 -0
  226. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/stub_request_snippet.rb +38 -0
  227. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/test_unit.rb +20 -0
  228. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/hash_counter.rb +39 -0
  229. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/hash_keys_stringifier.rb +25 -0
  230. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/hash_validator.rb +17 -0
  231. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/headers.rb +64 -0
  232. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/json.rb +67 -0
  233. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/query_mapper.rb +281 -0
  234. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/uri.rb +111 -0
  235. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/values_stringifier.rb +20 -0
  236. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/version_checker.rb +111 -0
  237. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/version.rb +3 -0
  238. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/webmock.rb +163 -0
  239. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/minitest/test_helper.rb +34 -0
  240. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/minitest/test_webmock.rb +9 -0
  241. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/minitest/webmock_spec.rb +60 -0
  242. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/async_http_client/async_http_client_spec.rb +375 -0
  243. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/async_http_client/async_http_client_spec_helper.rb +73 -0
  244. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/curb/curb_spec.rb +499 -0
  245. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/curb/curb_spec_helper.rb +147 -0
  246. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/em_http_request/em_http_request_spec.rb +462 -0
  247. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/em_http_request/em_http_request_spec_helper.rb +77 -0
  248. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/excon/excon_spec.rb +77 -0
  249. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/excon/excon_spec_helper.rb +52 -0
  250. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/http_rb/http_rb_spec.rb +93 -0
  251. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/http_rb/http_rb_spec_helper.rb +54 -0
  252. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/httpclient/httpclient_spec.rb +217 -0
  253. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/httpclient/httpclient_spec_helper.rb +57 -0
  254. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/manticore/manticore_spec.rb +107 -0
  255. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/manticore/manticore_spec_helper.rb +35 -0
  256. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/net_http_shared.rb +153 -0
  257. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/net_http_spec.rb +369 -0
  258. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/net_http_spec_helper.rb +64 -0
  259. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/real_net_http_spec.rb +20 -0
  260. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/patron/patron_spec.rb +125 -0
  261. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/patron/patron_spec_helper.rb +54 -0
  262. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/allowing_and_disabling_net_connect.rb +313 -0
  263. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/callbacks.rb +148 -0
  264. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/complex_cross_concern_behaviors.rb +36 -0
  265. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/enabling_and_disabling_webmock.rb +95 -0
  266. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/precedence_of_stubs.rb +15 -0
  267. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/request_expectations.rb +930 -0
  268. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/returning_declared_responses.rb +409 -0
  269. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/stubbing_requests.rb +678 -0
  270. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/typhoeus/typhoeus_hydra_spec.rb +135 -0
  271. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb +60 -0
  272. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/webmock_shared.rb +41 -0
  273. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/fixtures/test.txt +1 -0
  274. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/quality_spec.rb +84 -0
  275. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/spec_helper.rb +48 -0
  276. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/example_curl_output.txt +22 -0
  277. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/failures.rb +9 -0
  278. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/my_rack_app.rb +53 -0
  279. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/network_connection.rb +19 -0
  280. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/webmock_server.rb +70 -0
  281. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/api_spec.rb +175 -0
  282. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/errors_spec.rb +129 -0
  283. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb +17 -0
  284. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/http_lib_adapters/http_lib_adapter_spec.rb +12 -0
  285. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/matchers/hash_excluding_matcher_spec.rb +61 -0
  286. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/matchers/hash_including_matcher_spec.rb +87 -0
  287. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/rack_response_spec.rb +112 -0
  288. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_body_diff_spec.rb +90 -0
  289. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_execution_verifier_spec.rb +208 -0
  290. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_pattern_spec.rb +736 -0
  291. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_registry_spec.rb +95 -0
  292. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_signature_snippet_spec.rb +89 -0
  293. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_signature_spec.rb +155 -0
  294. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_stub_spec.rb +199 -0
  295. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/response_spec.rb +286 -0
  296. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/stub_registry_spec.rb +103 -0
  297. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/stub_request_snippet_spec.rb +115 -0
  298. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/hash_counter_spec.rb +39 -0
  299. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/hash_keys_stringifier_spec.rb +27 -0
  300. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/headers_spec.rb +28 -0
  301. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/json_spec.rb +33 -0
  302. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/query_mapper_spec.rb +157 -0
  303. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/uri_spec.rb +371 -0
  304. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/version_checker_spec.rb +65 -0
  305. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/webmock_spec.rb +60 -0
  306. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/http_request.rb +24 -0
  307. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/shared_test.rb +108 -0
  308. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/test_helper.rb +23 -0
  309. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/test_webmock.rb +12 -0
  310. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/webmock.gemspec +54 -0
  311. data/vendor/bundle/jruby/2.5.0/specifications/addressable-2.7.0.gemspec +39 -0
  312. data/vendor/bundle/jruby/2.5.0/specifications/crack-0.4.5.gemspec +32 -0
  313. data/vendor/bundle/jruby/2.5.0/specifications/hashdiff-1.0.1.gemspec +46 -0
  314. data/vendor/bundle/jruby/2.5.0/specifications/public_suffix-4.0.6.gemspec +24 -0
  315. data/vendor/bundle/jruby/2.5.0/specifications/rexml-3.2.5.gemspec +42 -0
  316. data/vendor/bundle/jruby/2.5.0/specifications/webmock-3.13.0.gemspec +85 -0
  317. metadata +309 -2
@@ -0,0 +1,602 @@
1
+ == Class Element
2
+
3
+ Class Element has methods from its superclasses and included modules;
4
+ see:
5
+
6
+ - {Tasks for Parent}[parent_rdoc.html].
7
+ - {Tasks for Child}[child_rdoc.html].
8
+ - {Tasks for Node}[node_rdoc.html].
9
+ - {Module Enumerable}[https://docs.ruby-lang.org/en/master/Enumerable.html].
10
+
11
+ :include: ../tocs/element_toc.rdoc
12
+
13
+ === New Element
14
+
15
+ ==== Task: Create a Default Element
16
+
17
+ Use method
18
+ {Element::new}[../../../../REXML/Element.html#method-c-new]
19
+ with no arguments to create a default element:
20
+
21
+ e = REXML::Element.new
22
+ e.name # => "UNDEFINED"
23
+ e.parent # => nil
24
+ e.context # => nil
25
+
26
+ ==== Task: Create a Named Element
27
+
28
+ Use method
29
+ {Element::new}[../../../../REXML/Element.html#method-c-new]
30
+ with a string name argument
31
+ to create a named element:
32
+
33
+ e = REXML::Element.new('foo')
34
+ e.name # => "foo"
35
+ e.parent # => nil
36
+ e.context # => nil
37
+
38
+ ==== Task: Create an Element with Name and Parent
39
+
40
+ Use method
41
+ {Element::new}[../../../../REXML/Element.html#method-c-new]
42
+ with name and parent arguments
43
+ to create an element with name and parent:
44
+
45
+ p = REXML::Parent.new
46
+ e = REXML::Element.new('foo', p)
47
+ e.name # => "foo"
48
+ e.parent # => #<REXML::Parent @parent=nil, @children=[<foo/>]>
49
+ e.context # => nil
50
+
51
+ ==== Task: Create an Element with Name, Parent, and Context
52
+
53
+ Use method
54
+ {Element::new}[../../../../REXML/Element.html#method-c-new]
55
+ with name, parent, and context arguments
56
+ to create an element with name, parent, and context:
57
+
58
+ p = REXML::Parent.new
59
+ e = REXML::Element.new('foo', p, {compress_whitespace: :all})
60
+ e.name # => "foo"
61
+ e.parent # => #<REXML::Parent @parent=nil, @children=[<foo/>]>
62
+ e.context # => {:compress_whitespace=>:all}
63
+
64
+ ==== Task: Create a Shallow Clone
65
+
66
+ Use method
67
+ {Element#clone}[../../../../REXML/Element.html#method-i-clone]
68
+ to create a shallow clone of an element,
69
+ copying only the name, attributes, and context:
70
+
71
+ e0 = REXML::Element.new('foo', nil, {compress_whitespace: :all})
72
+ e0.add_attribute(REXML::Attribute.new('bar', 'baz'))
73
+ e0.context = {compress_whitespace: :all}
74
+ e1 = e0.clone # => <foo bar='baz'/>
75
+ e1.name # => "foo"
76
+ e1.context # => {:compress_whitespace=>:all}
77
+
78
+ === Attributes
79
+
80
+ ==== Task: Create and Add an Attribute
81
+
82
+ Use method
83
+ {Element#add_attribute}[../../../../REXML/Element.html#method-i-add_attribute]
84
+ to create and add an attribute:
85
+
86
+ e = REXML::Element.new
87
+ e.add_attribute('attr', 'value') # => "value"
88
+ e['attr'] # => "value"
89
+ e.add_attribute('attr', 'VALUE') # => "VALUE"
90
+ e['attr'] # => "VALUE"
91
+
92
+ ==== Task: Add an Existing Attribute
93
+
94
+ Use method
95
+ {Element#add_attribute}[../../../../REXML/Element.html#method-i-add_attribute]
96
+ to add an existing attribute:
97
+
98
+ e = REXML::Element.new
99
+ a = REXML::Attribute.new('attr', 'value')
100
+ e.add_attribute(a)
101
+ e['attr'] # => "value"
102
+ a = REXML::Attribute.new('attr', 'VALUE')
103
+ e.add_attribute(a)
104
+ e['attr'] # => "VALUE"
105
+
106
+ ==== Task: Add Multiple Attributes from a Hash
107
+
108
+ Use method
109
+ {Element#add_attributes}[../../../../REXML/Element.html#method-i-add_attributes]
110
+ to add multiple attributes from a hash:
111
+
112
+ e = REXML::Element.new
113
+ h = {'foo' => 0, 'bar' => 1}
114
+ e.add_attributes(h)
115
+ e['foo'] # => "0"
116
+ e['bar'] # => "1"
117
+
118
+ ==== Task: Add Multiple Attributes from an Array
119
+
120
+ Use method
121
+ {Element#add_attributes}[../../../../REXML/Element.html#method-i-add_attributes]
122
+ to add multiple attributes from an array:
123
+
124
+ e = REXML::Element.new
125
+ a = [['foo', 0], ['bar', 1]]
126
+ e.add_attributes(a)
127
+ e['foo'] # => "0"
128
+ e['bar'] # => "1"
129
+
130
+ ==== Task: Retrieve the Value for an Attribute Name
131
+
132
+ Use method
133
+ {Element#[]}[../../../../REXML/Element.html#method-i-5B-5D]
134
+ to retrieve the value for an attribute name:
135
+
136
+ e = REXML::Element.new
137
+ e.add_attribute('attr', 'value') # => "value"
138
+ e['attr'] # => "value"
139
+
140
+ ==== Task: Retrieve the Attribute Value for a Name and Namespace
141
+
142
+ Use method
143
+ {Element#attribute}[../../../../REXML/Element.html#method-i-attribute]
144
+ to retrieve the value for an attribute name:
145
+
146
+ xml_string = "<root xmlns:a='a' a:x='a:x' x='x'/>"
147
+ d = REXML::Document.new(xml_string)
148
+ e = d.root
149
+ e.attribute("x") # => x='x'
150
+ e.attribute("x", "a") # => a:x='a:x'
151
+
152
+ ==== Task: Delete an Attribute
153
+
154
+ Use method
155
+ {Element#delete_attribute}[../../../../REXML/Element.html#method-i-delete_attribute]
156
+ to remove an attribute:
157
+
158
+ e = REXML::Element.new('foo')
159
+ e.add_attribute('bar', 'baz')
160
+ e.delete_attribute('bar')
161
+ e.delete_attribute('bar')
162
+ e['bar'] # => nil
163
+
164
+ ==== Task: Determine Whether the Element Has Attributes
165
+
166
+ Use method
167
+ {Element#has_attributes?}[../../../../REXML/Element.html#method-i-has_attributes-3F]
168
+ to determine whether the element has attributes:
169
+
170
+ e = REXML::Element.new('foo')
171
+ e.has_attributes? # => false
172
+ e.add_attribute('bar', 'baz')
173
+ e.has_attributes? # => true
174
+
175
+ === Children
176
+
177
+ <em>Element Children</em>
178
+
179
+ ==== Task: Create and Add an Element
180
+
181
+ Use method
182
+ {Element#add_element}[../../../../REXML/Element.html#method-i-add_element]
183
+ to create a new element and add it to this element:
184
+
185
+ e0 = REXML::Element.new('foo')
186
+ e0.add_element('bar')
187
+ e0.children # => [<bar/>]
188
+
189
+ ==== Task: Add an Existing Element
190
+
191
+ Use method
192
+ {Element#add_element}[../../../../REXML/Element.html#method-i-add_element]
193
+ to add an element to this element:
194
+
195
+ e0 = REXML::Element.new('foo')
196
+ e1 = REXML::Element.new('bar')
197
+ e0.add_element(e1)
198
+ e0.children # => [<bar/>]
199
+
200
+ ==== Task: Create and Add an Element with Attributes
201
+
202
+ Use method
203
+ {Element#add_element}[../../../../REXML/Element.html#method-i-add_element]
204
+ to create a new element with attributes, and add it to this element:
205
+
206
+ e0 = REXML::Element.new('foo')
207
+ e0.add_element('bar', {'name' => 'value'})
208
+ e0.children # => [<bar name='value'/>]
209
+
210
+ ==== Task: Add an Existing Element with Added Attributes
211
+
212
+ Use method
213
+ {Element#add_element}[../../../../REXML/Element.html#method-i-add_element]
214
+ to add an element to this element:
215
+
216
+ e0 = REXML::Element.new('foo')
217
+ e1 = REXML::Element.new('bar')
218
+ e0.add_element(e1, {'name' => 'value'})
219
+ e0.children # => [<bar name='value'/>]
220
+
221
+ ==== Task: Delete a Specified Element
222
+
223
+ Use method
224
+ {Element#delete_element}[../../../../REXML/Element.html#method-i-delete_element]
225
+ to remove a specified element from this element:
226
+
227
+ e0 = REXML::Element.new('foo')
228
+ e1 = REXML::Element.new('bar')
229
+ e0.add_element(e1)
230
+ e0.children # => [<bar/>]
231
+ e0.delete_element(e1)
232
+ e0.children # => []
233
+
234
+ ==== Task: Delete an Element by Index
235
+
236
+ Use method
237
+ {Element#delete_element}[../../../../REXML/Element.html#method-i-delete_element]
238
+ to remove an element from this element by index:
239
+
240
+ e0 = REXML::Element.new('foo')
241
+ e1 = REXML::Element.new('bar')
242
+ e0.add_element(e1)
243
+ e0.children # => [<bar/>]
244
+ e0.delete_element(1)
245
+ e0.children # => []
246
+
247
+ ==== Task: Delete an Element by XPath
248
+
249
+ Use method
250
+ {Element#delete_element}[../../../../REXML/Element.html#method-i-delete_element]
251
+ to remove an element from this element by XPath:
252
+
253
+ e0 = REXML::Element.new('foo')
254
+ e1 = REXML::Element.new('bar')
255
+ e0.add_element(e1)
256
+ e0.children # => [<bar/>]
257
+ e0.delete_element('//bar/')
258
+ e0.children # => []
259
+
260
+ ==== Task: Determine Whether Element Children
261
+
262
+ Use method
263
+ {Element#has_elements?}[../../../../REXML/Element.html#method-i-has_elements-3F]
264
+ to determine whether the element has element children:
265
+
266
+ e0 = REXML::Element.new('foo')
267
+ e0.has_elements? # => false
268
+ e0.add_element(REXML::Element.new('bar'))
269
+ e0.has_elements? # => true
270
+
271
+ ==== Task: Get Element Descendants by XPath
272
+
273
+ Use method
274
+ {Element#get_elements}[../../../../REXML/Element.html#method-i-get_elements]
275
+ to fetch all element descendant children by XPath:
276
+
277
+ xml_string = <<-EOT
278
+ <root>
279
+ <a level='1'>
280
+ <a level='2'/>
281
+ </a>
282
+ </root>
283
+ EOT
284
+ d = REXML::Document.new(xml_string)
285
+ d.root.get_elements('//a') # => [<a level='1'> ... </>, <a level='2'/>]
286
+
287
+ ==== Task: Get Next Element Sibling
288
+
289
+ Use method
290
+ {Element#next_element}[../../../../REXML/Element.html#method-i-next_element]
291
+ to retrieve the next element sibling:
292
+
293
+ d = REXML::Document.new '<a><b/>text<c/></a>'
294
+ d.root.elements['b'].next_element #-> <c/>
295
+ d.root.elements['c'].next_element #-> nil
296
+
297
+ ==== Task: Get Previous Element Sibling
298
+
299
+ Use method
300
+ {Element#previous_element}[../../../../REXML/Element.html#method-i-previous_element]
301
+ to retrieve the previous element sibling:
302
+
303
+ d = REXML::Document.new '<a><b/>text<c/></a>'
304
+ d.root.elements['c'].previous_element #-> <b/>
305
+ d.root.elements['b'].previous_element #-> nil
306
+
307
+ <em>Text Children</em>
308
+
309
+ ==== Task: Add a Text Node
310
+
311
+ Use method
312
+ {Element#add_text}[../../../../REXML/Element.html#method-i-add_text]
313
+ to add a text node to the element:
314
+
315
+ d = REXML::Document.new('<a>foo<b/>bar</a>')
316
+ e = d.root
317
+ e.add_text(REXML::Text.new('baz'))
318
+ e.to_a # => ["foo", <b/>, "bar", "baz"]
319
+ e.add_text(REXML::Text.new('baz'))
320
+ e.to_a # => ["foo", <b/>, "bar", "baz", "baz"]
321
+
322
+ ==== Task: Replace the First Text Node
323
+
324
+ Use method
325
+ {Element#text=}[../../../../REXML/Element.html#method-i-text-3D]
326
+ to replace the first text node in the element:
327
+
328
+ d = REXML::Document.new('<root><a/>text<b/>more<c/></root>')
329
+ e = d.root
330
+ e.to_a # => [<a/>, "text", <b/>, "more", <c/>]
331
+ e.text = 'oops'
332
+ e.to_a # => [<a/>, "oops", <b/>, "more", <c/>]
333
+
334
+ ==== Task: Remove the First Text Node
335
+
336
+ Use method
337
+ {Element#text=}[../../../../REXML/Element.html#method-i-text-3D]
338
+ to remove the first text node in the element:
339
+
340
+ d = REXML::Document.new('<root><a/>text<b/>more<c/></root>')
341
+ e = d.root
342
+ e.to_a # => [<a/>, "text", <b/>, "more", <c/>]
343
+ e.text = nil
344
+ e.to_a # => [<a/>, <b/>, "more", <c/>]
345
+
346
+ ==== Task: Retrieve the First Text Node
347
+
348
+ Use method
349
+ {Element#get_text}[../../../../REXML/Element.html#method-i-get_text]
350
+ to retrieve the first text node in the element:
351
+
352
+ d = REXML::Document.new('<root><a/>text<b/>more<c/></root>')
353
+ e = d.root
354
+ e.to_a # => [<a/>, "text", <b/>, "more", <c/>]
355
+ e.get_text # => "text"
356
+
357
+ ==== Task: Retrieve a Specific Text Node
358
+
359
+ Use method
360
+ {Element#get_text}[../../../../REXML/Element.html#method-i-get_text]
361
+ to retrieve the first text node in a specified element:
362
+
363
+ d = REXML::Document.new "<root>some text <b>this is bold!</b> more text</root>"
364
+ e = d.root
365
+ e.get_text('//root') # => "some text "
366
+ e.get_text('//b') # => "this is bold!"
367
+
368
+ ==== Task: Determine Whether the Element has Text Nodes
369
+
370
+ Use method
371
+ {Element#has_text?}[../../../../REXML/Element.html#method-i-has_text-3F]
372
+ to determine whethe the element has text:
373
+
374
+ e = REXML::Element.new('foo')
375
+ e.has_text? # => false
376
+ e.add_text('bar')
377
+ e.has_text? # => true
378
+
379
+ <em>Other Children</em>
380
+
381
+ ==== Task: Get the Child at a Given Index
382
+
383
+ Use method
384
+ {Element#[]}[../../../../REXML/Element.html#method-i-5B-5D]
385
+ to retrieve the child at a given index:
386
+
387
+ d = REXML::Document.new '><root><a/>text<b/>more<c/></root>'
388
+ e = d.root
389
+ e[0] # => <a/>
390
+ e[1] # => "text"
391
+ e[2] # => <b/>
392
+
393
+ ==== Task: Get All CDATA Children
394
+
395
+ Use method
396
+ {Element#cdatas}[../../../../REXML/Element.html#method-i-cdatas]
397
+ to retrieve all CDATA children:
398
+
399
+ xml_string = <<-EOT
400
+ <root>
401
+ <![CDATA[foo]]>
402
+ <![CDATA[bar]]>
403
+ </root>
404
+ EOT
405
+ d = REXML::Document.new(xml_string)
406
+ d.root.cdatas # => ["foo", "bar"]
407
+
408
+ ==== Task: Get All Comment Children
409
+
410
+ Use method
411
+ {Element#comments}[../../../../REXML/Element.html#method-i-comments]
412
+ to retrieve all comment children:
413
+
414
+ xml_string = <<-EOT
415
+ <root>
416
+ <!--foo-->
417
+ <!--bar-->
418
+ </root>
419
+ EOT
420
+ d = REXML::Document.new(xml_string)
421
+ d.root.comments.map {|comment| comment.to_s } # => ["foo", "bar"]
422
+
423
+ ==== Task: Get All Processing Instruction Children
424
+
425
+ Use method
426
+ {Element#instructions}[../../../../REXML/Element.html#method-i-instructions]
427
+ to retrieve all processing instruction children:
428
+
429
+ xml_string = <<-EOT
430
+ <root>
431
+ <?target0 foo?>
432
+ <?target1 bar?>
433
+ </root>
434
+ EOT
435
+ d = REXML::Document.new(xml_string)
436
+ instructions = d.root.instructions.map {|instruction| instruction.to_s }
437
+ instructions # => ["<?target0 foo?>", "<?target1 bar?>"]
438
+
439
+ ==== Task: Get All Text Children
440
+
441
+ Use method
442
+ {Element#texts}[../../../../REXML/Element.html#method-i-texts]
443
+ to retrieve all text children:
444
+
445
+ xml_string = '<root><a/>text<b/>more<c/></root>'
446
+ d = REXML::Document.new(xml_string)
447
+ d.root.texts # => ["text", "more"]
448
+
449
+ === Namespaces
450
+
451
+ ==== Task: Add a Namespace
452
+
453
+ Use method
454
+ {Element#add_namespace}[../../../../REXML/Element.html#method-i-add_namespace]
455
+ to add a namespace to the element:
456
+
457
+ e = REXML::Element.new('foo')
458
+ e.add_namespace('bar')
459
+ e.namespaces # => {"xmlns"=>"bar"}
460
+
461
+ ==== Task: Delete the Default Namespace
462
+
463
+ Use method
464
+ {Element#delete_namespace}[../../../../REXML/Element.html#method-i-delete_namespace]
465
+ to remove the default namespace from the element:
466
+
467
+ d = REXML::Document.new "<a xmlns:foo='bar' xmlns='twiddle'/>"
468
+ d.to_s # => "<a xmlns:foo='bar' xmlns='twiddle'/>"
469
+ d.root.delete_namespace # => <a xmlns:foo='bar'/>
470
+ d.to_s # => "<a xmlns:foo='bar'/>"
471
+
472
+ ==== Task: Delete a Specific Namespace
473
+
474
+ Use method
475
+ {Element#delete_namespace}[../../../../REXML/Element.html#method-i-delete_namespace]
476
+ to remove a specific namespace from the element:
477
+
478
+ d = REXML::Document.new "<a xmlns:foo='bar' xmlns='twiddle'/>"
479
+ d.to_s # => "<a xmlns:foo='bar' xmlns='twiddle'/>"
480
+ d.root.delete_namespace # => <a xmlns:foo='bar'/>
481
+ d.to_s # => "<a xmlns:foo='bar'/>"
482
+ d.root.delete_namespace('foo')
483
+ d.to_s # => "<a/>"
484
+
485
+ ==== Task: Get a Namespace URI
486
+
487
+ Use method
488
+ {Element#namespace}[../../../../REXML/Element.html#method-i-namespace]
489
+ to retrieve a speficic namespace URI for the element:
490
+
491
+ xml_string = <<-EOT
492
+ <root>
493
+ <a xmlns='1' xmlns:y='2'>
494
+ <b/>
495
+ <c xmlns:z='3'/>
496
+ </a>
497
+ </root>
498
+ EOT
499
+ d = REXML::Document.new(xml_string)
500
+ b = d.elements['//b']
501
+ b.namespace # => "1"
502
+ b.namespace('y') # => "2"
503
+
504
+ ==== Task: Retrieve Namespaces
505
+
506
+ Use method
507
+ {Element#namespaces}[../../../../REXML/Element.html#method-i-namespaces]
508
+ to retrieve all namespaces for the element:
509
+
510
+ xml_string = '<a xmlns="foo" xmlns:x="bar" xmlns:y="twee" z="glorp"/>'
511
+ d = REXML::Document.new(xml_string)
512
+ d.root.attributes.namespaces # => {"xmlns"=>"foo", "x"=>"bar", "y"=>"twee"}
513
+
514
+ ==== Task: Retrieve Namespace Prefixes
515
+
516
+ Use method
517
+ {Element#prefixes}[../../../../REXML/Element.html#method-i-prefixes]
518
+ to retrieve all prefixes (namespace names) for the element:
519
+
520
+ xml_string = <<-EOT
521
+ <root>
522
+ <a xmlns:x='1' xmlns:y='2'>
523
+ <b/>
524
+ <c xmlns:z='3'/>
525
+ </a>
526
+ </root>
527
+ EOT
528
+ d = REXML::Document.new(xml_string, {compress_whitespace: :all})
529
+ d.elements['//a'].prefixes # => ["x", "y"]
530
+ d.elements['//b'].prefixes # => ["x", "y"]
531
+ d.elements['//c'].prefixes # => ["x", "y", "z"]
532
+
533
+ === Iteration
534
+
535
+ ==== Task: Iterate Over Elements
536
+
537
+ Use method
538
+ {Element#each_element}[../../../../REXML/Element.html#method-i-each_element]
539
+ to iterate over element children:
540
+
541
+ d = REXML::Document.new '<a><b>b</b><c>b</c><d>d</d><e/></a>'
542
+ d.root.each_element {|e| p e }
543
+
544
+ Output:
545
+
546
+ <b> ... </>
547
+ <c> ... </>
548
+ <d> ... </>
549
+ <e/>
550
+
551
+ ==== Task: Iterate Over Elements Having a Specified Attribute
552
+
553
+ Use method
554
+ {Element#each_element_with_attribute}[../../../../REXML/Element.html#method-i-each_element_with_attribute]
555
+ to iterate over element children that have a specified attribute:
556
+
557
+ d = REXML::Document.new '<a><b id="1"/><c id="2"/><d id="1"/><e/></a>'
558
+ a = d.root
559
+ a.each_element_with_attribute('id') {|e| p e }
560
+
561
+ Output:
562
+
563
+ <b id='1'/>
564
+ <c id='2'/>
565
+ <d id='1'/>
566
+
567
+ ==== Task: Iterate Over Elements Having a Specified Attribute and Value
568
+
569
+ Use method
570
+ {Element#each_element_with_attribute}[../../../../REXML/Element.html#method-i-each_element_with_attribute]
571
+ to iterate over element children that have a specified attribute and value:
572
+
573
+ d = REXML::Document.new '<a><b id="1"/><c id="2"/><d id="1"/><e/></a>'
574
+ a = d.root
575
+ a.each_element_with_attribute('id', '1') {|e| p e }
576
+
577
+ Output:
578
+
579
+ <b id='1'/>
580
+ <d id='1'/>
581
+
582
+ ==== Task: Iterate Over Elements Having Specified Text
583
+
584
+ Use method
585
+ {Element#each_element_with_text}[../../../../REXML/Element.html#method-i-each_element_with_text]
586
+ to iterate over element children that have specified text:
587
+
588
+
589
+ === Context
590
+
591
+ #whitespace
592
+ #ignore_whitespace_nodes
593
+ #raw
594
+
595
+ === Other Getters
596
+
597
+ #document
598
+ #root
599
+ #root_node
600
+ #node_type
601
+ #xpath
602
+ #inspect