challah 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1773) hide show
  1. data/CHANGELOG.md +4 -0
  2. data/lib/challah/railtie.rb +2 -1
  3. data/lib/challah/version.rb +1 -1
  4. data/vendor/bundle/cache/actionmailer-3.2.5.gem +0 -0
  5. data/vendor/bundle/cache/actionpack-3.2.5.gem +0 -0
  6. data/vendor/bundle/cache/activemodel-3.2.5.gem +0 -0
  7. data/vendor/bundle/cache/activerecord-3.2.5.gem +0 -0
  8. data/vendor/bundle/cache/activeresource-3.2.5.gem +0 -0
  9. data/vendor/bundle/cache/activesupport-3.2.5.gem +0 -0
  10. data/vendor/bundle/cache/multi_json-1.3.6.gem +0 -0
  11. data/vendor/bundle/cache/rails-3.2.5.gem +0 -0
  12. data/vendor/bundle/cache/railties-3.2.5.gem +0 -0
  13. data/vendor/bundle/cache/thor-0.15.2.gem +0 -0
  14. data/vendor/bundle/cache/yard-0.8.2.gem +0 -0
  15. data/vendor/bundle/gems/actionmailer-3.2.5/CHANGELOG.md +476 -0
  16. data/vendor/bundle/gems/actionmailer-3.2.5/MIT-LICENSE +21 -0
  17. data/vendor/bundle/gems/actionmailer-3.2.5/README.rdoc +163 -0
  18. data/vendor/bundle/gems/actionmailer-3.2.5/lib/action_mailer/base.rb +737 -0
  19. data/vendor/bundle/gems/actionmailer-3.2.5/lib/action_mailer/collector.rb +30 -0
  20. data/vendor/bundle/gems/actionmailer-3.2.5/lib/action_mailer/delivery_methods.rb +86 -0
  21. data/vendor/bundle/gems/actionmailer-3.2.5/lib/action_mailer/log_subscriber.rb +22 -0
  22. data/vendor/bundle/gems/actionmailer-3.2.5/lib/action_mailer/mail_helper.rb +56 -0
  23. data/vendor/bundle/gems/actionmailer-3.2.5/lib/action_mailer/railtie.rb +44 -0
  24. data/vendor/bundle/gems/actionmailer-3.2.5/lib/action_mailer/test_case.rb +82 -0
  25. data/vendor/bundle/gems/actionmailer-3.2.5/lib/action_mailer/test_helper.rb +61 -0
  26. data/vendor/bundle/gems/actionmailer-3.2.5/lib/action_mailer/version.rb +10 -0
  27. data/vendor/bundle/gems/actionmailer-3.2.5/lib/action_mailer.rb +49 -0
  28. data/vendor/bundle/gems/actionmailer-3.2.5/lib/rails/generators/mailer/USAGE +18 -0
  29. data/vendor/bundle/gems/actionmailer-3.2.5/lib/rails/generators/mailer/mailer_generator.rb +16 -0
  30. data/vendor/bundle/gems/actionmailer-3.2.5/lib/rails/generators/mailer/templates/mailer.rb +18 -0
  31. data/vendor/bundle/gems/actionpack-3.2.5/CHANGELOG.md +5906 -0
  32. data/vendor/bundle/gems/actionpack-3.2.5/MIT-LICENSE +21 -0
  33. data/vendor/bundle/gems/actionpack-3.2.5/README.rdoc +341 -0
  34. data/vendor/bundle/gems/actionpack-3.2.5/lib/abstract_controller/asset_paths.rb +10 -0
  35. data/vendor/bundle/gems/actionpack-3.2.5/lib/abstract_controller/base.rb +213 -0
  36. data/vendor/bundle/gems/actionpack-3.2.5/lib/abstract_controller/callbacks.rb +198 -0
  37. data/vendor/bundle/gems/actionpack-3.2.5/lib/abstract_controller/collector.rb +32 -0
  38. data/vendor/bundle/gems/actionpack-3.2.5/lib/abstract_controller/helpers.rb +167 -0
  39. data/vendor/bundle/gems/actionpack-3.2.5/lib/abstract_controller/layouts.rb +423 -0
  40. data/vendor/bundle/gems/actionpack-3.2.5/lib/abstract_controller/logger.rb +13 -0
  41. data/vendor/bundle/gems/actionpack-3.2.5/lib/abstract_controller/railties/routes_helpers.rb +18 -0
  42. data/vendor/bundle/gems/actionpack-3.2.5/lib/abstract_controller/rendering.rb +179 -0
  43. data/vendor/bundle/gems/actionpack-3.2.5/lib/abstract_controller/translation.rb +13 -0
  44. data/vendor/bundle/gems/actionpack-3.2.5/lib/abstract_controller/url_for.rb +33 -0
  45. data/vendor/bundle/gems/actionpack-3.2.5/lib/abstract_controller/view_paths.rb +96 -0
  46. data/vendor/bundle/gems/actionpack-3.2.5/lib/abstract_controller.rb +28 -0
  47. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/base.rb +235 -0
  48. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/caching/actions.rb +185 -0
  49. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/caching/fragments.rb +127 -0
  50. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/caching/pages.rb +187 -0
  51. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/caching/sweeping.rb +97 -0
  52. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/caching.rb +83 -0
  53. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/deprecated/integration_test.rb +2 -0
  54. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/deprecated/performance_test.rb +1 -0
  55. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/deprecated.rb +3 -0
  56. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/log_subscriber.rb +66 -0
  57. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/compatibility.rb +64 -0
  58. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/conditional_get.rb +131 -0
  59. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/cookies.rb +16 -0
  60. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/data_streaming.rb +157 -0
  61. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/exceptions.rb +46 -0
  62. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/flash.rb +28 -0
  63. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/force_ssl.rb +39 -0
  64. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/head.rb +35 -0
  65. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/helpers.rb +113 -0
  66. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/hide_actions.rb +47 -0
  67. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/http_authentication.rb +466 -0
  68. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/implicit_render.rb +19 -0
  69. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/instrumentation.rb +105 -0
  70. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/mime_responds.rb +317 -0
  71. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/params_wrapper.rb +239 -0
  72. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/rack_delegation.rb +26 -0
  73. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/redirecting.rb +109 -0
  74. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/renderers.rb +109 -0
  75. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/rendering.rb +65 -0
  76. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/request_forgery_protection.rb +113 -0
  77. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/rescue.rb +35 -0
  78. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/responder.rb +286 -0
  79. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/session_management.rb +14 -0
  80. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/streaming.rb +229 -0
  81. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/testing.rb +37 -0
  82. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal/url_for.rb +47 -0
  83. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/metal.rb +250 -0
  84. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/middleware.rb +39 -0
  85. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/railtie.rb +51 -0
  86. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/railties/paths.rb +25 -0
  87. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/record_identifier.rb +85 -0
  88. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/test_case.rb +553 -0
  89. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/vendor/html-scanner/html/document.rb +68 -0
  90. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/vendor/html-scanner/html/node.rb +532 -0
  91. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +177 -0
  92. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/vendor/html-scanner/html/selector.rb +830 -0
  93. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +107 -0
  94. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/vendor/html-scanner/html/version.rb +11 -0
  95. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller/vendor/html-scanner.rb +20 -0
  96. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_controller.rb +65 -0
  97. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/http/cache.rb +123 -0
  98. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/http/filter_parameters.rb +70 -0
  99. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/http/headers.rb +31 -0
  100. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/http/mime_negotiation.rb +110 -0
  101. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/http/mime_type.rb +276 -0
  102. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/http/mime_types.rb +35 -0
  103. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/http/parameter_filter.rb +74 -0
  104. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/http/parameters.rb +83 -0
  105. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/http/rack_cache.rb +62 -0
  106. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/http/request.rb +279 -0
  107. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/http/response.rb +206 -0
  108. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/http/upload.rb +47 -0
  109. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/http/url.rb +174 -0
  110. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/best_standards_support.rb +22 -0
  111. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/body_proxy.rb +30 -0
  112. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/callbacks.rb +32 -0
  113. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/cookies.rb +350 -0
  114. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/debug_exceptions.rb +82 -0
  115. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/exception_wrapper.rb +78 -0
  116. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/flash.rb +260 -0
  117. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/head.rb +18 -0
  118. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/params_parser.rb +75 -0
  119. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/public_exceptions.rb +30 -0
  120. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/reloader.rb +89 -0
  121. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/remote_ip.rb +81 -0
  122. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/request_id.rb +39 -0
  123. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/rescue.rb +26 -0
  124. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/session/abstract_store.rb +79 -0
  125. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/session/cache_store.rb +49 -0
  126. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/session/cookie_store.rb +71 -0
  127. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/session/mem_cache_store.rb +17 -0
  128. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/show_exceptions.rb +87 -0
  129. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/stack.rb +124 -0
  130. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/static.rb +65 -0
  131. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb +31 -0
  132. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/templates/rescues/_trace.erb +26 -0
  133. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb +10 -0
  134. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/templates/rescues/layout.erb +32 -0
  135. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/templates/rescues/missing_template.erb +2 -0
  136. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/templates/rescues/routing_error.erb +15 -0
  137. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/templates/rescues/template_error.erb +17 -0
  138. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb +2 -0
  139. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/railtie.rb +34 -0
  140. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb +1509 -0
  141. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/routing/polymorphic_routes.rb +203 -0
  142. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/routing/redirection.rb +131 -0
  143. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb +658 -0
  144. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/routing/routes_proxy.rb +39 -0
  145. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/routing/url_for.rb +167 -0
  146. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/routing.rb +293 -0
  147. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/testing/assertions/dom.rb +37 -0
  148. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/testing/assertions/response.rb +96 -0
  149. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/testing/assertions/routing.rb +217 -0
  150. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/testing/assertions/selector.rb +435 -0
  151. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/testing/assertions/tag.rb +138 -0
  152. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/testing/assertions.rb +18 -0
  153. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/testing/integration.rb +496 -0
  154. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/testing/performance_test.rb +10 -0
  155. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/testing/test_process.rb +41 -0
  156. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/testing/test_request.rb +74 -0
  157. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch/testing/test_response.rb +29 -0
  158. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_dispatch.rb +102 -0
  159. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_pack/version.rb +10 -0
  160. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_pack.rb +24 -0
  161. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/asset_paths.rb +136 -0
  162. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/base.rb +220 -0
  163. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/buffers.rb +43 -0
  164. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/context.rb +36 -0
  165. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/flows.rb +79 -0
  166. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/active_model_helper.rb +50 -0
  167. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/asset_paths.rb +7 -0
  168. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/asset_tag_helper.rb +459 -0
  169. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb +146 -0
  170. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/asset_tag_helpers/asset_paths.rb +93 -0
  171. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb +192 -0
  172. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb +148 -0
  173. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/atom_feed_helper.rb +200 -0
  174. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/cache_helper.rb +64 -0
  175. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/capture_helper.rb +203 -0
  176. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/controller_helper.rb +23 -0
  177. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/csrf_helper.rb +32 -0
  178. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/date_helper.rb +1054 -0
  179. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/debug_helper.rb +40 -0
  180. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/form_helper.rb +1487 -0
  181. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/form_options_helper.rb +658 -0
  182. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/form_tag_helper.rb +688 -0
  183. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/javascript_helper.rb +114 -0
  184. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/number_helper.rb +539 -0
  185. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/output_safety_helper.rb +38 -0
  186. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/record_tag_helper.rb +109 -0
  187. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/rendering_helper.rb +90 -0
  188. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/sanitize_helper.rb +259 -0
  189. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/tag_helper.rb +160 -0
  190. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/text_helper.rb +426 -0
  191. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/translation_helper.rb +88 -0
  192. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers/url_helper.rb +696 -0
  193. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/helpers.rb +60 -0
  194. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/locale/en.yml +160 -0
  195. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/log_subscriber.rb +28 -0
  196. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/lookup_context.rb +241 -0
  197. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/path_set.rb +89 -0
  198. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/railtie.rb +55 -0
  199. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/renderer/abstract_renderer.rb +41 -0
  200. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/renderer/partial_renderer.rb +415 -0
  201. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/renderer/renderer.rb +54 -0
  202. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/renderer/streaming_template_renderer.rb +106 -0
  203. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/renderer/template_renderer.rb +94 -0
  204. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/template/error.rb +128 -0
  205. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/template/handlers/builder.rb +26 -0
  206. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/template/handlers/erb.rb +109 -0
  207. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/template/handlers.rb +50 -0
  208. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/template/resolver.rb +258 -0
  209. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/template/text.rb +30 -0
  210. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/template.rb +337 -0
  211. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/test_case.rb +244 -0
  212. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view/testing/resolvers.rb +50 -0
  213. data/vendor/bundle/gems/actionpack-3.2.5/lib/action_view.rb +84 -0
  214. data/vendor/bundle/gems/actionpack-3.2.5/lib/sprockets/assets.rake +99 -0
  215. data/vendor/bundle/gems/actionpack-3.2.5/lib/sprockets/bootstrap.rb +37 -0
  216. data/vendor/bundle/gems/actionpack-3.2.5/lib/sprockets/compressors.rb +83 -0
  217. data/vendor/bundle/gems/actionpack-3.2.5/lib/sprockets/helpers/isolated_helper.rb +13 -0
  218. data/vendor/bundle/gems/actionpack-3.2.5/lib/sprockets/helpers/rails_helper.rb +172 -0
  219. data/vendor/bundle/gems/actionpack-3.2.5/lib/sprockets/helpers.rb +6 -0
  220. data/vendor/bundle/gems/actionpack-3.2.5/lib/sprockets/railtie.rb +62 -0
  221. data/vendor/bundle/gems/actionpack-3.2.5/lib/sprockets/static_compiler.rb +64 -0
  222. data/vendor/bundle/gems/activemodel-3.2.5/CHANGELOG.md +134 -0
  223. data/vendor/bundle/gems/activemodel-3.2.5/MIT-LICENSE +21 -0
  224. data/vendor/bundle/gems/activemodel-3.2.5/README.rdoc +211 -0
  225. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/attribute_methods.rb +452 -0
  226. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/callbacks.rb +134 -0
  227. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/conversion.rb +73 -0
  228. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/dirty.rb +167 -0
  229. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/errors.rb +370 -0
  230. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/lint.rb +123 -0
  231. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/locale/en.yml +27 -0
  232. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/mass_assignment_security/permission_set.rb +40 -0
  233. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/mass_assignment_security/sanitizer.rb +59 -0
  234. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/mass_assignment_security.rb +237 -0
  235. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/naming.rb +171 -0
  236. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/observer_array.rb +147 -0
  237. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/observing.rb +252 -0
  238. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/railtie.rb +2 -0
  239. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/secure_password.rb +74 -0
  240. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/serialization.rb +139 -0
  241. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/serializers/json.rb +108 -0
  242. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/serializers/xml.rb +195 -0
  243. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/test_case.rb +16 -0
  244. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/translation.rb +70 -0
  245. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/validations/acceptance.rb +67 -0
  246. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/validations/callbacks.rb +57 -0
  247. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/validations/confirmation.rb +67 -0
  248. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/validations/exclusion.rb +75 -0
  249. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/validations/format.rb +105 -0
  250. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/validations/inclusion.rb +75 -0
  251. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/validations/length.rb +127 -0
  252. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/validations/numericality.rb +138 -0
  253. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/validations/presence.rb +49 -0
  254. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/validations/validates.rb +137 -0
  255. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/validations/with.rb +142 -0
  256. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/validations.rb +235 -0
  257. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/validator.rb +184 -0
  258. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model/version.rb +10 -0
  259. data/vendor/bundle/gems/activemodel-3.2.5/lib/active_model.rb +61 -0
  260. data/vendor/bundle/gems/activerecord-3.2.5/CHANGELOG.md +6792 -0
  261. data/vendor/bundle/gems/activerecord-3.2.5/MIT-LICENSE +20 -0
  262. data/vendor/bundle/gems/activerecord-3.2.5/README.rdoc +222 -0
  263. data/vendor/bundle/gems/activerecord-3.2.5/examples/associations.png +0 -0
  264. data/vendor/bundle/gems/activerecord-3.2.5/examples/performance.rb +177 -0
  265. data/vendor/bundle/gems/activerecord-3.2.5/examples/simple.rb +14 -0
  266. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/aggregations.rb +255 -0
  267. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/alias_tracker.rb +76 -0
  268. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/association.rb +240 -0
  269. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/association_scope.rb +134 -0
  270. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/belongs_to_association.rb +79 -0
  271. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/belongs_to_polymorphic_association.rb +34 -0
  272. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/builder/association.rb +55 -0
  273. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/builder/belongs_to.rb +85 -0
  274. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/builder/collection_association.rb +75 -0
  275. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/builder/has_and_belongs_to_many.rb +57 -0
  276. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/builder/has_many.rb +71 -0
  277. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/builder/has_one.rb +62 -0
  278. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/builder/singular_association.rb +32 -0
  279. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/collection_association.rb +586 -0
  280. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/collection_proxy.rb +131 -0
  281. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/has_and_belongs_to_many_association.rb +69 -0
  282. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/has_many_association.rb +112 -0
  283. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/has_many_through_association.rb +186 -0
  284. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/has_one_association.rb +73 -0
  285. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/has_one_through_association.rb +36 -0
  286. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/join_dependency/join_association.rb +154 -0
  287. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/join_dependency/join_base.rb +24 -0
  288. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/join_dependency/join_part.rb +78 -0
  289. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/join_dependency.rb +214 -0
  290. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/join_helper.rb +55 -0
  291. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/preloader/association.rb +127 -0
  292. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/preloader/belongs_to.rb +17 -0
  293. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/preloader/collection_association.rb +24 -0
  294. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/preloader/has_and_belongs_to_many.rb +60 -0
  295. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/preloader/has_many.rb +17 -0
  296. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/preloader/has_many_through.rb +15 -0
  297. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/preloader/has_one.rb +23 -0
  298. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/preloader/has_one_through.rb +9 -0
  299. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/preloader/singular_association.rb +21 -0
  300. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/preloader/through_association.rb +67 -0
  301. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/preloader.rb +177 -0
  302. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/singular_association.rb +64 -0
  303. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations/through_association.rb +87 -0
  304. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/associations.rb +1604 -0
  305. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/attribute_assignment.rb +221 -0
  306. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/attribute_methods/before_type_cast.rb +31 -0
  307. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/attribute_methods/deprecated_underscore_read.rb +32 -0
  308. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/attribute_methods/dirty.rb +101 -0
  309. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/attribute_methods/primary_key.rb +114 -0
  310. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/attribute_methods/query.rb +39 -0
  311. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/attribute_methods/read.rb +136 -0
  312. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/attribute_methods/serialization.rb +102 -0
  313. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/attribute_methods/time_zone_conversion.rb +63 -0
  314. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/attribute_methods/write.rb +69 -0
  315. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/attribute_methods.rb +273 -0
  316. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/autosave_association.rb +422 -0
  317. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/base.rb +721 -0
  318. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/callbacks.rb +275 -0
  319. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/coders/yaml_column.rb +41 -0
  320. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb +482 -0
  321. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_specification.rb +188 -0
  322. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/database_limits.rb +58 -0
  323. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb +390 -0
  324. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/query_cache.rb +82 -0
  325. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/quoting.rb +115 -0
  326. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/schema_definitions.rb +492 -0
  327. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/schema_statements.rb +606 -0
  328. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract_adapter.rb +296 -0
  329. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +674 -0
  330. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/column.rb +270 -0
  331. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/mysql2_adapter.rb +278 -0
  332. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/mysql_adapter.rb +426 -0
  333. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb +1306 -0
  334. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/schema_cache.rb +50 -0
  335. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/sqlite3_adapter.rb +55 -0
  336. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/sqlite_adapter.rb +579 -0
  337. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/connection_adapters/statement_pool.rb +40 -0
  338. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/counter_cache.rb +119 -0
  339. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/dynamic_finder_match.rb +68 -0
  340. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/dynamic_matchers.rb +79 -0
  341. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/dynamic_scope_match.rb +23 -0
  342. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/errors.rb +195 -0
  343. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/explain.rb +85 -0
  344. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/explain_subscriber.rb +24 -0
  345. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/fixtures/file.rb +65 -0
  346. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/fixtures.rb +922 -0
  347. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/identity_map.rb +162 -0
  348. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/inheritance.rb +174 -0
  349. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/integration.rb +49 -0
  350. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/locale/en.yml +40 -0
  351. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/locking/optimistic.rb +183 -0
  352. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/locking/pessimistic.rb +77 -0
  353. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/log_subscriber.rb +68 -0
  354. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/migration/command_recorder.rb +105 -0
  355. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/migration.rb +781 -0
  356. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/model_schema.rb +366 -0
  357. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/nested_attributes.rb +469 -0
  358. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/observer.rb +121 -0
  359. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/persistence.rb +372 -0
  360. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/query_cache.rb +74 -0
  361. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/querying.rb +58 -0
  362. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/railtie.rb +125 -0
  363. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/railties/console_sandbox.rb +6 -0
  364. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/railties/controller_runtime.rb +49 -0
  365. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/railties/databases.rake +624 -0
  366. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/railties/jdbcmysql_error.rb +16 -0
  367. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/readonly_attributes.rb +26 -0
  368. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/reflection.rb +534 -0
  369. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/relation/batches.rb +90 -0
  370. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/relation/calculations.rb +354 -0
  371. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/relation/delegation.rb +49 -0
  372. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/relation/finder_methods.rb +397 -0
  373. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/relation/predicate_builder.rb +58 -0
  374. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/relation/query_methods.rb +417 -0
  375. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/relation/spawn_methods.rb +148 -0
  376. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/relation.rb +537 -0
  377. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/result.rb +34 -0
  378. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/sanitization.rb +194 -0
  379. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/schema.rb +58 -0
  380. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/schema_dumper.rb +204 -0
  381. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/scoping/default.rb +142 -0
  382. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/scoping/named.rb +202 -0
  383. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/scoping.rb +152 -0
  384. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/serialization.rb +18 -0
  385. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/serializers/xml_serializer.rb +203 -0
  386. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/session_store.rb +358 -0
  387. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/store.rb +50 -0
  388. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/test_case.rb +73 -0
  389. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/timestamp.rb +113 -0
  390. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/transactions.rb +362 -0
  391. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/translation.rb +22 -0
  392. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/validations/associated.rb +43 -0
  393. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/validations/uniqueness.rb +180 -0
  394. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/validations.rb +83 -0
  395. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record/version.rb +10 -0
  396. data/vendor/bundle/gems/activerecord-3.2.5/lib/active_record.rb +147 -0
  397. data/vendor/bundle/gems/activerecord-3.2.5/lib/rails/generators/active_record/migration/migration_generator.rb +25 -0
  398. data/vendor/bundle/gems/activerecord-3.2.5/lib/rails/generators/active_record/migration/templates/migration.rb +34 -0
  399. data/vendor/bundle/gems/activerecord-3.2.5/lib/rails/generators/active_record/migration.rb +15 -0
  400. data/vendor/bundle/gems/activerecord-3.2.5/lib/rails/generators/active_record/model/model_generator.rb +47 -0
  401. data/vendor/bundle/gems/activerecord-3.2.5/lib/rails/generators/active_record/model/templates/migration.rb +15 -0
  402. data/vendor/bundle/gems/activerecord-3.2.5/lib/rails/generators/active_record/model/templates/model.rb +12 -0
  403. data/vendor/bundle/gems/activerecord-3.2.5/lib/rails/generators/active_record/model/templates/module.rb +7 -0
  404. data/vendor/bundle/gems/activerecord-3.2.5/lib/rails/generators/active_record/observer/observer_generator.rb +15 -0
  405. data/vendor/bundle/gems/activerecord-3.2.5/lib/rails/generators/active_record/observer/templates/observer.rb +4 -0
  406. data/vendor/bundle/gems/activerecord-3.2.5/lib/rails/generators/active_record/session_migration/session_migration_generator.rb +25 -0
  407. data/vendor/bundle/gems/activerecord-3.2.5/lib/rails/generators/active_record/session_migration/templates/migration.rb +12 -0
  408. data/vendor/bundle/gems/activerecord-3.2.5/lib/rails/generators/active_record.rb +25 -0
  409. data/vendor/bundle/gems/activeresource-3.2.5/CHANGELOG.md +353 -0
  410. data/vendor/bundle/gems/activeresource-3.2.5/MIT-LICENSE +20 -0
  411. data/vendor/bundle/gems/activeresource-3.2.5/README.rdoc +187 -0
  412. data/vendor/bundle/gems/activeresource-3.2.5/examples/performance.rb +70 -0
  413. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource/base.rb +1482 -0
  414. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource/connection.rb +287 -0
  415. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource/custom_methods.rb +119 -0
  416. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource/exceptions.rb +82 -0
  417. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource/formats/json_format.rb +25 -0
  418. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource/formats/xml_format.rb +25 -0
  419. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource/formats.rb +22 -0
  420. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource/http_mock.rb +335 -0
  421. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource/log_subscriber.rb +15 -0
  422. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource/observing.rb +29 -0
  423. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource/railtie.rb +14 -0
  424. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource/schema.rb +59 -0
  425. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource/validations.rb +134 -0
  426. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource/version.rb +10 -0
  427. data/vendor/bundle/gems/activeresource-3.2.5/lib/active_resource.rb +46 -0
  428. data/vendor/bundle/gems/activesupport-3.2.5/CHANGELOG.md +1693 -0
  429. data/vendor/bundle/gems/activesupport-3.2.5/MIT-LICENSE +20 -0
  430. data/vendor/bundle/gems/activesupport-3.2.5/README.rdoc +33 -0
  431. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/all.rb +3 -0
  432. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/backtrace_cleaner.rb +99 -0
  433. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/base64.rb +54 -0
  434. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/basic_object.rb +21 -0
  435. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/benchmarkable.rb +55 -0
  436. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/buffered_logger.rb +125 -0
  437. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/builder.rb +6 -0
  438. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/cache/file_store.rb +178 -0
  439. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/cache/mem_cache_store.rb +206 -0
  440. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/cache/memory_store.rb +159 -0
  441. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/cache/null_store.rb +44 -0
  442. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/cache/strategy/local_cache.rb +169 -0
  443. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/cache.rb +638 -0
  444. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/callbacks.rb +626 -0
  445. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/concern.rb +131 -0
  446. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/configurable.rb +90 -0
  447. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/array/access.rb +46 -0
  448. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/array/conversions.rb +164 -0
  449. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/array/extract_options.rb +29 -0
  450. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/array/grouping.rb +100 -0
  451. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/array/prepend_and_append.rb +7 -0
  452. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/array/random_access.rb +30 -0
  453. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/array/uniq_by.rb +16 -0
  454. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/array/wrap.rb +48 -0
  455. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/array.rb +8 -0
  456. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/benchmark.rb +7 -0
  457. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/big_decimal/conversions.rb +45 -0
  458. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/big_decimal.rb +1 -0
  459. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/class/attribute.rb +115 -0
  460. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/class/attribute_accessors.rb +168 -0
  461. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/class/delegating_attributes.rb +44 -0
  462. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/class/subclasses.rb +36 -0
  463. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/class.rb +4 -0
  464. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/date/acts_like.rb +8 -0
  465. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/date/calculations.rb +276 -0
  466. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/date/conversions.rb +106 -0
  467. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/date/freeze.rb +33 -0
  468. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/date/zones.rb +14 -0
  469. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/date_time/acts_like.rb +13 -0
  470. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/date_time/calculations.rb +143 -0
  471. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/date_time/conversions.rb +103 -0
  472. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/date_time/zones.rb +21 -0
  473. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/enumerable.rb +127 -0
  474. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/exception.rb +3 -0
  475. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/file/atomic.rb +42 -0
  476. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/file/path.rb +5 -0
  477. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/file.rb +2 -0
  478. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/float/rounding.rb +19 -0
  479. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/float.rb +1 -0
  480. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/hash/conversions.rb +157 -0
  481. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/hash/deep_dup.rb +18 -0
  482. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/hash/deep_merge.rb +21 -0
  483. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/hash/diff.rb +13 -0
  484. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/hash/except.rb +23 -0
  485. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/hash/indifferent_access.rb +24 -0
  486. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/hash/keys.rb +54 -0
  487. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/hash/reverse_merge.rb +23 -0
  488. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/hash/slice.rb +40 -0
  489. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/hash.rb +9 -0
  490. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/integer/inflections.rb +17 -0
  491. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/integer/multiple.rb +10 -0
  492. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/integer/time.rb +39 -0
  493. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/integer.rb +3 -0
  494. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/io.rb +15 -0
  495. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/kernel/agnostics.rb +11 -0
  496. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/kernel/debugger.rb +10 -0
  497. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/kernel/reporting.rb +93 -0
  498. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/kernel/singleton_class.rb +13 -0
  499. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/kernel.rb +4 -0
  500. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/load_error.rb +23 -0
  501. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/logger.rb +83 -0
  502. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/module/aliasing.rb +70 -0
  503. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/module/anonymous.rb +24 -0
  504. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/module/attr_internal.rb +39 -0
  505. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/module/attribute_accessors.rb +64 -0
  506. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/module/delegation.rb +153 -0
  507. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/module/deprecation.rb +9 -0
  508. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/module/introspection.rb +88 -0
  509. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/module/method_names.rb +14 -0
  510. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/module/qualified_const.rb +64 -0
  511. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/module/reachable.rb +8 -0
  512. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/module/remove_method.rb +16 -0
  513. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/module/synchronization.rb +45 -0
  514. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/module.rb +12 -0
  515. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/name_error.rb +18 -0
  516. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/numeric/bytes.rb +44 -0
  517. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/numeric/time.rb +79 -0
  518. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/numeric.rb +2 -0
  519. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/object/acts_like.rb +10 -0
  520. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/object/blank.rb +121 -0
  521. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/object/conversions.rb +4 -0
  522. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/object/duplicable.rb +119 -0
  523. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/object/inclusion.rb +25 -0
  524. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/object/instance_variables.rb +33 -0
  525. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/object/to_json.rb +19 -0
  526. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/object/to_param.rb +55 -0
  527. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/object/to_query.rb +27 -0
  528. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/object/try.rb +57 -0
  529. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/object/with_options.rb +43 -0
  530. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/object.rb +13 -0
  531. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/proc.rb +14 -0
  532. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/process/daemon.rb +23 -0
  533. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/process.rb +1 -0
  534. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/range/blockless_step.rb +29 -0
  535. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/range/conversions.rb +21 -0
  536. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/range/cover.rb +3 -0
  537. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/range/include_range.rb +21 -0
  538. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/range/overlaps.rb +8 -0
  539. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/range.rb +5 -0
  540. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/regexp.rb +5 -0
  541. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/rexml.rb +46 -0
  542. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string/access.rb +99 -0
  543. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string/behavior.rb +6 -0
  544. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string/conversions.rb +66 -0
  545. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string/encoding.rb +11 -0
  546. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string/exclude.rb +11 -0
  547. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string/filters.rb +49 -0
  548. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string/inflections.rb +202 -0
  549. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string/inquiry.rb +13 -0
  550. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string/interpolation.rb +2 -0
  551. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string/multibyte.rb +72 -0
  552. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string/output_safety.rb +187 -0
  553. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string/starts_ends_with.rb +4 -0
  554. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string/strip.rb +26 -0
  555. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string/xchar.rb +18 -0
  556. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/string.rb +14 -0
  557. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/time/acts_like.rb +8 -0
  558. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/time/calculations.rb +358 -0
  559. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/time/conversions.rb +85 -0
  560. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/time/marshal.rb +57 -0
  561. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/time/publicize_conversion_methods.rb +10 -0
  562. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/time/zones.rb +87 -0
  563. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext/uri.rb +30 -0
  564. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/core_ext.rb +3 -0
  565. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/dependencies/autoload.rb +50 -0
  566. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/dependencies.rb +703 -0
  567. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/deprecation/behaviors.rb +49 -0
  568. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/deprecation/method_wrappers.rb +29 -0
  569. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/deprecation/proxy_wrappers.rb +81 -0
  570. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/deprecation/reporting.rb +65 -0
  571. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/deprecation.rb +18 -0
  572. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/descendants_tracker.rb +45 -0
  573. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/duration.rb +110 -0
  574. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/file_update_checker.rb +121 -0
  575. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/file_watcher.rb +36 -0
  576. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/gzip.rb +30 -0
  577. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/hash_with_indifferent_access.rb +168 -0
  578. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/i18n.rb +9 -0
  579. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/i18n_railtie.rb +102 -0
  580. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/inflections.rb +61 -0
  581. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/inflector/inflections.rb +172 -0
  582. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/inflector/methods.rb +320 -0
  583. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/inflector/transliterate.rb +98 -0
  584. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/inflector.rb +7 -0
  585. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/json/decoding.rb +79 -0
  586. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/json/encoding.rb +284 -0
  587. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/json/variable.rb +17 -0
  588. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/json.rb +2 -0
  589. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/lazy_load_hooks.rb +46 -0
  590. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/locale/en.yml +36 -0
  591. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/log_subscriber/test_helper.rb +101 -0
  592. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/log_subscriber.rb +122 -0
  593. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/memoizable.rb +116 -0
  594. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/message_encryptor.rb +103 -0
  595. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/message_verifier.rb +74 -0
  596. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/multibyte/chars.rb +476 -0
  597. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/multibyte/exceptions.rb +8 -0
  598. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/multibyte/unicode.rb +393 -0
  599. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/multibyte/utils.rb +60 -0
  600. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/multibyte.rb +44 -0
  601. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/notifications/fanout.rb +61 -0
  602. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/notifications/instrumenter.rb +53 -0
  603. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/notifications.rb +154 -0
  604. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/option_merger.rb +25 -0
  605. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/ordered_hash.rb +222 -0
  606. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/ordered_options.rb +61 -0
  607. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/railtie.rb +59 -0
  608. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/rescuable.rb +115 -0
  609. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/ruby/shim.rb +22 -0
  610. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/string_inquirer.rb +21 -0
  611. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/tagged_logging.rb +70 -0
  612. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/test_case.rb +34 -0
  613. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/testing/assertions.rb +97 -0
  614. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/testing/declarative.rb +40 -0
  615. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/testing/deprecation.rb +55 -0
  616. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/testing/isolation.rb +157 -0
  617. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/testing/mochaing.rb +7 -0
  618. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/testing/pending.rb +52 -0
  619. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/testing/performance/jruby.rb +115 -0
  620. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/testing/performance/rubinius.rb +113 -0
  621. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/testing/performance/ruby/mri.rb +57 -0
  622. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/testing/performance/ruby/yarv.rb +57 -0
  623. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/testing/performance/ruby.rb +152 -0
  624. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/testing/performance.rb +317 -0
  625. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/testing/setup_and_teardown.rb +116 -0
  626. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/time/autoload.rb +5 -0
  627. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/time.rb +35 -0
  628. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/time_with_zone.rb +354 -0
  629. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/values/time_zone.rb +397 -0
  630. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/values/unicode_tables.dat +0 -0
  631. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/version.rb +10 -0
  632. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/whiny_nil.rb +24 -0
  633. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/xml_mini/jdom.rb +175 -0
  634. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/xml_mini/libxml.rb +80 -0
  635. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/xml_mini/libxmlsax.rb +86 -0
  636. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/xml_mini/nokogiri.rb +84 -0
  637. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/xml_mini/nokogirisax.rb +88 -0
  638. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/xml_mini/rexml.rb +130 -0
  639. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support/xml_mini.rb +168 -0
  640. data/vendor/bundle/gems/activesupport-3.2.5/lib/active_support.rb +82 -0
  641. data/vendor/bundle/gems/multi_json-1.3.6/Gemfile +7 -0
  642. data/vendor/bundle/gems/multi_json-1.3.6/LICENSE.md +20 -0
  643. data/vendor/bundle/gems/multi_json-1.3.6/README.md +119 -0
  644. data/vendor/bundle/gems/multi_json-1.3.6/Rakefile +20 -0
  645. data/vendor/bundle/gems/multi_json-1.3.6/lib/multi_json/adapters/json_common.rb +25 -0
  646. data/vendor/bundle/gems/multi_json-1.3.6/lib/multi_json/adapters/json_gem.rb +12 -0
  647. data/vendor/bundle/gems/multi_json-1.3.6/lib/multi_json/adapters/json_pure.rb +12 -0
  648. data/vendor/bundle/gems/multi_json-1.3.6/lib/multi_json/adapters/nsjsonserialization.rb +34 -0
  649. data/vendor/bundle/gems/multi_json-1.3.6/lib/multi_json/adapters/oj.rb +22 -0
  650. data/vendor/bundle/gems/multi_json-1.3.6/lib/multi_json/adapters/ok_json.rb +48 -0
  651. data/vendor/bundle/gems/multi_json-1.3.6/lib/multi_json/adapters/yajl.rb +18 -0
  652. data/vendor/bundle/gems/multi_json-1.3.6/lib/multi_json/vendor/okjson.rb +602 -0
  653. data/vendor/bundle/gems/multi_json-1.3.6/lib/multi_json/version.rb +3 -0
  654. data/vendor/bundle/gems/multi_json-1.3.6/lib/multi_json.rb +118 -0
  655. data/vendor/bundle/gems/multi_json-1.3.6/multi_json.gemspec +22 -0
  656. data/vendor/bundle/gems/multi_json-1.3.6/spec/adapter_shared_example.rb +115 -0
  657. data/vendor/bundle/gems/multi_json-1.3.6/spec/helper.rb +32 -0
  658. data/vendor/bundle/gems/multi_json-1.3.6/spec/multi_json_spec.rb +87 -0
  659. data/vendor/bundle/gems/railties-3.2.5/CHANGELOG.md +2446 -0
  660. data/vendor/bundle/gems/railties-3.2.5/README.rdoc +35 -0
  661. data/vendor/bundle/gems/railties-3.2.5/bin/rails +7 -0
  662. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/belongs_to.png +0 -0
  663. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/book_icon.gif +0 -0
  664. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/bullet.gif +0 -0
  665. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/challenge.png +0 -0
  666. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/chapters_icon.gif +0 -0
  667. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/check_bullet.gif +0 -0
  668. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/credits_pic_blank.gif +0 -0
  669. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/csrf.png +0 -0
  670. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/customized_error_messages.png +0 -0
  671. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/edge_badge.png +0 -0
  672. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/error_messages.png +0 -0
  673. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/feature_tile.gif +0 -0
  674. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/footer_tile.gif +0 -0
  675. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/fxn.png +0 -0
  676. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/grey_bullet.gif +0 -0
  677. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/habtm.png +0 -0
  678. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/has_many.png +0 -0
  679. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/has_many_through.png +0 -0
  680. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/has_one.png +0 -0
  681. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/has_one_through.png +0 -0
  682. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/header_backdrop.png +0 -0
  683. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/header_tile.gif +0 -0
  684. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/i18n/demo_html_safe.png +0 -0
  685. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/i18n/demo_localized_pirate.png +0 -0
  686. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/i18n/demo_translated_en.png +0 -0
  687. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/i18n/demo_translated_pirate.png +0 -0
  688. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/i18n/demo_translation_missing.png +0 -0
  689. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/i18n/demo_untranslated.png +0 -0
  690. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/README +5 -0
  691. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/1.png +0 -0
  692. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/10.png +0 -0
  693. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/11.png +0 -0
  694. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/12.png +0 -0
  695. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/13.png +0 -0
  696. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/14.png +0 -0
  697. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/15.png +0 -0
  698. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/2.png +0 -0
  699. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/3.png +0 -0
  700. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/4.png +0 -0
  701. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/5.png +0 -0
  702. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/6.png +0 -0
  703. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/7.png +0 -0
  704. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/8.png +0 -0
  705. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/callouts/9.png +0 -0
  706. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/caution.png +0 -0
  707. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/example.png +0 -0
  708. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/home.png +0 -0
  709. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/important.png +0 -0
  710. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/next.png +0 -0
  711. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/note.png +0 -0
  712. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/prev.png +0 -0
  713. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/tip.png +0 -0
  714. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/up.png +0 -0
  715. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/icons/warning.png +0 -0
  716. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/jaimeiniesta.jpg +0 -0
  717. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/nav_arrow.gif +0 -0
  718. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/polymorphic.png +0 -0
  719. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/posts_index.png +0 -0
  720. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/radar.png +0 -0
  721. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/rails_guides_kindle_cover.jpg +0 -0
  722. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/rails_guides_logo.gif +0 -0
  723. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/rails_logo_remix.gif +0 -0
  724. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/rails_welcome.png +0 -0
  725. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/session_fixation.png +0 -0
  726. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/tab_grey.gif +0 -0
  727. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/tab_info.gif +0 -0
  728. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/tab_note.gif +0 -0
  729. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/tab_red.gif +0 -0
  730. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/tab_yellow.gif +0 -0
  731. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/tab_yellow.png +0 -0
  732. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/validation_error_messages.png +0 -0
  733. data/vendor/bundle/gems/railties-3.2.5/guides/assets/images/vijaydev.jpg +0 -0
  734. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/guides.js +7 -0
  735. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushAS3.js +59 -0
  736. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushAppleScript.js +75 -0
  737. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushBash.js +59 -0
  738. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushCSharp.js +65 -0
  739. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushColdFusion.js +100 -0
  740. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushCpp.js +97 -0
  741. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushCss.js +91 -0
  742. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushDelphi.js +55 -0
  743. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushDiff.js +41 -0
  744. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushErlang.js +52 -0
  745. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushGroovy.js +67 -0
  746. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushJScript.js +52 -0
  747. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushJava.js +57 -0
  748. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushJavaFX.js +58 -0
  749. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushPerl.js +72 -0
  750. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushPhp.js +88 -0
  751. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushPlain.js +33 -0
  752. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushPowerShell.js +74 -0
  753. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushPython.js +64 -0
  754. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushRuby.js +55 -0
  755. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushSass.js +94 -0
  756. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushScala.js +51 -0
  757. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushSql.js +66 -0
  758. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushVb.js +56 -0
  759. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shBrushXml.js +69 -0
  760. data/vendor/bundle/gems/railties-3.2.5/guides/assets/javascripts/syntaxhighlighter/shCore.js +17 -0
  761. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/fixes.css +16 -0
  762. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/kindle.css +11 -0
  763. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/main.css +453 -0
  764. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/print.css +52 -0
  765. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/reset.css +43 -0
  766. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/style.css +13 -0
  767. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shCore.css +226 -0
  768. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shCoreDefault.css +328 -0
  769. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shCoreDjango.css +331 -0
  770. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shCoreEclipse.css +339 -0
  771. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shCoreEmacs.css +324 -0
  772. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shCoreFadeToGrey.css +328 -0
  773. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shCoreMDUltra.css +324 -0
  774. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shCoreMidnight.css +324 -0
  775. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shCoreRDark.css +324 -0
  776. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shThemeDefault.css +117 -0
  777. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shThemeDjango.css +120 -0
  778. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shThemeEclipse.css +128 -0
  779. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shThemeEmacs.css +113 -0
  780. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shThemeFadeToGrey.css +117 -0
  781. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shThemeMDUltra.css +113 -0
  782. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shThemeMidnight.css +113 -0
  783. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shThemeRDark.css +113 -0
  784. data/vendor/bundle/gems/railties-3.2.5/guides/assets/stylesheets/syntaxhighlighter/shThemeRailsGuides.css +116 -0
  785. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/Gemfile +38 -0
  786. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/README.rdoc +261 -0
  787. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/Rakefile +7 -0
  788. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/assets/images/rails.png +0 -0
  789. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/assets/javascripts/application.js +15 -0
  790. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/assets/javascripts/comments.js.coffee +3 -0
  791. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/assets/javascripts/home.js.coffee +3 -0
  792. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/assets/javascripts/posts.js.coffee +3 -0
  793. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/assets/stylesheets/application.css +13 -0
  794. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/assets/stylesheets/comments.css.scss +3 -0
  795. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/assets/stylesheets/home.css.scss +3 -0
  796. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/assets/stylesheets/posts.css.scss +3 -0
  797. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/assets/stylesheets/scaffolds.css.scss +56 -0
  798. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/controllers/application_controller.rb +3 -0
  799. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/controllers/comments_controller.rb +16 -0
  800. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/controllers/home_controller.rb +5 -0
  801. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/controllers/posts_controller.rb +84 -0
  802. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/helpers/application_helper.rb +2 -0
  803. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/helpers/comments_helper.rb +2 -0
  804. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/helpers/home_helper.rb +2 -0
  805. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/helpers/posts_helper.rb +5 -0
  806. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/models/comment.rb +3 -0
  807. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/models/post.rb +11 -0
  808. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/models/tag.rb +3 -0
  809. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/views/comments/_comment.html.erb +15 -0
  810. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/views/comments/_form.html.erb +13 -0
  811. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/views/home/index.html.erb +2 -0
  812. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/views/layouts/application.html.erb +14 -0
  813. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/views/posts/_form.html.erb +32 -0
  814. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/views/posts/edit.html.erb +6 -0
  815. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/views/posts/index.html.erb +27 -0
  816. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/views/posts/new.html.erb +5 -0
  817. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/views/posts/show.html.erb +31 -0
  818. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/app/views/tags/_form.html.erb +12 -0
  819. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/application.rb +59 -0
  820. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/boot.rb +6 -0
  821. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/database.yml +25 -0
  822. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/environment.rb +5 -0
  823. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/environments/development.rb +37 -0
  824. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/environments/production.rb +67 -0
  825. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/environments/test.rb +37 -0
  826. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/initializers/backtrace_silencers.rb +7 -0
  827. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/initializers/inflections.rb +15 -0
  828. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/initializers/mime_types.rb +5 -0
  829. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/initializers/secret_token.rb +7 -0
  830. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/initializers/session_store.rb +8 -0
  831. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/initializers/wrap_parameters.rb +14 -0
  832. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/locales/en.yml +5 -0
  833. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config/routes.rb +64 -0
  834. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/config.ru +4 -0
  835. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/db/migrate/20110901012504_create_posts.rb +11 -0
  836. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/db/migrate/20110901012815_create_comments.rb +12 -0
  837. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/db/migrate/20110901013701_create_tags.rb +11 -0
  838. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/db/schema.rb +43 -0
  839. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/db/seeds.rb +7 -0
  840. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/doc/README_FOR_APP +2 -0
  841. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/public/404.html +26 -0
  842. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/public/422.html +26 -0
  843. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/public/500.html +25 -0
  844. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/public/favicon.ico +0 -0
  845. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/public/robots.txt +5 -0
  846. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/script/rails +6 -0
  847. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/test/fixtures/comments.yml +11 -0
  848. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/test/fixtures/posts.yml +11 -0
  849. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/test/fixtures/tags.yml +9 -0
  850. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/test/functional/comments_controller_test.rb +7 -0
  851. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/test/functional/home_controller_test.rb +9 -0
  852. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/test/functional/posts_controller_test.rb +49 -0
  853. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/test/performance/browsing_test.rb +12 -0
  854. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/test/test_helper.rb +13 -0
  855. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/test/unit/comment_test.rb +7 -0
  856. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/test/unit/helpers/comments_helper_test.rb +4 -0
  857. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/test/unit/helpers/home_helper_test.rb +4 -0
  858. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/test/unit/helpers/posts_helper_test.rb +4 -0
  859. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/test/unit/post_test.rb +7 -0
  860. data/vendor/bundle/gems/railties-3.2.5/guides/code/getting_started/test/unit/tag_test.rb +7 -0
  861. data/vendor/bundle/gems/railties-3.2.5/guides/rails_guides/generator.rb +310 -0
  862. data/vendor/bundle/gems/railties-3.2.5/guides/rails_guides/helpers.rb +45 -0
  863. data/vendor/bundle/gems/railties-3.2.5/guides/rails_guides/indexer.rb +69 -0
  864. data/vendor/bundle/gems/railties-3.2.5/guides/rails_guides/levenshtein.rb +31 -0
  865. data/vendor/bundle/gems/railties-3.2.5/guides/rails_guides/textile_extensions.rb +63 -0
  866. data/vendor/bundle/gems/railties-3.2.5/guides/rails_guides.rb +50 -0
  867. data/vendor/bundle/gems/railties-3.2.5/guides/source/2_2_release_notes.textile +422 -0
  868. data/vendor/bundle/gems/railties-3.2.5/guides/source/2_3_release_notes.textile +610 -0
  869. data/vendor/bundle/gems/railties-3.2.5/guides/source/3_0_release_notes.textile +595 -0
  870. data/vendor/bundle/gems/railties-3.2.5/guides/source/3_1_release_notes.textile +431 -0
  871. data/vendor/bundle/gems/railties-3.2.5/guides/source/3_2_release_notes.textile +540 -0
  872. data/vendor/bundle/gems/railties-3.2.5/guides/source/_license.html.erb +2 -0
  873. data/vendor/bundle/gems/railties-3.2.5/guides/source/_welcome.html.erb +19 -0
  874. data/vendor/bundle/gems/railties-3.2.5/guides/source/action_controller_overview.textile +820 -0
  875. data/vendor/bundle/gems/railties-3.2.5/guides/source/action_mailer_basics.textile +516 -0
  876. data/vendor/bundle/gems/railties-3.2.5/guides/source/action_view_overview.textile +1497 -0
  877. data/vendor/bundle/gems/railties-3.2.5/guides/source/active_model_basics.textile +205 -0
  878. data/vendor/bundle/gems/railties-3.2.5/guides/source/active_record_basics.textile +218 -0
  879. data/vendor/bundle/gems/railties-3.2.5/guides/source/active_record_querying.textile +1433 -0
  880. data/vendor/bundle/gems/railties-3.2.5/guides/source/active_record_validations_callbacks.textile +1283 -0
  881. data/vendor/bundle/gems/railties-3.2.5/guides/source/active_resource_basics.textile +120 -0
  882. data/vendor/bundle/gems/railties-3.2.5/guides/source/active_support_core_extensions.textile +3713 -0
  883. data/vendor/bundle/gems/railties-3.2.5/guides/source/ajax_on_rails.textile +267 -0
  884. data/vendor/bundle/gems/railties-3.2.5/guides/source/api_documentation_guidelines.textile +185 -0
  885. data/vendor/bundle/gems/railties-3.2.5/guides/source/asset_pipeline.textile +707 -0
  886. data/vendor/bundle/gems/railties-3.2.5/guides/source/association_basics.textile +1959 -0
  887. data/vendor/bundle/gems/railties-3.2.5/guides/source/caching_with_rails.textile +437 -0
  888. data/vendor/bundle/gems/railties-3.2.5/guides/source/command_line.textile +574 -0
  889. data/vendor/bundle/gems/railties-3.2.5/guides/source/configuring.textile +641 -0
  890. data/vendor/bundle/gems/railties-3.2.5/guides/source/contributing_to_ruby_on_rails.textile +423 -0
  891. data/vendor/bundle/gems/railties-3.2.5/guides/source/credits.html.erb +72 -0
  892. data/vendor/bundle/gems/railties-3.2.5/guides/source/debugging_rails_applications.textile +714 -0
  893. data/vendor/bundle/gems/railties-3.2.5/guides/source/documents.yaml +157 -0
  894. data/vendor/bundle/gems/railties-3.2.5/guides/source/engines.textile +618 -0
  895. data/vendor/bundle/gems/railties-3.2.5/guides/source/form_helpers.textile +798 -0
  896. data/vendor/bundle/gems/railties-3.2.5/guides/source/generators.textile +621 -0
  897. data/vendor/bundle/gems/railties-3.2.5/guides/source/getting_started.textile +1929 -0
  898. data/vendor/bundle/gems/railties-3.2.5/guides/source/i18n.textile +931 -0
  899. data/vendor/bundle/gems/railties-3.2.5/guides/source/index.html.erb +30 -0
  900. data/vendor/bundle/gems/railties-3.2.5/guides/source/initialization.textile +1116 -0
  901. data/vendor/bundle/gems/railties-3.2.5/guides/source/kindle/KINDLE.md +26 -0
  902. data/vendor/bundle/gems/railties-3.2.5/guides/source/kindle/copyright.html.erb +1 -0
  903. data/vendor/bundle/gems/railties-3.2.5/guides/source/kindle/layout.html.erb +27 -0
  904. data/vendor/bundle/gems/railties-3.2.5/guides/source/kindle/rails_guides.opf.erb +52 -0
  905. data/vendor/bundle/gems/railties-3.2.5/guides/source/kindle/toc.html.erb +24 -0
  906. data/vendor/bundle/gems/railties-3.2.5/guides/source/kindle/toc.ncx.erb +64 -0
  907. data/vendor/bundle/gems/railties-3.2.5/guides/source/kindle/welcome.html.erb +5 -0
  908. data/vendor/bundle/gems/railties-3.2.5/guides/source/layout.html.erb +124 -0
  909. data/vendor/bundle/gems/railties-3.2.5/guides/source/layouts_and_rendering.textile +1237 -0
  910. data/vendor/bundle/gems/railties-3.2.5/guides/source/migrations.textile +900 -0
  911. data/vendor/bundle/gems/railties-3.2.5/guides/source/nested_model_forms.textile +222 -0
  912. data/vendor/bundle/gems/railties-3.2.5/guides/source/performance_testing.textile +597 -0
  913. data/vendor/bundle/gems/railties-3.2.5/guides/source/plugins.textile +464 -0
  914. data/vendor/bundle/gems/railties-3.2.5/guides/source/rails_application_templates.textile +240 -0
  915. data/vendor/bundle/gems/railties-3.2.5/guides/source/rails_on_rack.textile +236 -0
  916. data/vendor/bundle/gems/railties-3.2.5/guides/source/routing.textile +885 -0
  917. data/vendor/bundle/gems/railties-3.2.5/guides/source/ruby_on_rails_guides_guidelines.textile +79 -0
  918. data/vendor/bundle/gems/railties-3.2.5/guides/source/security.textile +1004 -0
  919. data/vendor/bundle/gems/railties-3.2.5/guides/source/testing.textile +947 -0
  920. data/vendor/bundle/gems/railties-3.2.5/guides/w3c_validator.rb +91 -0
  921. data/vendor/bundle/gems/railties-3.2.5/lib/rails/all.rb +15 -0
  922. data/vendor/bundle/gems/railties-3.2.5/lib/rails/application/bootstrap.rb +73 -0
  923. data/vendor/bundle/gems/railties-3.2.5/lib/rails/application/configuration.rb +151 -0
  924. data/vendor/bundle/gems/railties-3.2.5/lib/rails/application/finisher.rb +98 -0
  925. data/vendor/bundle/gems/railties-3.2.5/lib/rails/application/railties.rb +13 -0
  926. data/vendor/bundle/gems/railties-3.2.5/lib/rails/application/route_inspector.rb +84 -0
  927. data/vendor/bundle/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb +56 -0
  928. data/vendor/bundle/gems/railties-3.2.5/lib/rails/application.rb +315 -0
  929. data/vendor/bundle/gems/railties-3.2.5/lib/rails/backtrace_cleaner.rb +42 -0
  930. data/vendor/bundle/gems/railties-3.2.5/lib/rails/cli.rb +16 -0
  931. data/vendor/bundle/gems/railties-3.2.5/lib/rails/code_statistics.rb +118 -0
  932. data/vendor/bundle/gems/railties-3.2.5/lib/rails/commands/application.rb +38 -0
  933. data/vendor/bundle/gems/railties-3.2.5/lib/rails/commands/benchmarker.rb +34 -0
  934. data/vendor/bundle/gems/railties-3.2.5/lib/rails/commands/console.rb +55 -0
  935. data/vendor/bundle/gems/railties-3.2.5/lib/rails/commands/dbconsole.rb +123 -0
  936. data/vendor/bundle/gems/railties-3.2.5/lib/rails/commands/destroy.rb +10 -0
  937. data/vendor/bundle/gems/railties-3.2.5/lib/rails/commands/generate.rb +12 -0
  938. data/vendor/bundle/gems/railties-3.2.5/lib/rails/commands/plugin.rb +544 -0
  939. data/vendor/bundle/gems/railties-3.2.5/lib/rails/commands/plugin_new.rb +11 -0
  940. data/vendor/bundle/gems/railties-3.2.5/lib/rails/commands/profiler.rb +32 -0
  941. data/vendor/bundle/gems/railties-3.2.5/lib/rails/commands/runner.rb +54 -0
  942. data/vendor/bundle/gems/railties-3.2.5/lib/rails/commands/server.rb +100 -0
  943. data/vendor/bundle/gems/railties-3.2.5/lib/rails/commands/update.rb +9 -0
  944. data/vendor/bundle/gems/railties-3.2.5/lib/rails/commands.rb +104 -0
  945. data/vendor/bundle/gems/railties-3.2.5/lib/rails/configuration.rb +89 -0
  946. data/vendor/bundle/gems/railties-3.2.5/lib/rails/console/app.rb +36 -0
  947. data/vendor/bundle/gems/railties-3.2.5/lib/rails/console/helpers.rb +11 -0
  948. data/vendor/bundle/gems/railties-3.2.5/lib/rails/engine/commands.rb +43 -0
  949. data/vendor/bundle/gems/railties-3.2.5/lib/rails/engine/configuration.rb +84 -0
  950. data/vendor/bundle/gems/railties-3.2.5/lib/rails/engine/railties.rb +33 -0
  951. data/vendor/bundle/gems/railties-3.2.5/lib/rails/engine.rb +657 -0
  952. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/actions.rb +325 -0
  953. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/active_model.rb +78 -0
  954. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/app_base.rb +281 -0
  955. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/base.rb +389 -0
  956. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/css/assets/assets_generator.rb +13 -0
  957. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/css/assets/templates/stylesheet.css +4 -0
  958. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/css/scaffold/scaffold_generator.rb +16 -0
  959. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/erb/controller/controller_generator.rb +20 -0
  960. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/erb/controller/templates/view.html.erb +2 -0
  961. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/erb/mailer/mailer_generator.rb +13 -0
  962. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/erb/mailer/templates/view.text.erb +3 -0
  963. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/erb/scaffold/scaffold_generator.rb +29 -0
  964. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/erb/scaffold/templates/_form.html.erb +23 -0
  965. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/erb/scaffold/templates/edit.html.erb +6 -0
  966. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/erb/scaffold/templates/index.html.erb +27 -0
  967. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/erb/scaffold/templates/new.html.erb +5 -0
  968. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/erb/scaffold/templates/show.html.erb +12 -0
  969. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/erb.rb +21 -0
  970. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/generated_attribute.rb +107 -0
  971. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/js/assets/assets_generator.rb +13 -0
  972. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/js/assets/templates/javascript.js +2 -0
  973. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/migration.rb +68 -0
  974. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/named_base.rb +202 -0
  975. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/USAGE +15 -0
  976. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/app_generator.rb +303 -0
  977. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/Gemfile +26 -0
  978. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/README +261 -0
  979. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/Rakefile +7 -0
  980. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/app/assets/images/rails.png +0 -0
  981. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt +17 -0
  982. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css +13 -0
  983. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb +3 -0
  984. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/app/helpers/application_helper.rb +2 -0
  985. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +14 -0
  986. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/application.rb +74 -0
  987. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/boot.rb +6 -0
  988. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml +31 -0
  989. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml +86 -0
  990. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml +62 -0
  991. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml +33 -0
  992. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml +43 -0
  993. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml +20 -0
  994. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/databases/mysql.yml +54 -0
  995. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/databases/oracle.yml +39 -0
  996. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml +55 -0
  997. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml +25 -0
  998. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/environment.rb +5 -0
  999. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +41 -0
  1000. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +73 -0
  1001. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +39 -0
  1002. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/initializers/backtrace_silencers.rb +7 -0
  1003. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/initializers/inflections.rb +15 -0
  1004. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/initializers/mime_types.rb +5 -0
  1005. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/initializers/secret_token.rb.tt +7 -0
  1006. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/initializers/session_store.rb.tt +8 -0
  1007. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt +16 -0
  1008. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/locales/en.yml +5 -0
  1009. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config/routes.rb +58 -0
  1010. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/config.ru +4 -0
  1011. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +7 -0
  1012. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/doc/README_FOR_APP +2 -0
  1013. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/gitignore +15 -0
  1014. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/public/404.html +26 -0
  1015. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/public/422.html +26 -0
  1016. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/public/500.html +25 -0
  1017. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/public/favicon.ico +0 -0
  1018. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/public/index.html +241 -0
  1019. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/public/robots.txt +5 -0
  1020. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/script/rails +5 -0
  1021. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/test/performance/browsing_test.rb +12 -0
  1022. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/app/templates/test/test_helper.rb +15 -0
  1023. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/assets/USAGE +20 -0
  1024. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/assets/assets_generator.rb +25 -0
  1025. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/assets/templates/javascript.js +2 -0
  1026. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/assets/templates/stylesheet.css +4 -0
  1027. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/controller/USAGE +18 -0
  1028. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/controller/controller_generator.rb +20 -0
  1029. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/controller/templates/controller.rb +13 -0
  1030. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/generator/USAGE +12 -0
  1031. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/generator/generator_generator.rb +25 -0
  1032. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +3 -0
  1033. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/generator/templates/USAGE.tt +8 -0
  1034. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/helper/USAGE +17 -0
  1035. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/helper/helper_generator.rb +13 -0
  1036. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/helper/templates/helper.rb +4 -0
  1037. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/integration_test/USAGE +10 -0
  1038. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/integration_test/integration_test_generator.rb +7 -0
  1039. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/migration/USAGE +29 -0
  1040. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/migration/migration_generator.rb +8 -0
  1041. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/model/USAGE +45 -0
  1042. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/model/model_generator.rb +8 -0
  1043. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/observer/USAGE +12 -0
  1044. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/observer/observer_generator.rb +7 -0
  1045. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/performance_test/USAGE +10 -0
  1046. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/performance_test/performance_test_generator.rb +7 -0
  1047. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/USAGE +10 -0
  1048. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb +318 -0
  1049. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec +27 -0
  1050. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/Gemfile +23 -0
  1051. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/MIT-LICENSE +20 -0
  1052. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/README.rdoc +3 -0
  1053. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/Rakefile +31 -0
  1054. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/app/controllers/%name%/application_controller.rb.tt +4 -0
  1055. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/app/helpers/%name%/application_helper.rb.tt +4 -0
  1056. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/app/views/layouts/%name%/application.html.erb.tt +14 -0
  1057. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/config/routes.rb +6 -0
  1058. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/gitignore +7 -0
  1059. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/lib/%name%/engine.rb +7 -0
  1060. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/lib/%name%/version.rb +3 -0
  1061. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/lib/%name%.rb +6 -0
  1062. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/lib/tasks/%name%_tasks.rake +4 -0
  1063. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/rails/application.rb +18 -0
  1064. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/rails/boot.rb +10 -0
  1065. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/rails/routes.rb +4 -0
  1066. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/script/rails.tt +7 -0
  1067. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/test/%name%_test.rb +7 -0
  1068. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/test/integration/navigation_test.rb +12 -0
  1069. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb +15 -0
  1070. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/resource/USAGE +23 -0
  1071. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/resource/resource_generator.rb +20 -0
  1072. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/resource_route/resource_route_generator.rb +13 -0
  1073. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/scaffold/USAGE +35 -0
  1074. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/scaffold/scaffold_generator.rb +23 -0
  1075. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/scaffold/templates/scaffold.css +56 -0
  1076. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/scaffold_controller/USAGE +20 -0
  1077. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +25 -0
  1078. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/scaffold_controller/templates/controller.rb +89 -0
  1079. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/session_migration/USAGE +8 -0
  1080. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/session_migration/session_migration_generator.rb +8 -0
  1081. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/task/USAGE +9 -0
  1082. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/task/task_generator.rb +12 -0
  1083. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/rails/task/templates/task.rb +8 -0
  1084. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/resource_helpers.rb +80 -0
  1085. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_case.rb +247 -0
  1086. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/controller/controller_generator.rb +15 -0
  1087. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/controller/templates/functional_test.rb +19 -0
  1088. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/helper/helper_generator.rb +13 -0
  1089. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/helper/templates/helper_test.rb +6 -0
  1090. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/integration/integration_generator.rb +13 -0
  1091. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/integration/templates/integration_test.rb +7 -0
  1092. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/mailer/mailer_generator.rb +14 -0
  1093. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/mailer/templates/functional_test.rb +21 -0
  1094. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/model/model_generator.rb +24 -0
  1095. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/model/templates/fixtures.yml +23 -0
  1096. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/model/templates/unit_test.rb +9 -0
  1097. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/observer/observer_generator.rb +13 -0
  1098. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/observer/templates/unit_test.rb +9 -0
  1099. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/performance/performance_generator.rb +13 -0
  1100. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/performance/templates/performance_test.rb +12 -0
  1101. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/plugin/plugin_generator.rb +13 -0
  1102. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt +7 -0
  1103. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/plugin/templates/test_helper.rb +3 -0
  1104. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +38 -0
  1105. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb +51 -0
  1106. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators/test_unit.rb +8 -0
  1107. data/vendor/bundle/gems/railties-3.2.5/lib/rails/generators.rb +339 -0
  1108. data/vendor/bundle/gems/railties-3.2.5/lib/rails/info.rb +116 -0
  1109. data/vendor/bundle/gems/railties-3.2.5/lib/rails/info_controller.rb +15 -0
  1110. data/vendor/bundle/gems/railties-3.2.5/lib/rails/initializable.rb +89 -0
  1111. data/vendor/bundle/gems/railties-3.2.5/lib/rails/paths.rb +211 -0
  1112. data/vendor/bundle/gems/railties-3.2.5/lib/rails/performance_test_help.rb +3 -0
  1113. data/vendor/bundle/gems/railties-3.2.5/lib/rails/plugin.rb +92 -0
  1114. data/vendor/bundle/gems/railties-3.2.5/lib/rails/rack/debugger.rb +24 -0
  1115. data/vendor/bundle/gems/railties-3.2.5/lib/rails/rack/log_tailer.rb +34 -0
  1116. data/vendor/bundle/gems/railties-3.2.5/lib/rails/rack/logger.rb +47 -0
  1117. data/vendor/bundle/gems/railties-3.2.5/lib/rails/rack.rb +7 -0
  1118. data/vendor/bundle/gems/railties-3.2.5/lib/rails/railtie/configurable.rb +35 -0
  1119. data/vendor/bundle/gems/railties-3.2.5/lib/rails/railtie/configuration.rb +90 -0
  1120. data/vendor/bundle/gems/railties-3.2.5/lib/rails/railtie.rb +202 -0
  1121. data/vendor/bundle/gems/railties-3.2.5/lib/rails/ruby_version_check.rb +23 -0
  1122. data/vendor/bundle/gems/railties-3.2.5/lib/rails/rubyprof_ext.rb +35 -0
  1123. data/vendor/bundle/gems/railties-3.2.5/lib/rails/script_rails_loader.rb +29 -0
  1124. data/vendor/bundle/gems/railties-3.2.5/lib/rails/source_annotation_extractor.rb +104 -0
  1125. data/vendor/bundle/gems/railties-3.2.5/lib/rails/tasks/annotations.rake +20 -0
  1126. data/vendor/bundle/gems/railties-3.2.5/lib/rails/tasks/documentation.rake +155 -0
  1127. data/vendor/bundle/gems/railties-3.2.5/lib/rails/tasks/engine.rake +72 -0
  1128. data/vendor/bundle/gems/railties-3.2.5/lib/rails/tasks/framework.rake +76 -0
  1129. data/vendor/bundle/gems/railties-3.2.5/lib/rails/tasks/log.rake +9 -0
  1130. data/vendor/bundle/gems/railties-3.2.5/lib/rails/tasks/middleware.rake +7 -0
  1131. data/vendor/bundle/gems/railties-3.2.5/lib/rails/tasks/misc.rake +67 -0
  1132. data/vendor/bundle/gems/railties-3.2.5/lib/rails/tasks/routes.rake +9 -0
  1133. data/vendor/bundle/gems/railties-3.2.5/lib/rails/tasks/statistics.rake +16 -0
  1134. data/vendor/bundle/gems/railties-3.2.5/lib/rails/tasks/tmp.rake +37 -0
  1135. data/vendor/bundle/gems/railties-3.2.5/lib/rails/tasks.rb +16 -0
  1136. data/vendor/bundle/gems/railties-3.2.5/lib/rails/test_help.rb +56 -0
  1137. data/vendor/bundle/gems/railties-3.2.5/lib/rails/test_unit/railtie.rb +15 -0
  1138. data/vendor/bundle/gems/railties-3.2.5/lib/rails/test_unit/sub_test_task.rb +8 -0
  1139. data/vendor/bundle/gems/railties-3.2.5/lib/rails/test_unit/testing.rake +146 -0
  1140. data/vendor/bundle/gems/railties-3.2.5/lib/rails/version.rb +10 -0
  1141. data/vendor/bundle/gems/railties-3.2.5/lib/rails.rb +126 -0
  1142. data/vendor/bundle/gems/thor-0.15.2/CHANGELOG.rdoc +103 -0
  1143. data/vendor/bundle/gems/thor-0.15.2/Gemfile +15 -0
  1144. data/vendor/bundle/gems/thor-0.15.2/LICENSE.md +20 -0
  1145. data/vendor/bundle/gems/thor-0.15.2/README.md +28 -0
  1146. data/vendor/bundle/gems/thor-0.15.2/Thorfile +30 -0
  1147. data/vendor/bundle/gems/thor-0.15.2/bin/rake2thor +86 -0
  1148. data/vendor/bundle/gems/thor-0.15.2/bin/thor +6 -0
  1149. data/vendor/bundle/gems/thor-0.15.2/lib/thor/actions/create_file.rb +105 -0
  1150. data/vendor/bundle/gems/thor-0.15.2/lib/thor/actions/create_link.rb +57 -0
  1151. data/vendor/bundle/gems/thor-0.15.2/lib/thor/actions/directory.rb +97 -0
  1152. data/vendor/bundle/gems/thor-0.15.2/lib/thor/actions/empty_directory.rb +153 -0
  1153. data/vendor/bundle/gems/thor-0.15.2/lib/thor/actions/file_manipulation.rb +308 -0
  1154. data/vendor/bundle/gems/thor-0.15.2/lib/thor/actions/inject_into_file.rb +109 -0
  1155. data/vendor/bundle/gems/thor-0.15.2/lib/thor/actions.rb +318 -0
  1156. data/vendor/bundle/gems/thor-0.15.2/lib/thor/base.rb +617 -0
  1157. data/vendor/bundle/gems/thor-0.15.2/lib/thor/core_ext/file_binary_read.rb +9 -0
  1158. data/vendor/bundle/gems/thor-0.15.2/lib/thor/core_ext/hash_with_indifferent_access.rb +75 -0
  1159. data/vendor/bundle/gems/thor-0.15.2/lib/thor/core_ext/ordered_hash.rb +100 -0
  1160. data/vendor/bundle/gems/thor-0.15.2/lib/thor/error.rb +35 -0
  1161. data/vendor/bundle/gems/thor-0.15.2/lib/thor/group.rb +285 -0
  1162. data/vendor/bundle/gems/thor-0.15.2/lib/thor/invocation.rb +170 -0
  1163. data/vendor/bundle/gems/thor-0.15.2/lib/thor/parser/argument.rb +67 -0
  1164. data/vendor/bundle/gems/thor-0.15.2/lib/thor/parser/arguments.rb +165 -0
  1165. data/vendor/bundle/gems/thor-0.15.2/lib/thor/parser/option.rb +121 -0
  1166. data/vendor/bundle/gems/thor-0.15.2/lib/thor/parser/options.rb +178 -0
  1167. data/vendor/bundle/gems/thor-0.15.2/lib/thor/parser.rb +4 -0
  1168. data/vendor/bundle/gems/thor-0.15.2/lib/thor/rake_compat.rb +71 -0
  1169. data/vendor/bundle/gems/thor-0.15.2/lib/thor/runner.rb +321 -0
  1170. data/vendor/bundle/gems/thor-0.15.2/lib/thor/shell/basic.rb +389 -0
  1171. data/vendor/bundle/gems/thor-0.15.2/lib/thor/shell/color.rb +144 -0
  1172. data/vendor/bundle/gems/thor-0.15.2/lib/thor/shell/html.rb +123 -0
  1173. data/vendor/bundle/gems/thor-0.15.2/lib/thor/shell.rb +88 -0
  1174. data/vendor/bundle/gems/thor-0.15.2/lib/thor/task.rb +132 -0
  1175. data/vendor/bundle/gems/thor-0.15.2/lib/thor/util.rb +248 -0
  1176. data/vendor/bundle/gems/thor-0.15.2/lib/thor/version.rb +3 -0
  1177. data/vendor/bundle/gems/thor-0.15.2/lib/thor.rb +379 -0
  1178. data/vendor/bundle/gems/thor-0.15.2/spec/actions/create_file_spec.rb +170 -0
  1179. data/vendor/bundle/gems/thor-0.15.2/spec/actions/create_link_spec.rb +81 -0
  1180. data/vendor/bundle/gems/thor-0.15.2/spec/actions/directory_spec.rb +136 -0
  1181. data/vendor/bundle/gems/thor-0.15.2/spec/actions/empty_directory_spec.rb +130 -0
  1182. data/vendor/bundle/gems/thor-0.15.2/spec/actions/file_manipulation_spec.rb +370 -0
  1183. data/vendor/bundle/gems/thor-0.15.2/spec/actions/inject_into_file_spec.rb +135 -0
  1184. data/vendor/bundle/gems/thor-0.15.2/spec/actions_spec.rb +326 -0
  1185. data/vendor/bundle/gems/thor-0.15.2/spec/base_spec.rb +274 -0
  1186. data/vendor/bundle/gems/thor-0.15.2/spec/core_ext/hash_with_indifferent_access_spec.rb +43 -0
  1187. data/vendor/bundle/gems/thor-0.15.2/spec/core_ext/ordered_hash_spec.rb +115 -0
  1188. data/vendor/bundle/gems/thor-0.15.2/spec/exit_condition_spec.rb +19 -0
  1189. data/vendor/bundle/gems/thor-0.15.2/spec/fixtures/application.rb +2 -0
  1190. data/vendor/bundle/gems/thor-0.15.2/spec/fixtures/bundle/execute.rb +6 -0
  1191. data/vendor/bundle/gems/thor-0.15.2/spec/fixtures/bundle/main.thor +1 -0
  1192. data/vendor/bundle/gems/thor-0.15.2/spec/fixtures/doc/%file_name%.rb.tt +1 -0
  1193. data/vendor/bundle/gems/thor-0.15.2/spec/fixtures/doc/COMMENTER +10 -0
  1194. data/vendor/bundle/gems/thor-0.15.2/spec/fixtures/doc/README +3 -0
  1195. data/vendor/bundle/gems/thor-0.15.2/spec/fixtures/doc/block_helper.rb +3 -0
  1196. data/vendor/bundle/gems/thor-0.15.2/spec/fixtures/doc/config.rb +1 -0
  1197. data/vendor/bundle/gems/thor-0.15.2/spec/fixtures/doc/config.yaml.tt +1 -0
  1198. data/vendor/bundle/gems/thor-0.15.2/spec/fixtures/group.thor +114 -0
  1199. data/vendor/bundle/gems/thor-0.15.2/spec/fixtures/invoke.thor +112 -0
  1200. data/vendor/bundle/gems/thor-0.15.2/spec/fixtures/path with spaces +0 -0
  1201. data/vendor/bundle/gems/thor-0.15.2/spec/fixtures/script.thor +190 -0
  1202. data/vendor/bundle/gems/thor-0.15.2/spec/fixtures/task.thor +10 -0
  1203. data/vendor/bundle/gems/thor-0.15.2/spec/group_spec.rb +216 -0
  1204. data/vendor/bundle/gems/thor-0.15.2/spec/invocation_spec.rb +100 -0
  1205. data/vendor/bundle/gems/thor-0.15.2/spec/parser/argument_spec.rb +47 -0
  1206. data/vendor/bundle/gems/thor-0.15.2/spec/parser/arguments_spec.rb +65 -0
  1207. data/vendor/bundle/gems/thor-0.15.2/spec/parser/option_spec.rb +202 -0
  1208. data/vendor/bundle/gems/thor-0.15.2/spec/parser/options_spec.rb +329 -0
  1209. data/vendor/bundle/gems/thor-0.15.2/spec/rake_compat_spec.rb +72 -0
  1210. data/vendor/bundle/gems/thor-0.15.2/spec/register_spec.rb +135 -0
  1211. data/vendor/bundle/gems/thor-0.15.2/spec/runner_spec.rb +241 -0
  1212. data/vendor/bundle/gems/thor-0.15.2/spec/shell/basic_spec.rb +300 -0
  1213. data/vendor/bundle/gems/thor-0.15.2/spec/shell/color_spec.rb +81 -0
  1214. data/vendor/bundle/gems/thor-0.15.2/spec/shell/html_spec.rb +32 -0
  1215. data/vendor/bundle/gems/thor-0.15.2/spec/shell_spec.rb +47 -0
  1216. data/vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb +58 -0
  1217. data/vendor/bundle/gems/thor-0.15.2/spec/task_spec.rb +79 -0
  1218. data/vendor/bundle/gems/thor-0.15.2/spec/thor_spec.rb +387 -0
  1219. data/vendor/bundle/gems/thor-0.15.2/spec/util_spec.rb +163 -0
  1220. data/vendor/bundle/gems/thor-0.15.2/thor.gemspec +26 -0
  1221. data/vendor/bundle/gems/yard-0.8.2/ChangeLog +12178 -0
  1222. data/vendor/bundle/gems/yard-0.8.2/LEGAL +74 -0
  1223. data/vendor/bundle/gems/yard-0.8.2/LICENSE +22 -0
  1224. data/vendor/bundle/gems/yard-0.8.2/README.md +553 -0
  1225. data/vendor/bundle/gems/yard-0.8.2/Rakefile +93 -0
  1226. data/vendor/bundle/gems/yard-0.8.2/benchmarks/builtins_vs_eval.rb +23 -0
  1227. data/vendor/bundle/gems/yard-0.8.2/benchmarks/concat_vs_join.rb +12 -0
  1228. data/vendor/bundle/gems/yard-0.8.2/benchmarks/erb_vs_erubis.rb +53 -0
  1229. data/vendor/bundle/gems/yard-0.8.2/benchmarks/format_args.rb +46 -0
  1230. data/vendor/bundle/gems/yard-0.8.2/benchmarks/generation.rb +37 -0
  1231. data/vendor/bundle/gems/yard-0.8.2/benchmarks/marshal_vs_dbm.rb +63 -0
  1232. data/vendor/bundle/gems/yard-0.8.2/benchmarks/parsing.rb +46 -0
  1233. data/vendor/bundle/gems/yard-0.8.2/benchmarks/pathname_vs_string.rb +50 -0
  1234. data/vendor/bundle/gems/yard-0.8.2/benchmarks/rdoc_vs_yardoc.rb +10 -0
  1235. data/vendor/bundle/gems/yard-0.8.2/benchmarks/registry_store_types.rb +48 -0
  1236. data/vendor/bundle/gems/yard-0.8.2/benchmarks/ri_vs_yri.rb +18 -0
  1237. data/vendor/bundle/gems/yard-0.8.2/benchmarks/ripper_parser.rb +12 -0
  1238. data/vendor/bundle/gems/yard-0.8.2/benchmarks/splat_vs_flatten.rb +12 -0
  1239. data/vendor/bundle/gems/yard-0.8.2/benchmarks/template_erb.rb +22 -0
  1240. data/vendor/bundle/gems/yard-0.8.2/benchmarks/template_format.rb +6 -0
  1241. data/vendor/bundle/gems/yard-0.8.2/benchmarks/template_profile.rb +17 -0
  1242. data/vendor/bundle/gems/yard-0.8.2/benchmarks/yri_cache.rb +19 -0
  1243. data/vendor/bundle/gems/yard-0.8.2/bin/yard +12 -0
  1244. data/vendor/bundle/gems/yard-0.8.2/bin/yardoc +12 -0
  1245. data/vendor/bundle/gems/yard-0.8.2/bin/yri +12 -0
  1246. data/vendor/bundle/gems/yard-0.8.2/docs/CodeObjects.md +115 -0
  1247. data/vendor/bundle/gems/yard-0.8.2/docs/GettingStarted.md +592 -0
  1248. data/vendor/bundle/gems/yard-0.8.2/docs/Handlers.md +152 -0
  1249. data/vendor/bundle/gems/yard-0.8.2/docs/Overview.md +61 -0
  1250. data/vendor/bundle/gems/yard-0.8.2/docs/Parser.md +191 -0
  1251. data/vendor/bundle/gems/yard-0.8.2/docs/Tags.md +282 -0
  1252. data/vendor/bundle/gems/yard-0.8.2/docs/TagsArch.md +123 -0
  1253. data/vendor/bundle/gems/yard-0.8.2/docs/Templates.md +496 -0
  1254. data/vendor/bundle/gems/yard-0.8.2/docs/WhatsNew.md +1166 -0
  1255. data/vendor/bundle/gems/yard-0.8.2/docs/images/code-objects-class-diagram.png +0 -0
  1256. data/vendor/bundle/gems/yard-0.8.2/docs/images/handlers-class-diagram.png +0 -0
  1257. data/vendor/bundle/gems/yard-0.8.2/docs/images/overview-class-diagram.png +0 -0
  1258. data/vendor/bundle/gems/yard-0.8.2/docs/images/parser-class-diagram.png +0 -0
  1259. data/vendor/bundle/gems/yard-0.8.2/docs/images/tags-class-diagram.png +0 -0
  1260. data/vendor/bundle/gems/yard-0.8.2/docs/templates/default/fulldoc/html/full_list_tag.erb +7 -0
  1261. data/vendor/bundle/gems/yard-0.8.2/docs/templates/default/fulldoc/html/setup.rb +6 -0
  1262. data/vendor/bundle/gems/yard-0.8.2/docs/templates/default/layout/html/setup.rb +8 -0
  1263. data/vendor/bundle/gems/yard-0.8.2/docs/templates/default/layout/html/tag_list.erb +11 -0
  1264. data/vendor/bundle/gems/yard-0.8.2/docs/templates/default/yard_tags/html/list.erb +18 -0
  1265. data/vendor/bundle/gems/yard-0.8.2/docs/templates/default/yard_tags/html/setup.rb +27 -0
  1266. data/vendor/bundle/gems/yard-0.8.2/docs/templates/plugin.rb +65 -0
  1267. data/vendor/bundle/gems/yard-0.8.2/lib/rubygems_plugin.rb +4 -0
  1268. data/vendor/bundle/gems/yard-0.8.2/lib/yard/autoload.rb +284 -0
  1269. data/vendor/bundle/gems/yard-0.8.2/lib/yard/cli/command.rb +76 -0
  1270. data/vendor/bundle/gems/yard-0.8.2/lib/yard/cli/command_parser.rb +90 -0
  1271. data/vendor/bundle/gems/yard-0.8.2/lib/yard/cli/config.rb +136 -0
  1272. data/vendor/bundle/gems/yard-0.8.2/lib/yard/cli/diff.rb +201 -0
  1273. data/vendor/bundle/gems/yard-0.8.2/lib/yard/cli/gems.rb +83 -0
  1274. data/vendor/bundle/gems/yard-0.8.2/lib/yard/cli/graph.rb +121 -0
  1275. data/vendor/bundle/gems/yard-0.8.2/lib/yard/cli/help.rb +18 -0
  1276. data/vendor/bundle/gems/yard-0.8.2/lib/yard/cli/i18n.rb +69 -0
  1277. data/vendor/bundle/gems/yard-0.8.2/lib/yard/cli/list.rb +22 -0
  1278. data/vendor/bundle/gems/yard-0.8.2/lib/yard/cli/server.rb +183 -0
  1279. data/vendor/bundle/gems/yard-0.8.2/lib/yard/cli/stats.rb +213 -0
  1280. data/vendor/bundle/gems/yard-0.8.2/lib/yard/cli/yardoc.rb +776 -0
  1281. data/vendor/bundle/gems/yard-0.8.2/lib/yard/cli/yri.rb +214 -0
  1282. data/vendor/bundle/gems/yard-0.8.2/lib/yard/code_objects/base.rb +551 -0
  1283. data/vendor/bundle/gems/yard-0.8.2/lib/yard/code_objects/class_object.rb +143 -0
  1284. data/vendor/bundle/gems/yard-0.8.2/lib/yard/code_objects/class_variable_object.rb +8 -0
  1285. data/vendor/bundle/gems/yard-0.8.2/lib/yard/code_objects/constant_object.rb +13 -0
  1286. data/vendor/bundle/gems/yard-0.8.2/lib/yard/code_objects/extended_method_object.rb +23 -0
  1287. data/vendor/bundle/gems/yard-0.8.2/lib/yard/code_objects/extra_file_object.rb +89 -0
  1288. data/vendor/bundle/gems/yard-0.8.2/lib/yard/code_objects/macro_object.rb +172 -0
  1289. data/vendor/bundle/gems/yard-0.8.2/lib/yard/code_objects/method_object.rb +191 -0
  1290. data/vendor/bundle/gems/yard-0.8.2/lib/yard/code_objects/module_object.rb +18 -0
  1291. data/vendor/bundle/gems/yard-0.8.2/lib/yard/code_objects/namespace_object.rb +200 -0
  1292. data/vendor/bundle/gems/yard-0.8.2/lib/yard/code_objects/proxy.rb +257 -0
  1293. data/vendor/bundle/gems/yard-0.8.2/lib/yard/code_objects/root_object.rb +16 -0
  1294. data/vendor/bundle/gems/yard-0.8.2/lib/yard/config.rb +269 -0
  1295. data/vendor/bundle/gems/yard-0.8.2/lib/yard/core_ext/array.rb +15 -0
  1296. data/vendor/bundle/gems/yard-0.8.2/lib/yard/core_ext/file.rb +65 -0
  1297. data/vendor/bundle/gems/yard-0.8.2/lib/yard/core_ext/hash.rb +15 -0
  1298. data/vendor/bundle/gems/yard-0.8.2/lib/yard/core_ext/insertion.rb +60 -0
  1299. data/vendor/bundle/gems/yard-0.8.2/lib/yard/core_ext/module.rb +19 -0
  1300. data/vendor/bundle/gems/yard-0.8.2/lib/yard/core_ext/string.rb +67 -0
  1301. data/vendor/bundle/gems/yard-0.8.2/lib/yard/core_ext/symbol_hash.rb +73 -0
  1302. data/vendor/bundle/gems/yard-0.8.2/lib/yard/docstring.rb +317 -0
  1303. data/vendor/bundle/gems/yard-0.8.2/lib/yard/docstring_parser.rb +298 -0
  1304. data/vendor/bundle/gems/yard-0.8.2/lib/yard/globals.rb +18 -0
  1305. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/base.rb +581 -0
  1306. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/alias_handler.rb +15 -0
  1307. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/attribute_handler.rb +13 -0
  1308. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/base.rb +110 -0
  1309. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/class_handler.rb +26 -0
  1310. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/constant_handler.rb +12 -0
  1311. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/handler_methods.rb +166 -0
  1312. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/init_handler.rb +18 -0
  1313. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/method_handler.rb +35 -0
  1314. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/mixin_handler.rb +13 -0
  1315. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/module_handler.rb +16 -0
  1316. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/override_comment_handler.rb +30 -0
  1317. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/path_handler.rb +10 -0
  1318. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/struct_handler.rb +12 -0
  1319. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/symbol_handler.rb +7 -0
  1320. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/processor.rb +198 -0
  1321. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/alias_handler.rb +41 -0
  1322. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/attribute_handler.rb +82 -0
  1323. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/base.rb +164 -0
  1324. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/class_condition_handler.rb +86 -0
  1325. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/class_handler.rb +122 -0
  1326. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/class_variable_handler.rb +16 -0
  1327. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/comment_handler.rb +9 -0
  1328. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/constant_handler.rb +45 -0
  1329. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/dsl_handler.rb +14 -0
  1330. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/dsl_handler_methods.rb +71 -0
  1331. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/exception_handler.rb +26 -0
  1332. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/extend_handler.rb +21 -0
  1333. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/alias_handler.rb +34 -0
  1334. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/attribute_handler.rb +60 -0
  1335. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/base.rb +250 -0
  1336. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/class_condition_handler.rb +83 -0
  1337. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/class_handler.rb +110 -0
  1338. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/class_variable_handler.rb +14 -0
  1339. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/comment_handler.rb +9 -0
  1340. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/constant_handler.rb +28 -0
  1341. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/dsl_handler.rb +16 -0
  1342. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/exception_handler.rb +12 -0
  1343. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/extend_handler.rb +20 -0
  1344. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/method_handler.rb +78 -0
  1345. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/mixin_handler.rb +39 -0
  1346. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/module_function_handler.rb +18 -0
  1347. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/module_handler.rb +11 -0
  1348. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/private_constant_handler.rb +21 -0
  1349. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/visibility_handler.rb +16 -0
  1350. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/legacy/yield_handler.rb +28 -0
  1351. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/method_condition_handler.rb +8 -0
  1352. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/method_handler.rb +91 -0
  1353. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/mixin_handler.rb +36 -0
  1354. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/module_function_handler.rb +26 -0
  1355. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/module_handler.rb +11 -0
  1356. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/private_constant_handler.rb +36 -0
  1357. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/struct_handler_methods.rb +141 -0
  1358. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/visibility_handler.rb +24 -0
  1359. data/vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/ruby/yield_handler.rb +30 -0
  1360. data/vendor/bundle/gems/yard-0.8.2/lib/yard/i18n/locale.rb +50 -0
  1361. data/vendor/bundle/gems/yard-0.8.2/lib/yard/i18n/message.rb +56 -0
  1362. data/vendor/bundle/gems/yard-0.8.2/lib/yard/i18n/messages.rb +55 -0
  1363. data/vendor/bundle/gems/yard-0.8.2/lib/yard/i18n/pot_generator.rb +280 -0
  1364. data/vendor/bundle/gems/yard-0.8.2/lib/yard/i18n/text.rb +173 -0
  1365. data/vendor/bundle/gems/yard-0.8.2/lib/yard/logging.rb +164 -0
  1366. data/vendor/bundle/gems/yard-0.8.2/lib/yard/options.rb +216 -0
  1367. data/vendor/bundle/gems/yard-0.8.2/lib/yard/parser/base.rb +56 -0
  1368. data/vendor/bundle/gems/yard-0.8.2/lib/yard/parser/c/c_parser.rb +225 -0
  1369. data/vendor/bundle/gems/yard-0.8.2/lib/yard/parser/c/comment_parser.rb +131 -0
  1370. data/vendor/bundle/gems/yard-0.8.2/lib/yard/parser/c/statement.rb +63 -0
  1371. data/vendor/bundle/gems/yard-0.8.2/lib/yard/parser/ruby/ast_node.rb +489 -0
  1372. data/vendor/bundle/gems/yard-0.8.2/lib/yard/parser/ruby/legacy/ruby_lex.rb +1376 -0
  1373. data/vendor/bundle/gems/yard-0.8.2/lib/yard/parser/ruby/legacy/ruby_parser.rb +31 -0
  1374. data/vendor/bundle/gems/yard-0.8.2/lib/yard/parser/ruby/legacy/statement.rb +65 -0
  1375. data/vendor/bundle/gems/yard-0.8.2/lib/yard/parser/ruby/legacy/statement_list.rb +381 -0
  1376. data/vendor/bundle/gems/yard-0.8.2/lib/yard/parser/ruby/legacy/token_list.rb +66 -0
  1377. data/vendor/bundle/gems/yard-0.8.2/lib/yard/parser/ruby/ruby_parser.rb +615 -0
  1378. data/vendor/bundle/gems/yard-0.8.2/lib/yard/parser/source_parser.rb +519 -0
  1379. data/vendor/bundle/gems/yard-0.8.2/lib/yard/rake/yardoc_task.rb +75 -0
  1380. data/vendor/bundle/gems/yard-0.8.2/lib/yard/registry.rb +419 -0
  1381. data/vendor/bundle/gems/yard-0.8.2/lib/yard/registry_store.rb +305 -0
  1382. data/vendor/bundle/gems/yard-0.8.2/lib/yard/rubygems/backports/LICENSE.txt +57 -0
  1383. data/vendor/bundle/gems/yard-0.8.2/lib/yard/rubygems/backports/MIT.txt +20 -0
  1384. data/vendor/bundle/gems/yard-0.8.2/lib/yard/rubygems/backports/gem.rb +8 -0
  1385. data/vendor/bundle/gems/yard-0.8.2/lib/yard/rubygems/backports/source_index.rb +353 -0
  1386. data/vendor/bundle/gems/yard-0.8.2/lib/yard/rubygems/backports.rb +8 -0
  1387. data/vendor/bundle/gems/yard-0.8.2/lib/yard/rubygems/doc_manager.rb +79 -0
  1388. data/vendor/bundle/gems/yard-0.8.2/lib/yard/rubygems/specification.rb +41 -0
  1389. data/vendor/bundle/gems/yard-0.8.2/lib/yard/serializers/base.rb +80 -0
  1390. data/vendor/bundle/gems/yard-0.8.2/lib/yard/serializers/file_system_serializer.rb +90 -0
  1391. data/vendor/bundle/gems/yard-0.8.2/lib/yard/serializers/process_serializer.rb +24 -0
  1392. data/vendor/bundle/gems/yard-0.8.2/lib/yard/serializers/stdout_serializer.rb +32 -0
  1393. data/vendor/bundle/gems/yard-0.8.2/lib/yard/serializers/yardoc_serializer.rb +124 -0
  1394. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/adapter.rb +100 -0
  1395. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/commands/base.rb +193 -0
  1396. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/commands/display_file_command.rb +24 -0
  1397. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/commands/display_object_command.rb +58 -0
  1398. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/commands/frames_command.rb +15 -0
  1399. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/commands/library_command.rb +147 -0
  1400. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/commands/library_index_command.rb +24 -0
  1401. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/commands/list_command.rb +24 -0
  1402. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/commands/search_command.rb +78 -0
  1403. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/commands/static_file_command.rb +50 -0
  1404. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/doc_server_helper.rb +74 -0
  1405. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/doc_server_serializer.rb +33 -0
  1406. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/library_version.rb +227 -0
  1407. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/rack_adapter.rb +88 -0
  1408. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/router.rb +176 -0
  1409. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/static_caching.rb +45 -0
  1410. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/default/fulldoc/html/css/custom.css +78 -0
  1411. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/default/fulldoc/html/images/processing.gif +0 -0
  1412. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/default/fulldoc/html/js/autocomplete.js +12 -0
  1413. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/default/layout/html/breadcrumb.erb +46 -0
  1414. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/default/layout/html/script_setup.erb +8 -0
  1415. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/default/layout/html/setup.rb +7 -0
  1416. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/default/method_details/html/permalink.erb +4 -0
  1417. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/default/method_details/html/setup.rb +4 -0
  1418. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/doc_server/library_list/html/contents.erb +13 -0
  1419. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/doc_server/library_list/html/headers.erb +26 -0
  1420. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/doc_server/library_list/html/library_list.erb +12 -0
  1421. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/doc_server/library_list/html/setup.rb +3 -0
  1422. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/doc_server/library_list/html/title.erb +2 -0
  1423. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/doc_server/processing/html/processing.erb +51 -0
  1424. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/doc_server/processing/html/setup.rb +3 -0
  1425. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/doc_server/search/html/search.erb +18 -0
  1426. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/templates/doc_server/search/html/setup.rb +8 -0
  1427. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server/webrick_adapter.rb +43 -0
  1428. data/vendor/bundle/gems/yard-0.8.2/lib/yard/server.rb +11 -0
  1429. data/vendor/bundle/gems/yard-0.8.2/lib/yard/tags/default_factory.rb +176 -0
  1430. data/vendor/bundle/gems/yard-0.8.2/lib/yard/tags/default_tag.rb +12 -0
  1431. data/vendor/bundle/gems/yard-0.8.2/lib/yard/tags/directives.rb +594 -0
  1432. data/vendor/bundle/gems/yard-0.8.2/lib/yard/tags/library.rb +630 -0
  1433. data/vendor/bundle/gems/yard-0.8.2/lib/yard/tags/option_tag.rb +12 -0
  1434. data/vendor/bundle/gems/yard-0.8.2/lib/yard/tags/overload_tag.rb +65 -0
  1435. data/vendor/bundle/gems/yard-0.8.2/lib/yard/tags/ref_tag.rb +7 -0
  1436. data/vendor/bundle/gems/yard-0.8.2/lib/yard/tags/ref_tag_list.rb +27 -0
  1437. data/vendor/bundle/gems/yard-0.8.2/lib/yard/tags/tag.rb +57 -0
  1438. data/vendor/bundle/gems/yard-0.8.2/lib/yard/tags/tag_format_error.rb +6 -0
  1439. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/engine.rb +185 -0
  1440. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/erb_cache.rb +22 -0
  1441. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/helpers/base_helper.rb +212 -0
  1442. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/helpers/filter_helper.rb +26 -0
  1443. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/helpers/html_helper.rb +589 -0
  1444. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +59 -0
  1445. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/helpers/markup/rdoc_markup.rb +85 -0
  1446. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/helpers/markup_helper.rb +164 -0
  1447. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/helpers/method_helper.rb +72 -0
  1448. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/helpers/module_helper.rb +19 -0
  1449. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/helpers/text_helper.rb +95 -0
  1450. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/helpers/uml_helper.rb +46 -0
  1451. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/section.rb +106 -0
  1452. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/template.rb +395 -0
  1453. data/vendor/bundle/gems/yard-0.8.2/lib/yard/templates/template_options.rb +88 -0
  1454. data/vendor/bundle/gems/yard-0.8.2/lib/yard/verifier.rb +148 -0
  1455. data/vendor/bundle/gems/yard-0.8.2/lib/yard.rb +48 -0
  1456. data/vendor/bundle/gems/yard-0.8.2/spec/cli/command_parser_spec.rb +43 -0
  1457. data/vendor/bundle/gems/yard-0.8.2/spec/cli/command_spec.rb +36 -0
  1458. data/vendor/bundle/gems/yard-0.8.2/spec/cli/config_spec.rb +92 -0
  1459. data/vendor/bundle/gems/yard-0.8.2/spec/cli/diff_spec.rb +175 -0
  1460. data/vendor/bundle/gems/yard-0.8.2/spec/cli/gems_spec.rb +81 -0
  1461. data/vendor/bundle/gems/yard-0.8.2/spec/cli/graph_spec.rb +10 -0
  1462. data/vendor/bundle/gems/yard-0.8.2/spec/cli/help_spec.rb +22 -0
  1463. data/vendor/bundle/gems/yard-0.8.2/spec/cli/i18n_spec.rb +111 -0
  1464. data/vendor/bundle/gems/yard-0.8.2/spec/cli/list_spec.rb +8 -0
  1465. data/vendor/bundle/gems/yard-0.8.2/spec/cli/server_spec.rb +219 -0
  1466. data/vendor/bundle/gems/yard-0.8.2/spec/cli/stats_spec.rb +90 -0
  1467. data/vendor/bundle/gems/yard-0.8.2/spec/cli/yardoc_spec.rb +741 -0
  1468. data/vendor/bundle/gems/yard-0.8.2/spec/cli/yri_spec.rb +99 -0
  1469. data/vendor/bundle/gems/yard-0.8.2/spec/code_objects/base_spec.rb +392 -0
  1470. data/vendor/bundle/gems/yard-0.8.2/spec/code_objects/class_object_spec.rb +225 -0
  1471. data/vendor/bundle/gems/yard-0.8.2/spec/code_objects/code_object_list_spec.rb +33 -0
  1472. data/vendor/bundle/gems/yard-0.8.2/spec/code_objects/constants_spec.rb +82 -0
  1473. data/vendor/bundle/gems/yard-0.8.2/spec/code_objects/extra_file_object_spec.rb +132 -0
  1474. data/vendor/bundle/gems/yard-0.8.2/spec/code_objects/macro_object_spec.rb +148 -0
  1475. data/vendor/bundle/gems/yard-0.8.2/spec/code_objects/method_object_spec.rb +175 -0
  1476. data/vendor/bundle/gems/yard-0.8.2/spec/code_objects/module_object_spec.rb +141 -0
  1477. data/vendor/bundle/gems/yard-0.8.2/spec/code_objects/namespace_object_spec.rb +170 -0
  1478. data/vendor/bundle/gems/yard-0.8.2/spec/code_objects/proxy_spec.rb +140 -0
  1479. data/vendor/bundle/gems/yard-0.8.2/spec/code_objects/spec_helper.rb +3 -0
  1480. data/vendor/bundle/gems/yard-0.8.2/spec/config_spec.rb +176 -0
  1481. data/vendor/bundle/gems/yard-0.8.2/spec/core_ext/array_spec.rb +14 -0
  1482. data/vendor/bundle/gems/yard-0.8.2/spec/core_ext/file_spec.rb +68 -0
  1483. data/vendor/bundle/gems/yard-0.8.2/spec/core_ext/hash_spec.rb +14 -0
  1484. data/vendor/bundle/gems/yard-0.8.2/spec/core_ext/insertion_spec.rb +37 -0
  1485. data/vendor/bundle/gems/yard-0.8.2/spec/core_ext/module_spec.rb +15 -0
  1486. data/vendor/bundle/gems/yard-0.8.2/spec/core_ext/string_spec.rb +42 -0
  1487. data/vendor/bundle/gems/yard-0.8.2/spec/core_ext/symbol_hash_spec.rb +86 -0
  1488. data/vendor/bundle/gems/yard-0.8.2/spec/docstring_parser_spec.rb +224 -0
  1489. data/vendor/bundle/gems/yard-0.8.2/spec/docstring_spec.rb +287 -0
  1490. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/alias_handler_spec.rb +80 -0
  1491. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/attribute_handler_spec.rb +94 -0
  1492. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/base_spec.rb +197 -0
  1493. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/c/alias_handler_spec.rb +33 -0
  1494. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/c/attribute_handler_spec.rb +40 -0
  1495. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/c/class_handler_spec.rb +63 -0
  1496. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/c/constant_handler_spec.rb +68 -0
  1497. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/c/init_handler_spec.rb +47 -0
  1498. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/c/method_handler_spec.rb +228 -0
  1499. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/c/mixin_handler_spec.rb +27 -0
  1500. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/c/module_handler_spec.rb +38 -0
  1501. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/c/override_comment_handler_spec.rb +46 -0
  1502. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/c/path_handler_spec.rb +35 -0
  1503. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/c/spec_helper.rb +11 -0
  1504. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/c/struct_handler_spec.rb +15 -0
  1505. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/class_condition_handler_spec.rb +67 -0
  1506. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/class_handler_spec.rb +246 -0
  1507. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/class_variable_handler_spec.rb +11 -0
  1508. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/constant_handler_spec.rb +64 -0
  1509. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/dsl_handler_spec.rb +186 -0
  1510. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/alias_handler_001.rb.txt +44 -0
  1511. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/attribute_handler_001.rb.txt +32 -0
  1512. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/class_condition_handler_001.rb.txt +69 -0
  1513. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/class_handler_001.rb.txt +120 -0
  1514. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/class_variable_handler_001.rb.txt +10 -0
  1515. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/constant_handler_001.rb.txt +25 -0
  1516. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/dsl_handler_001.rb.txt +110 -0
  1517. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/exception_handler_001.rb.txt +59 -0
  1518. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/extend_handler_001.rb.txt +16 -0
  1519. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/method_condition_handler_001.rb.txt +10 -0
  1520. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/method_handler_001.rb.txt +126 -0
  1521. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/mixin_handler_001.rb.txt +37 -0
  1522. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/module_handler_001.rb.txt +29 -0
  1523. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/private_constant_handler_001.rb.txt +8 -0
  1524. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/process_handler_001.rb.txt +11 -0
  1525. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/visibility_handler_001.rb.txt +27 -0
  1526. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/examples/yield_handler_001.rb.txt +54 -0
  1527. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/exception_handler_spec.rb +48 -0
  1528. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/extend_handler_spec.rb +23 -0
  1529. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/legacy_base_spec.rb +128 -0
  1530. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/method_condition_handler_spec.rb +14 -0
  1531. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/method_handler_spec.rb +184 -0
  1532. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/mixin_handler_spec.rb +55 -0
  1533. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/module_function_handler_spec.rb +82 -0
  1534. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/module_handler_spec.rb +34 -0
  1535. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/private_constant_handler_spec.rb +24 -0
  1536. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/processor_spec.rb +23 -0
  1537. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/ruby/base_spec.rb +94 -0
  1538. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/ruby/legacy/base_spec.rb +82 -0
  1539. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/spec_helper.rb +33 -0
  1540. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/visibility_handler_spec.rb +34 -0
  1541. data/vendor/bundle/gems/yard-0.8.2/spec/handlers/yield_handler_spec.rb +51 -0
  1542. data/vendor/bundle/gems/yard-0.8.2/spec/i18n/locale_spec.rb +62 -0
  1543. data/vendor/bundle/gems/yard-0.8.2/spec/i18n/message_spec.rb +52 -0
  1544. data/vendor/bundle/gems/yard-0.8.2/spec/i18n/messages_spec.rb +67 -0
  1545. data/vendor/bundle/gems/yard-0.8.2/spec/i18n/pot_generator_spec.rb +262 -0
  1546. data/vendor/bundle/gems/yard-0.8.2/spec/i18n/text_spec.rb +180 -0
  1547. data/vendor/bundle/gems/yard-0.8.2/spec/logging_spec.rb +35 -0
  1548. data/vendor/bundle/gems/yard-0.8.2/spec/options_spec.rb +160 -0
  1549. data/vendor/bundle/gems/yard-0.8.2/spec/parser/base_spec.rb +24 -0
  1550. data/vendor/bundle/gems/yard-0.8.2/spec/parser/c_parser_spec.rb +166 -0
  1551. data/vendor/bundle/gems/yard-0.8.2/spec/parser/examples/array.c.txt +3887 -0
  1552. data/vendor/bundle/gems/yard-0.8.2/spec/parser/examples/example1.rb.txt +8 -0
  1553. data/vendor/bundle/gems/yard-0.8.2/spec/parser/examples/extrafile.c.txt +8 -0
  1554. data/vendor/bundle/gems/yard-0.8.2/spec/parser/examples/multifile.c.txt +6 -0
  1555. data/vendor/bundle/gems/yard-0.8.2/spec/parser/examples/override.c.txt +424 -0
  1556. data/vendor/bundle/gems/yard-0.8.2/spec/parser/examples/parse_in_order_001.rb.txt +2 -0
  1557. data/vendor/bundle/gems/yard-0.8.2/spec/parser/examples/parse_in_order_002.rb.txt +2 -0
  1558. data/vendor/bundle/gems/yard-0.8.2/spec/parser/examples/tag_handler_001.rb.txt +8 -0
  1559. data/vendor/bundle/gems/yard-0.8.2/spec/parser/ruby/ast_node_spec.rb +33 -0
  1560. data/vendor/bundle/gems/yard-0.8.2/spec/parser/ruby/legacy/statement_list_spec.rb +299 -0
  1561. data/vendor/bundle/gems/yard-0.8.2/spec/parser/ruby/legacy/token_list_spec.rb +69 -0
  1562. data/vendor/bundle/gems/yard-0.8.2/spec/parser/ruby/ruby_parser_spec.rb +295 -0
  1563. data/vendor/bundle/gems/yard-0.8.2/spec/parser/source_parser_spec.rb +658 -0
  1564. data/vendor/bundle/gems/yard-0.8.2/spec/parser/tag_parsing_spec.rb +18 -0
  1565. data/vendor/bundle/gems/yard-0.8.2/spec/rake/yardoc_task_spec.rb +92 -0
  1566. data/vendor/bundle/gems/yard-0.8.2/spec/registry_spec.rb +359 -0
  1567. data/vendor/bundle/gems/yard-0.8.2/spec/registry_store_spec.rb +305 -0
  1568. data/vendor/bundle/gems/yard-0.8.2/spec/rubygems/doc_manager_spec.rb +112 -0
  1569. data/vendor/bundle/gems/yard-0.8.2/spec/serializers/data/serialized_yardoc/checksums +1 -0
  1570. data/vendor/bundle/gems/yard-0.8.2/spec/serializers/data/serialized_yardoc/objects/Foo/bar_i.dat +0 -0
  1571. data/vendor/bundle/gems/yard-0.8.2/spec/serializers/data/serialized_yardoc/objects/Foo/baz_i.dat +0 -0
  1572. data/vendor/bundle/gems/yard-0.8.2/spec/serializers/data/serialized_yardoc/objects/Foo.dat +0 -0
  1573. data/vendor/bundle/gems/yard-0.8.2/spec/serializers/data/serialized_yardoc/objects/root.dat +0 -0
  1574. data/vendor/bundle/gems/yard-0.8.2/spec/serializers/data/serialized_yardoc/proxy_types +2 -0
  1575. data/vendor/bundle/gems/yard-0.8.2/spec/serializers/file_system_serializer_spec.rb +124 -0
  1576. data/vendor/bundle/gems/yard-0.8.2/spec/serializers/spec_helper.rb +2 -0
  1577. data/vendor/bundle/gems/yard-0.8.2/spec/serializers/yardoc_serializer_spec.rb +46 -0
  1578. data/vendor/bundle/gems/yard-0.8.2/spec/server/adapter_spec.rb +38 -0
  1579. data/vendor/bundle/gems/yard-0.8.2/spec/server/commands/base_spec.rb +87 -0
  1580. data/vendor/bundle/gems/yard-0.8.2/spec/server/commands/library_command_spec.rb +39 -0
  1581. data/vendor/bundle/gems/yard-0.8.2/spec/server/commands/static_file_command_spec.rb +84 -0
  1582. data/vendor/bundle/gems/yard-0.8.2/spec/server/doc_server_helper_spec.rb +51 -0
  1583. data/vendor/bundle/gems/yard-0.8.2/spec/server/doc_server_serializer_spec.rb +45 -0
  1584. data/vendor/bundle/gems/yard-0.8.2/spec/server/rack_adapter_spec.rb +20 -0
  1585. data/vendor/bundle/gems/yard-0.8.2/spec/server/router_spec.rb +122 -0
  1586. data/vendor/bundle/gems/yard-0.8.2/spec/server/spec_helper.rb +17 -0
  1587. data/vendor/bundle/gems/yard-0.8.2/spec/server/static_caching_spec.rb +39 -0
  1588. data/vendor/bundle/gems/yard-0.8.2/spec/server/webrick_servlet_spec.rb +20 -0
  1589. data/vendor/bundle/gems/yard-0.8.2/spec/server_spec.rb +10 -0
  1590. data/vendor/bundle/gems/yard-0.8.2/spec/spec_helper.rb +105 -0
  1591. data/vendor/bundle/gems/yard-0.8.2/spec/tags/default_factory_spec.rb +152 -0
  1592. data/vendor/bundle/gems/yard-0.8.2/spec/tags/default_tag_spec.rb +11 -0
  1593. data/vendor/bundle/gems/yard-0.8.2/spec/tags/directives_spec.rb +429 -0
  1594. data/vendor/bundle/gems/yard-0.8.2/spec/tags/library_spec.rb +34 -0
  1595. data/vendor/bundle/gems/yard-0.8.2/spec/tags/overload_tag_spec.rb +53 -0
  1596. data/vendor/bundle/gems/yard-0.8.2/spec/tags/ref_tag_list_spec.rb +53 -0
  1597. data/vendor/bundle/gems/yard-0.8.2/spec/templates/class_spec.rb +44 -0
  1598. data/vendor/bundle/gems/yard-0.8.2/spec/templates/constant_spec.rb +40 -0
  1599. data/vendor/bundle/gems/yard-0.8.2/spec/templates/engine_spec.rb +121 -0
  1600. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/class001.html +280 -0
  1601. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/class001.txt +36 -0
  1602. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/class002.html +35 -0
  1603. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/constant001.txt +25 -0
  1604. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/constant002.txt +7 -0
  1605. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/constant003.txt +11 -0
  1606. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/method001.html +130 -0
  1607. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/method001.txt +35 -0
  1608. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/method002.html +86 -0
  1609. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/method002.txt +20 -0
  1610. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/method003.html +159 -0
  1611. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/method003.txt +45 -0
  1612. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/method004.html +44 -0
  1613. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/method004.txt +10 -0
  1614. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/method005.html +99 -0
  1615. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/method005.txt +33 -0
  1616. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/module001.dot +33 -0
  1617. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/module001.html +791 -0
  1618. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/module001.txt +33 -0
  1619. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/module002.html +318 -0
  1620. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/module003.html +185 -0
  1621. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/module004.html +387 -0
  1622. data/vendor/bundle/gems/yard-0.8.2/spec/templates/examples/tag001.txt +82 -0
  1623. data/vendor/bundle/gems/yard-0.8.2/spec/templates/helpers/base_helper_spec.rb +175 -0
  1624. data/vendor/bundle/gems/yard-0.8.2/spec/templates/helpers/html_helper_spec.rb +586 -0
  1625. data/vendor/bundle/gems/yard-0.8.2/spec/templates/helpers/html_syntax_highlight_helper_spec.rb +48 -0
  1626. data/vendor/bundle/gems/yard-0.8.2/spec/templates/helpers/markup/rdoc_markup_spec.rb +84 -0
  1627. data/vendor/bundle/gems/yard-0.8.2/spec/templates/helpers/markup_helper_spec.rb +135 -0
  1628. data/vendor/bundle/gems/yard-0.8.2/spec/templates/helpers/method_helper_spec.rb +75 -0
  1629. data/vendor/bundle/gems/yard-0.8.2/spec/templates/helpers/shared_signature_examples.rb +123 -0
  1630. data/vendor/bundle/gems/yard-0.8.2/spec/templates/helpers/text_helper_spec.rb +44 -0
  1631. data/vendor/bundle/gems/yard-0.8.2/spec/templates/method_spec.rb +102 -0
  1632. data/vendor/bundle/gems/yard-0.8.2/spec/templates/module_spec.rb +181 -0
  1633. data/vendor/bundle/gems/yard-0.8.2/spec/templates/onefile_spec.rb +64 -0
  1634. data/vendor/bundle/gems/yard-0.8.2/spec/templates/section_spec.rb +146 -0
  1635. data/vendor/bundle/gems/yard-0.8.2/spec/templates/spec_helper.rb +72 -0
  1636. data/vendor/bundle/gems/yard-0.8.2/spec/templates/tag_spec.rb +51 -0
  1637. data/vendor/bundle/gems/yard-0.8.2/spec/templates/template_spec.rb +409 -0
  1638. data/vendor/bundle/gems/yard-0.8.2/spec/verifier_spec.rb +106 -0
  1639. data/vendor/bundle/gems/yard-0.8.2/templates/default/class/dot/setup.rb +6 -0
  1640. data/vendor/bundle/gems/yard-0.8.2/templates/default/class/dot/superklass.erb +3 -0
  1641. data/vendor/bundle/gems/yard-0.8.2/templates/default/class/html/constructor_details.erb +8 -0
  1642. data/vendor/bundle/gems/yard-0.8.2/templates/default/class/html/setup.rb +1 -0
  1643. data/vendor/bundle/gems/yard-0.8.2/templates/default/class/html/subclasses.erb +4 -0
  1644. data/vendor/bundle/gems/yard-0.8.2/templates/default/class/setup.rb +36 -0
  1645. data/vendor/bundle/gems/yard-0.8.2/templates/default/class/text/setup.rb +11 -0
  1646. data/vendor/bundle/gems/yard-0.8.2/templates/default/class/text/subclasses.erb +5 -0
  1647. data/vendor/bundle/gems/yard-0.8.2/templates/default/constant/text/header.erb +11 -0
  1648. data/vendor/bundle/gems/yard-0.8.2/templates/default/constant/text/setup.rb +3 -0
  1649. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/html/abstract.erb +4 -0
  1650. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/html/deprecated.erb +1 -0
  1651. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/html/index.erb +5 -0
  1652. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/html/note.erb +6 -0
  1653. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/html/private.erb +4 -0
  1654. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/html/returns_void.erb +1 -0
  1655. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/html/text.erb +1 -0
  1656. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/html/todo.erb +6 -0
  1657. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/setup.rb +49 -0
  1658. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/text/abstract.erb +2 -0
  1659. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/text/deprecated.erb +2 -0
  1660. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/text/index.erb +2 -0
  1661. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/text/note.erb +4 -0
  1662. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/text/private.erb +2 -0
  1663. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/text/returns_void.erb +1 -0
  1664. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/text/text.erb +1 -0
  1665. data/vendor/bundle/gems/yard-0.8.2/templates/default/docstring/text/todo.erb +4 -0
  1666. data/vendor/bundle/gems/yard-0.8.2/templates/default/fulldoc/html/css/common.css +1 -0
  1667. data/vendor/bundle/gems/yard-0.8.2/templates/default/fulldoc/html/css/full_list.css +57 -0
  1668. data/vendor/bundle/gems/yard-0.8.2/templates/default/fulldoc/html/css/style.css +328 -0
  1669. data/vendor/bundle/gems/yard-0.8.2/templates/default/fulldoc/html/frames.erb +28 -0
  1670. data/vendor/bundle/gems/yard-0.8.2/templates/default/fulldoc/html/full_list.erb +39 -0
  1671. data/vendor/bundle/gems/yard-0.8.2/templates/default/fulldoc/html/full_list_class.erb +2 -0
  1672. data/vendor/bundle/gems/yard-0.8.2/templates/default/fulldoc/html/full_list_file.erb +5 -0
  1673. data/vendor/bundle/gems/yard-0.8.2/templates/default/fulldoc/html/full_list_method.erb +12 -0
  1674. data/vendor/bundle/gems/yard-0.8.2/templates/default/fulldoc/html/js/app.js +214 -0
  1675. data/vendor/bundle/gems/yard-0.8.2/templates/default/fulldoc/html/js/full_list.js +173 -0
  1676. data/vendor/bundle/gems/yard-0.8.2/templates/default/fulldoc/html/js/jquery.js +4 -0
  1677. data/vendor/bundle/gems/yard-0.8.2/templates/default/fulldoc/html/setup.rb +206 -0
  1678. data/vendor/bundle/gems/yard-0.8.2/templates/default/layout/dot/header.erb +6 -0
  1679. data/vendor/bundle/gems/yard-0.8.2/templates/default/layout/dot/setup.rb +14 -0
  1680. data/vendor/bundle/gems/yard-0.8.2/templates/default/layout/html/breadcrumb.erb +13 -0
  1681. data/vendor/bundle/gems/yard-0.8.2/templates/default/layout/html/files.erb +11 -0
  1682. data/vendor/bundle/gems/yard-0.8.2/templates/default/layout/html/footer.erb +5 -0
  1683. data/vendor/bundle/gems/yard-0.8.2/templates/default/layout/html/headers.erb +14 -0
  1684. data/vendor/bundle/gems/yard-0.8.2/templates/default/layout/html/index.erb +2 -0
  1685. data/vendor/bundle/gems/yard-0.8.2/templates/default/layout/html/layout.erb +20 -0
  1686. data/vendor/bundle/gems/yard-0.8.2/templates/default/layout/html/listing.erb +4 -0
  1687. data/vendor/bundle/gems/yard-0.8.2/templates/default/layout/html/objects.erb +32 -0
  1688. data/vendor/bundle/gems/yard-0.8.2/templates/default/layout/html/script_setup.erb +5 -0
  1689. data/vendor/bundle/gems/yard-0.8.2/templates/default/layout/html/search.erb +8 -0
  1690. data/vendor/bundle/gems/yard-0.8.2/templates/default/layout/html/setup.rb +71 -0
  1691. data/vendor/bundle/gems/yard-0.8.2/templates/default/method/html/header.erb +16 -0
  1692. data/vendor/bundle/gems/yard-0.8.2/templates/default/method/setup.rb +3 -0
  1693. data/vendor/bundle/gems/yard-0.8.2/templates/default/method/text/header.erb +1 -0
  1694. data/vendor/bundle/gems/yard-0.8.2/templates/default/method_details/html/header.erb +3 -0
  1695. data/vendor/bundle/gems/yard-0.8.2/templates/default/method_details/html/method_signature.erb +25 -0
  1696. data/vendor/bundle/gems/yard-0.8.2/templates/default/method_details/html/source.erb +10 -0
  1697. data/vendor/bundle/gems/yard-0.8.2/templates/default/method_details/setup.rb +10 -0
  1698. data/vendor/bundle/gems/yard-0.8.2/templates/default/method_details/text/header.erb +10 -0
  1699. data/vendor/bundle/gems/yard-0.8.2/templates/default/method_details/text/method_signature.erb +12 -0
  1700. data/vendor/bundle/gems/yard-0.8.2/templates/default/method_details/text/setup.rb +10 -0
  1701. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/dot/child.erb +1 -0
  1702. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/dot/dependencies.erb +3 -0
  1703. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/dot/header.erb +6 -0
  1704. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/dot/info.erb +14 -0
  1705. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/dot/setup.rb +14 -0
  1706. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/attribute_details.erb +10 -0
  1707. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/attribute_summary.erb +8 -0
  1708. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/box_info.erb +37 -0
  1709. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/children.erb +8 -0
  1710. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/constant_summary.erb +13 -0
  1711. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/defines.erb +3 -0
  1712. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/header.erb +5 -0
  1713. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/inherited_attributes.erb +14 -0
  1714. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/inherited_constants.erb +8 -0
  1715. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/inherited_methods.erb +19 -0
  1716. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/item_summary.erb +40 -0
  1717. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/method_details_list.erb +9 -0
  1718. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/method_summary.erb +14 -0
  1719. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/methodmissing.erb +12 -0
  1720. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/html/pre_docstring.erb +1 -0
  1721. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/setup.rb +164 -0
  1722. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/text/children.erb +10 -0
  1723. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/text/class_meths_list.erb +8 -0
  1724. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/text/extends.erb +8 -0
  1725. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/text/header.erb +7 -0
  1726. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/text/includes.erb +8 -0
  1727. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/text/instance_meths_list.erb +8 -0
  1728. data/vendor/bundle/gems/yard-0.8.2/templates/default/module/text/setup.rb +12 -0
  1729. data/vendor/bundle/gems/yard-0.8.2/templates/default/onefile/html/files.erb +5 -0
  1730. data/vendor/bundle/gems/yard-0.8.2/templates/default/onefile/html/layout.erb +22 -0
  1731. data/vendor/bundle/gems/yard-0.8.2/templates/default/onefile/html/readme.erb +3 -0
  1732. data/vendor/bundle/gems/yard-0.8.2/templates/default/onefile/html/setup.rb +43 -0
  1733. data/vendor/bundle/gems/yard-0.8.2/templates/default/root/dot/child.erb +3 -0
  1734. data/vendor/bundle/gems/yard-0.8.2/templates/default/root/dot/setup.rb +5 -0
  1735. data/vendor/bundle/gems/yard-0.8.2/templates/default/root/html/setup.rb +1 -0
  1736. data/vendor/bundle/gems/yard-0.8.2/templates/default/tags/html/example.erb +11 -0
  1737. data/vendor/bundle/gems/yard-0.8.2/templates/default/tags/html/index.erb +3 -0
  1738. data/vendor/bundle/gems/yard-0.8.2/templates/default/tags/html/option.erb +24 -0
  1739. data/vendor/bundle/gems/yard-0.8.2/templates/default/tags/html/overload.erb +14 -0
  1740. data/vendor/bundle/gems/yard-0.8.2/templates/default/tags/html/see.erb +8 -0
  1741. data/vendor/bundle/gems/yard-0.8.2/templates/default/tags/html/tag.erb +20 -0
  1742. data/vendor/bundle/gems/yard-0.8.2/templates/default/tags/setup.rb +55 -0
  1743. data/vendor/bundle/gems/yard-0.8.2/templates/default/tags/text/example.erb +12 -0
  1744. data/vendor/bundle/gems/yard-0.8.2/templates/default/tags/text/index.erb +1 -0
  1745. data/vendor/bundle/gems/yard-0.8.2/templates/default/tags/text/option.erb +20 -0
  1746. data/vendor/bundle/gems/yard-0.8.2/templates/default/tags/text/overload.erb +19 -0
  1747. data/vendor/bundle/gems/yard-0.8.2/templates/default/tags/text/see.erb +11 -0
  1748. data/vendor/bundle/gems/yard-0.8.2/templates/default/tags/text/tag.erb +13 -0
  1749. data/vendor/bundle/gems/yard-0.8.2/templates/guide/class/html/setup.rb +1 -0
  1750. data/vendor/bundle/gems/yard-0.8.2/templates/guide/docstring/html/setup.rb +1 -0
  1751. data/vendor/bundle/gems/yard-0.8.2/templates/guide/fulldoc/html/css/style.css +93 -0
  1752. data/vendor/bundle/gems/yard-0.8.2/templates/guide/fulldoc/html/js/app.js +33 -0
  1753. data/vendor/bundle/gems/yard-0.8.2/templates/guide/fulldoc/html/setup.rb +54 -0
  1754. data/vendor/bundle/gems/yard-0.8.2/templates/guide/layout/html/layout.erb +81 -0
  1755. data/vendor/bundle/gems/yard-0.8.2/templates/guide/layout/html/setup.rb +24 -0
  1756. data/vendor/bundle/gems/yard-0.8.2/templates/guide/method/html/header.erb +18 -0
  1757. data/vendor/bundle/gems/yard-0.8.2/templates/guide/method/html/setup.rb +21 -0
  1758. data/vendor/bundle/gems/yard-0.8.2/templates/guide/module/html/header.erb +7 -0
  1759. data/vendor/bundle/gems/yard-0.8.2/templates/guide/module/html/method_list.erb +5 -0
  1760. data/vendor/bundle/gems/yard-0.8.2/templates/guide/module/html/setup.rb +26 -0
  1761. data/vendor/bundle/gems/yard-0.8.2/templates/guide/tags/html/setup.rb +8 -0
  1762. data/vendor/bundle/specifications/actionmailer-3.2.5.gemspec +33 -0
  1763. data/vendor/bundle/specifications/actionpack-3.2.5.gemspec +57 -0
  1764. data/vendor/bundle/specifications/activemodel-3.2.5.gemspec +32 -0
  1765. data/vendor/bundle/specifications/activerecord-3.2.5.gemspec +41 -0
  1766. data/vendor/bundle/specifications/activeresource-3.2.5.gemspec +35 -0
  1767. data/vendor/bundle/specifications/activesupport-3.2.5.gemspec +33 -0
  1768. data/vendor/bundle/specifications/multi_json-1.3.6.gemspec +40 -0
  1769. data/vendor/bundle/specifications/rails-3.2.5.gemspec +47 -0
  1770. data/vendor/bundle/specifications/railties-3.2.5.gemspec +47 -0
  1771. data/vendor/bundle/specifications/thor-0.15.2.gemspec +50 -0
  1772. data/vendor/bundle/specifications/yard-0.8.2.gemspec +28 -0
  1773. metadata +1779 -10
@@ -0,0 +1,3887 @@
1
+ /**********************************************************************
2
+
3
+ array.c -
4
+
5
+ $Author: yugui $
6
+ created at: Fri Aug 6 09:46:12 JST 1993
7
+
8
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
9
+ Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
10
+ Copyright (C) 2000 Information-technology Promotion Agency, Japan
11
+
12
+ **********************************************************************/
13
+
14
+ #include "ruby/ruby.h"
15
+ #include "ruby/util.h"
16
+ #include "ruby/st.h"
17
+
18
+ #ifndef ARRAY_DEBUG
19
+ # define NDEBUG
20
+ #endif
21
+ #include <assert.h>
22
+
23
+ VALUE rb_cArray;
24
+
25
+ static ID id_cmp;
26
+
27
+ #define ARY_DEFAULT_SIZE 16
28
+ #define ARY_MAX_SIZE (LONG_MAX / sizeof(VALUE))
29
+
30
+ void
31
+ rb_mem_clear(register VALUE *mem, register long size)
32
+ {
33
+ while (size--) {
34
+ *mem++ = Qnil;
35
+ }
36
+ }
37
+
38
+ static inline void
39
+ memfill(register VALUE *mem, register long size, register VALUE val)
40
+ {
41
+ while (size--) {
42
+ *mem++ = val;
43
+ }
44
+ }
45
+
46
+ # define ARY_SHARED_P(ary) \
47
+ (assert(!FL_TEST(ary, ELTS_SHARED) || !FL_TEST(ary, RARRAY_EMBED_FLAG)), \
48
+ FL_TEST(ary,ELTS_SHARED))
49
+ # define ARY_EMBED_P(ary) \
50
+ (assert(!FL_TEST(ary, ELTS_SHARED) || !FL_TEST(ary, RARRAY_EMBED_FLAG)), \
51
+ FL_TEST(ary, RARRAY_EMBED_FLAG))
52
+
53
+ #define ARY_HEAP_PTR(a) (assert(!ARY_EMBED_P(a)), RARRAY(a)->as.heap.ptr)
54
+ #define ARY_HEAP_LEN(a) (assert(!ARY_EMBED_P(a)), RARRAY(a)->as.heap.len)
55
+ #define ARY_EMBED_PTR(a) (assert(ARY_EMBED_P(a)), RARRAY(a)->as.ary)
56
+ #define ARY_EMBED_LEN(a) \
57
+ (assert(ARY_EMBED_P(a)), \
58
+ (long)((RBASIC(a)->flags >> RARRAY_EMBED_LEN_SHIFT) & \
59
+ (RARRAY_EMBED_LEN_MASK >> RARRAY_EMBED_LEN_SHIFT)))
60
+
61
+ #define ARY_OWNS_HEAP_P(a) (!FL_TEST(a, ELTS_SHARED|RARRAY_EMBED_FLAG))
62
+ #define FL_SET_EMBED(a) do { \
63
+ assert(!ARY_SHARED_P(a)); \
64
+ assert(!OBJ_FROZEN(a)); \
65
+ FL_SET(a, RARRAY_EMBED_FLAG); \
66
+ } while (0)
67
+ #define FL_UNSET_EMBED(ary) FL_UNSET(ary, RARRAY_EMBED_FLAG|RARRAY_EMBED_LEN_MASK)
68
+ #define FL_SET_SHARED(ary) do { \
69
+ assert(!ARY_EMBED_P(ary)); \
70
+ FL_SET(ary, ELTS_SHARED); \
71
+ } while (0)
72
+ #define FL_UNSET_SHARED(ary) FL_UNSET(ary, ELTS_SHARED)
73
+
74
+ #define ARY_SET_PTR(ary, p) do { \
75
+ assert(!ARY_EMBED_P(ary)); \
76
+ assert(!OBJ_FROZEN(ary)); \
77
+ RARRAY(ary)->as.heap.ptr = (p); \
78
+ } while (0)
79
+ #define ARY_SET_EMBED_LEN(ary, n) do { \
80
+ long tmp_n = n; \
81
+ assert(ARY_EMBED_P(ary)); \
82
+ assert(!OBJ_FROZEN(ary)); \
83
+ RBASIC(ary)->flags &= ~RARRAY_EMBED_LEN_MASK; \
84
+ RBASIC(ary)->flags |= (tmp_n) << RARRAY_EMBED_LEN_SHIFT; \
85
+ } while (0)
86
+ #define ARY_SET_HEAP_LEN(ary, n) do { \
87
+ assert(!ARY_EMBED_P(ary)); \
88
+ RARRAY(ary)->as.heap.len = n; \
89
+ } while (0)
90
+ #define ARY_SET_LEN(ary, n) do { \
91
+ if (ARY_EMBED_P(ary)) { \
92
+ ARY_SET_EMBED_LEN(ary, n); \
93
+ } \
94
+ else { \
95
+ ARY_SET_HEAP_LEN(ary, n); \
96
+ } \
97
+ assert(RARRAY_LEN(ary) == n); \
98
+ } while (0)
99
+ #define ARY_INCREASE_PTR(ary, n) do { \
100
+ assert(!ARY_EMBED_P(ary)); \
101
+ assert(!OBJ_FROZEN(ary)); \
102
+ RARRAY(ary)->as.heap.ptr += n; \
103
+ } while (0)
104
+ #define ARY_INCREASE_LEN(ary, n) do { \
105
+ assert(!OBJ_FROZEN(ary)); \
106
+ if (ARY_EMBED_P(ary)) { \
107
+ ARY_SET_EMBED_LEN(ary, RARRAY_LEN(ary)+n); \
108
+ } \
109
+ else { \
110
+ RARRAY(ary)->as.heap.len += n; \
111
+ } \
112
+ } while (0)
113
+
114
+ #define ARY_CAPA(ary) (ARY_EMBED_P(ary) ? RARRAY_EMBED_LEN_MAX : \
115
+ ARY_SHARED_ROOT_P(ary) ? RARRAY_LEN(ary) : RARRAY(ary)->as.heap.aux.capa)
116
+ #define ARY_SET_CAPA(ary, n) do { \
117
+ assert(!ARY_EMBED_P(ary)); \
118
+ assert(!ARY_SHARED_P(ary)); \
119
+ assert(!OBJ_FROZEN(ary)); \
120
+ RARRAY(ary)->as.heap.aux.capa = (n); \
121
+ } while (0)
122
+
123
+ #define ARY_SHARED(ary) (assert(ARY_SHARED_P(ary)), RARRAY(ary)->as.heap.aux.shared)
124
+ #define ARY_SET_SHARED(ary, value) do { \
125
+ assert(!ARY_EMBED_P(ary)); \
126
+ assert(ARY_SHARED_P(ary)); \
127
+ assert(ARY_SHARED_ROOT_P(value)); \
128
+ RARRAY(ary)->as.heap.aux.shared = (value); \
129
+ } while (0)
130
+ #define RARRAY_SHARED_ROOT_FLAG FL_USER5
131
+ #define ARY_SHARED_ROOT_P(ary) (FL_TEST(ary, RARRAY_SHARED_ROOT_FLAG))
132
+ #define ARY_SHARED_NUM(ary) \
133
+ (assert(ARY_SHARED_ROOT_P(ary)), RARRAY(ary)->as.heap.aux.capa)
134
+ #define ARY_SET_SHARED_NUM(ary, value) do { \
135
+ assert(ARY_SHARED_ROOT_P(ary)); \
136
+ RARRAY(ary)->as.heap.aux.capa = (value); \
137
+ } while (0)
138
+ #define FL_SET_SHARED_ROOT(ary) do { \
139
+ assert(!ARY_EMBED_P(ary)); \
140
+ FL_SET(ary, RARRAY_SHARED_ROOT_FLAG); \
141
+ } while (0)
142
+
143
+ static void
144
+ ary_resize_capa(VALUE ary, long capacity)
145
+ {
146
+ assert(RARRAY_LEN(ary) <= capacity);
147
+ assert(!OBJ_FROZEN(ary));
148
+ assert(!ARY_SHARED_P(ary));
149
+ if (capacity > RARRAY_EMBED_LEN_MAX) {
150
+ if (ARY_EMBED_P(ary)) {
151
+ long len = ARY_EMBED_LEN(ary);
152
+ VALUE *ptr = ALLOC_N(VALUE, (capacity));
153
+ MEMCPY(ptr, ARY_EMBED_PTR(ary), VALUE, len);
154
+ FL_UNSET_EMBED(ary);
155
+ ARY_SET_PTR(ary, ptr);
156
+ ARY_SET_HEAP_LEN(ary, len);
157
+ }
158
+ else {
159
+ REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, (capacity));
160
+ }
161
+ ARY_SET_CAPA(ary, (capacity));
162
+ }
163
+ else {
164
+ if (!ARY_EMBED_P(ary)) {
165
+ long len = RARRAY_LEN(ary);
166
+ VALUE *ptr = RARRAY_PTR(ary);
167
+ MEMCPY(RARRAY(ary)->as.ary, ptr, VALUE, len);
168
+ FL_SET_EMBED(ary);
169
+ ARY_SET_LEN(ary, len);
170
+ xfree(ptr);
171
+ }
172
+ }
173
+ }
174
+
175
+ static void
176
+ rb_ary_decrement_share(VALUE shared)
177
+ {
178
+ if (shared) {
179
+ int num = ARY_SHARED_NUM(shared) - 1;
180
+ if (num == 0) {
181
+ rb_ary_free(shared);
182
+ rb_gc_force_recycle(shared);
183
+ }
184
+ else if (num > 0) {
185
+ ARY_SET_SHARED_NUM(shared, num);
186
+ }
187
+ }
188
+ }
189
+
190
+ static void
191
+ rb_ary_unshare(VALUE ary)
192
+ {
193
+ VALUE shared = RARRAY(ary)->as.heap.aux.shared;
194
+ rb_ary_decrement_share(shared);
195
+ FL_UNSET_SHARED(ary);
196
+ }
197
+
198
+ static inline void
199
+ rb_ary_unshare_safe(VALUE ary) {
200
+ if (ARY_SHARED_P(ary) && !ARY_EMBED_P(ary)) {
201
+ rb_ary_unshare(ary);
202
+ }
203
+ }
204
+
205
+ static VALUE
206
+ rb_ary_increment_share(VALUE shared) {
207
+ int num = ARY_SHARED_NUM(shared);
208
+ if (num >= 0) {
209
+ ARY_SET_SHARED_NUM(shared, num + 1);
210
+ }
211
+ return shared;
212
+ }
213
+
214
+ static void
215
+ rb_ary_set_shared(VALUE ary, VALUE shared)
216
+ {
217
+ rb_ary_increment_share(shared);
218
+ FL_SET_SHARED(ary);
219
+ ARY_SET_SHARED(ary, shared);
220
+ }
221
+
222
+ static inline void
223
+ rb_ary_modify_check(VALUE ary)
224
+ {
225
+ if (OBJ_FROZEN(ary)) rb_error_frozen("array");
226
+ if (!OBJ_UNTRUSTED(ary) && rb_safe_level() >= 4)
227
+ rb_raise(rb_eSecurityError, "Insecure: can't modify array");
228
+ }
229
+
230
+ static void
231
+ rb_ary_modify(VALUE ary)
232
+ {
233
+ rb_ary_modify_check(ary);
234
+ if (ARY_SHARED_P(ary)) {
235
+ long len = RARRAY_LEN(ary);
236
+ if (len <= RARRAY_EMBED_LEN_MAX) {
237
+ VALUE *ptr = ARY_HEAP_PTR(ary);
238
+ VALUE shared = ARY_SHARED(ary);
239
+ FL_UNSET_SHARED(ary);
240
+ FL_SET_EMBED(ary);
241
+ MEMCPY(ARY_EMBED_PTR(ary), ptr, VALUE, len);
242
+ rb_ary_decrement_share(shared);
243
+ ARY_SET_EMBED_LEN(ary, len);
244
+ }
245
+ else {
246
+ VALUE *ptr = ALLOC_N(VALUE, len);
247
+ MEMCPY(ptr, RARRAY_PTR(ary), VALUE, len);
248
+ rb_ary_unshare(ary);
249
+ ARY_SET_CAPA(ary, len);
250
+ ARY_SET_PTR(ary, ptr);
251
+ }
252
+ }
253
+ }
254
+
255
+ VALUE
256
+ rb_ary_freeze(VALUE ary)
257
+ {
258
+ return rb_obj_freeze(ary);
259
+ }
260
+
261
+ /*
262
+ * call-seq:
263
+ * array.frozen? -> true or false
264
+ *
265
+ * Return <code>true</code> if this array is frozen (or temporarily frozen
266
+ * while being sorted).
267
+ */
268
+
269
+ static VALUE
270
+ rb_ary_frozen_p(VALUE ary)
271
+ {
272
+ if (OBJ_FROZEN(ary)) return Qtrue;
273
+ return Qfalse;
274
+ }
275
+
276
+ static VALUE
277
+ ary_alloc(VALUE klass)
278
+ {
279
+ NEWOBJ(ary, struct RArray);
280
+ OBJSETUP(ary, klass, T_ARRAY);
281
+ FL_SET_EMBED((VALUE)ary);
282
+ ARY_SET_EMBED_LEN((VALUE)ary, 0);
283
+
284
+ return (VALUE)ary;
285
+ }
286
+
287
+ static VALUE
288
+ ary_new(VALUE klass, long len)
289
+ {
290
+ VALUE ary;
291
+
292
+ if (len < 0) {
293
+ rb_raise(rb_eArgError, "negative array size (or size too big)");
294
+ }
295
+ if (len > ARY_MAX_SIZE) {
296
+ rb_raise(rb_eArgError, "array size too big");
297
+ }
298
+ ary = ary_alloc(klass);
299
+ if (len > RARRAY_EMBED_LEN_MAX) {
300
+ FL_UNSET_EMBED(ary);
301
+ ARY_SET_PTR(ary, ALLOC_N(VALUE, len));
302
+ ARY_SET_CAPA(ary, len);
303
+ ARY_SET_HEAP_LEN(ary, 0);
304
+ }
305
+
306
+ return ary;
307
+ }
308
+
309
+ VALUE
310
+ rb_ary_new2(long len)
311
+ {
312
+ return ary_new(rb_cArray, len);
313
+ }
314
+
315
+
316
+ VALUE
317
+ rb_ary_new(void)
318
+ {
319
+ return rb_ary_new2(RARRAY_EMBED_LEN_MAX);
320
+ }
321
+
322
+ #include <stdarg.h>
323
+
324
+ VALUE
325
+ rb_ary_new3(long n, ...)
326
+ {
327
+ va_list ar;
328
+ VALUE ary;
329
+ long i;
330
+
331
+ ary = rb_ary_new2(n);
332
+
333
+ va_start(ar, n);
334
+ for (i=0; i<n; i++) {
335
+ RARRAY_PTR(ary)[i] = va_arg(ar, VALUE);
336
+ }
337
+ va_end(ar);
338
+
339
+ ARY_SET_LEN(ary, n);
340
+ return ary;
341
+ }
342
+
343
+ VALUE
344
+ rb_ary_new4(long n, const VALUE *elts)
345
+ {
346
+ VALUE ary;
347
+
348
+ ary = rb_ary_new2(n);
349
+ if (n > 0 && elts) {
350
+ MEMCPY(RARRAY_PTR(ary), elts, VALUE, n);
351
+ ARY_SET_LEN(ary, n);
352
+ }
353
+
354
+ return ary;
355
+ }
356
+
357
+ VALUE
358
+ rb_ary_tmp_new(long len)
359
+ {
360
+ return ary_new(0, len);
361
+ }
362
+
363
+ void
364
+ rb_ary_free(VALUE ary)
365
+ {
366
+ if (ARY_OWNS_HEAP_P(ary)) {
367
+ xfree(RARRAY_PTR(ary));
368
+ }
369
+ }
370
+
371
+ static VALUE
372
+ ary_make_shared(VALUE ary)
373
+ {
374
+ assert(!ARY_EMBED_P(ary));
375
+ if (ARY_SHARED_P(ary)) {
376
+ return ARY_SHARED(ary);
377
+ }
378
+ else {
379
+ NEWOBJ(shared, struct RArray);
380
+ OBJSETUP(shared, 0, T_ARRAY);
381
+ FL_UNSET_EMBED(shared);
382
+
383
+ ARY_SET_LEN((VALUE)shared, RARRAY_LEN(ary));
384
+ ARY_SET_PTR((VALUE)shared, RARRAY_PTR(ary));
385
+ FL_SET_SHARED_ROOT(shared);
386
+ ARY_SET_SHARED_NUM((VALUE)shared, 1);
387
+ FL_SET_SHARED(ary);
388
+ ARY_SET_SHARED(ary, (VALUE)shared);
389
+ OBJ_FREEZE(shared);
390
+ return (VALUE)shared;
391
+ }
392
+ }
393
+
394
+
395
+ static VALUE
396
+ ary_make_substitution(VALUE ary)
397
+ {
398
+ if (RARRAY_LEN(ary) <= RARRAY_EMBED_LEN_MAX) {
399
+ VALUE subst = rb_ary_new2(RARRAY_LEN(ary));
400
+ MEMCPY(ARY_EMBED_PTR(subst), RARRAY_PTR(ary), VALUE, RARRAY_LEN(ary));
401
+ ARY_SET_EMBED_LEN(subst, RARRAY_LEN(ary));
402
+ return subst;
403
+ }
404
+ else {
405
+ return rb_ary_increment_share(ary_make_shared(ary));
406
+ }
407
+ }
408
+
409
+ VALUE
410
+ rb_assoc_new(VALUE car, VALUE cdr)
411
+ {
412
+ return rb_ary_new3(2, car, cdr);
413
+ }
414
+
415
+ static VALUE
416
+ to_ary(VALUE ary)
417
+ {
418
+ return rb_convert_type(ary, T_ARRAY, "Array", "to_ary");
419
+ }
420
+
421
+ VALUE
422
+ rb_check_array_type(VALUE ary)
423
+ {
424
+ return rb_check_convert_type(ary, T_ARRAY, "Array", "to_ary");
425
+ }
426
+
427
+ /*
428
+ * call-seq:
429
+ * Array.try_convert(obj) -> array or nil
430
+ *
431
+ * Try to convert <i>obj</i> into an array, using to_ary method.
432
+ * Returns converted array or nil if <i>obj</i> cannot be converted
433
+ * for any reason. This method is to check if an argument is an
434
+ * array.
435
+ *
436
+ * Array.try_convert([1]) # => [1]
437
+ * Array.try_convert("1") # => nil
438
+ *
439
+ * if tmp = Array.try_convert(arg)
440
+ * # the argument is an array
441
+ * elsif tmp = String.try_convert(arg)
442
+ * # the argument is a string
443
+ * end
444
+ *
445
+ */
446
+
447
+ static VALUE
448
+ rb_ary_s_try_convert(VALUE dummy, VALUE ary)
449
+ {
450
+ return rb_check_array_type(ary);
451
+ }
452
+
453
+ /*
454
+ * call-seq:
455
+ * Array.new(size=0, obj=nil)
456
+ * Array.new(array)
457
+ * Array.new(size) {|index| block }
458
+ *
459
+ * Returns a new array. In the first form, the new array is
460
+ * empty. In the second it is created with _size_ copies of _obj_
461
+ * (that is, _size_ references to the same
462
+ * _obj_). The third form creates a copy of the array
463
+ * passed as a parameter (the array is generated by calling
464
+ * to_ary on the parameter). In the last form, an array
465
+ * of the given size is created. Each element in this array is
466
+ * calculated by passing the element's index to the given block and
467
+ * storing the return value.
468
+ *
469
+ * Array.new
470
+ * Array.new(2)
471
+ * Array.new(5, "A")
472
+ *
473
+ * # only one copy of the object is created
474
+ * a = Array.new(2, Hash.new)
475
+ * a[0]['cat'] = 'feline'
476
+ * a
477
+ * a[1]['cat'] = 'Felix'
478
+ * a
479
+ *
480
+ * # here multiple copies are created
481
+ * a = Array.new(2) { Hash.new }
482
+ * a[0]['cat'] = 'feline'
483
+ * a
484
+ *
485
+ * squares = Array.new(5) {|i| i*i}
486
+ * squares
487
+ *
488
+ * copy = Array.new(squares)
489
+ */
490
+
491
+ static VALUE
492
+ rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
493
+ {
494
+ long len;
495
+ VALUE size, val;
496
+
497
+ rb_ary_modify(ary);
498
+ if (argc == 0) {
499
+ if (ARY_OWNS_HEAP_P(ary) && RARRAY_PTR(ary)) {
500
+ xfree(RARRAY_PTR(ary));
501
+ }
502
+ rb_ary_unshare_safe(ary);
503
+ FL_SET_EMBED(ary);
504
+ ARY_SET_EMBED_LEN(ary, 0);
505
+ if (rb_block_given_p()) {
506
+ rb_warning("given block not used");
507
+ }
508
+ return ary;
509
+ }
510
+ rb_scan_args(argc, argv, "02", &size, &val);
511
+ if (argc == 1 && !FIXNUM_P(size)) {
512
+ val = rb_check_array_type(size);
513
+ if (!NIL_P(val)) {
514
+ rb_ary_replace(ary, val);
515
+ return ary;
516
+ }
517
+ }
518
+
519
+ len = NUM2LONG(size);
520
+ if (len < 0) {
521
+ rb_raise(rb_eArgError, "negative array size");
522
+ }
523
+ if (len > ARY_MAX_SIZE) {
524
+ rb_raise(rb_eArgError, "array size too big");
525
+ }
526
+ rb_ary_modify(ary);
527
+ ary_resize_capa(ary, len);
528
+ if (rb_block_given_p()) {
529
+ long i;
530
+
531
+ if (argc == 2) {
532
+ rb_warn("block supersedes default value argument");
533
+ }
534
+ for (i=0; i<len; i++) {
535
+ rb_ary_store(ary, i, rb_yield(LONG2NUM(i)));
536
+ ARY_SET_LEN(ary, i + 1);
537
+ }
538
+ }
539
+ else {
540
+ memfill(RARRAY_PTR(ary), len, val);
541
+ ARY_SET_LEN(ary, len);
542
+ }
543
+ return ary;
544
+ }
545
+
546
+
547
+ /*
548
+ * Returns a new array populated with the given objects.
549
+ *
550
+ * Array.[]( 1, 'a', /^A/ )
551
+ * Array[ 1, 'a', /^A/ ]
552
+ * [ 1, 'a', /^A/ ]
553
+ */
554
+
555
+ static VALUE
556
+ rb_ary_s_create(int argc, VALUE *argv, VALUE klass)
557
+ {
558
+ VALUE ary = ary_new(klass, argc);
559
+ if (argc > 0 && argv) {
560
+ MEMCPY(RARRAY_PTR(ary), argv, VALUE, argc);
561
+ ARY_SET_LEN(ary, argc);
562
+ }
563
+
564
+ return ary;
565
+ }
566
+
567
+ void
568
+ rb_ary_store(VALUE ary, long idx, VALUE val)
569
+ {
570
+ if (idx < 0) {
571
+ idx += RARRAY_LEN(ary);
572
+ if (idx < 0) {
573
+ rb_raise(rb_eIndexError, "index %ld out of array",
574
+ idx - RARRAY_LEN(ary));
575
+ }
576
+ }
577
+ else if (idx >= ARY_MAX_SIZE) {
578
+ rb_raise(rb_eIndexError, "index %ld too big", idx);
579
+ }
580
+
581
+ rb_ary_modify(ary);
582
+ if (idx >= ARY_CAPA(ary)) {
583
+ long new_capa = ARY_CAPA(ary) / 2;
584
+
585
+ if (new_capa < ARY_DEFAULT_SIZE) {
586
+ new_capa = ARY_DEFAULT_SIZE;
587
+ }
588
+ if (new_capa >= ARY_MAX_SIZE - idx) {
589
+ new_capa = (ARY_MAX_SIZE - idx) / 2;
590
+ }
591
+ new_capa += idx;
592
+ ary_resize_capa(ary, new_capa);
593
+ }
594
+ if (idx > RARRAY_LEN(ary)) {
595
+ rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary),
596
+ idx-RARRAY_LEN(ary) + 1);
597
+ }
598
+
599
+ if (idx >= RARRAY_LEN(ary)) {
600
+ ARY_SET_LEN(ary, idx + 1);
601
+ }
602
+ RARRAY_PTR(ary)[idx] = val;
603
+ }
604
+
605
+ static VALUE
606
+ ary_make_partial(VALUE ary, VALUE klass, long offset, long len)
607
+ {
608
+ assert(offset >= 0);
609
+ assert(len >= 0);
610
+ assert(offset+len <= RARRAY_LEN(ary));
611
+
612
+ if (len <= RARRAY_EMBED_LEN_MAX) {
613
+ VALUE result = ary_alloc(klass);
614
+ MEMCPY(ARY_EMBED_PTR(result), RARRAY_PTR(ary) + offset, VALUE, len);
615
+ ARY_SET_EMBED_LEN(result, len);
616
+ return result;
617
+ }
618
+ else {
619
+ VALUE shared, result = ary_alloc(klass);
620
+ FL_UNSET_EMBED(result);
621
+
622
+ shared = ary_make_shared(ary);
623
+ ARY_SET_PTR(result, RARRAY_PTR(ary));
624
+ ARY_SET_LEN(result, RARRAY_LEN(ary));
625
+ rb_ary_set_shared(result, shared);
626
+
627
+ ARY_INCREASE_PTR(result, offset);
628
+ ARY_SET_LEN(result, len);
629
+ return result;
630
+ }
631
+ }
632
+
633
+ static VALUE
634
+ ary_make_shared_copy(VALUE ary)
635
+ {
636
+ return ary_make_partial(ary, rb_obj_class(ary), 0, RARRAY_LEN(ary));
637
+ }
638
+
639
+ enum ary_take_pos_flags
640
+ {
641
+ ARY_TAKE_FIRST = 0,
642
+ ARY_TAKE_LAST = 1
643
+ };
644
+
645
+ static VALUE
646
+ ary_take_first_or_last(int argc, VALUE *argv, VALUE ary, enum ary_take_pos_flags last)
647
+ {
648
+ VALUE nv;
649
+ long n;
650
+ long offset = 0;
651
+
652
+ rb_scan_args(argc, argv, "1", &nv);
653
+ n = NUM2LONG(nv);
654
+ if (n > RARRAY_LEN(ary)) {
655
+ n = RARRAY_LEN(ary);
656
+ }
657
+ else if (n < 0) {
658
+ rb_raise(rb_eArgError, "negative array size");
659
+ }
660
+ if (last) {
661
+ offset = RARRAY_LEN(ary) - n;
662
+ }
663
+ return ary_make_partial(ary, rb_cArray, offset, n);
664
+ }
665
+
666
+ /*
667
+ * call-seq:
668
+ * array << obj -> array
669
+ *
670
+ * Append---Pushes the given object on to the end of this array. This
671
+ * expression returns the array itself, so several appends
672
+ * may be chained together.
673
+ *
674
+ * [ 1, 2 ] << "c" << "d" << [ 3, 4 ]
675
+ * #=> [ 1, 2, "c", "d", [ 3, 4 ] ]
676
+ *
677
+ */
678
+
679
+ VALUE
680
+ rb_ary_push(VALUE ary, VALUE item)
681
+ {
682
+ rb_ary_store(ary, RARRAY_LEN(ary), item);
683
+ return ary;
684
+ }
685
+
686
+ /*
687
+ * call-seq:
688
+ * array.push(obj, ... ) -> array
689
+ *
690
+ * Append---Pushes the given object(s) on to the end of this array. This
691
+ * expression returns the array itself, so several appends
692
+ * may be chained together.
693
+ *
694
+ * a = [ "a", "b", "c" ]
695
+ * a.push("d", "e", "f")
696
+ * #=> ["a", "b", "c", "d", "e", "f"]
697
+ */
698
+
699
+ static VALUE
700
+ rb_ary_push_m(int argc, VALUE *argv, VALUE ary)
701
+ {
702
+ rb_ary_modify_check(ary);
703
+ while (argc--) {
704
+ rb_ary_push(ary, *argv++);
705
+ }
706
+ return ary;
707
+ }
708
+
709
+ VALUE
710
+ rb_ary_pop(VALUE ary)
711
+ {
712
+ long n;
713
+ rb_ary_modify_check(ary);
714
+ if (RARRAY_LEN(ary) == 0) return Qnil;
715
+ if (ARY_OWNS_HEAP_P(ary) &&
716
+ RARRAY_LEN(ary) * 3 < ARY_CAPA(ary) &&
717
+ ARY_CAPA(ary) > ARY_DEFAULT_SIZE)
718
+ {
719
+ ary_resize_capa(ary, RARRAY_LEN(ary) * 2);
720
+ }
721
+ n = RARRAY_LEN(ary)-1;
722
+ ARY_SET_LEN(ary, n);
723
+ return RARRAY_PTR(ary)[n];
724
+ }
725
+
726
+ /*
727
+ * call-seq:
728
+ * array.pop -> obj or nil
729
+ * array.pop(n) -> array
730
+ *
731
+ * Removes the last element from <i>self</i> and returns it, or
732
+ * <code>nil</code> if the array is empty.
733
+ *
734
+ * If a number _n_ is given, returns an array of the last n elements
735
+ * (or less) just like <code>array.slice!(-n, n)</code> does.
736
+ *
737
+ * a = [ "a", "b", "c", "d" ]
738
+ * a.pop #=> "d"
739
+ * a.pop(2) #=> ["b", "c"]
740
+ * a #=> ["a"]
741
+ */
742
+
743
+ static VALUE
744
+ rb_ary_pop_m(int argc, VALUE *argv, VALUE ary)
745
+ {
746
+ VALUE result;
747
+
748
+ if (argc == 0) {
749
+ return rb_ary_pop(ary);
750
+ }
751
+
752
+ rb_ary_modify_check(ary);
753
+ result = ary_take_first_or_last(argc, argv, ary, ARY_TAKE_LAST);
754
+ ARY_INCREASE_LEN(ary, -RARRAY_LEN(result));
755
+ return result;
756
+ }
757
+
758
+ VALUE
759
+ rb_ary_shift(VALUE ary)
760
+ {
761
+ VALUE top;
762
+
763
+ rb_ary_modify_check(ary);
764
+ if (RARRAY_LEN(ary) == 0) return Qnil;
765
+ top = RARRAY_PTR(ary)[0];
766
+ if (!ARY_SHARED_P(ary)) {
767
+ if (RARRAY_LEN(ary) < ARY_DEFAULT_SIZE) {
768
+ MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+1, VALUE, RARRAY_LEN(ary)-1);
769
+ ARY_INCREASE_LEN(ary, -1);
770
+ return top;
771
+ }
772
+ assert(!ARY_EMBED_P(ary)); /* ARY_EMBED_LEN_MAX < ARY_DEFAULT_SIZE */
773
+
774
+ RARRAY_PTR(ary)[0] = Qnil;
775
+ ary_make_shared(ary);
776
+ }
777
+ ARY_INCREASE_PTR(ary, 1); /* shift ptr */
778
+ ARY_INCREASE_LEN(ary, -1);
779
+
780
+ return top;
781
+ }
782
+
783
+ /*
784
+ * call-seq:
785
+ * array.shift -> obj or nil
786
+ * array.shift(n) -> array
787
+ *
788
+ * Returns the first element of <i>self</i> and removes it (shifting all
789
+ * other elements down by one). Returns <code>nil</code> if the array
790
+ * is empty.
791
+ *
792
+ * If a number _n_ is given, returns an array of the first n elements
793
+ * (or less) just like <code>array.slice!(0, n)</code> does.
794
+ *
795
+ * args = [ "-m", "-q", "filename" ]
796
+ * args.shift #=> "-m"
797
+ * args #=> ["-q", "filename"]
798
+ *
799
+ * args = [ "-m", "-q", "filename" ]
800
+ * args.shift(2) #=> ["-m", "-q"]
801
+ * args #=> ["filename"]
802
+ */
803
+
804
+ static VALUE
805
+ rb_ary_shift_m(int argc, VALUE *argv, VALUE ary)
806
+ {
807
+ VALUE result;
808
+ long n;
809
+
810
+ if (argc == 0) {
811
+ return rb_ary_shift(ary);
812
+ }
813
+
814
+ rb_ary_modify_check(ary);
815
+ result = ary_take_first_or_last(argc, argv, ary, ARY_TAKE_FIRST);
816
+ n = RARRAY_LEN(result);
817
+ if (ARY_SHARED_P(ary)) {
818
+ ARY_INCREASE_PTR(ary, n);
819
+ }
820
+ else {
821
+ MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+n, VALUE, RARRAY_LEN(ary)-n);
822
+ }
823
+ ARY_INCREASE_LEN(ary, -n);
824
+
825
+ return result;
826
+ }
827
+
828
+ /*
829
+ * call-seq:
830
+ * array.unshift(obj, ...) -> array
831
+ *
832
+ * Prepends objects to the front of <i>array</i>.
833
+ * other elements up one.
834
+ *
835
+ * a = [ "b", "c", "d" ]
836
+ * a.unshift("a") #=> ["a", "b", "c", "d"]
837
+ * a.unshift(1, 2) #=> [ 1, 2, "a", "b", "c", "d"]
838
+ */
839
+
840
+ static VALUE
841
+ rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary)
842
+ {
843
+ long len;
844
+
845
+ if (argc == 0) return ary;
846
+ rb_ary_modify(ary);
847
+ if (ARY_CAPA(ary) <= (len = RARRAY_LEN(ary)) + argc) {
848
+ ary_resize_capa(ary, len + argc + ARY_DEFAULT_SIZE);
849
+ }
850
+
851
+ /* sliding items */
852
+ MEMMOVE(RARRAY_PTR(ary) + argc, RARRAY_PTR(ary), VALUE, len);
853
+ MEMCPY(RARRAY_PTR(ary), argv, VALUE, argc);
854
+ ARY_INCREASE_LEN(ary, argc);
855
+
856
+ return ary;
857
+ }
858
+
859
+ VALUE
860
+ rb_ary_unshift(VALUE ary, VALUE item)
861
+ {
862
+ return rb_ary_unshift_m(1,&item,ary);
863
+ }
864
+
865
+ /* faster version - use this if you don't need to treat negative offset */
866
+ static inline VALUE
867
+ rb_ary_elt(VALUE ary, long offset)
868
+ {
869
+ if (RARRAY_LEN(ary) == 0) return Qnil;
870
+ if (offset < 0 || RARRAY_LEN(ary) <= offset) {
871
+ return Qnil;
872
+ }
873
+ return RARRAY_PTR(ary)[offset];
874
+ }
875
+
876
+ VALUE
877
+ rb_ary_entry(VALUE ary, long offset)
878
+ {
879
+ if (offset < 0) {
880
+ offset += RARRAY_LEN(ary);
881
+ }
882
+ return rb_ary_elt(ary, offset);
883
+ }
884
+
885
+ VALUE
886
+ rb_ary_subseq(VALUE ary, long beg, long len)
887
+ {
888
+ VALUE klass;
889
+
890
+ if (beg > RARRAY_LEN(ary)) return Qnil;
891
+ if (beg < 0 || len < 0) return Qnil;
892
+
893
+ if (RARRAY_LEN(ary) < len || RARRAY_LEN(ary) < beg + len) {
894
+ len = RARRAY_LEN(ary) - beg;
895
+ }
896
+ klass = rb_obj_class(ary);
897
+ if (len == 0) return ary_new(klass, 0);
898
+
899
+ return ary_make_partial(ary, klass, beg, len);
900
+ }
901
+
902
+ /*
903
+ * call-seq:
904
+ * array[index] -> obj or nil
905
+ * array[start, length] -> an_array or nil
906
+ * array[range] -> an_array or nil
907
+ * array.slice(index) -> obj or nil
908
+ * array.slice(start, length) -> an_array or nil
909
+ * array.slice(range) -> an_array or nil
910
+ *
911
+ * Element Reference---Returns the element at _index_,
912
+ * or returns a subarray starting at _start_ and
913
+ * continuing for _length_ elements, or returns a subarray
914
+ * specified by _range_.
915
+ * Negative indices count backward from the end of the
916
+ * array (-1 is the last element). Returns nil if the index
917
+ * (or starting index) are out of range.
918
+ *
919
+ * a = [ "a", "b", "c", "d", "e" ]
920
+ * a[2] + a[0] + a[1] #=> "cab"
921
+ * a[6] #=> nil
922
+ * a[1, 2] #=> [ "b", "c" ]
923
+ * a[1..3] #=> [ "b", "c", "d" ]
924
+ * a[4..7] #=> [ "e" ]
925
+ * a[6..10] #=> nil
926
+ * a[-3, 3] #=> [ "c", "d", "e" ]
927
+ * # special cases
928
+ * a[5] #=> nil
929
+ * a[5, 1] #=> []
930
+ * a[5..10] #=> []
931
+ *
932
+ */
933
+
934
+ VALUE
935
+ rb_ary_aref(int argc, VALUE *argv, VALUE ary)
936
+ {
937
+ VALUE arg;
938
+ long beg, len;
939
+
940
+ if (argc == 2) {
941
+ beg = NUM2LONG(argv[0]);
942
+ len = NUM2LONG(argv[1]);
943
+ if (beg < 0) {
944
+ beg += RARRAY_LEN(ary);
945
+ }
946
+ return rb_ary_subseq(ary, beg, len);
947
+ }
948
+ if (argc != 1) {
949
+ rb_scan_args(argc, argv, "11", 0, 0);
950
+ }
951
+ arg = argv[0];
952
+ /* special case - speeding up */
953
+ if (FIXNUM_P(arg)) {
954
+ return rb_ary_entry(ary, FIX2LONG(arg));
955
+ }
956
+ /* check if idx is Range */
957
+ switch (rb_range_beg_len(arg, &beg, &len, RARRAY_LEN(ary), 0)) {
958
+ case Qfalse:
959
+ break;
960
+ case Qnil:
961
+ return Qnil;
962
+ default:
963
+ return rb_ary_subseq(ary, beg, len);
964
+ }
965
+ return rb_ary_entry(ary, NUM2LONG(arg));
966
+ }
967
+
968
+ /*
969
+ * call-seq:
970
+ * array.at(index) -> obj or nil
971
+ *
972
+ * Returns the element at _index_. A
973
+ * negative index counts from the end of _self_. Returns +nil+
974
+ * if the index is out of range. See also <code>Array#[]</code>.
975
+ *
976
+ * a = [ "a", "b", "c", "d", "e" ]
977
+ * a.at(0) #=> "a"
978
+ * a.at(-1) #=> "e"
979
+ */
980
+
981
+ static VALUE
982
+ rb_ary_at(VALUE ary, VALUE pos)
983
+ {
984
+ return rb_ary_entry(ary, NUM2LONG(pos));
985
+ }
986
+
987
+ /*
988
+ * call-seq:
989
+ * array.first -> obj or nil
990
+ * array.first(n) -> an_array
991
+ *
992
+ * Returns the first element, or the first +n+ elements, of the array.
993
+ * If the array is empty, the first form returns <code>nil</code>, and the
994
+ * second form returns an empty array.
995
+ *
996
+ * a = [ "q", "r", "s", "t" ]
997
+ * a.first #=> "q"
998
+ * a.first(2) #=> ["q", "r"]
999
+ */
1000
+
1001
+ static VALUE
1002
+ rb_ary_first(int argc, VALUE *argv, VALUE ary)
1003
+ {
1004
+ if (argc == 0) {
1005
+ if (RARRAY_LEN(ary) == 0) return Qnil;
1006
+ return RARRAY_PTR(ary)[0];
1007
+ }
1008
+ else {
1009
+ return ary_take_first_or_last(argc, argv, ary, ARY_TAKE_FIRST);
1010
+ }
1011
+ }
1012
+
1013
+ /*
1014
+ * call-seq:
1015
+ * array.last -> obj or nil
1016
+ * array.last(n) -> an_array
1017
+ *
1018
+ * Returns the last element(s) of <i>self</i>. If the array is empty,
1019
+ * the first form returns <code>nil</code>.
1020
+ *
1021
+ * a = [ "w", "x", "y", "z" ]
1022
+ * a.last #=> "z"
1023
+ * a.last(2) #=> ["y", "z"]
1024
+ */
1025
+
1026
+ VALUE
1027
+ rb_ary_last(int argc, VALUE *argv, VALUE ary)
1028
+ {
1029
+ if (argc == 0) {
1030
+ if (RARRAY_LEN(ary) == 0) return Qnil;
1031
+ return RARRAY_PTR(ary)[RARRAY_LEN(ary)-1];
1032
+ }
1033
+ else {
1034
+ return ary_take_first_or_last(argc, argv, ary, ARY_TAKE_LAST);
1035
+ }
1036
+ }
1037
+
1038
+ /*
1039
+ * call-seq:
1040
+ * array.fetch(index) -> obj
1041
+ * array.fetch(index, default ) -> obj
1042
+ * array.fetch(index) {|index| block } -> obj
1043
+ *
1044
+ * Tries to return the element at position <i>index</i>. If the index
1045
+ * lies outside the array, the first form throws an
1046
+ * <code>IndexError</code> exception, the second form returns
1047
+ * <i>default</i>, and the third form returns the value of invoking
1048
+ * the block, passing in the index. Negative values of <i>index</i>
1049
+ * count from the end of the array.
1050
+ *
1051
+ * a = [ 11, 22, 33, 44 ]
1052
+ * a.fetch(1) #=> 22
1053
+ * a.fetch(-1) #=> 44
1054
+ * a.fetch(4, 'cat') #=> "cat"
1055
+ * a.fetch(4) { |i| i*i } #=> 16
1056
+ */
1057
+
1058
+ static VALUE
1059
+ rb_ary_fetch(int argc, VALUE *argv, VALUE ary)
1060
+ {
1061
+ VALUE pos, ifnone;
1062
+ long block_given;
1063
+ long idx;
1064
+
1065
+ rb_scan_args(argc, argv, "11", &pos, &ifnone);
1066
+ block_given = rb_block_given_p();
1067
+ if (block_given && argc == 2) {
1068
+ rb_warn("block supersedes default value argument");
1069
+ }
1070
+ idx = NUM2LONG(pos);
1071
+
1072
+ if (idx < 0) {
1073
+ idx += RARRAY_LEN(ary);
1074
+ }
1075
+ if (idx < 0 || RARRAY_LEN(ary) <= idx) {
1076
+ if (block_given) return rb_yield(pos);
1077
+ if (argc == 1) {
1078
+ rb_raise(rb_eIndexError, "index %ld out of array", idx);
1079
+ }
1080
+ return ifnone;
1081
+ }
1082
+ return RARRAY_PTR(ary)[idx];
1083
+ }
1084
+
1085
+ /*
1086
+ * call-seq:
1087
+ * array.index(obj) -> int or nil
1088
+ * array.index {|item| block} -> int or nil
1089
+ *
1090
+ * Returns the index of the first object in <i>self</i> such that is
1091
+ * <code>==</code> to <i>obj</i>. If a block is given instead of an
1092
+ * argument, returns first object for which <em>block</em> is true.
1093
+ * Returns <code>nil</code> if no match is found.
1094
+ *
1095
+ * a = [ "a", "b", "c" ]
1096
+ * a.index("b") #=> 1
1097
+ * a.index("z") #=> nil
1098
+ * a.index{|x|x=="b"} #=> 1
1099
+ *
1100
+ * This is an alias of <code>#find_index</code>.
1101
+ */
1102
+
1103
+ static VALUE
1104
+ rb_ary_index(int argc, VALUE *argv, VALUE ary)
1105
+ {
1106
+ VALUE val;
1107
+ long i;
1108
+
1109
+ if (argc == 0) {
1110
+ RETURN_ENUMERATOR(ary, 0, 0);
1111
+ for (i=0; i<RARRAY_LEN(ary); i++) {
1112
+ if (RTEST(rb_yield(RARRAY_PTR(ary)[i]))) {
1113
+ return LONG2NUM(i);
1114
+ }
1115
+ }
1116
+ return Qnil;
1117
+ }
1118
+ rb_scan_args(argc, argv, "01", &val);
1119
+ for (i=0; i<RARRAY_LEN(ary); i++) {
1120
+ if (rb_equal(RARRAY_PTR(ary)[i], val))
1121
+ return LONG2NUM(i);
1122
+ }
1123
+ return Qnil;
1124
+ }
1125
+
1126
+ /*
1127
+ * call-seq:
1128
+ * array.rindex(obj) -> int or nil
1129
+ *
1130
+ * Returns the index of the last object in <i>array</i>
1131
+ * <code>==</code> to <i>obj</i>. If a block is given instead of an
1132
+ * argument, returns first object for which <em>block</em> is
1133
+ * true. Returns <code>nil</code> if no match is found.
1134
+ *
1135
+ * a = [ "a", "b", "b", "b", "c" ]
1136
+ * a.rindex("b") #=> 3
1137
+ * a.rindex("z") #=> nil
1138
+ * a.rindex{|x|x=="b"} #=> 3
1139
+ */
1140
+
1141
+ static VALUE
1142
+ rb_ary_rindex(int argc, VALUE *argv, VALUE ary)
1143
+ {
1144
+ VALUE val;
1145
+ long i = RARRAY_LEN(ary);
1146
+
1147
+ if (argc == 0) {
1148
+ RETURN_ENUMERATOR(ary, 0, 0);
1149
+ while (i--) {
1150
+ if (RTEST(rb_yield(RARRAY_PTR(ary)[i])))
1151
+ return LONG2NUM(i);
1152
+ if (i > RARRAY_LEN(ary)) {
1153
+ i = RARRAY_LEN(ary);
1154
+ }
1155
+ }
1156
+ return Qnil;
1157
+ }
1158
+ rb_scan_args(argc, argv, "01", &val);
1159
+ while (i--) {
1160
+ if (rb_equal(RARRAY_PTR(ary)[i], val))
1161
+ return LONG2NUM(i);
1162
+ if (i > RARRAY_LEN(ary)) {
1163
+ i = RARRAY_LEN(ary);
1164
+ }
1165
+ }
1166
+ return Qnil;
1167
+ }
1168
+
1169
+ VALUE
1170
+ rb_ary_to_ary(VALUE obj)
1171
+ {
1172
+ if (TYPE(obj) == T_ARRAY) {
1173
+ return obj;
1174
+ }
1175
+ if (rb_respond_to(obj, rb_intern("to_ary"))) {
1176
+ return to_ary(obj);
1177
+ }
1178
+ return rb_ary_new3(1, obj);
1179
+ }
1180
+
1181
+ static void
1182
+ rb_ary_splice(VALUE ary, long beg, long len, VALUE rpl)
1183
+ {
1184
+ long rlen;
1185
+
1186
+ if (len < 0) rb_raise(rb_eIndexError, "negative length (%ld)", len);
1187
+ if (beg < 0) {
1188
+ beg += RARRAY_LEN(ary);
1189
+ if (beg < 0) {
1190
+ beg -= RARRAY_LEN(ary);
1191
+ rb_raise(rb_eIndexError, "index %ld out of array", beg);
1192
+ }
1193
+ }
1194
+ if (RARRAY_LEN(ary) < len || RARRAY_LEN(ary) < beg + len) {
1195
+ len = RARRAY_LEN(ary) - beg;
1196
+ }
1197
+
1198
+ if (rpl == Qundef) {
1199
+ rlen = 0;
1200
+ }
1201
+ else {
1202
+ rpl = rb_ary_to_ary(rpl);
1203
+ rlen = RARRAY_LEN(rpl);
1204
+ }
1205
+ rb_ary_modify(ary);
1206
+ if (beg >= RARRAY_LEN(ary)) {
1207
+ if (beg > ARY_MAX_SIZE - rlen) {
1208
+ rb_raise(rb_eIndexError, "index %ld too big", beg);
1209
+ }
1210
+ len = beg + rlen;
1211
+ if (len >= ARY_CAPA(ary)) {
1212
+ ary_resize_capa(ary, len);
1213
+ }
1214
+ rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary), beg - RARRAY_LEN(ary));
1215
+ if (rlen > 0) {
1216
+ MEMCPY(RARRAY_PTR(ary) + beg, RARRAY_PTR(rpl), VALUE, rlen);
1217
+ }
1218
+ ARY_SET_LEN(ary, len);
1219
+ }
1220
+ else {
1221
+ long alen;
1222
+
1223
+ alen = RARRAY_LEN(ary) + rlen - len;
1224
+ if (alen >= ARY_CAPA(ary)) {
1225
+ ary_resize_capa(ary, alen);
1226
+ }
1227
+
1228
+ if (len != rlen) {
1229
+ MEMMOVE(RARRAY_PTR(ary) + beg + rlen, RARRAY_PTR(ary) + beg + len,
1230
+ VALUE, RARRAY_LEN(ary) - (beg + len));
1231
+ ARY_SET_LEN(ary, alen);
1232
+ }
1233
+ if (rlen > 0) {
1234
+ MEMMOVE(RARRAY_PTR(ary) + beg, RARRAY_PTR(rpl), VALUE, rlen);
1235
+ }
1236
+ }
1237
+ }
1238
+
1239
+ /*
1240
+ * call-seq:
1241
+ * array[index] = obj -> obj
1242
+ * array[start, length] = obj or an_array or nil -> obj or an_array or nil
1243
+ * array[range] = obj or an_array or nil -> obj or an_array or nil
1244
+ *
1245
+ * Element Assignment---Sets the element at _index_,
1246
+ * or replaces a subarray starting at _start_ and
1247
+ * continuing for _length_ elements, or replaces a subarray
1248
+ * specified by _range_. If indices are greater than
1249
+ * the current capacity of the array, the array grows
1250
+ * automatically. A negative indices will count backward
1251
+ * from the end of the array. Inserts elements if _length_ is
1252
+ * zero. An +IndexError+ is raised if a negative index points
1253
+ * past the beginning of the array. See also
1254
+ * <code>Array#push</code>, and <code>Array#unshift</code>.
1255
+ *
1256
+ * a = Array.new
1257
+ * a[4] = "4"; #=> [nil, nil, nil, nil, "4"]
1258
+ * a[0, 3] = [ 'a', 'b', 'c' ] #=> ["a", "b", "c", nil, "4"]
1259
+ * a[1..2] = [ 1, 2 ] #=> ["a", 1, 2, nil, "4"]
1260
+ * a[0, 2] = "?" #=> ["?", 2, nil, "4"]
1261
+ * a[0..2] = "A" #=> ["A", "4"]
1262
+ * a[-1] = "Z" #=> ["A", "Z"]
1263
+ * a[1..-1] = nil #=> ["A", nil]
1264
+ * a[1..-1] = [] #=> ["A"]
1265
+ */
1266
+
1267
+ static VALUE
1268
+ rb_ary_aset(int argc, VALUE *argv, VALUE ary)
1269
+ {
1270
+ long offset, beg, len;
1271
+
1272
+ if (argc == 3) {
1273
+ beg = NUM2LONG(argv[0]);
1274
+ len = NUM2LONG(argv[1]);
1275
+ rb_ary_splice(ary, beg, len, argv[2]);
1276
+ return argv[2];
1277
+ }
1278
+ if (argc != 2) {
1279
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc);
1280
+ }
1281
+ if (FIXNUM_P(argv[0])) {
1282
+ offset = FIX2LONG(argv[0]);
1283
+ goto fixnum;
1284
+ }
1285
+ if (rb_range_beg_len(argv[0], &beg, &len, RARRAY_LEN(ary), 1)) {
1286
+ /* check if idx is Range */
1287
+ rb_ary_splice(ary, beg, len, argv[1]);
1288
+ return argv[1];
1289
+ }
1290
+
1291
+ offset = NUM2LONG(argv[0]);
1292
+ fixnum:
1293
+ rb_ary_store(ary, offset, argv[1]);
1294
+ return argv[1];
1295
+ }
1296
+
1297
+ /*
1298
+ * call-seq:
1299
+ * array.insert(index, obj...) -> array
1300
+ *
1301
+ * Inserts the given values before the element with the given index
1302
+ * (which may be negative).
1303
+ *
1304
+ * a = %w{ a b c d }
1305
+ * a.insert(2, 99) #=> ["a", "b", 99, "c", "d"]
1306
+ * a.insert(-2, 1, 2, 3) #=> ["a", "b", 99, "c", 1, 2, 3, "d"]
1307
+ */
1308
+
1309
+ static VALUE
1310
+ rb_ary_insert(int argc, VALUE *argv, VALUE ary)
1311
+ {
1312
+ long pos;
1313
+
1314
+ if (argc == 1) return ary;
1315
+ if (argc < 1) {
1316
+ rb_raise(rb_eArgError, "wrong number of arguments (at least 1)");
1317
+ }
1318
+ pos = NUM2LONG(argv[0]);
1319
+ if (pos == -1) {
1320
+ pos = RARRAY_LEN(ary);
1321
+ }
1322
+ if (pos < 0) {
1323
+ pos++;
1324
+ }
1325
+ rb_ary_splice(ary, pos, 0, rb_ary_new4(argc - 1, argv + 1));
1326
+ return ary;
1327
+ }
1328
+
1329
+ /*
1330
+ * call-seq:
1331
+ * array.each {|item| block } -> array
1332
+ *
1333
+ * Calls <i>block</i> once for each element in <i>self</i>, passing that
1334
+ * element as a parameter.
1335
+ *
1336
+ * a = [ "a", "b", "c" ]
1337
+ * a.each {|x| print x, " -- " }
1338
+ *
1339
+ * produces:
1340
+ *
1341
+ * a -- b -- c --
1342
+ */
1343
+
1344
+ VALUE
1345
+ rb_ary_each(VALUE ary)
1346
+ {
1347
+ long i;
1348
+
1349
+ RETURN_ENUMERATOR(ary, 0, 0);
1350
+ for (i=0; i<RARRAY_LEN(ary); i++) {
1351
+ rb_yield(RARRAY_PTR(ary)[i]);
1352
+ }
1353
+ return ary;
1354
+ }
1355
+
1356
+ /*
1357
+ * call-seq:
1358
+ * array.each_index {|index| block } -> array
1359
+ *
1360
+ * Same as <code>Array#each</code>, but passes the index of the element
1361
+ * instead of the element itself.
1362
+ *
1363
+ * a = [ "a", "b", "c" ]
1364
+ * a.each_index {|x| print x, " -- " }
1365
+ *
1366
+ * produces:
1367
+ *
1368
+ * 0 -- 1 -- 2 --
1369
+ */
1370
+
1371
+ static VALUE
1372
+ rb_ary_each_index(VALUE ary)
1373
+ {
1374
+ long i;
1375
+ RETURN_ENUMERATOR(ary, 0, 0);
1376
+
1377
+ for (i=0; i<RARRAY_LEN(ary); i++) {
1378
+ rb_yield(LONG2NUM(i));
1379
+ }
1380
+ return ary;
1381
+ }
1382
+
1383
+ /*
1384
+ * call-seq:
1385
+ * array.reverse_each {|item| block }
1386
+ *
1387
+ * Same as <code>Array#each</code>, but traverses <i>self</i> in reverse
1388
+ * order.
1389
+ *
1390
+ * a = [ "a", "b", "c" ]
1391
+ * a.reverse_each {|x| print x, " " }
1392
+ *
1393
+ * produces:
1394
+ *
1395
+ * c b a
1396
+ */
1397
+
1398
+ static VALUE
1399
+ rb_ary_reverse_each(VALUE ary)
1400
+ {
1401
+ long len;
1402
+
1403
+ RETURN_ENUMERATOR(ary, 0, 0);
1404
+ len = RARRAY_LEN(ary);
1405
+ while (len--) {
1406
+ rb_yield(RARRAY_PTR(ary)[len]);
1407
+ if (RARRAY_LEN(ary) < len) {
1408
+ len = RARRAY_LEN(ary);
1409
+ }
1410
+ }
1411
+ return ary;
1412
+ }
1413
+
1414
+ /*
1415
+ * call-seq:
1416
+ * array.length -> int
1417
+ *
1418
+ * Returns the number of elements in <i>self</i>. May be zero.
1419
+ *
1420
+ * [ 1, 2, 3, 4, 5 ].length #=> 5
1421
+ */
1422
+
1423
+ static VALUE
1424
+ rb_ary_length(VALUE ary)
1425
+ {
1426
+ long len = RARRAY_LEN(ary);
1427
+ return LONG2NUM(len);
1428
+ }
1429
+
1430
+ /*
1431
+ * call-seq:
1432
+ * array.empty? -> true or false
1433
+ *
1434
+ * Returns <code>true</code> if <i>self</i> array contains no elements.
1435
+ *
1436
+ * [].empty? #=> true
1437
+ */
1438
+
1439
+ static VALUE
1440
+ rb_ary_empty_p(VALUE ary)
1441
+ {
1442
+ if (RARRAY_LEN(ary) == 0)
1443
+ return Qtrue;
1444
+ return Qfalse;
1445
+ }
1446
+
1447
+ VALUE
1448
+ rb_ary_dup(VALUE ary)
1449
+ {
1450
+ VALUE dup = rb_ary_new2(RARRAY_LEN(ary));
1451
+ int is_embed = ARY_EMBED_P(dup);
1452
+ DUPSETUP(dup, ary);
1453
+ if (is_embed) FL_SET_EMBED(dup);
1454
+ MEMCPY(RARRAY_PTR(dup), RARRAY_PTR(ary), VALUE, RARRAY_LEN(ary));
1455
+ ARY_SET_LEN(dup, RARRAY_LEN(ary));
1456
+
1457
+ return dup;
1458
+ }
1459
+
1460
+ extern VALUE rb_output_fs;
1461
+
1462
+ static VALUE
1463
+ recursive_join(VALUE ary, VALUE argp, int recur)
1464
+ {
1465
+ VALUE *arg = (VALUE *)argp;
1466
+ if (recur) {
1467
+ return rb_usascii_str_new2("[...]");
1468
+ }
1469
+ return rb_ary_join(arg[0], arg[1]);
1470
+ }
1471
+
1472
+ VALUE
1473
+ rb_ary_join(VALUE ary, VALUE sep)
1474
+ {
1475
+ long len = 1, i;
1476
+ int taint = Qfalse;
1477
+ int untrust = Qfalse;
1478
+ VALUE result, tmp;
1479
+
1480
+ if (RARRAY_LEN(ary) == 0) return rb_str_new(0, 0);
1481
+ if (OBJ_TAINTED(ary) || OBJ_TAINTED(sep)) taint = Qtrue;
1482
+ if (OBJ_UNTRUSTED(ary) || OBJ_UNTRUSTED(sep)) untrust = Qtrue;
1483
+
1484
+ for (i=0; i<RARRAY_LEN(ary); i++) {
1485
+ tmp = rb_check_string_type(RARRAY_PTR(ary)[i]);
1486
+ len += NIL_P(tmp) ? 10 : RSTRING_LEN(tmp);
1487
+ }
1488
+ if (!NIL_P(sep)) {
1489
+ StringValue(sep);
1490
+ len += RSTRING_LEN(sep) * (RARRAY_LEN(ary) - 1);
1491
+ }
1492
+ result = rb_str_buf_new(len);
1493
+ for (i=0; i<RARRAY_LEN(ary); i++) {
1494
+ tmp = RARRAY_PTR(ary)[i];
1495
+ switch (TYPE(tmp)) {
1496
+ case T_STRING:
1497
+ break;
1498
+ case T_ARRAY:
1499
+ if (tmp == ary) {
1500
+ tmp = rb_usascii_str_new2("[...]");
1501
+ }
1502
+ else {
1503
+ VALUE args[2];
1504
+
1505
+ args[0] = tmp;
1506
+ args[1] = sep;
1507
+ tmp = rb_exec_recursive(recursive_join, ary, (VALUE)args);
1508
+ }
1509
+ break;
1510
+ default:
1511
+ tmp = rb_obj_as_string(tmp);
1512
+ }
1513
+ if (i > 0 && !NIL_P(sep))
1514
+ rb_str_buf_append(result, sep);
1515
+ rb_str_buf_append(result, tmp);
1516
+ if (OBJ_TAINTED(tmp)) taint = Qtrue;
1517
+ if (OBJ_UNTRUSTED(tmp)) untrust = Qtrue;
1518
+ }
1519
+
1520
+ if (taint) OBJ_TAINT(result);
1521
+ if (untrust) OBJ_UNTRUST(result);
1522
+ return result;
1523
+ }
1524
+
1525
+ /*
1526
+ * call-seq:
1527
+ * array.join(sep=$,) -> str
1528
+ *
1529
+ * Returns a string created by converting each element of the array to
1530
+ * a string, separated by <i>sep</i>.
1531
+ *
1532
+ * [ "a", "b", "c" ].join #=> "abc"
1533
+ * [ "a", "b", "c" ].join("-") #=> "a-b-c"
1534
+ */
1535
+
1536
+ static VALUE
1537
+ rb_ary_join_m(int argc, VALUE *argv, VALUE ary)
1538
+ {
1539
+ VALUE sep;
1540
+
1541
+ rb_scan_args(argc, argv, "01", &sep);
1542
+ if (NIL_P(sep)) sep = rb_output_fs;
1543
+
1544
+ return rb_ary_join(ary, sep);
1545
+ }
1546
+
1547
+ static VALUE
1548
+ inspect_ary(VALUE ary, VALUE dummy, int recur)
1549
+ {
1550
+ int tainted = OBJ_TAINTED(ary);
1551
+ int untrust = OBJ_UNTRUSTED(ary);
1552
+ long i;
1553
+ VALUE s, str;
1554
+
1555
+ if (recur) return rb_tainted_str_new2("[...]");
1556
+ str = rb_str_buf_new2("[");
1557
+ for (i=0; i<RARRAY_LEN(ary); i++) {
1558
+ s = rb_inspect(RARRAY_PTR(ary)[i]);
1559
+ if (OBJ_TAINTED(s)) tainted = Qtrue;
1560
+ if (OBJ_UNTRUSTED(s)) untrust = Qtrue;
1561
+ if (i > 0) rb_str_buf_cat2(str, ", ");
1562
+ rb_str_buf_append(str, s);
1563
+ }
1564
+ rb_str_buf_cat2(str, "]");
1565
+ if (tainted) OBJ_TAINT(str);
1566
+ if (untrust) OBJ_UNTRUST(str);
1567
+ return str;
1568
+ }
1569
+
1570
+ /*
1571
+ * call-seq:
1572
+ * array.to_s -> string
1573
+ * array.inspect -> string
1574
+ *
1575
+ * Create a printable version of <i>array</i>.
1576
+ */
1577
+
1578
+ static VALUE
1579
+ rb_ary_inspect(VALUE ary)
1580
+ {
1581
+ if (RARRAY_LEN(ary) == 0) return rb_usascii_str_new2("[]");
1582
+ return rb_exec_recursive(inspect_ary, ary, 0);
1583
+ }
1584
+
1585
+ VALUE
1586
+ rb_ary_to_s(VALUE ary)
1587
+ {
1588
+ return rb_ary_inspect(ary);
1589
+ }
1590
+
1591
+ /*
1592
+ * call-seq:
1593
+ * array.to_a -> array
1594
+ *
1595
+ * Returns _self_. If called on a subclass of Array, converts
1596
+ * the receiver to an Array object.
1597
+ */
1598
+
1599
+ static VALUE
1600
+ rb_ary_to_a(VALUE ary)
1601
+ {
1602
+ if (rb_obj_class(ary) != rb_cArray) {
1603
+ VALUE dup = rb_ary_new2(RARRAY_LEN(ary));
1604
+ rb_ary_replace(dup, ary);
1605
+ return dup;
1606
+ }
1607
+ return ary;
1608
+ }
1609
+
1610
+ /*
1611
+ * call-seq:
1612
+ * array.to_ary -> array
1613
+ *
1614
+ * Returns _self_.
1615
+ */
1616
+
1617
+ static VALUE
1618
+ rb_ary_to_ary_m(VALUE ary)
1619
+ {
1620
+ return ary;
1621
+ }
1622
+
1623
+ VALUE
1624
+ rb_ary_reverse(VALUE ary)
1625
+ {
1626
+ VALUE *p1, *p2;
1627
+ VALUE tmp;
1628
+
1629
+ rb_ary_modify(ary);
1630
+ if (RARRAY_LEN(ary) > 1) {
1631
+ p1 = RARRAY_PTR(ary);
1632
+ p2 = p1 + RARRAY_LEN(ary) - 1; /* points last item */
1633
+
1634
+ while (p1 < p2) {
1635
+ tmp = *p1;
1636
+ *p1++ = *p2;
1637
+ *p2-- = tmp;
1638
+ }
1639
+ }
1640
+ return ary;
1641
+ }
1642
+
1643
+ /*
1644
+ * call-seq:
1645
+ * array.reverse! -> array
1646
+ *
1647
+ * Reverses _self_ in place.
1648
+ *
1649
+ * a = [ "a", "b", "c" ]
1650
+ * a.reverse! #=> ["c", "b", "a"]
1651
+ * a #=> ["c", "b", "a"]
1652
+ */
1653
+
1654
+ static VALUE
1655
+ rb_ary_reverse_bang(VALUE ary)
1656
+ {
1657
+ return rb_ary_reverse(ary);
1658
+ }
1659
+
1660
+ /*
1661
+ * call-seq:
1662
+ * array.reverse -> an_array
1663
+ *
1664
+ * Returns a new array containing <i>self</i>'s elements in reverse order.
1665
+ *
1666
+ * [ "a", "b", "c" ].reverse #=> ["c", "b", "a"]
1667
+ * [ 1 ].reverse #=> [1]
1668
+ */
1669
+
1670
+ static VALUE
1671
+ rb_ary_reverse_m(VALUE ary)
1672
+ {
1673
+ return rb_ary_reverse(rb_ary_dup(ary));
1674
+ }
1675
+
1676
+ struct ary_sort_data {
1677
+ VALUE ary;
1678
+ int opt_methods;
1679
+ int opt_inited;
1680
+ };
1681
+
1682
+ enum {
1683
+ sort_opt_Fixnum,
1684
+ sort_opt_String,
1685
+ sort_optimizable_count
1686
+ };
1687
+
1688
+ #define STRING_P(s) (TYPE(s) == T_STRING && CLASS_OF(s) == rb_cString)
1689
+
1690
+ #define SORT_OPTIMIZABLE_BIT(type) (1U << TOKEN_PASTE(sort_opt_,type))
1691
+ #define SORT_OPTIMIZABLE(data, type) \
1692
+ ((data->opt_inited & SORT_OPTIMIZABLE_BIT(type)) ? \
1693
+ (data->opt_methods & SORT_OPTIMIZABLE_BIT(type)) : \
1694
+ ((data->opt_inited |= SORT_OPTIMIZABLE_BIT(type)), \
1695
+ rb_method_basic_definition_p(TOKEN_PASTE(rb_c,type), id_cmp) && \
1696
+ (data->opt_methods |= SORT_OPTIMIZABLE_BIT(type))))
1697
+
1698
+ static VALUE
1699
+ sort_reentered(VALUE ary)
1700
+ {
1701
+ if (RBASIC(ary)->klass) {
1702
+ rb_raise(rb_eRuntimeError, "sort reentered");
1703
+ }
1704
+ return Qnil;
1705
+ }
1706
+
1707
+ static int
1708
+ sort_1(const void *ap, const void *bp, void *dummy)
1709
+ {
1710
+ struct ary_sort_data *data = dummy;
1711
+ VALUE retval = sort_reentered(data->ary);
1712
+ VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
1713
+ int n;
1714
+
1715
+ retval = rb_yield_values(2, a, b);
1716
+ n = rb_cmpint(retval, a, b);
1717
+ sort_reentered(data->ary);
1718
+ return n;
1719
+ }
1720
+
1721
+ static int
1722
+ sort_2(const void *ap, const void *bp, void *dummy)
1723
+ {
1724
+ struct ary_sort_data *data = dummy;
1725
+ VALUE retval = sort_reentered(data->ary);
1726
+ VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
1727
+ int n;
1728
+
1729
+ if (FIXNUM_P(a) && FIXNUM_P(b) && SORT_OPTIMIZABLE(data, Fixnum)) {
1730
+ if ((long)a > (long)b) return 1;
1731
+ if ((long)a < (long)b) return -1;
1732
+ return 0;
1733
+ }
1734
+ if (STRING_P(a) && STRING_P(b) && SORT_OPTIMIZABLE(data, String)) {
1735
+ return rb_str_cmp(a, b);
1736
+ }
1737
+
1738
+ retval = rb_funcall(a, id_cmp, 1, b);
1739
+ n = rb_cmpint(retval, a, b);
1740
+ sort_reentered(data->ary);
1741
+
1742
+ return n;
1743
+ }
1744
+
1745
+ /*
1746
+ * call-seq:
1747
+ * array.sort! -> array
1748
+ * array.sort! {| a,b | block } -> array
1749
+ *
1750
+ * Sorts _self_. Comparisons for
1751
+ * the sort will be done using the <code><=></code> operator or using
1752
+ * an optional code block. The block implements a comparison between
1753
+ * <i>a</i> and <i>b</i>, returning -1, 0, or +1. See also
1754
+ * <code>Enumerable#sort_by</code>.
1755
+ *
1756
+ * a = [ "d", "a", "e", "c", "b" ]
1757
+ * a.sort #=> ["a", "b", "c", "d", "e"]
1758
+ * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
1759
+ */
1760
+
1761
+ VALUE
1762
+ rb_ary_sort_bang(VALUE ary)
1763
+ {
1764
+ rb_ary_modify(ary);
1765
+ assert(!ARY_SHARED_P(ary));
1766
+ if (RARRAY_LEN(ary) > 1) {
1767
+ VALUE tmp = ary_make_substitution(ary); /* only ary refers tmp */
1768
+ struct ary_sort_data data;
1769
+
1770
+ RBASIC(tmp)->klass = 0;
1771
+ data.ary = tmp;
1772
+ data.opt_methods = 0;
1773
+ data.opt_inited = 0;
1774
+ ruby_qsort(RARRAY_PTR(tmp), RARRAY_LEN(tmp), sizeof(VALUE),
1775
+ rb_block_given_p()?sort_1:sort_2, &data);
1776
+
1777
+ if (ARY_EMBED_P(tmp)) {
1778
+ assert(ARY_EMBED_P(tmp));
1779
+ if (ARY_SHARED_P(ary)) { /* ary might be destructively operated in the given block */
1780
+ rb_ary_unshare(ary);
1781
+ }
1782
+ FL_SET_EMBED(ary);
1783
+ MEMCPY(RARRAY_PTR(ary), ARY_EMBED_PTR(tmp), VALUE, ARY_EMBED_LEN(tmp));
1784
+ ARY_SET_LEN(ary, ARY_EMBED_LEN(tmp));
1785
+ }
1786
+ else {
1787
+ assert(!ARY_EMBED_P(tmp));
1788
+ if (ARY_HEAP_PTR(ary) == ARY_HEAP_PTR(tmp)) {
1789
+ assert(!ARY_EMBED_P(ary));
1790
+ FL_UNSET_SHARED(ary);
1791
+ ARY_SET_CAPA(ary, ARY_CAPA(tmp));
1792
+ }
1793
+ else {
1794
+ assert(!ARY_SHARED_P(tmp));
1795
+ if (ARY_EMBED_P(ary)) {
1796
+ FL_UNSET_EMBED(ary);
1797
+ }
1798
+ else if (ARY_SHARED_P(ary)) {
1799
+ /* ary might be destructively operated in the given block */
1800
+ rb_ary_unshare(ary);
1801
+ }
1802
+ else {
1803
+ xfree(ARY_HEAP_PTR(ary));
1804
+ }
1805
+ ARY_SET_PTR(ary, RARRAY_PTR(tmp));
1806
+ ARY_SET_HEAP_LEN(ary, RARRAY_LEN(tmp));
1807
+ ARY_SET_CAPA(ary, ARY_CAPA(tmp));
1808
+ }
1809
+ /* tmp was lost ownership for the ptr */
1810
+ FL_UNSET(tmp, FL_FREEZE);
1811
+ FL_SET_EMBED(tmp);
1812
+ ARY_SET_EMBED_LEN(tmp, 0);
1813
+ FL_SET(tmp, FL_FREEZE);
1814
+ }
1815
+ /* tmp will be GC'ed. */
1816
+ RBASIC(tmp)->klass = rb_cArray;
1817
+ }
1818
+ return ary;
1819
+ }
1820
+
1821
+ /*
1822
+ * call-seq:
1823
+ * array.sort -> an_array
1824
+ * array.sort {| a,b | block } -> an_array
1825
+ *
1826
+ * Returns a new array created by sorting <i>self</i>. Comparisons for
1827
+ * the sort will be done using the <code><=></code> operator or using
1828
+ * an optional code block. The block implements a comparison between
1829
+ * <i>a</i> and <i>b</i>, returning -1, 0, or +1. See also
1830
+ * <code>Enumerable#sort_by</code>.
1831
+ *
1832
+ * a = [ "d", "a", "e", "c", "b" ]
1833
+ * a.sort #=> ["a", "b", "c", "d", "e"]
1834
+ * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
1835
+ */
1836
+
1837
+ VALUE
1838
+ rb_ary_sort(VALUE ary)
1839
+ {
1840
+ ary = rb_ary_dup(ary);
1841
+ rb_ary_sort_bang(ary);
1842
+ return ary;
1843
+ }
1844
+
1845
+
1846
+ /*
1847
+ * call-seq:
1848
+ * array.collect {|item| block } -> an_array
1849
+ * array.map {|item| block } -> an_array
1850
+ *
1851
+ * Invokes <i>block</i> once for each element of <i>self</i>. Creates a
1852
+ * new array containing the values returned by the block.
1853
+ * See also <code>Enumerable#collect</code>.
1854
+ *
1855
+ * a = [ "a", "b", "c", "d" ]
1856
+ * a.collect {|x| x + "!" } #=> ["a!", "b!", "c!", "d!"]
1857
+ * a #=> ["a", "b", "c", "d"]
1858
+ */
1859
+
1860
+ static VALUE
1861
+ rb_ary_collect(VALUE ary)
1862
+ {
1863
+ long i;
1864
+ VALUE collect;
1865
+
1866
+ RETURN_ENUMERATOR(ary, 0, 0);
1867
+ collect = rb_ary_new2(RARRAY_LEN(ary));
1868
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
1869
+ rb_ary_push(collect, rb_yield(RARRAY_PTR(ary)[i]));
1870
+ }
1871
+ return collect;
1872
+ }
1873
+
1874
+
1875
+ /*
1876
+ * call-seq:
1877
+ * array.collect! {|item| block } -> array
1878
+ * array.map! {|item| block } -> array
1879
+ *
1880
+ * Invokes the block once for each element of _self_, replacing the
1881
+ * element with the value returned by _block_.
1882
+ * See also <code>Enumerable#collect</code>.
1883
+ *
1884
+ * a = [ "a", "b", "c", "d" ]
1885
+ * a.collect! {|x| x + "!" }
1886
+ * a #=> [ "a!", "b!", "c!", "d!" ]
1887
+ */
1888
+
1889
+ static VALUE
1890
+ rb_ary_collect_bang(VALUE ary)
1891
+ {
1892
+ long i;
1893
+
1894
+ RETURN_ENUMERATOR(ary, 0, 0);
1895
+ rb_ary_modify(ary);
1896
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
1897
+ rb_ary_store(ary, i, rb_yield(RARRAY_PTR(ary)[i]));
1898
+ }
1899
+ return ary;
1900
+ }
1901
+
1902
+ VALUE
1903
+ rb_get_values_at(VALUE obj, long olen, int argc, VALUE *argv, VALUE (*func) (VALUE, long))
1904
+ {
1905
+ VALUE result = rb_ary_new2(argc);
1906
+ long beg, len, i, j;
1907
+
1908
+ for (i=0; i<argc; i++) {
1909
+ if (FIXNUM_P(argv[i])) {
1910
+ rb_ary_push(result, (*func)(obj, FIX2LONG(argv[i])));
1911
+ continue;
1912
+ }
1913
+ /* check if idx is Range */
1914
+ switch (rb_range_beg_len(argv[i], &beg, &len, olen, 0)) {
1915
+ case Qfalse:
1916
+ break;
1917
+ case Qnil:
1918
+ continue;
1919
+ default:
1920
+ for (j=0; j<len; j++) {
1921
+ rb_ary_push(result, (*func)(obj, j+beg));
1922
+ }
1923
+ continue;
1924
+ }
1925
+ rb_ary_push(result, (*func)(obj, NUM2LONG(argv[i])));
1926
+ }
1927
+ return result;
1928
+ }
1929
+
1930
+ /*
1931
+ * call-seq:
1932
+ * array.values_at(selector,... ) -> an_array
1933
+ *
1934
+ * Returns an array containing the elements in
1935
+ * _self_ corresponding to the given selector(s). The selectors
1936
+ * may be either integer indices or ranges.
1937
+ * See also <code>Array#select</code>.
1938
+ *
1939
+ * a = %w{ a b c d e f }
1940
+ * a.values_at(1, 3, 5)
1941
+ * a.values_at(1, 3, 5, 7)
1942
+ * a.values_at(-1, -3, -5, -7)
1943
+ * a.values_at(1..3, 2...5)
1944
+ */
1945
+
1946
+ static VALUE
1947
+ rb_ary_values_at(int argc, VALUE *argv, VALUE ary)
1948
+ {
1949
+ return rb_get_values_at(ary, RARRAY_LEN(ary), argc, argv, rb_ary_entry);
1950
+ }
1951
+
1952
+
1953
+ /*
1954
+ * call-seq:
1955
+ * array.select {|item| block } -> an_array
1956
+ *
1957
+ * Invokes the block passing in successive elements from <i>array</i>,
1958
+ * returning an array containing those elements for which the block
1959
+ * returns a true value (equivalent to <code>Enumerable#select</code>).
1960
+ *
1961
+ * a = %w{ a b c d e f }
1962
+ * a.select {|v| v =~ /[aeiou]/} #=> ["a", "e"]
1963
+ */
1964
+
1965
+ static VALUE
1966
+ rb_ary_select(VALUE ary)
1967
+ {
1968
+ VALUE result;
1969
+ long i;
1970
+
1971
+ RETURN_ENUMERATOR(ary, 0, 0);
1972
+ result = rb_ary_new2(RARRAY_LEN(ary));
1973
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
1974
+ if (RTEST(rb_yield(RARRAY_PTR(ary)[i]))) {
1975
+ rb_ary_push(result, rb_ary_elt(ary, i));
1976
+ }
1977
+ }
1978
+ return result;
1979
+ }
1980
+
1981
+ /*
1982
+ * call-seq:
1983
+ * array.delete(obj) -> obj or nil
1984
+ * array.delete(obj) { block } -> obj or nil
1985
+ *
1986
+ * Deletes items from <i>self</i> that are equal to <i>obj</i>. If
1987
+ * the item is not found, returns <code>nil</code>. If the optional
1988
+ * code block is given, returns the result of <i>block</i> if the item
1989
+ * is not found.
1990
+ *
1991
+ * a = [ "a", "b", "b", "b", "c" ]
1992
+ * a.delete("b") #=> "b"
1993
+ * a #=> ["a", "c"]
1994
+ * a.delete("z") #=> nil
1995
+ * a.delete("z") { "not found" } #=> "not found"
1996
+ */
1997
+
1998
+ VALUE
1999
+ rb_ary_delete(VALUE ary, VALUE item)
2000
+ {
2001
+ VALUE v = item;
2002
+ long i1, i2;
2003
+
2004
+ for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
2005
+ VALUE e = RARRAY_PTR(ary)[i1];
2006
+
2007
+ if (rb_equal(e, item)) {
2008
+ v = e;
2009
+ continue;
2010
+ }
2011
+ if (i1 != i2) {
2012
+ rb_ary_store(ary, i2, e);
2013
+ }
2014
+ i2++;
2015
+ }
2016
+ if (RARRAY_LEN(ary) == i2) {
2017
+ if (rb_block_given_p()) {
2018
+ return rb_yield(item);
2019
+ }
2020
+ return Qnil;
2021
+ }
2022
+
2023
+ rb_ary_modify(ary);
2024
+ if (RARRAY_LEN(ary) > i2) {
2025
+ ARY_SET_LEN(ary, i2);
2026
+ if (i2 * 2 < ARY_CAPA(ary) &&
2027
+ ARY_CAPA(ary) > ARY_DEFAULT_SIZE) {
2028
+ ary_resize_capa(ary, i2*2);
2029
+ }
2030
+ }
2031
+
2032
+ return v;
2033
+ }
2034
+
2035
+ VALUE
2036
+ rb_ary_delete_at(VALUE ary, long pos)
2037
+ {
2038
+ long len = RARRAY_LEN(ary);
2039
+ VALUE del;
2040
+
2041
+ if (pos >= len) return Qnil;
2042
+ if (pos < 0) {
2043
+ pos += len;
2044
+ if (pos < 0) return Qnil;
2045
+ }
2046
+
2047
+ rb_ary_modify(ary);
2048
+ del = RARRAY_PTR(ary)[pos];
2049
+ MEMMOVE(RARRAY_PTR(ary)+pos, RARRAY_PTR(ary)+pos+1, VALUE,
2050
+ RARRAY_LEN(ary)-pos-1);
2051
+ ARY_INCREASE_LEN(ary, -1);
2052
+
2053
+ return del;
2054
+ }
2055
+
2056
+ /*
2057
+ * call-seq:
2058
+ * array.delete_at(index) -> obj or nil
2059
+ *
2060
+ * Deletes the element at the specified index, returning that element,
2061
+ * or <code>nil</code> if the index is out of range. See also
2062
+ * <code>Array#slice!</code>.
2063
+ *
2064
+ * a = %w( ant bat cat dog )
2065
+ * a.delete_at(2) #=> "cat"
2066
+ * a #=> ["ant", "bat", "dog"]
2067
+ * a.delete_at(99) #=> nil
2068
+ */
2069
+
2070
+ static VALUE
2071
+ rb_ary_delete_at_m(VALUE ary, VALUE pos)
2072
+ {
2073
+ return rb_ary_delete_at(ary, NUM2LONG(pos));
2074
+ }
2075
+
2076
+ /*
2077
+ * call-seq:
2078
+ * array.slice!(index) -> obj or nil
2079
+ * array.slice!(start, length) -> sub_array or nil
2080
+ * array.slice!(range) -> sub_array or nil
2081
+ *
2082
+ * Deletes the element(s) given by an index (optionally with a length)
2083
+ * or by a range. Returns the deleted object, subarray, or
2084
+ * <code>nil</code> if the index is out of range.
2085
+ *
2086
+ * a = [ "a", "b", "c" ]
2087
+ * a.slice!(1) #=> "b"
2088
+ * a #=> ["a", "c"]
2089
+ * a.slice!(-1) #=> "c"
2090
+ * a #=> ["a"]
2091
+ * a.slice!(100) #=> nil
2092
+ * a #=> ["a"]
2093
+ */
2094
+
2095
+ static VALUE
2096
+ rb_ary_slice_bang(int argc, VALUE *argv, VALUE ary)
2097
+ {
2098
+ VALUE arg1, arg2;
2099
+ long pos, len, orig_len;
2100
+
2101
+ rb_ary_modify_check(ary);
2102
+ if (rb_scan_args(argc, argv, "11", &arg1, &arg2) == 2) {
2103
+ pos = NUM2LONG(arg1);
2104
+ len = NUM2LONG(arg2);
2105
+ delete_pos_len:
2106
+ if (len < 0) return Qnil;
2107
+ orig_len = RARRAY_LEN(ary);
2108
+ if (pos < 0) {
2109
+ pos += orig_len;
2110
+ if (pos < 0) return Qnil;
2111
+ }
2112
+ else if (orig_len < pos) return Qnil;
2113
+ if (orig_len < pos + len) {
2114
+ len = orig_len - pos;
2115
+ }
2116
+ if (len == 0) return rb_ary_new2(0);
2117
+ arg2 = rb_ary_new4(len, RARRAY_PTR(ary)+pos);
2118
+ RBASIC(arg2)->klass = rb_obj_class(ary);
2119
+ rb_ary_splice(ary, pos, len, Qundef);
2120
+ return arg2;
2121
+ }
2122
+
2123
+ if (!FIXNUM_P(arg1)) {
2124
+ switch (rb_range_beg_len(arg1, &pos, &len, RARRAY_LEN(ary), 0)) {
2125
+ case Qtrue:
2126
+ /* valid range */
2127
+ goto delete_pos_len;
2128
+ case Qnil:
2129
+ /* invalid range */
2130
+ return Qnil;
2131
+ default:
2132
+ /* not a range */
2133
+ break;
2134
+ }
2135
+ }
2136
+
2137
+ return rb_ary_delete_at(ary, NUM2LONG(arg1));
2138
+ }
2139
+
2140
+ /*
2141
+ * call-seq:
2142
+ * array.reject! {|item| block } -> array or nil
2143
+ *
2144
+ * Equivalent to <code>Array#delete_if</code>, deleting elements from
2145
+ * _self_ for which the block evaluates to true, but returns
2146
+ * <code>nil</code> if no changes were made. Also see
2147
+ * <code>Enumerable#reject</code>.
2148
+ */
2149
+
2150
+ static VALUE
2151
+ rb_ary_reject_bang(VALUE ary)
2152
+ {
2153
+ long i1, i2;
2154
+
2155
+ RETURN_ENUMERATOR(ary, 0, 0);
2156
+ rb_ary_modify(ary);
2157
+ for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
2158
+ VALUE v = RARRAY_PTR(ary)[i1];
2159
+ if (RTEST(rb_yield(v))) continue;
2160
+ if (i1 != i2) {
2161
+ rb_ary_store(ary, i2, v);
2162
+ }
2163
+ i2++;
2164
+ }
2165
+
2166
+ if (RARRAY_LEN(ary) == i2) return Qnil;
2167
+ if (i2 < RARRAY_LEN(ary))
2168
+ ARY_SET_LEN(ary, i2);
2169
+ return ary;
2170
+ }
2171
+
2172
+ /*
2173
+ * call-seq:
2174
+ * array.reject {|item| block } -> an_array
2175
+ *
2176
+ * Returns a new array containing the items in _self_
2177
+ * for which the block is not true.
2178
+ */
2179
+
2180
+ static VALUE
2181
+ rb_ary_reject(VALUE ary)
2182
+ {
2183
+ RETURN_ENUMERATOR(ary, 0, 0);
2184
+ ary = rb_ary_dup(ary);
2185
+ rb_ary_reject_bang(ary);
2186
+ return ary;
2187
+ }
2188
+
2189
+ /*
2190
+ * call-seq:
2191
+ * array.delete_if {|item| block } -> array
2192
+ *
2193
+ * Deletes every element of <i>self</i> for which <i>block</i> evaluates
2194
+ * to <code>true</code>.
2195
+ *
2196
+ * a = [ "a", "b", "c" ]
2197
+ * a.delete_if {|x| x >= "b" } #=> ["a"]
2198
+ */
2199
+
2200
+ static VALUE
2201
+ rb_ary_delete_if(VALUE ary)
2202
+ {
2203
+ RETURN_ENUMERATOR(ary, 0, 0);
2204
+ rb_ary_reject_bang(ary);
2205
+ return ary;
2206
+ }
2207
+
2208
+ static VALUE
2209
+ take_i(VALUE val, VALUE *args, int argc, VALUE *argv)
2210
+ {
2211
+ if (args[1]-- == 0) rb_iter_break();
2212
+ if (argc > 1) val = rb_ary_new4(argc, argv);
2213
+ rb_ary_push(args[0], val);
2214
+ return Qnil;
2215
+ }
2216
+
2217
+ static VALUE
2218
+ take_items(VALUE obj, long n)
2219
+ {
2220
+ VALUE result = rb_check_array_type(obj);
2221
+ VALUE args[2];
2222
+
2223
+ if (!NIL_P(result)) return rb_ary_subseq(result, 0, n);
2224
+ result = rb_ary_new2(n);
2225
+ args[0] = result; args[1] = (VALUE)n;
2226
+ rb_block_call(obj, rb_intern("each"), 0, 0, take_i, (VALUE)args);
2227
+ return result;
2228
+ }
2229
+
2230
+
2231
+ /*
2232
+ * call-seq:
2233
+ * array.zip(arg, ...) -> an_array
2234
+ * array.zip(arg, ...) {| arr | block } -> nil
2235
+ *
2236
+ * Converts any arguments to arrays, then merges elements of
2237
+ * <i>self</i> with corresponding elements from each argument. This
2238
+ * generates a sequence of <code>self.size</code> <em>n</em>-element
2239
+ * arrays, where <em>n</em> is one more that the count of arguments. If
2240
+ * the size of any argument is less than <code>enumObj.size</code>,
2241
+ * <code>nil</code> values are supplied. If a block given, it is
2242
+ * invoked for each output array, otherwise an array of arrays is
2243
+ * returned.
2244
+ *
2245
+ * a = [ 4, 5, 6 ]
2246
+ * b = [ 7, 8, 9 ]
2247
+ * [1,2,3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
2248
+ * [1,2].zip(a,b) #=> [[1, 4, 7], [2, 5, 8]]
2249
+ * a.zip([1,2],[8]) #=> [[4,1,8], [5,2,nil], [6,nil,nil]]
2250
+ */
2251
+
2252
+ static VALUE
2253
+ rb_ary_zip(int argc, VALUE *argv, VALUE ary)
2254
+ {
2255
+ int i, j;
2256
+ long len;
2257
+ VALUE result = Qnil;
2258
+
2259
+ len = RARRAY_LEN(ary);
2260
+ for (i=0; i<argc; i++) {
2261
+ argv[i] = take_items(argv[i], len);
2262
+ }
2263
+ if (!rb_block_given_p()) {
2264
+ result = rb_ary_new2(len);
2265
+ }
2266
+
2267
+ for (i=0; i<RARRAY_LEN(ary); i++) {
2268
+ VALUE tmp = rb_ary_new2(argc+1);
2269
+
2270
+ rb_ary_push(tmp, rb_ary_elt(ary, i));
2271
+ for (j=0; j<argc; j++) {
2272
+ rb_ary_push(tmp, rb_ary_elt(argv[j], i));
2273
+ }
2274
+ if (NIL_P(result)) {
2275
+ rb_yield(tmp);
2276
+ }
2277
+ else {
2278
+ rb_ary_push(result, tmp);
2279
+ }
2280
+ }
2281
+ return result;
2282
+ }
2283
+
2284
+ /*
2285
+ * call-seq:
2286
+ * array.transpose -> an_array
2287
+ *
2288
+ * Assumes that <i>self</i> is an array of arrays and transposes the
2289
+ * rows and columns.
2290
+ *
2291
+ * a = [[1,2], [3,4], [5,6]]
2292
+ * a.transpose #=> [[1, 3, 5], [2, 4, 6]]
2293
+ */
2294
+
2295
+ static VALUE
2296
+ rb_ary_transpose(VALUE ary)
2297
+ {
2298
+ long elen = -1, alen, i, j;
2299
+ VALUE tmp, result = 0;
2300
+
2301
+ alen = RARRAY_LEN(ary);
2302
+ if (alen == 0) return rb_ary_dup(ary);
2303
+ for (i=0; i<alen; i++) {
2304
+ tmp = to_ary(rb_ary_elt(ary, i));
2305
+ if (elen < 0) { /* first element */
2306
+ elen = RARRAY_LEN(tmp);
2307
+ result = rb_ary_new2(elen);
2308
+ for (j=0; j<elen; j++) {
2309
+ rb_ary_store(result, j, rb_ary_new2(alen));
2310
+ }
2311
+ }
2312
+ else if (elen != RARRAY_LEN(tmp)) {
2313
+ rb_raise(rb_eIndexError, "element size differs (%ld should be %ld)",
2314
+ RARRAY_LEN(tmp), elen);
2315
+ }
2316
+ for (j=0; j<elen; j++) {
2317
+ rb_ary_store(rb_ary_elt(result, j), i, rb_ary_elt(tmp, j));
2318
+ }
2319
+ }
2320
+ return result;
2321
+ }
2322
+
2323
+ /*
2324
+ * call-seq:
2325
+ * array.replace(other_array) -> array
2326
+ *
2327
+ * Replaces the contents of <i>self</i> with the contents of
2328
+ * <i>other_array</i>, truncating or expanding if necessary.
2329
+ *
2330
+ * a = [ "a", "b", "c", "d", "e" ]
2331
+ * a.replace([ "x", "y", "z" ]) #=> ["x", "y", "z"]
2332
+ * a #=> ["x", "y", "z"]
2333
+ */
2334
+
2335
+ VALUE
2336
+ rb_ary_replace(VALUE copy, VALUE orig)
2337
+ {
2338
+ orig = to_ary(orig);
2339
+ rb_ary_modify_check(copy);
2340
+ if (copy == orig) return copy;
2341
+
2342
+ if (RARRAY_LEN(orig) <= RARRAY_EMBED_LEN_MAX) {
2343
+ VALUE *ptr;
2344
+ VALUE shared = 0;
2345
+
2346
+ if (ARY_OWNS_HEAP_P(copy)) {
2347
+ xfree(RARRAY_PTR(copy));
2348
+ }
2349
+ else if (ARY_SHARED_P(copy)) {
2350
+ shared = ARY_SHARED(copy);
2351
+ FL_UNSET_SHARED(copy);
2352
+ }
2353
+ FL_SET_EMBED(copy);
2354
+ ptr = RARRAY_PTR(orig);
2355
+ MEMCPY(RARRAY_PTR(copy), ptr, VALUE, RARRAY_LEN(orig));
2356
+ if (shared) {
2357
+ rb_ary_decrement_share(shared);
2358
+ }
2359
+ ARY_SET_LEN(copy, RARRAY_LEN(orig));
2360
+ }
2361
+ else {
2362
+ VALUE shared = ary_make_shared(orig);
2363
+ if (ARY_OWNS_HEAP_P(copy)) {
2364
+ xfree(RARRAY_PTR(copy));
2365
+ } else {
2366
+ rb_ary_unshare_safe(copy);
2367
+ }
2368
+ FL_UNSET_EMBED(copy);
2369
+ ARY_SET_PTR(copy, RARRAY_PTR(orig));
2370
+ ARY_SET_LEN(copy, RARRAY_LEN(orig));
2371
+ rb_ary_set_shared(copy, shared);
2372
+ }
2373
+ return copy;
2374
+ }
2375
+
2376
+ /*
2377
+ * call-seq:
2378
+ * array.clear -> array
2379
+ *
2380
+ * Removes all elements from _self_.
2381
+ *
2382
+ * a = [ "a", "b", "c", "d", "e" ]
2383
+ * a.clear #=> [ ]
2384
+ */
2385
+
2386
+ VALUE
2387
+ rb_ary_clear(VALUE ary)
2388
+ {
2389
+ rb_ary_modify(ary);
2390
+ ARY_SET_LEN(ary, 0);
2391
+ if (ARY_DEFAULT_SIZE * 2 < ARY_CAPA(ary)) {
2392
+ ary_resize_capa(ary, ARY_DEFAULT_SIZE * 2);
2393
+ }
2394
+ return ary;
2395
+ }
2396
+
2397
+ /*
2398
+ * call-seq:
2399
+ * array.fill(obj) -> array
2400
+ * array.fill(obj, start [, length]) -> array
2401
+ * array.fill(obj, range ) -> array
2402
+ * array.fill {|index| block } -> array
2403
+ * array.fill(start [, length] ) {|index| block } -> array
2404
+ * array.fill(range) {|index| block } -> array
2405
+ *
2406
+ * The first three forms set the selected elements of <i>self</i> (which
2407
+ * may be the entire array) to <i>obj</i>. A <i>start</i> of
2408
+ * <code>nil</code> is equivalent to zero. A <i>length</i> of
2409
+ * <code>nil</code> is equivalent to <i>self.length</i>. The last three
2410
+ * forms fill the array with the value of the block. The block is
2411
+ * passed the absolute index of each element to be filled.
2412
+ *
2413
+ * a = [ "a", "b", "c", "d" ]
2414
+ * a.fill("x") #=> ["x", "x", "x", "x"]
2415
+ * a.fill("z", 2, 2) #=> ["x", "x", "z", "z"]
2416
+ * a.fill("y", 0..1) #=> ["y", "y", "z", "z"]
2417
+ * a.fill {|i| i*i} #=> [0, 1, 4, 9]
2418
+ * a.fill(-2) {|i| i*i*i} #=> [0, 1, 8, 27]
2419
+ */
2420
+
2421
+ static VALUE
2422
+ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
2423
+ {
2424
+ VALUE item, arg1, arg2;
2425
+ long beg = 0, end = 0, len = 0;
2426
+ VALUE *p, *pend;
2427
+ int block_p = Qfalse;
2428
+
2429
+ if (rb_block_given_p()) {
2430
+ block_p = Qtrue;
2431
+ rb_scan_args(argc, argv, "02", &arg1, &arg2);
2432
+ argc += 1; /* hackish */
2433
+ }
2434
+ else {
2435
+ rb_scan_args(argc, argv, "12", &item, &arg1, &arg2);
2436
+ }
2437
+ switch (argc) {
2438
+ case 1:
2439
+ beg = 0;
2440
+ len = RARRAY_LEN(ary);
2441
+ break;
2442
+ case 2:
2443
+ if (rb_range_beg_len(arg1, &beg, &len, RARRAY_LEN(ary), 1)) {
2444
+ break;
2445
+ }
2446
+ /* fall through */
2447
+ case 3:
2448
+ beg = NIL_P(arg1) ? 0 : NUM2LONG(arg1);
2449
+ if (beg < 0) {
2450
+ beg = RARRAY_LEN(ary) + beg;
2451
+ if (beg < 0) beg = 0;
2452
+ }
2453
+ len = NIL_P(arg2) ? RARRAY_LEN(ary) - beg : NUM2LONG(arg2);
2454
+ break;
2455
+ }
2456
+ rb_ary_modify(ary);
2457
+ if (len < 0) {
2458
+ return ary;
2459
+ }
2460
+ if (beg >= ARY_MAX_SIZE || len > ARY_MAX_SIZE - beg) {
2461
+ rb_raise(rb_eArgError, "argument too big");
2462
+ }
2463
+ end = beg + len;
2464
+ if (RARRAY_LEN(ary) < end) {
2465
+ if (end >= ARY_CAPA(ary)) {
2466
+ ary_resize_capa(ary, end);
2467
+ }
2468
+ rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary), end - RARRAY_LEN(ary));
2469
+ ARY_SET_LEN(ary, end);
2470
+ }
2471
+
2472
+ if (block_p) {
2473
+ VALUE v;
2474
+ long i;
2475
+
2476
+ for (i=beg; i<end; i++) {
2477
+ v = rb_yield(LONG2NUM(i));
2478
+ if (i>=RARRAY_LEN(ary)) break;
2479
+ RARRAY_PTR(ary)[i] = v;
2480
+ }
2481
+ }
2482
+ else {
2483
+ p = RARRAY_PTR(ary) + beg;
2484
+ pend = p + len;
2485
+ while (p < pend) {
2486
+ *p++ = item;
2487
+ }
2488
+ }
2489
+ return ary;
2490
+ }
2491
+
2492
+ /*
2493
+ * call-seq:
2494
+ * array + other_array -> an_array
2495
+ *
2496
+ * Concatenation---Returns a new array built by concatenating the
2497
+ * two arrays together to produce a third array.
2498
+ *
2499
+ * [ 1, 2, 3 ] + [ 4, 5 ] #=> [ 1, 2, 3, 4, 5 ]
2500
+ */
2501
+
2502
+ VALUE
2503
+ rb_ary_plus(VALUE x, VALUE y)
2504
+ {
2505
+ VALUE z;
2506
+ long len;
2507
+
2508
+ y = to_ary(y);
2509
+ len = RARRAY_LEN(x) + RARRAY_LEN(y);
2510
+ z = rb_ary_new2(len);
2511
+ MEMCPY(RARRAY_PTR(z), RARRAY_PTR(x), VALUE, RARRAY_LEN(x));
2512
+ MEMCPY(RARRAY_PTR(z) + RARRAY_LEN(x), RARRAY_PTR(y), VALUE, RARRAY_LEN(y));
2513
+ ARY_SET_LEN(z, len);
2514
+ return z;
2515
+ }
2516
+
2517
+ /*
2518
+ * call-seq:
2519
+ * array.concat(other_array) -> array
2520
+ *
2521
+ * Appends the elements in other_array to _self_.
2522
+ *
2523
+ * [ "a", "b" ].concat( ["c", "d"] ) #=> [ "a", "b", "c", "d" ]
2524
+ */
2525
+
2526
+
2527
+ VALUE
2528
+ rb_ary_concat(VALUE x, VALUE y)
2529
+ {
2530
+ y = to_ary(y);
2531
+ if (RARRAY_LEN(y) > 0) {
2532
+ rb_ary_splice(x, RARRAY_LEN(x), 0, y);
2533
+ }
2534
+ return x;
2535
+ }
2536
+
2537
+
2538
+ /*
2539
+ * call-seq:
2540
+ * array * int -> an_array
2541
+ * array * str -> a_string
2542
+ *
2543
+ * Repetition---With a String argument, equivalent to
2544
+ * self.join(str). Otherwise, returns a new array
2545
+ * built by concatenating the _int_ copies of _self_.
2546
+ *
2547
+ *
2548
+ * [ 1, 2, 3 ] * 3 #=> [ 1, 2, 3, 1, 2, 3, 1, 2, 3 ]
2549
+ * [ 1, 2, 3 ] * "," #=> "1,2,3"
2550
+ *
2551
+ */
2552
+
2553
+ static VALUE
2554
+ rb_ary_times(VALUE ary, VALUE times)
2555
+ {
2556
+ VALUE ary2, tmp;
2557
+ long i, len;
2558
+
2559
+ tmp = rb_check_string_type(times);
2560
+ if (!NIL_P(tmp)) {
2561
+ return rb_ary_join(ary, tmp);
2562
+ }
2563
+
2564
+ len = NUM2LONG(times);
2565
+ if (len == 0) {
2566
+ ary2 = ary_new(rb_obj_class(ary), 0);
2567
+ goto out;
2568
+ }
2569
+ if (len < 0) {
2570
+ rb_raise(rb_eArgError, "negative argument");
2571
+ }
2572
+ if (ARY_MAX_SIZE/len < RARRAY_LEN(ary)) {
2573
+ rb_raise(rb_eArgError, "argument too big");
2574
+ }
2575
+ len *= RARRAY_LEN(ary);
2576
+
2577
+ ary2 = ary_new(rb_obj_class(ary), len);
2578
+ ARY_SET_LEN(ary2, len);
2579
+
2580
+ for (i=0; i<len; i+=RARRAY_LEN(ary)) {
2581
+ MEMCPY(RARRAY_PTR(ary2)+i, RARRAY_PTR(ary), VALUE, RARRAY_LEN(ary));
2582
+ }
2583
+ out:
2584
+ OBJ_INFECT(ary2, ary);
2585
+
2586
+ return ary2;
2587
+ }
2588
+
2589
+ /*
2590
+ * call-seq:
2591
+ * array.assoc(obj) -> an_array or nil
2592
+ *
2593
+ * Searches through an array whose elements are also arrays
2594
+ * comparing _obj_ with the first element of each contained array
2595
+ * using obj.==.
2596
+ * Returns the first contained array that matches (that
2597
+ * is, the first associated array),
2598
+ * or +nil+ if no match is found.
2599
+ * See also <code>Array#rassoc</code>.
2600
+ *
2601
+ * s1 = [ "colors", "red", "blue", "green" ]
2602
+ * s2 = [ "letters", "a", "b", "c" ]
2603
+ * s3 = "foo"
2604
+ * a = [ s1, s2, s3 ]
2605
+ * a.assoc("letters") #=> [ "letters", "a", "b", "c" ]
2606
+ * a.assoc("foo") #=> nil
2607
+ */
2608
+
2609
+ VALUE
2610
+ rb_ary_assoc(VALUE ary, VALUE key)
2611
+ {
2612
+ long i;
2613
+ VALUE v;
2614
+
2615
+ for (i = 0; i < RARRAY_LEN(ary); ++i) {
2616
+ v = rb_check_array_type(RARRAY_PTR(ary)[i]);
2617
+ if (!NIL_P(v) && RARRAY_LEN(v) > 0 &&
2618
+ rb_equal(RARRAY_PTR(v)[0], key))
2619
+ return v;
2620
+ }
2621
+ return Qnil;
2622
+ }
2623
+
2624
+ /*
2625
+ * call-seq:
2626
+ * array.rassoc(obj) -> an_array or nil
2627
+ *
2628
+ * Searches through the array whose elements are also arrays. Compares
2629
+ * _obj_ with the second element of each contained array using
2630
+ * <code>==</code>. Returns the first contained array that matches. See
2631
+ * also <code>Array#assoc</code>.
2632
+ *
2633
+ * a = [ [ 1, "one"], [2, "two"], [3, "three"], ["ii", "two"] ]
2634
+ * a.rassoc("two") #=> [2, "two"]
2635
+ * a.rassoc("four") #=> nil
2636
+ */
2637
+
2638
+ VALUE
2639
+ rb_ary_rassoc(VALUE ary, VALUE value)
2640
+ {
2641
+ long i;
2642
+ VALUE v;
2643
+
2644
+ for (i = 0; i < RARRAY_LEN(ary); ++i) {
2645
+ v = RARRAY_PTR(ary)[i];
2646
+ if (TYPE(v) == T_ARRAY &&
2647
+ RARRAY_LEN(v) > 1 &&
2648
+ rb_equal(RARRAY_PTR(v)[1], value))
2649
+ return v;
2650
+ }
2651
+ return Qnil;
2652
+ }
2653
+
2654
+ static VALUE
2655
+ recursive_equal(VALUE ary1, VALUE ary2, int recur)
2656
+ {
2657
+ long i;
2658
+
2659
+ if (recur) return Qtrue; /* Subtle! */
2660
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
2661
+ if (!rb_equal(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i)))
2662
+ return Qfalse;
2663
+ }
2664
+ return Qtrue;
2665
+ }
2666
+
2667
+ /*
2668
+ * call-seq:
2669
+ * array == other_array -> bool
2670
+ *
2671
+ * Equality---Two arrays are equal if they contain the same number
2672
+ * of elements and if each element is equal to (according to
2673
+ * Object.==) the corresponding element in the other array.
2674
+ *
2675
+ * [ "a", "c" ] == [ "a", "c", 7 ] #=> false
2676
+ * [ "a", "c", 7 ] == [ "a", "c", 7 ] #=> true
2677
+ * [ "a", "c", 7 ] == [ "a", "d", "f" ] #=> false
2678
+ *
2679
+ */
2680
+
2681
+ static VALUE
2682
+ rb_ary_equal(VALUE ary1, VALUE ary2)
2683
+ {
2684
+ if (ary1 == ary2) return Qtrue;
2685
+ if (TYPE(ary2) != T_ARRAY) {
2686
+ if (!rb_respond_to(ary2, rb_intern("to_ary"))) {
2687
+ return Qfalse;
2688
+ }
2689
+ return rb_equal(ary2, ary1);
2690
+ }
2691
+ if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return Qfalse;
2692
+ return rb_exec_recursive_paired(recursive_equal, ary1, ary2, ary2);
2693
+ }
2694
+
2695
+ static VALUE
2696
+ recursive_eql(VALUE ary1, VALUE ary2, int recur)
2697
+ {
2698
+ long i;
2699
+
2700
+ if (recur) return Qtrue; /* Subtle! */
2701
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
2702
+ if (!rb_eql(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i)))
2703
+ return Qfalse;
2704
+ }
2705
+ return Qtrue;
2706
+ }
2707
+
2708
+ /*
2709
+ * call-seq:
2710
+ * array.eql?(other) -> true or false
2711
+ *
2712
+ * Returns <code>true</code> if _array_ and _other_ are the same object,
2713
+ * or are both arrays with the same content.
2714
+ */
2715
+
2716
+ static VALUE
2717
+ rb_ary_eql(VALUE ary1, VALUE ary2)
2718
+ {
2719
+ if (ary1 == ary2) return Qtrue;
2720
+ if (TYPE(ary2) != T_ARRAY) return Qfalse;
2721
+ if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return Qfalse;
2722
+ return rb_exec_recursive_paired(recursive_eql, ary1, ary2, ary2);
2723
+ }
2724
+
2725
+ static VALUE
2726
+ recursive_hash(VALUE ary, VALUE dummy, int recur)
2727
+ {
2728
+ long i, h;
2729
+ VALUE n;
2730
+
2731
+ if (recur) {
2732
+ return LONG2FIX(0);
2733
+ }
2734
+ h = RARRAY_LEN(ary);
2735
+ for (i=0; i<RARRAY_LEN(ary); i++) {
2736
+ h = (h << 1) | (h<0 ? 1 : 0);
2737
+ n = rb_hash(RARRAY_PTR(ary)[i]);
2738
+ h ^= NUM2LONG(n);
2739
+ }
2740
+ return LONG2FIX(h);
2741
+ }
2742
+
2743
+ /*
2744
+ * call-seq:
2745
+ * array.hash -> fixnum
2746
+ *
2747
+ * Compute a hash-code for this array. Two arrays with the same content
2748
+ * will have the same hash code (and will compare using <code>eql?</code>).
2749
+ */
2750
+
2751
+ static VALUE
2752
+ rb_ary_hash(VALUE ary)
2753
+ {
2754
+ return rb_exec_recursive(recursive_hash, ary, 0);
2755
+ }
2756
+
2757
+ /*
2758
+ * call-seq:
2759
+ * array.include?(obj) -> true or false
2760
+ *
2761
+ * Returns <code>true</code> if the given object is present in
2762
+ * <i>self</i> (that is, if any object <code>==</code> <i>anObject</i>),
2763
+ * <code>false</code> otherwise.
2764
+ *
2765
+ * a = [ "a", "b", "c" ]
2766
+ * a.include?("b") #=> true
2767
+ * a.include?("z") #=> false
2768
+ */
2769
+
2770
+ VALUE
2771
+ rb_ary_includes(VALUE ary, VALUE item)
2772
+ {
2773
+ long i;
2774
+
2775
+ for (i=0; i<RARRAY_LEN(ary); i++) {
2776
+ if (rb_equal(RARRAY_PTR(ary)[i], item)) {
2777
+ return Qtrue;
2778
+ }
2779
+ }
2780
+ return Qfalse;
2781
+ }
2782
+
2783
+
2784
+ static VALUE
2785
+ recursive_cmp(VALUE ary1, VALUE ary2, int recur)
2786
+ {
2787
+ long i, len;
2788
+
2789
+ if (recur) return Qundef; /* Subtle! */
2790
+ len = RARRAY_LEN(ary1);
2791
+ if (len > RARRAY_LEN(ary2)) {
2792
+ len = RARRAY_LEN(ary2);
2793
+ }
2794
+ for (i=0; i<len; i++) {
2795
+ VALUE v = rb_funcall(rb_ary_elt(ary1, i), id_cmp, 1, rb_ary_elt(ary2, i));
2796
+ if (v != INT2FIX(0)) {
2797
+ return v;
2798
+ }
2799
+ }
2800
+ return Qundef;
2801
+ }
2802
+
2803
+ /*
2804
+ * call-seq:
2805
+ * array <=> other_array -> -1, 0, +1
2806
+ *
2807
+ * Comparison---Returns an integer (-1, 0,
2808
+ * or +1) if this array is less than, equal to, or greater than
2809
+ * other_array. Each object in each array is compared
2810
+ * (using <=>). If any value isn't
2811
+ * equal, then that inequality is the return value. If all the
2812
+ * values found are equal, then the return is based on a
2813
+ * comparison of the array lengths. Thus, two arrays are
2814
+ * ``equal'' according to <code>Array#<=></code> if and only if they have
2815
+ * the same length and the value of each element is equal to the
2816
+ * value of the corresponding element in the other array.
2817
+ *
2818
+ * [ "a", "a", "c" ] <=> [ "a", "b", "c" ] #=> -1
2819
+ * [ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ] #=> +1
2820
+ *
2821
+ */
2822
+
2823
+ VALUE
2824
+ rb_ary_cmp(VALUE ary1, VALUE ary2)
2825
+ {
2826
+ long len;
2827
+ VALUE v;
2828
+
2829
+ ary2 = to_ary(ary2);
2830
+ if (ary1 == ary2) return INT2FIX(0);
2831
+ v = rb_exec_recursive_paired(recursive_cmp, ary1, ary2, ary2);
2832
+ if (v != Qundef) return v;
2833
+ len = RARRAY_LEN(ary1) - RARRAY_LEN(ary2);
2834
+ if (len == 0) return INT2FIX(0);
2835
+ if (len > 0) return INT2FIX(1);
2836
+ return INT2FIX(-1);
2837
+ }
2838
+
2839
+ static VALUE
2840
+ ary_make_hash(VALUE ary1, VALUE ary2)
2841
+ {
2842
+ VALUE hash = rb_hash_new();
2843
+ long i;
2844
+
2845
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
2846
+ rb_hash_aset(hash, RARRAY_PTR(ary1)[i], Qtrue);
2847
+ }
2848
+ if (ary2) {
2849
+ for (i=0; i<RARRAY_LEN(ary2); i++) {
2850
+ rb_hash_aset(hash, RARRAY_PTR(ary2)[i], Qtrue);
2851
+ }
2852
+ }
2853
+ return hash;
2854
+ }
2855
+
2856
+ /*
2857
+ * call-seq:
2858
+ * array - other_array -> an_array
2859
+ *
2860
+ * Array Difference---Returns a new array that is a copy of
2861
+ * the original array, removing any items that also appear in
2862
+ * other_array. (If you need set-like behavior, see the
2863
+ * library class Set.)
2864
+ *
2865
+ * [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ] #=> [ 3, 3, 5 ]
2866
+ */
2867
+
2868
+ static VALUE
2869
+ rb_ary_diff(VALUE ary1, VALUE ary2)
2870
+ {
2871
+ VALUE ary3;
2872
+ volatile VALUE hash;
2873
+ long i;
2874
+
2875
+ hash = ary_make_hash(to_ary(ary2), 0);
2876
+ ary3 = rb_ary_new();
2877
+
2878
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
2879
+ if (st_lookup(RHASH_TBL(hash), RARRAY_PTR(ary1)[i], 0)) continue;
2880
+ rb_ary_push(ary3, rb_ary_elt(ary1, i));
2881
+ }
2882
+ return ary3;
2883
+ }
2884
+
2885
+ /*
2886
+ * call-seq:
2887
+ * array & other_array
2888
+ *
2889
+ * Set Intersection---Returns a new array
2890
+ * containing elements common to the two arrays, with no duplicates.
2891
+ *
2892
+ * [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ]
2893
+ */
2894
+
2895
+
2896
+ static VALUE
2897
+ rb_ary_and(VALUE ary1, VALUE ary2)
2898
+ {
2899
+ VALUE hash, ary3, v, vv;
2900
+ long i;
2901
+
2902
+ ary2 = to_ary(ary2);
2903
+ ary3 = rb_ary_new2(RARRAY_LEN(ary1) < RARRAY_LEN(ary2) ?
2904
+ RARRAY_LEN(ary1) : RARRAY_LEN(ary2));
2905
+ hash = ary_make_hash(ary2, 0);
2906
+
2907
+ if (RHASH_EMPTY_P(hash))
2908
+ return ary3;
2909
+
2910
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
2911
+ v = vv = rb_ary_elt(ary1, i);
2912
+ if (st_delete(RHASH_TBL(hash), (st_data_t*)&vv, 0)) {
2913
+ rb_ary_push(ary3, v);
2914
+ }
2915
+ }
2916
+
2917
+ return ary3;
2918
+ }
2919
+
2920
+ /*
2921
+ * call-seq:
2922
+ * array | other_array -> an_array
2923
+ *
2924
+ * Set Union---Returns a new array by joining this array with
2925
+ * other_array, removing duplicates.
2926
+ *
2927
+ * [ "a", "b", "c" ] | [ "c", "d", "a" ]
2928
+ * #=> [ "a", "b", "c", "d" ]
2929
+ */
2930
+
2931
+ static VALUE
2932
+ rb_ary_or(VALUE ary1, VALUE ary2)
2933
+ {
2934
+ VALUE hash, ary3;
2935
+ VALUE v, vv;
2936
+ long i;
2937
+
2938
+ ary2 = to_ary(ary2);
2939
+ ary3 = rb_ary_new2(RARRAY_LEN(ary1)+RARRAY_LEN(ary2));
2940
+ hash = ary_make_hash(ary1, ary2);
2941
+
2942
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
2943
+ v = vv = rb_ary_elt(ary1, i);
2944
+ if (st_delete(RHASH_TBL(hash), (st_data_t*)&vv, 0)) {
2945
+ rb_ary_push(ary3, v);
2946
+ }
2947
+ }
2948
+ for (i=0; i<RARRAY_LEN(ary2); i++) {
2949
+ v = vv = rb_ary_elt(ary2, i);
2950
+ if (st_delete(RHASH_TBL(hash), (st_data_t*)&vv, 0)) {
2951
+ rb_ary_push(ary3, v);
2952
+ }
2953
+ }
2954
+ return ary3;
2955
+ }
2956
+
2957
+ /*
2958
+ * call-seq:
2959
+ * array.uniq! -> array or nil
2960
+ *
2961
+ * Removes duplicate elements from _self_.
2962
+ * Returns <code>nil</code> if no changes are made (that is, no
2963
+ * duplicates are found).
2964
+ *
2965
+ * a = [ "a", "a", "b", "b", "c" ]
2966
+ * a.uniq! #=> ["a", "b", "c"]
2967
+ * b = [ "a", "b", "c" ]
2968
+ * b.uniq! #=> nil
2969
+ */
2970
+
2971
+ static VALUE
2972
+ rb_ary_uniq_bang(VALUE ary)
2973
+ {
2974
+ VALUE hash, v, vv;
2975
+ long i, j;
2976
+
2977
+ hash = ary_make_hash(ary, 0);
2978
+
2979
+ if (RARRAY_LEN(ary) == RHASH_SIZE(hash)) {
2980
+ return Qnil;
2981
+ }
2982
+ for (i=j=0; i<RARRAY_LEN(ary); i++) {
2983
+ v = vv = rb_ary_elt(ary, i);
2984
+ if (st_delete(RHASH_TBL(hash), (st_data_t*)&vv, 0)) {
2985
+ rb_ary_store(ary, j++, v);
2986
+ }
2987
+ }
2988
+ ARY_SET_LEN(ary, j);
2989
+
2990
+ return ary;
2991
+ }
2992
+
2993
+ /*
2994
+ * call-seq:
2995
+ * array.uniq -> an_array
2996
+ *
2997
+ * Returns a new array by removing duplicate values in <i>self</i>.
2998
+ *
2999
+ * a = [ "a", "a", "b", "b", "c" ]
3000
+ * a.uniq #=> ["a", "b", "c"]
3001
+ */
3002
+
3003
+ static VALUE
3004
+ rb_ary_uniq(VALUE ary)
3005
+ {
3006
+ ary = rb_ary_dup(ary);
3007
+ rb_ary_uniq_bang(ary);
3008
+ return ary;
3009
+ }
3010
+
3011
+ /*
3012
+ * call-seq:
3013
+ * array.compact! -> array or nil
3014
+ *
3015
+ * Removes +nil+ elements from array.
3016
+ * Returns +nil+ if no changes were made.
3017
+ *
3018
+ * [ "a", nil, "b", nil, "c" ].compact! #=> [ "a", "b", "c" ]
3019
+ * [ "a", "b", "c" ].compact! #=> nil
3020
+ */
3021
+
3022
+ static VALUE
3023
+ rb_ary_compact_bang(VALUE ary)
3024
+ {
3025
+ VALUE *p, *t, *end;
3026
+ long n;
3027
+
3028
+ rb_ary_modify(ary);
3029
+ p = t = RARRAY_PTR(ary);
3030
+ end = p + RARRAY_LEN(ary);
3031
+
3032
+ while (t < end) {
3033
+ if (NIL_P(*t)) t++;
3034
+ else *p++ = *t++;
3035
+ }
3036
+ n = p - RARRAY_PTR(ary);
3037
+ if (RARRAY_LEN(ary) == n) {
3038
+ return Qnil;
3039
+ }
3040
+ ARY_SET_LEN(ary, n);
3041
+ if (n * 2 < ARY_CAPA(ary) && ARY_DEFAULT_SIZE * 2 < ARY_CAPA(ary)) {
3042
+ ary_resize_capa(ary, n * 2);
3043
+ }
3044
+
3045
+ return ary;
3046
+ }
3047
+
3048
+ /*
3049
+ * call-seq:
3050
+ * array.compact -> an_array
3051
+ *
3052
+ * Returns a copy of _self_ with all +nil+ elements removed.
3053
+ *
3054
+ * [ "a", nil, "b", nil, "c", nil ].compact
3055
+ * #=> [ "a", "b", "c" ]
3056
+ */
3057
+
3058
+ static VALUE
3059
+ rb_ary_compact(VALUE ary)
3060
+ {
3061
+ ary = rb_ary_dup(ary);
3062
+ rb_ary_compact_bang(ary);
3063
+ return ary;
3064
+ }
3065
+
3066
+ /*
3067
+ * call-seq:
3068
+ * array.count -> int
3069
+ * array.count(obj) -> int
3070
+ * array.count { |item| block } -> int
3071
+ *
3072
+ * Returns the number of elements. If an argument is given, counts
3073
+ * the number of elements which equals to <i>obj</i>. If a block is
3074
+ * given, counts the number of elements yielding a true value.
3075
+ *
3076
+ * ary = [1, 2, 4, 2]
3077
+ * ary.count # => 4
3078
+ * ary.count(2) # => 2
3079
+ * ary.count{|x|x%2==0} # => 3
3080
+ *
3081
+ */
3082
+
3083
+ static VALUE
3084
+ rb_ary_count(int argc, VALUE *argv, VALUE ary)
3085
+ {
3086
+ long n = 0;
3087
+
3088
+ if (argc == 0) {
3089
+ VALUE *p, *pend;
3090
+
3091
+ if (!rb_block_given_p())
3092
+ return LONG2NUM(RARRAY_LEN(ary));
3093
+
3094
+ for (p = RARRAY_PTR(ary), pend = p + RARRAY_LEN(ary); p < pend; p++) {
3095
+ if (RTEST(rb_yield(*p))) n++;
3096
+ }
3097
+ }
3098
+ else {
3099
+ VALUE obj, *p, *pend;
3100
+
3101
+ rb_scan_args(argc, argv, "1", &obj);
3102
+ if (rb_block_given_p()) {
3103
+ rb_warn("given block not used");
3104
+ }
3105
+ for (p = RARRAY_PTR(ary), pend = p + RARRAY_LEN(ary); p < pend; p++) {
3106
+ if (rb_equal(*p, obj)) n++;
3107
+ }
3108
+ }
3109
+
3110
+ return LONG2NUM(n);
3111
+ }
3112
+
3113
+ static VALUE
3114
+ flatten(VALUE ary, int level, int *modified)
3115
+ {
3116
+ long i = 0;
3117
+ VALUE stack, result, tmp, elt;
3118
+ st_table *memo;
3119
+ st_data_t id;
3120
+
3121
+ stack = ary_new(0, ARY_DEFAULT_SIZE);
3122
+ result = ary_new(0, RARRAY_LEN(ary));
3123
+ memo = st_init_numtable();
3124
+ st_insert(memo, (st_data_t)ary, (st_data_t)Qtrue);
3125
+ *modified = 0;
3126
+
3127
+ while (1) {
3128
+ while (i < RARRAY_LEN(ary)) {
3129
+ elt = RARRAY_PTR(ary)[i++];
3130
+ tmp = rb_check_array_type(elt);
3131
+ if (RBASIC(result)->klass) {
3132
+ rb_raise(rb_eRuntimeError, "flatten reentered");
3133
+ }
3134
+ if (NIL_P(tmp) || (level >= 0 && RARRAY_LEN(stack) / 2 >= level)) {
3135
+ rb_ary_push(result, elt);
3136
+ }
3137
+ else {
3138
+ *modified = 1;
3139
+ id = (st_data_t)tmp;
3140
+ if (st_lookup(memo, id, 0)) {
3141
+ st_free_table(memo);
3142
+ rb_raise(rb_eArgError, "tried to flatten recursive array");
3143
+ }
3144
+ st_insert(memo, id, (st_data_t)Qtrue);
3145
+ rb_ary_push(stack, ary);
3146
+ rb_ary_push(stack, LONG2NUM(i));
3147
+ ary = tmp;
3148
+ i = 0;
3149
+ }
3150
+ }
3151
+ if (RARRAY_LEN(stack) == 0) {
3152
+ break;
3153
+ }
3154
+ id = (st_data_t)ary;
3155
+ st_delete(memo, &id, 0);
3156
+ tmp = rb_ary_pop(stack);
3157
+ i = NUM2LONG(tmp);
3158
+ ary = rb_ary_pop(stack);
3159
+ }
3160
+
3161
+ st_free_table(memo);
3162
+
3163
+ RBASIC(result)->klass = rb_class_of(ary);
3164
+ return result;
3165
+ }
3166
+
3167
+ /*
3168
+ * call-seq:
3169
+ * array.flatten! -> array or nil
3170
+ * array.flatten!(level) -> array or nil
3171
+ *
3172
+ * Flattens _self_ in place.
3173
+ * Returns <code>nil</code> if no modifications were made (i.e.,
3174
+ * <i>array</i> contains no subarrays.) If the optional <i>level</i>
3175
+ * argument determines the level of recursion to flatten.
3176
+ *
3177
+ * a = [ 1, 2, [3, [4, 5] ] ]
3178
+ * a.flatten! #=> [1, 2, 3, 4, 5]
3179
+ * a.flatten! #=> nil
3180
+ * a #=> [1, 2, 3, 4, 5]
3181
+ * a = [ 1, 2, [3, [4, 5] ] ]
3182
+ * a.flatten!(1) #=> [1, 2, 3, [4, 5]]
3183
+ */
3184
+
3185
+ static VALUE
3186
+ rb_ary_flatten_bang(int argc, VALUE *argv, VALUE ary)
3187
+ {
3188
+ int mod = 0, level = -1;
3189
+ VALUE result, lv;
3190
+
3191
+ rb_scan_args(argc, argv, "01", &lv);
3192
+ if (!NIL_P(lv)) level = NUM2INT(lv);
3193
+ if (level == 0) return Qnil;
3194
+
3195
+ result = flatten(ary, level, &mod);
3196
+ if (mod == 0) return Qnil;
3197
+ rb_ary_replace(ary, result);
3198
+
3199
+ return ary;
3200
+ }
3201
+
3202
+ /*
3203
+ * call-seq:
3204
+ * array.flatten -> an_array
3205
+ * array.flatten(level) -> an_array
3206
+ *
3207
+ * Returns a new array that is a one-dimensional flattening of this
3208
+ * array (recursively). That is, for every element that is an array,
3209
+ * extract its elements into the new array. If the optional
3210
+ * <i>level</i> argument determines the level of recursion to flatten.
3211
+ *
3212
+ * s = [ 1, 2, 3 ] #=> [1, 2, 3]
3213
+ * t = [ 4, 5, 6, [7, 8] ] #=> [4, 5, 6, [7, 8]]
3214
+ * a = [ s, t, 9, 10 ] #=> [[1, 2, 3], [4, 5, 6, [7, 8]], 9, 10]
3215
+ * a.flatten #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
3216
+ * a = [ 1, 2, [3, [4, 5] ] ]
3217
+ * a.flatten(1) #=> [1, 2, 3, [4, 5]]
3218
+ */
3219
+
3220
+ static VALUE
3221
+ rb_ary_flatten(int argc, VALUE *argv, VALUE ary)
3222
+ {
3223
+ int mod = 0, level = -1;
3224
+ VALUE result, lv;
3225
+
3226
+ rb_scan_args(argc, argv, "01", &lv);
3227
+ if (!NIL_P(lv)) level = NUM2INT(lv);
3228
+ if (level == 0) return ary_make_shared_copy(ary);
3229
+
3230
+ result = flatten(ary, level, &mod);
3231
+ OBJ_INFECT(result, ary);
3232
+
3233
+ return result;
3234
+ }
3235
+
3236
+ /*
3237
+ * call-seq:
3238
+ * array.shuffle! -> array
3239
+ *
3240
+ * Shuffles elements in _self_ in place.
3241
+ */
3242
+
3243
+
3244
+ static VALUE
3245
+ rb_ary_shuffle_bang(VALUE ary)
3246
+ {
3247
+ long i = RARRAY_LEN(ary);
3248
+
3249
+ rb_ary_modify(ary);
3250
+ while (i) {
3251
+ long j = rb_genrand_real()*i;
3252
+ VALUE tmp = RARRAY_PTR(ary)[--i];
3253
+ RARRAY_PTR(ary)[i] = RARRAY_PTR(ary)[j];
3254
+ RARRAY_PTR(ary)[j] = tmp;
3255
+ }
3256
+ return ary;
3257
+ }
3258
+
3259
+
3260
+ /*
3261
+ * call-seq:
3262
+ * array.shuffle -> an_array
3263
+ *
3264
+ * Returns a new array with elements of this array shuffled.
3265
+ *
3266
+ * a = [ 1, 2, 3 ] #=> [1, 2, 3]
3267
+ * a.shuffle #=> [2, 3, 1]
3268
+ */
3269
+
3270
+ static VALUE
3271
+ rb_ary_shuffle(VALUE ary)
3272
+ {
3273
+ ary = rb_ary_dup(ary);
3274
+ rb_ary_shuffle_bang(ary);
3275
+ return ary;
3276
+ }
3277
+
3278
+
3279
+ /*
3280
+ * call-seq:
3281
+ * array.sample -> obj
3282
+ * array.sample(n) -> an_array
3283
+ *
3284
+ * Choose a random element, or the random +n+ elements, from the array.
3285
+ * If the array is empty, the first form returns <code>nil</code>, and the
3286
+ * second form returns an empty array.
3287
+ *
3288
+ */
3289
+
3290
+
3291
+ static VALUE
3292
+ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
3293
+ {
3294
+ VALUE nv, result, *ptr;
3295
+ long n, len, i, j, k, idx[10];
3296
+
3297
+ len = RARRAY_LEN(ary);
3298
+ if (argc == 0) {
3299
+ if (len == 0) return Qnil;
3300
+ i = len == 1 ? 0 : rb_genrand_real()*len;
3301
+ return RARRAY_PTR(ary)[i];
3302
+ }
3303
+ rb_scan_args(argc, argv, "1", &nv);
3304
+ n = NUM2LONG(nv);
3305
+ if (n < 0) rb_raise(rb_eArgError, "negative sample number");
3306
+ ptr = RARRAY_PTR(ary);
3307
+ len = RARRAY_LEN(ary);
3308
+ if (n > len) n = len;
3309
+ switch (n) {
3310
+ case 0: return rb_ary_new2(0);
3311
+ case 1:
3312
+ return rb_ary_new4(1, &ptr[(long)(rb_genrand_real()*len)]);
3313
+ case 2:
3314
+ i = rb_genrand_real()*len;
3315
+ j = rb_genrand_real()*(len-1);
3316
+ if (j >= i) j++;
3317
+ return rb_ary_new3(2, ptr[i], ptr[j]);
3318
+ case 3:
3319
+ i = rb_genrand_real()*len;
3320
+ j = rb_genrand_real()*(len-1);
3321
+ k = rb_genrand_real()*(len-2);
3322
+ {
3323
+ long l = j, g = i;
3324
+ if (j >= i) l = i, g = ++j;
3325
+ if (k >= l && (++k >= g)) ++k;
3326
+ }
3327
+ return rb_ary_new3(3, ptr[i], ptr[j], ptr[k]);
3328
+ }
3329
+ if (n < sizeof(idx)/sizeof(idx[0])) {
3330
+ long sorted[sizeof(idx)/sizeof(idx[0])];
3331
+ sorted[0] = idx[0] = rb_genrand_real()*len;
3332
+ for (i=1; i<n; i++) {
3333
+ k = rb_genrand_real()*--len;
3334
+ for (j = 0; j < i; ++j) {
3335
+ if (k < sorted[j]) break;
3336
+ ++k;
3337
+ }
3338
+ memmove(&sorted[j+1], &sorted[j], sizeof(sorted[0])*(i-j));
3339
+ sorted[j] = idx[i] = k;
3340
+ }
3341
+ result = rb_ary_new2(n);
3342
+ for (i=0; i<n; i++) {
3343
+ RARRAY_PTR(result)[i] = RARRAY_PTR(ary)[idx[i]];
3344
+ }
3345
+ }
3346
+ else {
3347
+ result = rb_ary_new4(len, ptr);
3348
+ RB_GC_GUARD(ary);
3349
+ for (i=0; i<n; i++) {
3350
+ j = (long)(rb_genrand_real()*(len-i)) + i;
3351
+ nv = RARRAY_PTR(result)[j];
3352
+ RARRAY_PTR(result)[j] = RARRAY_PTR(result)[i];
3353
+ RARRAY_PTR(result)[i] = nv;
3354
+ }
3355
+ }
3356
+ ARY_SET_LEN(result, n);
3357
+
3358
+ return result;
3359
+ }
3360
+
3361
+
3362
+ /*
3363
+ * call-seq:
3364
+ * ary.cycle {|obj| block }
3365
+ * ary.cycle(n) {|obj| block }
3366
+ *
3367
+ * Calls <i>block</i> for each element repeatedly _n_ times or
3368
+ * forever if none or nil is given. If a non-positive number is
3369
+ * given or the array is empty, does nothing. Returns nil if the
3370
+ * loop has finished without getting interrupted.
3371
+ *
3372
+ * a = ["a", "b", "c"]
3373
+ * a.cycle {|x| puts x } # print, a, b, c, a, b, c,.. forever.
3374
+ * a.cycle(2) {|x| puts x } # print, a, b, c, a, b, c.
3375
+ *
3376
+ */
3377
+
3378
+ static VALUE
3379
+ rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
3380
+ {
3381
+ long n, i;
3382
+ VALUE nv = Qnil;
3383
+
3384
+ rb_scan_args(argc, argv, "01", &nv);
3385
+
3386
+ RETURN_ENUMERATOR(ary, argc, argv);
3387
+ if (NIL_P(nv)) {
3388
+ n = -1;
3389
+ }
3390
+ else {
3391
+ n = NUM2LONG(nv);
3392
+ if (n <= 0) return Qnil;
3393
+ }
3394
+
3395
+ while (RARRAY_LEN(ary) > 0 && (n < 0 || 0 < n--)) {
3396
+ for (i=0; i<RARRAY_LEN(ary); i++) {
3397
+ rb_yield(RARRAY_PTR(ary)[i]);
3398
+ }
3399
+ }
3400
+ return Qnil;
3401
+ }
3402
+
3403
+ #define tmpbuf(n, size) rb_str_tmp_new((n)*(size))
3404
+
3405
+ /*
3406
+ * Recursively compute permutations of r elements of the set [0..n-1].
3407
+ * When we have a complete permutation of array indexes, copy the values
3408
+ * at those indexes into a new array and yield that array.
3409
+ *
3410
+ * n: the size of the set
3411
+ * r: the number of elements in each permutation
3412
+ * p: the array (of size r) that we're filling in
3413
+ * index: what index we're filling in now
3414
+ * used: an array of booleans: whether a given index is already used
3415
+ * values: the Ruby array that holds the actual values to permute
3416
+ */
3417
+ static void
3418
+ permute0(long n, long r, long *p, long index, int *used, VALUE values)
3419
+ {
3420
+ long i,j;
3421
+ for (i = 0; i < n; i++) {
3422
+ if (used[i] == 0) {
3423
+ p[index] = i;
3424
+ if (index < r-1) { /* if not done yet */
3425
+ used[i] = 1; /* mark index used */
3426
+ permute0(n, r, p, index+1, /* recurse */
3427
+ used, values);
3428
+ used[i] = 0; /* index unused */
3429
+ }
3430
+ else {
3431
+ /* We have a complete permutation of array indexes */
3432
+ /* Build a ruby array of the corresponding values */
3433
+ /* And yield it to the associated block */
3434
+ VALUE result = rb_ary_new2(r);
3435
+ VALUE *result_array = RARRAY_PTR(result);
3436
+ const VALUE *values_array = RARRAY_PTR(values);
3437
+
3438
+ for (j = 0; j < r; j++) result_array[j] = values_array[p[j]];
3439
+ ARY_SET_LEN(result, r);
3440
+ rb_yield(result);
3441
+ }
3442
+ }
3443
+ }
3444
+ }
3445
+
3446
+ /*
3447
+ * call-seq:
3448
+ * ary.permutation { |p| block } -> array
3449
+ * ary.permutation -> enumerator
3450
+ * ary.permutation(n) { |p| block } -> array
3451
+ * ary.permutation(n) -> enumerator
3452
+ *
3453
+ * When invoked with a block, yield all permutations of length <i>n</i>
3454
+ * of the elements of <i>ary</i>, then return the array itself.
3455
+ * If <i>n</i> is not specified, yield all permutations of all elements.
3456
+ * The implementation makes no guarantees about the order in which
3457
+ * the permutations are yielded.
3458
+ *
3459
+ * When invoked without a block, return an enumerator object instead.
3460
+ *
3461
+ * Examples:
3462
+ *
3463
+ * a = [1, 2, 3]
3464
+ * a.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
3465
+ * a.permutation(1).to_a #=> [[1],[2],[3]]
3466
+ * a.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
3467
+ * a.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
3468
+ * a.permutation(0).to_a #=> [[]] # one permutation of length 0
3469
+ * a.permutation(4).to_a #=> [] # no permutations of length 4
3470
+ */
3471
+
3472
+ static VALUE
3473
+ rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
3474
+ {
3475
+ VALUE num;
3476
+ long r, n, i;
3477
+
3478
+ n = RARRAY_LEN(ary); /* Array length */
3479
+ RETURN_ENUMERATOR(ary, argc, argv); /* Return enumerator if no block */
3480
+ rb_scan_args(argc, argv, "01", &num);
3481
+ r = NIL_P(num) ? n : NUM2LONG(num); /* Permutation size from argument */
3482
+
3483
+ if (r < 0 || n < r) {
3484
+ /* no permutations: yield nothing */
3485
+ }
3486
+ else if (r == 0) { /* exactly one permutation: the zero-length array */
3487
+ rb_yield(rb_ary_new2(0));
3488
+ }
3489
+ else if (r == 1) { /* this is a special, easy case */
3490
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
3491
+ rb_yield(rb_ary_new3(1, RARRAY_PTR(ary)[i]));
3492
+ }
3493
+ }
3494
+ else { /* this is the general case */
3495
+ volatile VALUE t0 = tmpbuf(n,sizeof(long));
3496
+ long *p = (long*)RSTRING_PTR(t0);
3497
+ volatile VALUE t1 = tmpbuf(n,sizeof(int));
3498
+ int *used = (int*)RSTRING_PTR(t1);
3499
+ VALUE ary0 = ary_make_substitution(ary); /* private defensive copy of ary */
3500
+ RBASIC(ary0)->klass = 0;
3501
+
3502
+ for (i = 0; i < n; i++) used[i] = 0; /* initialize array */
3503
+
3504
+ permute0(n, r, p, 0, used, ary0); /* compute and yield permutations */
3505
+ RB_GC_GUARD(t0);
3506
+ RB_GC_GUARD(t1);
3507
+ RBASIC(ary0)->klass = rb_cArray;
3508
+ }
3509
+ return ary;
3510
+ }
3511
+
3512
+ static long
3513
+ combi_len(long n, long k)
3514
+ {
3515
+ long i, val = 1;
3516
+
3517
+ if (k*2 > n) k = n-k;
3518
+ if (k == 0) return 1;
3519
+ if (k < 0) return 0;
3520
+ val = 1;
3521
+ for (i=1; i <= k; i++,n--) {
3522
+ long m = val;
3523
+ val *= n;
3524
+ if (val < m) {
3525
+ rb_raise(rb_eRangeError, "too big for combination");
3526
+ }
3527
+ val /= i;
3528
+ }
3529
+ return val;
3530
+ }
3531
+
3532
+ /*
3533
+ * call-seq:
3534
+ * ary.combination(n) { |c| block } -> ary
3535
+ * ary.combination(n) -> enumerator
3536
+ *
3537
+ * When invoked with a block, yields all combinations of length <i>n</i>
3538
+ * of elements from <i>ary</i> and then returns <i>ary</i> itself.
3539
+ * The implementation makes no guarantees about the order in which
3540
+ * the combinations are yielded.
3541
+ *
3542
+ * When invoked without a block, returns an enumerator object instead.
3543
+ *
3544
+ * Examples:
3545
+ *
3546
+ * a = [1, 2, 3, 4]
3547
+ * a.combination(1).to_a #=> [[1],[2],[3],[4]]
3548
+ * a.combination(2).to_a #=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]
3549
+ * a.combination(3).to_a #=> [[1,2,3],[1,2,4],[1,3,4],[2,3,4]]
3550
+ * a.combination(4).to_a #=> [[1,2,3,4]]
3551
+ * a.combination(0).to_a #=> [[]] # one combination of length 0
3552
+ * a.combination(5).to_a #=> [] # no combinations of length 5
3553
+ *
3554
+ */
3555
+
3556
+ static VALUE
3557
+ rb_ary_combination(VALUE ary, VALUE num)
3558
+ {
3559
+ long n, i, len;
3560
+
3561
+ n = NUM2LONG(num);
3562
+ RETURN_ENUMERATOR(ary, 1, &num);
3563
+ len = RARRAY_LEN(ary);
3564
+ if (n < 0 || len < n) {
3565
+ /* yield nothing */
3566
+ }
3567
+ else if (n == 0) {
3568
+ rb_yield(rb_ary_new2(0));
3569
+ }
3570
+ else if (n == 1) {
3571
+ for (i = 0; i < len; i++) {
3572
+ rb_yield(rb_ary_new3(1, RARRAY_PTR(ary)[i]));
3573
+ }
3574
+ }
3575
+ else {
3576
+ volatile VALUE t0 = tmpbuf(n+1, sizeof(long));
3577
+ long *stack = (long*)RSTRING_PTR(t0);
3578
+ long nlen = combi_len(len, n);
3579
+ volatile VALUE cc = rb_ary_new2(n);
3580
+ VALUE *chosen = RARRAY_PTR(cc);
3581
+ long lev = 0;
3582
+
3583
+ RBASIC(cc)->klass = 0;
3584
+ MEMZERO(stack, long, n);
3585
+ stack[0] = -1;
3586
+ for (i = 0; i < nlen; i++) {
3587
+ chosen[lev] = RARRAY_PTR(ary)[stack[lev+1]];
3588
+ for (lev++; lev < n; lev++) {
3589
+ chosen[lev] = RARRAY_PTR(ary)[stack[lev+1] = stack[lev]+1];
3590
+ }
3591
+ rb_yield(rb_ary_new4(n, chosen));
3592
+ do {
3593
+ stack[lev--]++;
3594
+ } while (lev && (stack[lev+1]+n == len+lev+1));
3595
+ }
3596
+ }
3597
+ return ary;
3598
+ }
3599
+
3600
+ /*
3601
+ * call-seq:
3602
+ * ary.product(other_ary, ...)
3603
+ *
3604
+ * Returns an array of all combinations of elements from all arrays.
3605
+ * The length of the returned array is the product of the length
3606
+ * of ary and the argument arrays
3607
+ *
3608
+ * [1,2,3].product([4,5]) # => [[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]]
3609
+ * [1,2].product([1,2]) # => [[1,1],[1,2],[2,1],[2,2]]
3610
+ * [1,2].product([3,4],[5,6]) # => [[1,3,5],[1,3,6],[1,4,5],[1,4,6],
3611
+ * # [2,3,5],[2,3,6],[2,4,5],[2,4,6]]
3612
+ * [1,2].product() # => [[1],[2]]
3613
+ * [1,2].product([]) # => []
3614
+ */
3615
+
3616
+ static VALUE
3617
+ rb_ary_product(int argc, VALUE *argv, VALUE ary)
3618
+ {
3619
+ int n = argc+1; /* How many arrays we're operating on */
3620
+ volatile VALUE t0 = tmpbuf(n, sizeof(VALUE));
3621
+ volatile VALUE t1 = tmpbuf(n, sizeof(int));
3622
+ VALUE *arrays = (VALUE*)RSTRING_PTR(t0); /* The arrays we're computing the product of */
3623
+ int *counters = (int*)RSTRING_PTR(t1); /* The current position in each one */
3624
+ VALUE result; /* The array we'll be returning */
3625
+ long i,j;
3626
+ long resultlen = 1;
3627
+
3628
+ RBASIC(t0)->klass = 0;
3629
+ RBASIC(t1)->klass = 0;
3630
+
3631
+ /* initialize the arrays of arrays */
3632
+ arrays[0] = ary;
3633
+ for (i = 1; i < n; i++) arrays[i] = to_ary(argv[i-1]);
3634
+
3635
+ /* initialize the counters for the arrays */
3636
+ for (i = 0; i < n; i++) counters[i] = 0;
3637
+
3638
+ /* Compute the length of the result array; return [] if any is empty */
3639
+ for (i = 0; i < n; i++) {
3640
+ long k = RARRAY_LEN(arrays[i]), l = resultlen;
3641
+ if (k == 0) return rb_ary_new2(0);
3642
+ resultlen *= k;
3643
+ if (resultlen < k || resultlen < l || resultlen / k != l) {
3644
+ rb_raise(rb_eRangeError, "too big to product");
3645
+ }
3646
+ }
3647
+
3648
+ /* Otherwise, allocate and fill in an array of results */
3649
+ result = rb_ary_new2(resultlen);
3650
+ for (i = 0; i < resultlen; i++) {
3651
+ int m;
3652
+ /* fill in one subarray */
3653
+ VALUE subarray = rb_ary_new2(n);
3654
+ for (j = 0; j < n; j++) {
3655
+ rb_ary_push(subarray, rb_ary_entry(arrays[j], counters[j]));
3656
+ }
3657
+
3658
+ /* put it on the result array */
3659
+ rb_ary_push(result, subarray);
3660
+
3661
+ /*
3662
+ * Increment the last counter. If it overflows, reset to 0
3663
+ * and increment the one before it.
3664
+ */
3665
+ m = n-1;
3666
+ counters[m]++;
3667
+ while (m > 0 && counters[m] == RARRAY_LEN(arrays[m])) {
3668
+ counters[m] = 0;
3669
+ m--;
3670
+ counters[m]++;
3671
+ }
3672
+ }
3673
+
3674
+ return result;
3675
+ }
3676
+
3677
+ /*
3678
+ * call-seq:
3679
+ * ary.take(n) => array
3680
+ *
3681
+ * Returns first n elements from <i>ary</i>.
3682
+ *
3683
+ * a = [1, 2, 3, 4, 5, 0]
3684
+ * a.take(3) # => [1, 2, 3]
3685
+ *
3686
+ */
3687
+
3688
+ static VALUE
3689
+ rb_ary_take(VALUE obj, VALUE n)
3690
+ {
3691
+ long len = NUM2LONG(n);
3692
+ if (len < 0) {
3693
+ rb_raise(rb_eArgError, "attempt to take negative size");
3694
+ }
3695
+ return rb_ary_subseq(obj, 0, len);
3696
+ }
3697
+
3698
+ /*
3699
+ * call-seq:
3700
+ * ary.take_while {|arr| block } => array
3701
+ *
3702
+ * Passes elements to the block until the block returns nil or false,
3703
+ * then stops iterating and returns an array of all prior elements.
3704
+ *
3705
+ * a = [1, 2, 3, 4, 5, 0]
3706
+ * a.take_while {|i| i < 3 } # => [1, 2]
3707
+ *
3708
+ */
3709
+
3710
+ static VALUE
3711
+ rb_ary_take_while(VALUE ary)
3712
+ {
3713
+ long i;
3714
+
3715
+ RETURN_ENUMERATOR(ary, 0, 0);
3716
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
3717
+ if (!RTEST(rb_yield(RARRAY_PTR(ary)[i]))) break;
3718
+ }
3719
+ return rb_ary_take(ary, LONG2FIX(i));
3720
+ }
3721
+
3722
+ /*
3723
+ * call-seq:
3724
+ * ary.drop(n) => array
3725
+ *
3726
+ * Drops first n elements from <i>ary</i>, and returns rest elements
3727
+ * in an array.
3728
+ *
3729
+ * a = [1, 2, 3, 4, 5, 0]
3730
+ * a.drop(3) # => [4, 5, 0]
3731
+ *
3732
+ */
3733
+
3734
+ static VALUE
3735
+ rb_ary_drop(VALUE ary, VALUE n)
3736
+ {
3737
+ VALUE result;
3738
+ long pos = NUM2LONG(n);
3739
+ if (pos < 0) {
3740
+ rb_raise(rb_eArgError, "attempt to drop negative size");
3741
+ }
3742
+
3743
+ result = rb_ary_subseq(ary, pos, RARRAY_LEN(ary));
3744
+ if (result == Qnil) result = rb_ary_new();
3745
+ return result;
3746
+ }
3747
+
3748
+ /*
3749
+ * call-seq:
3750
+ * ary.drop_while {|arr| block } => array
3751
+ *
3752
+ * Drops elements up to, but not including, the first element for
3753
+ * which the block returns nil or false and returns an array
3754
+ * containing the remaining elements.
3755
+ *
3756
+ * a = [1, 2, 3, 4, 5, 0]
3757
+ * a.drop_while {|i| i < 3 } # => [3, 4, 5, 0]
3758
+ *
3759
+ */
3760
+
3761
+ static VALUE
3762
+ rb_ary_drop_while(VALUE ary)
3763
+ {
3764
+ long i;
3765
+
3766
+ RETURN_ENUMERATOR(ary, 0, 0);
3767
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
3768
+ if (!RTEST(rb_yield(RARRAY_PTR(ary)[i]))) break;
3769
+ }
3770
+ return rb_ary_drop(ary, LONG2FIX(i));
3771
+ }
3772
+
3773
+
3774
+
3775
+ /* Arrays are ordered, integer-indexed collections of any object.
3776
+ * Array indexing starts at 0, as in C or Java. A negative index is
3777
+ * assumed to be relative to the end of the array---that is, an index of -1
3778
+ * indicates the last element of the array, -2 is the next to last
3779
+ * element in the array, and so on.
3780
+ */
3781
+
3782
+ void
3783
+ Init_Array(void)
3784
+ {
3785
+ #undef rb_intern
3786
+ #define rb_intern(str) rb_intern_const(str)
3787
+
3788
+ rb_cArray = rb_define_class("Array", rb_cObject);
3789
+ rb_include_module(rb_cArray, rb_mEnumerable);
3790
+
3791
+ rb_define_alloc_func(rb_cArray, ary_alloc);
3792
+ rb_define_singleton_method(rb_cArray, "[]", rb_ary_s_create, -1);
3793
+ rb_define_singleton_method(rb_cArray, "try_convert", rb_ary_s_try_convert, 1);
3794
+ rb_define_method(rb_cArray, "initialize", rb_ary_initialize, -1);
3795
+ rb_define_method(rb_cArray, "initialize_copy", rb_ary_replace, 1);
3796
+
3797
+ rb_define_method(rb_cArray, "to_s", rb_ary_inspect, 0);
3798
+ rb_define_method(rb_cArray, "inspect", rb_ary_inspect, 0);
3799
+ rb_define_method(rb_cArray, "to_a", rb_ary_to_a, 0);
3800
+ rb_define_method(rb_cArray, "to_ary", rb_ary_to_ary_m, 0);
3801
+ rb_define_method(rb_cArray, "frozen?", rb_ary_frozen_p, 0);
3802
+
3803
+ rb_define_method(rb_cArray, "==", rb_ary_equal, 1);
3804
+ rb_define_method(rb_cArray, "eql?", rb_ary_eql, 1);
3805
+ rb_define_method(rb_cArray, "hash", rb_ary_hash, 0);
3806
+
3807
+ rb_define_method(rb_cArray, "[]", rb_ary_aref, -1);
3808
+ rb_define_method(rb_cArray, "[]=", rb_ary_aset, -1);
3809
+ rb_define_method(rb_cArray, "at", rb_ary_at, 1);
3810
+ rb_define_method(rb_cArray, "fetch", rb_ary_fetch, -1);
3811
+ rb_define_method(rb_cArray, "first", rb_ary_first, -1);
3812
+ rb_define_method(rb_cArray, "last", rb_ary_last, -1);
3813
+ rb_define_method(rb_cArray, "concat", rb_ary_concat, 1);
3814
+ rb_define_method(rb_cArray, "<<", rb_ary_push, 1);
3815
+ rb_define_method(rb_cArray, "push", rb_ary_push_m, -1);
3816
+ rb_define_method(rb_cArray, "pop", rb_ary_pop_m, -1);
3817
+ rb_define_method(rb_cArray, "shift", rb_ary_shift_m, -1);
3818
+ rb_define_method(rb_cArray, "unshift", rb_ary_unshift_m, -1);
3819
+ rb_define_method(rb_cArray, "insert", rb_ary_insert, -1);
3820
+ rb_define_method(rb_cArray, "each", rb_ary_each, 0);
3821
+ rb_define_method(rb_cArray, "each_index", rb_ary_each_index, 0);
3822
+ rb_define_method(rb_cArray, "reverse_each", rb_ary_reverse_each, 0);
3823
+ rb_define_method(rb_cArray, "length", rb_ary_length, 0);
3824
+ rb_define_alias(rb_cArray, "size", "length");
3825
+ rb_define_method(rb_cArray, "empty?", rb_ary_empty_p, 0);
3826
+ rb_define_method(rb_cArray, "find_index", rb_ary_index, -1);
3827
+ rb_define_method(rb_cArray, "index", rb_ary_index, -1);
3828
+ rb_define_method(rb_cArray, "rindex", rb_ary_rindex, -1);
3829
+ rb_define_method(rb_cArray, "join", rb_ary_join_m, -1);
3830
+ rb_define_method(rb_cArray, "reverse", rb_ary_reverse_m, 0);
3831
+ rb_define_method(rb_cArray, "reverse!", rb_ary_reverse_bang, 0);
3832
+ rb_define_method(rb_cArray, "sort", rb_ary_sort, 0);
3833
+ rb_define_method(rb_cArray, "sort!", rb_ary_sort_bang, 0);
3834
+ rb_define_method(rb_cArray, "collect", rb_ary_collect, 0);
3835
+ rb_define_method(rb_cArray, "collect!", rb_ary_collect_bang, 0);
3836
+ rb_define_method(rb_cArray, "map", rb_ary_collect, 0);
3837
+ rb_define_method(rb_cArray, "map!", rb_ary_collect_bang, 0);
3838
+ rb_define_method(rb_cArray, "select", rb_ary_select, 0);
3839
+ rb_define_method(rb_cArray, "values_at", rb_ary_values_at, -1);
3840
+ rb_define_method(rb_cArray, "delete", rb_ary_delete, 1);
3841
+ rb_define_method(rb_cArray, "delete_at", rb_ary_delete_at_m, 1);
3842
+ rb_define_method(rb_cArray, "delete_if", rb_ary_delete_if, 0);
3843
+ rb_define_method(rb_cArray, "reject", rb_ary_reject, 0);
3844
+ rb_define_method(rb_cArray, "reject!", rb_ary_reject_bang, 0);
3845
+ rb_define_method(rb_cArray, "zip", rb_ary_zip, -1);
3846
+ rb_define_method(rb_cArray, "transpose", rb_ary_transpose, 0);
3847
+ rb_define_method(rb_cArray, "replace", rb_ary_replace, 1);
3848
+ rb_define_method(rb_cArray, "clear", rb_ary_clear, 0);
3849
+ rb_define_method(rb_cArray, "fill", rb_ary_fill, -1);
3850
+ rb_define_method(rb_cArray, "include?", rb_ary_includes, 1);
3851
+ rb_define_method(rb_cArray, "<=>", rb_ary_cmp, 1);
3852
+
3853
+ rb_define_method(rb_cArray, "slice", rb_ary_aref, -1);
3854
+ rb_define_method(rb_cArray, "slice!", rb_ary_slice_bang, -1);
3855
+
3856
+ rb_define_method(rb_cArray, "assoc", rb_ary_assoc, 1);
3857
+ rb_define_method(rb_cArray, "rassoc", rb_ary_rassoc, 1);
3858
+
3859
+ rb_define_method(rb_cArray, "+", rb_ary_plus, 1);
3860
+ rb_define_method(rb_cArray, "*", rb_ary_times, 1);
3861
+
3862
+ rb_define_method(rb_cArray, "-", rb_ary_diff, 1);
3863
+ rb_define_method(rb_cArray, "&", rb_ary_and, 1);
3864
+ rb_define_method(rb_cArray, "|", rb_ary_or, 1);
3865
+
3866
+ rb_define_method(rb_cArray, "uniq", rb_ary_uniq, 0);
3867
+ rb_define_method(rb_cArray, "uniq!", rb_ary_uniq_bang, 0);
3868
+ rb_define_method(rb_cArray, "compact", rb_ary_compact, 0);
3869
+ rb_define_method(rb_cArray, "compact!", rb_ary_compact_bang, 0);
3870
+ rb_define_method(rb_cArray, "flatten", rb_ary_flatten, -1);
3871
+ rb_define_method(rb_cArray, "flatten!", rb_ary_flatten_bang, -1);
3872
+ rb_define_method(rb_cArray, "count", rb_ary_count, -1);
3873
+ rb_define_method(rb_cArray, "shuffle!", rb_ary_shuffle_bang, 0);
3874
+ rb_define_method(rb_cArray, "shuffle", rb_ary_shuffle, 0);
3875
+ rb_define_method(rb_cArray, "sample", rb_ary_sample, -1);
3876
+ rb_define_method(rb_cArray, "cycle", rb_ary_cycle, -1);
3877
+ rb_define_method(rb_cArray, "permutation", rb_ary_permutation, -1);
3878
+ rb_define_method(rb_cArray, "combination", rb_ary_combination, 1);
3879
+ rb_define_method(rb_cArray, "product", rb_ary_product, -1);
3880
+
3881
+ rb_define_method(rb_cArray, "take", rb_ary_take, 1);
3882
+ rb_define_method(rb_cArray, "take_while", rb_ary_take_while, 0);
3883
+ rb_define_method(rb_cArray, "drop", rb_ary_drop, 1);
3884
+ rb_define_method(rb_cArray, "drop_while", rb_ary_drop_while, 0);
3885
+
3886
+ id_cmp = rb_intern("<=>");
3887
+ }