mercadopago-custom-checkout 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (308) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +23 -0
  3. data/.gs/bin/rake +23 -0
  4. data/.gs/cache/faraday-0.9.2.gem +0 -0
  5. data/.gs/cache/minitest-5.9.0.gem +0 -0
  6. data/.gs/cache/multi_json-1.12.1.gem +0 -0
  7. data/.gs/cache/multipart-post-2.0.0.gem +0 -0
  8. data/.gs/cache/rake-10.5.0.gem +0 -0
  9. data/.gs/gems/faraday-0.9.2/LICENSE.md +20 -0
  10. data/.gs/gems/faraday-0.9.2/README.md +245 -0
  11. data/.gs/gems/faraday-0.9.2/lib/faraday.rb +268 -0
  12. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter.rb +46 -0
  13. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_http.rb +237 -0
  14. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_http_ssl_patch.rb +56 -0
  15. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_synchrony.rb +100 -0
  16. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_synchrony/parallel_manager.rb +66 -0
  17. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/excon.rb +81 -0
  18. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/httpclient.rb +117 -0
  19. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb +130 -0
  20. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/net_http_persistent.rb +49 -0
  21. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/patron.rb +78 -0
  22. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/rack.rb +58 -0
  23. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/test.rb +162 -0
  24. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/typhoeus.rb +123 -0
  25. data/.gs/gems/faraday-0.9.2/lib/faraday/autoload.rb +84 -0
  26. data/.gs/gems/faraday-0.9.2/lib/faraday/connection.rb +437 -0
  27. data/.gs/gems/faraday-0.9.2/lib/faraday/error.rb +53 -0
  28. data/.gs/gems/faraday-0.9.2/lib/faraday/middleware.rb +37 -0
  29. data/.gs/gems/faraday-0.9.2/lib/faraday/options.rb +359 -0
  30. data/.gs/gems/faraday-0.9.2/lib/faraday/parameters.rb +197 -0
  31. data/.gs/gems/faraday-0.9.2/lib/faraday/rack_builder.rb +213 -0
  32. data/.gs/gems/faraday-0.9.2/lib/faraday/request.rb +92 -0
  33. data/.gs/gems/faraday-0.9.2/lib/faraday/request/authorization.rb +42 -0
  34. data/.gs/gems/faraday-0.9.2/lib/faraday/request/basic_authentication.rb +13 -0
  35. data/.gs/gems/faraday-0.9.2/lib/faraday/request/instrumentation.rb +36 -0
  36. data/.gs/gems/faraday-0.9.2/lib/faraday/request/multipart.rb +63 -0
  37. data/.gs/gems/faraday-0.9.2/lib/faraday/request/retry.rb +154 -0
  38. data/.gs/gems/faraday-0.9.2/lib/faraday/request/token_authentication.rb +15 -0
  39. data/.gs/gems/faraday-0.9.2/lib/faraday/request/url_encoded.rb +36 -0
  40. data/.gs/gems/faraday-0.9.2/lib/faraday/response.rb +93 -0
  41. data/.gs/gems/faraday-0.9.2/lib/faraday/response/logger.rb +59 -0
  42. data/.gs/gems/faraday-0.9.2/lib/faraday/response/raise_error.rb +21 -0
  43. data/.gs/gems/faraday-0.9.2/lib/faraday/upload_io.rb +67 -0
  44. data/.gs/gems/faraday-0.9.2/lib/faraday/utils.rb +309 -0
  45. data/.gs/gems/minitest-5.9.0/.autotest +34 -0
  46. data/.gs/gems/minitest-5.9.0/History.rdoc +1176 -0
  47. data/.gs/gems/minitest-5.9.0/Manifest.txt +26 -0
  48. data/.gs/gems/minitest-5.9.0/README.rdoc +656 -0
  49. data/.gs/gems/minitest-5.9.0/Rakefile +72 -0
  50. data/.gs/gems/minitest-5.9.0/design_rationale.rb +52 -0
  51. data/.gs/gems/minitest-5.9.0/lib/hoe/minitest.rb +26 -0
  52. data/.gs/gems/minitest-5.9.0/lib/minitest.rb +815 -0
  53. data/.gs/gems/minitest-5.9.0/lib/minitest/assertions.rb +674 -0
  54. data/.gs/gems/minitest-5.9.0/lib/minitest/autorun.rb +13 -0
  55. data/.gs/gems/minitest-5.9.0/lib/minitest/benchmark.rb +424 -0
  56. data/.gs/gems/minitest-5.9.0/lib/minitest/expectations.rb +284 -0
  57. data/.gs/gems/minitest-5.9.0/lib/minitest/hell.rb +17 -0
  58. data/.gs/gems/minitest-5.9.0/lib/minitest/mock.rb +232 -0
  59. data/.gs/gems/minitest-5.9.0/lib/minitest/parallel.rb +69 -0
  60. data/.gs/gems/minitest-5.9.0/lib/minitest/pride.rb +4 -0
  61. data/.gs/gems/minitest-5.9.0/lib/minitest/pride_plugin.rb +142 -0
  62. data/.gs/gems/minitest-5.9.0/lib/minitest/spec.rb +331 -0
  63. data/.gs/gems/minitest-5.9.0/lib/minitest/test.rb +284 -0
  64. data/.gs/gems/minitest-5.9.0/lib/minitest/unit.rb +45 -0
  65. data/.gs/gems/minitest-5.9.0/test/minitest/metametameta.rb +90 -0
  66. data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_benchmark.rb +137 -0
  67. data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_mock.rb +512 -0
  68. data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_reporter.rb +281 -0
  69. data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_spec.rb +967 -0
  70. data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_test.rb +1983 -0
  71. data/.gs/gems/multi_json-1.12.1/CHANGELOG.md +245 -0
  72. data/.gs/gems/multi_json-1.12.1/CONTRIBUTING.md +46 -0
  73. data/.gs/gems/multi_json-1.12.1/LICENSE.md +20 -0
  74. data/.gs/gems/multi_json-1.12.1/README.md +121 -0
  75. data/.gs/gems/multi_json-1.12.1/lib/multi_json.rb +161 -0
  76. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapter.rb +49 -0
  77. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapter_error.rb +15 -0
  78. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/gson.rb +20 -0
  79. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/jr_jackson.rb +25 -0
  80. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/json_common.rb +23 -0
  81. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/json_gem.rb +11 -0
  82. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/json_pure.rb +11 -0
  83. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/nsjsonserialization.rb +32 -0
  84. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/oj.rb +25 -0
  85. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/ok_json.rb +23 -0
  86. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/yajl.rb +19 -0
  87. data/.gs/gems/multi_json-1.12.1/lib/multi_json/convertible_hash_keys.rb +43 -0
  88. data/.gs/gems/multi_json-1.12.1/lib/multi_json/options.rb +39 -0
  89. data/.gs/gems/multi_json-1.12.1/lib/multi_json/options_cache.rb +29 -0
  90. data/.gs/gems/multi_json-1.12.1/lib/multi_json/parse_error.rb +17 -0
  91. data/.gs/gems/multi_json-1.12.1/lib/multi_json/vendor/okjson.rb +606 -0
  92. data/.gs/gems/multi_json-1.12.1/lib/multi_json/version.rb +17 -0
  93. data/.gs/gems/multi_json-1.12.1/multi_json.gemspec +20 -0
  94. data/.gs/gems/multipart-post-2.0.0/.gitignore +6 -0
  95. data/.gs/gems/multipart-post-2.0.0/.travis.yml +7 -0
  96. data/.gs/gems/multipart-post-2.0.0/Gemfile +14 -0
  97. data/.gs/gems/multipart-post-2.0.0/History.txt +60 -0
  98. data/.gs/gems/multipart-post-2.0.0/Manifest.txt +9 -0
  99. data/.gs/gems/multipart-post-2.0.0/README.md +77 -0
  100. data/.gs/gems/multipart-post-2.0.0/Rakefile +9 -0
  101. data/.gs/gems/multipart-post-2.0.0/lib/composite_io.rb +108 -0
  102. data/.gs/gems/multipart-post-2.0.0/lib/multipart_post.rb +9 -0
  103. data/.gs/gems/multipart-post-2.0.0/lib/multipartable.rb +29 -0
  104. data/.gs/gems/multipart-post-2.0.0/lib/net/http/post/multipart.rb +27 -0
  105. data/.gs/gems/multipart-post-2.0.0/lib/parts.rb +96 -0
  106. data/.gs/gems/multipart-post-2.0.0/multipart-post.gemspec +22 -0
  107. data/.gs/gems/multipart-post-2.0.0/test/multibyte.txt +1 -0
  108. data/.gs/gems/multipart-post-2.0.0/test/net/http/post/test_multipart.rb +110 -0
  109. data/.gs/gems/multipart-post-2.0.0/test/test_composite_io.rb +115 -0
  110. data/.gs/gems/multipart-post-2.0.0/test/test_parts.rb +86 -0
  111. data/.gs/gems/rake-10.5.0/.autotest +7 -0
  112. data/.gs/gems/rake-10.5.0/.rubocop.yml +27 -0
  113. data/.gs/gems/rake-10.5.0/.togglerc +7 -0
  114. data/.gs/gems/rake-10.5.0/CONTRIBUTING.rdoc +38 -0
  115. data/.gs/gems/rake-10.5.0/History.rdoc +659 -0
  116. data/.gs/gems/rake-10.5.0/MIT-LICENSE +21 -0
  117. data/.gs/gems/rake-10.5.0/Manifest.txt +166 -0
  118. data/.gs/gems/rake-10.5.0/README.rdoc +139 -0
  119. data/.gs/gems/rake-10.5.0/Rakefile +81 -0
  120. data/.gs/gems/rake-10.5.0/bin/rake +33 -0
  121. data/.gs/gems/rake-10.5.0/doc/command_line_usage.rdoc +158 -0
  122. data/.gs/gems/rake-10.5.0/doc/example/Rakefile1 +38 -0
  123. data/.gs/gems/rake-10.5.0/doc/example/Rakefile2 +35 -0
  124. data/.gs/gems/rake-10.5.0/doc/example/a.c +6 -0
  125. data/.gs/gems/rake-10.5.0/doc/example/b.c +6 -0
  126. data/.gs/gems/rake-10.5.0/doc/example/main.c +11 -0
  127. data/.gs/gems/rake-10.5.0/doc/glossary.rdoc +42 -0
  128. data/.gs/gems/rake-10.5.0/doc/jamis.rb +591 -0
  129. data/.gs/gems/rake-10.5.0/doc/proto_rake.rdoc +127 -0
  130. data/.gs/gems/rake-10.5.0/doc/rake.1 +141 -0
  131. data/.gs/gems/rake-10.5.0/doc/rakefile.rdoc +624 -0
  132. data/.gs/gems/rake-10.5.0/doc/rational.rdoc +151 -0
  133. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.4.14.rdoc +23 -0
  134. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.4.15.rdoc +35 -0
  135. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.5.0.rdoc +53 -0
  136. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.5.3.rdoc +78 -0
  137. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.5.4.rdoc +46 -0
  138. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.6.0.rdoc +141 -0
  139. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.0.rdoc +119 -0
  140. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.1.rdoc +59 -0
  141. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.2.rdoc +121 -0
  142. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.3.rdoc +47 -0
  143. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.0.rdoc +114 -0
  144. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.2.rdoc +165 -0
  145. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.3.rdoc +112 -0
  146. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.4.rdoc +147 -0
  147. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.5.rdoc +53 -0
  148. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.6.rdoc +37 -0
  149. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.7.rdoc +55 -0
  150. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.0.rdoc +112 -0
  151. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.1.rdoc +52 -0
  152. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
  153. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.rdoc +49 -0
  154. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.3.rdoc +102 -0
  155. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.4.rdoc +60 -0
  156. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.5.rdoc +55 -0
  157. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.6.rdoc +64 -0
  158. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.0.rdoc +178 -0
  159. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.1.rdoc +58 -0
  160. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.2.rdoc +53 -0
  161. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.3.rdoc +191 -0
  162. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.1.0.rdoc +61 -0
  163. data/.gs/gems/rake-10.5.0/lib/rake.rb +79 -0
  164. data/.gs/gems/rake-10.5.0/lib/rake/alt_system.rb +110 -0
  165. data/.gs/gems/rake-10.5.0/lib/rake/application.rb +790 -0
  166. data/.gs/gems/rake-10.5.0/lib/rake/backtrace.rb +23 -0
  167. data/.gs/gems/rake-10.5.0/lib/rake/clean.rb +76 -0
  168. data/.gs/gems/rake-10.5.0/lib/rake/cloneable.rb +16 -0
  169. data/.gs/gems/rake-10.5.0/lib/rake/contrib/.document +1 -0
  170. data/.gs/gems/rake-10.5.0/lib/rake/contrib/compositepublisher.rb +21 -0
  171. data/.gs/gems/rake-10.5.0/lib/rake/contrib/ftptools.rb +137 -0
  172. data/.gs/gems/rake-10.5.0/lib/rake/contrib/publisher.rb +81 -0
  173. data/.gs/gems/rake-10.5.0/lib/rake/contrib/rubyforgepublisher.rb +18 -0
  174. data/.gs/gems/rake-10.5.0/lib/rake/contrib/sshpublisher.rb +61 -0
  175. data/.gs/gems/rake-10.5.0/lib/rake/contrib/sys.rb +4 -0
  176. data/.gs/gems/rake-10.5.0/lib/rake/cpu_counter.rb +125 -0
  177. data/.gs/gems/rake-10.5.0/lib/rake/default_loader.rb +14 -0
  178. data/.gs/gems/rake-10.5.0/lib/rake/dsl_definition.rb +201 -0
  179. data/.gs/gems/rake-10.5.0/lib/rake/early_time.rb +21 -0
  180. data/.gs/gems/rake-10.5.0/lib/rake/ext/core.rb +25 -0
  181. data/.gs/gems/rake-10.5.0/lib/rake/ext/module.rb +2 -0
  182. data/.gs/gems/rake-10.5.0/lib/rake/ext/pathname.rb +25 -0
  183. data/.gs/gems/rake-10.5.0/lib/rake/ext/string.rb +175 -0
  184. data/.gs/gems/rake-10.5.0/lib/rake/ext/time.rb +18 -0
  185. data/.gs/gems/rake-10.5.0/lib/rake/file_creation_task.rb +24 -0
  186. data/.gs/gems/rake-10.5.0/lib/rake/file_list.rb +428 -0
  187. data/.gs/gems/rake-10.5.0/lib/rake/file_task.rb +46 -0
  188. data/.gs/gems/rake-10.5.0/lib/rake/file_utils.rb +128 -0
  189. data/.gs/gems/rake-10.5.0/lib/rake/file_utils_ext.rb +144 -0
  190. data/.gs/gems/rake-10.5.0/lib/rake/gempackagetask.rb +4 -0
  191. data/.gs/gems/rake-10.5.0/lib/rake/invocation_chain.rb +56 -0
  192. data/.gs/gems/rake-10.5.0/lib/rake/invocation_exception_mixin.rb +16 -0
  193. data/.gs/gems/rake-10.5.0/lib/rake/late_time.rb +17 -0
  194. data/.gs/gems/rake-10.5.0/lib/rake/linked_list.rb +103 -0
  195. data/.gs/gems/rake-10.5.0/lib/rake/loaders/makefile.rb +53 -0
  196. data/.gs/gems/rake-10.5.0/lib/rake/multi_task.rb +13 -0
  197. data/.gs/gems/rake-10.5.0/lib/rake/name_space.rb +38 -0
  198. data/.gs/gems/rake-10.5.0/lib/rake/packagetask.rb +199 -0
  199. data/.gs/gems/rake-10.5.0/lib/rake/pathmap.rb +3 -0
  200. data/.gs/gems/rake-10.5.0/lib/rake/phony.rb +15 -0
  201. data/.gs/gems/rake-10.5.0/lib/rake/private_reader.rb +20 -0
  202. data/.gs/gems/rake-10.5.0/lib/rake/promise.rb +99 -0
  203. data/.gs/gems/rake-10.5.0/lib/rake/pseudo_status.rb +29 -0
  204. data/.gs/gems/rake-10.5.0/lib/rake/rake_module.rb +38 -0
  205. data/.gs/gems/rake-10.5.0/lib/rake/rake_test_loader.rb +22 -0
  206. data/.gs/gems/rake-10.5.0/lib/rake/rdoctask.rb +4 -0
  207. data/.gs/gems/rake-10.5.0/lib/rake/ruby182_test_unit_fix.rb +29 -0
  208. data/.gs/gems/rake-10.5.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
  209. data/.gs/gems/rake-10.5.0/lib/rake/runtest.rb +27 -0
  210. data/.gs/gems/rake-10.5.0/lib/rake/scope.rb +42 -0
  211. data/.gs/gems/rake-10.5.0/lib/rake/task.rb +383 -0
  212. data/.gs/gems/rake-10.5.0/lib/rake/task_argument_error.rb +7 -0
  213. data/.gs/gems/rake-10.5.0/lib/rake/task_arguments.rb +98 -0
  214. data/.gs/gems/rake-10.5.0/lib/rake/task_manager.rb +307 -0
  215. data/.gs/gems/rake-10.5.0/lib/rake/tasklib.rb +24 -0
  216. data/.gs/gems/rake-10.5.0/lib/rake/testtask.rb +213 -0
  217. data/.gs/gems/rake-10.5.0/lib/rake/thread_history_display.rb +48 -0
  218. data/.gs/gems/rake-10.5.0/lib/rake/thread_pool.rb +164 -0
  219. data/.gs/gems/rake-10.5.0/lib/rake/trace_output.rb +22 -0
  220. data/.gs/gems/rake-10.5.0/lib/rake/version.rb +7 -0
  221. data/.gs/gems/rake-10.5.0/lib/rake/win32.rb +56 -0
  222. data/.gs/gems/rake-10.5.0/rakelib/publish.rake +20 -0
  223. data/.gs/gems/rake-10.5.0/rakelib/test_times.rake +25 -0
  224. data/.gs/gems/rake-10.5.0/test/file_creation.rb +34 -0
  225. data/.gs/gems/rake-10.5.0/test/helper.rb +129 -0
  226. data/.gs/gems/rake-10.5.0/test/support/rakefile_definitions.rb +478 -0
  227. data/.gs/gems/rake-10.5.0/test/support/ruby_runner.rb +34 -0
  228. data/.gs/gems/rake-10.5.0/test/test_private_reader.rb +42 -0
  229. data/.gs/gems/rake-10.5.0/test/test_rake.rb +40 -0
  230. data/.gs/gems/rake-10.5.0/test/test_rake_application.rb +643 -0
  231. data/.gs/gems/rake-10.5.0/test/test_rake_application_options.rb +468 -0
  232. data/.gs/gems/rake-10.5.0/test/test_rake_backtrace.rb +119 -0
  233. data/.gs/gems/rake-10.5.0/test/test_rake_clean.rb +61 -0
  234. data/.gs/gems/rake-10.5.0/test/test_rake_cpu_counter.rb +68 -0
  235. data/.gs/gems/rake-10.5.0/test/test_rake_definitions.rb +84 -0
  236. data/.gs/gems/rake-10.5.0/test/test_rake_directory_task.rb +76 -0
  237. data/.gs/gems/rake-10.5.0/test/test_rake_dsl.rb +40 -0
  238. data/.gs/gems/rake-10.5.0/test/test_rake_early_time.rb +31 -0
  239. data/.gs/gems/rake-10.5.0/test/test_rake_extension.rb +59 -0
  240. data/.gs/gems/rake-10.5.0/test/test_rake_file_creation_task.rb +56 -0
  241. data/.gs/gems/rake-10.5.0/test/test_rake_file_list.rb +670 -0
  242. data/.gs/gems/rake-10.5.0/test/test_rake_file_list_path_map.rb +8 -0
  243. data/.gs/gems/rake-10.5.0/test/test_rake_file_task.rb +197 -0
  244. data/.gs/gems/rake-10.5.0/test/test_rake_file_utils.rb +314 -0
  245. data/.gs/gems/rake-10.5.0/test/test_rake_ftp_file.rb +74 -0
  246. data/.gs/gems/rake-10.5.0/test/test_rake_functional.rb +482 -0
  247. data/.gs/gems/rake-10.5.0/test/test_rake_invocation_chain.rb +64 -0
  248. data/.gs/gems/rake-10.5.0/test/test_rake_late_time.rb +18 -0
  249. data/.gs/gems/rake-10.5.0/test/test_rake_linked_list.rb +84 -0
  250. data/.gs/gems/rake-10.5.0/test/test_rake_makefile_loader.rb +46 -0
  251. data/.gs/gems/rake-10.5.0/test/test_rake_multi_task.rb +64 -0
  252. data/.gs/gems/rake-10.5.0/test/test_rake_name_space.rb +57 -0
  253. data/.gs/gems/rake-10.5.0/test/test_rake_package_task.rb +79 -0
  254. data/.gs/gems/rake-10.5.0/test/test_rake_path_map.rb +168 -0
  255. data/.gs/gems/rake-10.5.0/test/test_rake_path_map_explode.rb +34 -0
  256. data/.gs/gems/rake-10.5.0/test/test_rake_path_map_partial.rb +18 -0
  257. data/.gs/gems/rake-10.5.0/test/test_rake_pathname_extensions.rb +15 -0
  258. data/.gs/gems/rake-10.5.0/test/test_rake_pseudo_status.rb +21 -0
  259. data/.gs/gems/rake-10.5.0/test/test_rake_rake_test_loader.rb +20 -0
  260. data/.gs/gems/rake-10.5.0/test/test_rake_reduce_compat.rb +26 -0
  261. data/.gs/gems/rake-10.5.0/test/test_rake_require.rb +40 -0
  262. data/.gs/gems/rake-10.5.0/test/test_rake_rules.rb +388 -0
  263. data/.gs/gems/rake-10.5.0/test/test_rake_scope.rb +44 -0
  264. data/.gs/gems/rake-10.5.0/test/test_rake_task.rb +393 -0
  265. data/.gs/gems/rake-10.5.0/test/test_rake_task_argument_parsing.rb +119 -0
  266. data/.gs/gems/rake-10.5.0/test/test_rake_task_arguments.rb +127 -0
  267. data/.gs/gems/rake-10.5.0/test/test_rake_task_lib.rb +9 -0
  268. data/.gs/gems/rake-10.5.0/test/test_rake_task_manager.rb +178 -0
  269. data/.gs/gems/rake-10.5.0/test/test_rake_task_manager_argument_resolution.rb +19 -0
  270. data/.gs/gems/rake-10.5.0/test/test_rake_task_with_arguments.rb +172 -0
  271. data/.gs/gems/rake-10.5.0/test/test_rake_test_task.rb +146 -0
  272. data/.gs/gems/rake-10.5.0/test/test_rake_thread_pool.rb +145 -0
  273. data/.gs/gems/rake-10.5.0/test/test_rake_top_level_functions.rb +71 -0
  274. data/.gs/gems/rake-10.5.0/test/test_rake_win32.rb +72 -0
  275. data/.gs/gems/rake-10.5.0/test/test_thread_history_display.rb +101 -0
  276. data/.gs/gems/rake-10.5.0/test/test_trace_output.rb +52 -0
  277. data/.gs/specifications/faraday-0.9.2.gemspec +31 -0
  278. data/.gs/specifications/minitest-5.9.0.gemspec +39 -0
  279. data/.gs/specifications/multi_json-1.12.1.gemspec +33 -0
  280. data/.gs/specifications/multipart-post-2.0.0.gemspec +22 -0
  281. data/.gs/specifications/rake-10.5.0.gemspec +43 -0
  282. data/.rubocop.yml +36 -0
  283. data/.ruby-version +1 -0
  284. data/.travis.yml +7 -0
  285. data/CODE_OF_CONDUCT.md +49 -0
  286. data/Gemfile +10 -0
  287. data/LICENSE.txt +21 -0
  288. data/README.md +35 -0
  289. data/Rakefile +38 -0
  290. data/bin/console +14 -0
  291. data/bin/setup +8 -0
  292. data/lib/mercadopago/core/client.rb +70 -0
  293. data/lib/mercadopago/core/endpoints.rb +134 -0
  294. data/lib/mercadopago/core/errors.rb +6 -0
  295. data/lib/mercadopago/core/gateway.rb +84 -0
  296. data/lib/mercadopago/custom_checkout.rb +29 -0
  297. data/lib/mercadopago/custom_checkout/account.rb +162 -0
  298. data/lib/mercadopago/custom_checkout/card_issuer.rb +20 -0
  299. data/lib/mercadopago/custom_checkout/card_token.rb +57 -0
  300. data/lib/mercadopago/custom_checkout/customer.rb +84 -0
  301. data/lib/mercadopago/custom_checkout/errors.rb +6 -0
  302. data/lib/mercadopago/custom_checkout/identification_type.rb +19 -0
  303. data/lib/mercadopago/custom_checkout/payment_method.rb +42 -0
  304. data/lib/mercadopago/custom_checkout/payments.rb +24 -0
  305. data/lib/mercadopago/custom_checkout/resource.rb +14 -0
  306. data/lib/mercadopago/custom_checkout/version.rb +5 -0
  307. data/mercadopago-custom-checkout.gemspec +30 -0
  308. metadata +455 -0
@@ -0,0 +1,127 @@
1
+ = Original Prototype Rake
2
+
3
+ This is the original 100 line prototype rake program.
4
+
5
+ ---
6
+ #!/usr/bin/env ruby
7
+
8
+ require 'ftools'
9
+
10
+ class Task
11
+ TASKS = Hash.new
12
+
13
+ attr_reader :prerequisites
14
+
15
+ def initialize(task_name)
16
+ @name = task_name
17
+ @prerequisites = []
18
+ @actions = []
19
+ end
20
+
21
+ def enhance(deps=nil, &block)
22
+ @prerequisites |= deps if deps
23
+ @actions << block if block_given?
24
+ self
25
+ end
26
+
27
+ def name
28
+ @name.to_s
29
+ end
30
+
31
+ def invoke
32
+ @prerequisites.each { |n| Task[n].invoke }
33
+ execute if needed?
34
+ end
35
+
36
+ def execute
37
+ return if @triggered
38
+ @triggered = true
39
+ @actions.collect { |act| result = act.call(self) }.last
40
+ end
41
+
42
+ def needed?
43
+ true
44
+ end
45
+
46
+ def timestamp
47
+ Time.now
48
+ end
49
+
50
+ class << self
51
+ def [](task_name)
52
+ TASKS[intern(task_name)] or fail "Don't know how to rake #{task_name}"
53
+ end
54
+
55
+ def define_task(args, &block)
56
+ case args
57
+ when Hash
58
+ fail "Too Many Target Names: #{args.keys.join(' ')}" if args.size > 1
59
+ fail "No Task Name Given" if args.size < 1
60
+ task_name = args.keys[0]
61
+ deps = args[task_name]
62
+ else
63
+ task_name = args
64
+ deps = []
65
+ end
66
+ deps = deps.collect {|d| intern(d) }
67
+ get(task_name).enhance(deps, &block)
68
+ end
69
+
70
+ def get(task_name)
71
+ name = intern(task_name)
72
+ TASKS[name] ||= self.new(name)
73
+ end
74
+
75
+ def intern(task_name)
76
+ (Symbol === task_name) ? task_name : task_name.intern
77
+ end
78
+ end
79
+ end
80
+
81
+ class FileTask < Task
82
+ def needed?
83
+ return true unless File.exist?(name)
84
+ latest_prereq = @prerequisites.collect{|n| Task[n].timestamp}.max
85
+ return false if latest_prereq.nil?
86
+ timestamp < latest_prereq
87
+ end
88
+
89
+ def timestamp
90
+ File.new(name.to_s).mtime
91
+ end
92
+ end
93
+
94
+ def task(args, &block)
95
+ Task.define_task(args, &block)
96
+ end
97
+
98
+ def file(args, &block)
99
+ FileTask.define_task(args, &block)
100
+ end
101
+
102
+ def sys(cmd)
103
+ puts cmd
104
+ system(cmd) or fail "Command Failed: [#{cmd}]"
105
+ end
106
+
107
+ def rake
108
+ begin
109
+ here = Dir.pwd
110
+ while ! File.exist?("Rakefile")
111
+ Dir.chdir("..")
112
+ fail "No Rakefile found" if Dir.pwd == here
113
+ here = Dir.pwd
114
+ end
115
+ puts "(in #{Dir.pwd})"
116
+ load "./Rakefile"
117
+ ARGV.push("default") if ARGV.size == 0
118
+ ARGV.each { |task_name| Task[task_name].invoke }
119
+ rescue Exception => ex
120
+ puts "rake aborted ... #{ex.message}"
121
+ puts ex.backtrace.find {|str| str =~ /Rakefile/ } || ""
122
+ end
123
+ end
124
+
125
+ if __FILE__ == $0 then
126
+ rake
127
+ end
@@ -0,0 +1,141 @@
1
+ .\" Hey, EMACS: -*- nroff -*-
2
+ .\" First parameter, NAME, should be all caps
3
+ .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
4
+ .\" other parameters are allowed: see man(7), man(1)
5
+ .TH RAKE 1 "December 3, 2014" "rake 10.4.2" "Rake User Commands"
6
+ .\" Please adjust this date whenever revising the manpage.
7
+ .\"
8
+ .\" Some roff macros, for reference:
9
+ .\" .nh disable hyphenation
10
+ .\" .hy enable hyphenation
11
+ .\" .ad l left justify
12
+ .\" .ad b justify to both left and right margins
13
+ .\" .nf disable filling
14
+ .\" .fi enable filling
15
+ .\" .br insert line break
16
+ .\" .sp <n> insert n+1 empty lines
17
+ .\" for manpage-specific macros, see man(7)
18
+ .SH NAME
19
+ rake \- a make-like build utility for Ruby
20
+ .SH SYNOPSIS
21
+ \fBrake\fR [\fI\-f rakefile\fR] {\fIOPTIONS\fR} \fITARGETS...\fR
22
+ .br
23
+ .SH DESCRIPTION
24
+ .B rake
25
+ is a make-like build utility for Ruby. Tasks and dependencies are specified in
26
+ standard Ruby syntax.
27
+ .SH OPTIONS
28
+ .TP
29
+ \fB\-m\fR, \fB\-\-multitask\fR
30
+ Treat all tasks as multitasks.
31
+ .TP
32
+ \fB\-B\fR, \fB\-\-build\-all\fR
33
+ Build all prerequisites, including those which are up\-to\-date.
34
+
35
+ .TP
36
+ \fB\-j\fR, \fB\-\-jobs\fR [\fINUMBER\fR]
37
+ Specifies the maximum number of tasks to execute in parallel (default is number of CPU cores + 4).
38
+
39
+ .SS Modules
40
+ .TP
41
+ \fB\-I\fR, \fB\-\-libdir\fR \fILIBDIR\fR
42
+ Include \fILIBDIR\fR in the search path for required modules.
43
+ .TP
44
+ \fB\-r\fR, \fB\-\-require\fR \fIMODULE\fR
45
+ Require \fIMODULE\fR before executing rakefile.
46
+
47
+ .SS Rakefile location
48
+ .TP
49
+ \fB\-f\fR, \fB\-\-rakefile\fR [\fIFILENAME\fR]
50
+ Use \fIFILENAME\fR as the rakefile to search for.
51
+ .TP
52
+ \fB\-N\fR, \fB\-\-no\-search\fR, \fB\-\-nosearch\fR
53
+ Do not search parent directories for the Rakefile.
54
+ .TP
55
+ \fB\-G\fR, \fB\-\-no\-system\fR, \fB\-\-nosystem\fR
56
+ Use standard project Rakefile search paths, ignore system wide rakefiles.
57
+ .TP
58
+ \fB\-R\fR, \fB\-\-rakelibdir\fR \fIRAKELIBDIR\fR
59
+ Auto\-import any .rake files in \fIRAKELIBDIR\fR (default is 'rakelib')
60
+ .HP
61
+ \fB\-\-rakelib\fR
62
+ .TP
63
+ \fB\-g\fR, \fB\-\-system\fR
64
+ Using system wide (global) rakefiles (usually '\fI~/.rake/*.rake\fR').
65
+
66
+ .SS Debugging
67
+ .TP
68
+ \fB\-\-backtrace\fR=\fI\,[OUT]\/\fR
69
+ Enable full backtrace. \fIOUT\fR can be stderr (default) or stdout.
70
+ .TP
71
+ \fB\-t\fR, \fB\-\-trace\fR=\fI\,[OUT]\/\fR
72
+ Turn on invoke/execute tracing, enable full backtrace. \fIOUT\fR can be stderr (default) or stdout.
73
+ .TP
74
+ \fB\-\-suppress\-backtrace\fR \fIPATTERN\fR
75
+ Suppress backtrace lines matching regexp \fIPATTERN\fR. Ignored if \fI\-\-trace\fR is on.
76
+ .TP
77
+ \fB\-\-rules\fR
78
+ Trace the rules resolution.
79
+
80
+ .TP
81
+ \fB\-n\fR, \fB\-\-dry\-run\fR
82
+ Do a dry run without executing actions.
83
+ .TP
84
+ \fB\-T\fR, \fB\-\-tasks\fR [\fIPATTERN\fR]
85
+ Display the tasks (matching optional \fIPATTERN\fR) with descriptions, then exit.
86
+ .TP
87
+ \fB\-D\fR, \fB\-\-describe\fR [\fIPATTERN\fR]
88
+ Describe the tasks (matching optional \fIPATTERN\fR), then exit.
89
+ .TP
90
+ \fB\-W\fR, \fB\-\-where\fR [\fIPATTERN\fR]
91
+ Describe the tasks (matching optional \fIPATTERN\fR), then exit.
92
+ .TP
93
+ \fB\-P\fR, \fB\-\-prereqs\fR
94
+ Display the tasks and dependencies, then exit.
95
+
96
+ .TP
97
+ \fB\-e\fR, \fB\-\-execute\fR \fICODE\fR
98
+ Execute some Ruby code and exit.
99
+ .TP
100
+ \fB\-p\fR, \fB\-\-execute\-print\fR \fICODE\fR
101
+ Execute some Ruby code, print the result, then exit.
102
+ .TP
103
+ \fB\-E\fR, \fB\-\-execute\-continue\fR \fICODE\fR
104
+ Execute some Ruby code, then continue with normal task processing.
105
+
106
+ .SS Information
107
+ .TP
108
+ \fB\-v\fR, \fB\-\-verbose\fR
109
+ Log message to standard output.
110
+ .TP
111
+ \fB\-q\fR, \fB\-\-quiet\fR
112
+ Do not log messages to standard output.
113
+ .TP
114
+ \fB\-s\fR, \fB\-\-silent\fR
115
+ Like \fB\-\-quiet\fR, but also suppresses the 'in directory' announcement.
116
+ .TP
117
+ \fB\-X\fR, \fB\-\-no\-deprecation\-warnings\fR
118
+ Disable the deprecation warnings.
119
+ .TP
120
+ \fB\-\-comments\fR
121
+ Show commented tasks only
122
+ .TP
123
+ \fB\-A\fR, \fB\-\-all\fR
124
+ Show all tasks, even uncommented ones (in combination with \fB\-T\fR or \fB\-D\fR)
125
+ .TP
126
+ \fB\-\-job\-stats\fR [\fILEVEL\fR]
127
+ Display job statistics. \fILEVEL=history\fR displays a complete job list
128
+ .TP
129
+ \fB\-V\fR, \fB\-\-version\fR
130
+ Display the program version.
131
+ .TP
132
+ \fB\-h\fR, \fB\-H\fR, \fB\-\-help\fR
133
+ Display a help message.
134
+
135
+ .SH SEE ALSO
136
+ The complete documentation for \fBrake\fR has been installed at \fI/usr/share/doc/rake-doc/html/index.html\fR. It is also available online at \fIhttp://docs.seattlerb.org/rake\fR.
137
+ .SH AUTHOR
138
+ .B rake
139
+ was written by Jim Weirich <jim@weirichhouse.org>
140
+ .PP
141
+ This manual was created by Caitlin Matos <caitlin.matos@zoho.com> for the Debian project (but may be used by others). It was inspired by the manual by Jani Monoses <jani@iv.ro> for the Ubuntu project.
@@ -0,0 +1,624 @@
1
+ = Rakefile Format
2
+
3
+ First of all, there is no special format for a Rakefile. A Rakefile
4
+ contains executable Ruby code. Anything legal in a ruby script is
5
+ allowed in a Rakefile.
6
+
7
+ Now that we understand there is no special syntax in a Rakefile, there
8
+ are some conventions that are used in a Rakefile that are a little
9
+ unusual in a typical Ruby program. Since a Rakefile is tailored to
10
+ specifying tasks and actions, the idioms used in a Rakefile are
11
+ designed to support that.
12
+
13
+ So, what goes into a Rakefile?
14
+
15
+ == Tasks
16
+
17
+ Tasks are the main unit of work in a Rakefile. Tasks have a name
18
+ (usually given as a symbol or a string), a list of prerequisites (more
19
+ symbols or strings) and a list of actions (given as a block).
20
+
21
+ === Simple Tasks
22
+
23
+ A task is declared by using the +task+ method. +task+ takes a single
24
+ parameter that is the name of the task.
25
+
26
+ task :name
27
+
28
+ === Tasks with Prerequisites
29
+
30
+ Any prerequisites are given as a list (enclosed in square brackets)
31
+ following the name and an arrow (=>).
32
+
33
+ task name: [:prereq1, :prereq2]
34
+
35
+ *NOTE:* Although this syntax looks a little funky, it is legal
36
+ Ruby. We are constructing a hash where the key is :name and the value
37
+ for that key is the list of prerequisites. It is equivalent to the
38
+ following ...
39
+
40
+ hash = Hash.new
41
+ hash[:name] = [:prereq1, :prereq2]
42
+ task(hash)
43
+
44
+ You can also use strings for task names and prerequisites, rake doesn't care.
45
+ This is the same task definition:
46
+
47
+ task 'name' => %w[prereq1 prereq2]
48
+
49
+ As is this:
50
+
51
+ task name: %w[prereq1 prereq2]
52
+
53
+ We'll prefer this style for regular tasks with prerequisites throughout the
54
+ rest of the document. Using an array of strings for the prerequisites means
55
+ you will need to make fewer changes if you need to move tasks into namespaces
56
+ or perform other refactorings.
57
+
58
+ === Tasks with Actions
59
+
60
+ Actions are defined by passing a block to the +task+ method. Any Ruby
61
+ code can be placed in the block. The block may reference the task
62
+ object via the block parameter.
63
+
64
+ task name: [:prereq1, :prereq2] do |t|
65
+ # actions (may reference t)
66
+ end
67
+
68
+ === Multiple Definitions
69
+
70
+ A task may be specified more than once. Each specification adds its
71
+ prerequisites and actions to the existing definition. This allows one
72
+ part of a rakefile to specify the actions and a different rakefile
73
+ (perhaps separately generated) to specify the dependencies.
74
+
75
+ For example, the following is equivalent to the single task
76
+ specification given above.
77
+
78
+ task :name
79
+ task name: :prereq1
80
+ task name: %w[prereq2]
81
+ task :name do |t|
82
+ # actions
83
+ end
84
+
85
+ == File Tasks
86
+
87
+ Some tasks are designed to create a file from one or more other files.
88
+ Tasks that generate these files may be skipped if the file already
89
+ exists. File tasks are used to specify file creation tasks.
90
+
91
+ File tasks are declared using the +file+ method (instead of the +task+
92
+ method). In addition, file tasks are usually named with a string
93
+ rather than a symbol.
94
+
95
+ The following file task creates a executable program (named +prog+)
96
+ given two object files named +a.o+ and +b.o+. The tasks
97
+ for creating +a.o+ and +b.o+ are not shown.
98
+
99
+ file "prog" => ["a.o", "b.o"] do |t|
100
+ sh "cc -o #{t.name} #{t.prerequisites.join(' ')}"
101
+ end
102
+
103
+ == Directory Tasks
104
+
105
+ It is common to need to create directories upon demand. The
106
+ +directory+ convenience method is a short-hand for creating a FileTask
107
+ that creates the directory. For example, the following declaration
108
+ ...
109
+
110
+ directory "testdata/examples/doc"
111
+
112
+ is equivalent to ...
113
+
114
+ file "testdata" do |t| mkdir t.name end
115
+ file "testdata/examples" => ["testdata"] do |t| mkdir t.name end
116
+ file "testdata/examples/doc" => ["testdata/examples"] do |t| mkdir t.name end
117
+
118
+ The +directory+ method does not accept prerequisites or actions, but
119
+ both prerequisites and actions can be added later. For example ...
120
+
121
+ directory "testdata"
122
+ file "testdata" => ["otherdata"]
123
+ file "testdata" do
124
+ cp Dir["standard_data/*.data"], "testdata"
125
+ end
126
+
127
+ == Tasks with Parallel Prerequisites
128
+
129
+ Rake allows parallel execution of prerequisites using the following syntax:
130
+
131
+ multitask copy_files: %w[copy_src copy_doc copy_bin] do
132
+ puts "All Copies Complete"
133
+ end
134
+
135
+ In this example, +copy_files+ is a normal rake task. Its actions are
136
+ executed whenever all of its prerequisites are done. The big
137
+ difference is that the prerequisites (+copy_src+, +copy_bin+ and
138
+ +copy_doc+) are executed in parallel. Each of the prerequisites are
139
+ run in their own Ruby thread, possibly allowing faster overall runtime.
140
+
141
+ === Secondary Prerequisites
142
+
143
+ If any of the primary prerequisites of a multitask have common secondary
144
+ prerequisites, all of the primary/parallel prerequisites will wait
145
+ until the common prerequisites have been run.
146
+
147
+ For example, if the <tt>copy_<em>xxx</em></tt> tasks have the
148
+ following prerequisites:
149
+
150
+ task copy_src: :prep_for_copy
151
+ task copy_bin: :prep_for_copy
152
+ task copy_doc: :prep_for_copy
153
+
154
+ Then the +prep_for_copy+ task is run before starting all the copies in
155
+ parallel. Once +prep_for_copy+ is complete, +copy_src+, +copy_bin+,
156
+ and +copy_doc+ are all run in parallel. Note that +prep_for_copy+ is
157
+ run only once, even though it is referenced in multiple threads.
158
+
159
+ === Thread Safety
160
+
161
+ The Rake internal data structures are thread-safe with respect
162
+ to the multitask parallel execution, so there is no need for the user
163
+ to do extra synchronization for Rake's benefit. However, if there are
164
+ user data structures shared between the parallel prerequisites, the
165
+ user must do whatever is necessary to prevent race conditions.
166
+
167
+ == Tasks with Arguments
168
+
169
+ Prior to version 0.8.0, rake was only able to handle command line
170
+ arguments of the form NAME=VALUE that were passed into Rake via the
171
+ ENV hash. Many folks had asked for some kind of simple command line
172
+ arguments, perhaps using "--" to separate regular task names from
173
+ argument values on the command line. The problem is that there was no
174
+ easy way to associate positional arguments on the command line with
175
+ different tasks. Suppose both tasks :a and :b expect a command line
176
+ argument: does the first value go with :a? What if :b is run first?
177
+ Should it then get the first command line argument.
178
+
179
+ Rake 0.8.0 solves this problem by explicitly passing values directly
180
+ to the tasks that need them. For example, if I had a release task
181
+ that required a version number, I could say:
182
+
183
+ rake release[0.8.2]
184
+
185
+ And the string "0.8.2" will be passed to the :release task. Multiple
186
+ arguments can be passed by separating them with a comma, for example:
187
+
188
+ rake name[john,doe]
189
+
190
+ Just a few words of caution. The rake task name and its arguments
191
+ need to be a single command line argument to rake. This generally
192
+ means no spaces. If spaces are needed, then the entire name +
193
+ argument string should be quoted. Something like this:
194
+
195
+ rake "name[billy bob, smith]"
196
+
197
+ (Quoting rules vary between operating systems and shells, so make sure
198
+ you consult the proper docs for your OS/shell).
199
+
200
+ === Tasks that Expect Parameters
201
+
202
+ Parameters are only given to tasks that are setup to expect them. In
203
+ order to handle named parameters, the task declaration syntax for
204
+ tasks has been extended slightly.
205
+
206
+ For example, a task that needs a first name and last name might be
207
+ declared as:
208
+
209
+ task :name, [:first_name, :last_name]
210
+
211
+ The first argument is still the name of the task (:name in this case).
212
+ The next two arguments are the names of the parameters expected by
213
+ :name in an array (:first_name and :last_name in the example).
214
+
215
+ To access the values of the parameters, the block defining the task
216
+ behaviour can now accept a second parameter:
217
+
218
+ task :name, [:first_name, :last_name] do |t, args|
219
+ puts "First name is #{args.first_name}"
220
+ puts "Last name is #{args.last_name}"
221
+ end
222
+
223
+ The first argument of the block "t" is always bound to the current
224
+ task object. The second argument "args" is an open-struct like object
225
+ that allows access to the task arguments. Extra command line
226
+ arguments to a task are ignored. Missing command line arguments are
227
+ picked up from matching environment variables. If there are no
228
+ matching environment variables, they are given the nil value.
229
+
230
+ If you wish to specify default values for the arguments, you can use
231
+ the with_defaults method in the task body. Here is the above example
232
+ where we specify default values for the first and last names:
233
+
234
+ task :name, [:first_name, :last_name] do |t, args|
235
+ args.with_defaults(:first_name => "John", :last_name => "Dough")
236
+ puts "First name is #{args.first_name}"
237
+ puts "Last name is #{args.last_name}"
238
+ end
239
+
240
+ === Tasks that Expect Parameters and Have Prerequisites
241
+
242
+ Tasks that use parameters have a slightly different format for
243
+ prerequisites. Use the arrow notation to indicate the prerequisites
244
+ for tasks with arguments. For example:
245
+
246
+ task :name, [:first_name, :last_name] => [:pre_name] do |t, args|
247
+ args.with_defaults(:first_name => "John", :last_name => "Dough")
248
+ puts "First name is #{args.first_name}"
249
+ puts "Last name is #{args.last_name}"
250
+ end
251
+
252
+ === Tasks that take Variable-length Parameters
253
+
254
+ Tasks that need to handle a list of values as a parameter can use the
255
+ extras method of the args variable. This allows for tasks that can
256
+ loop over a variable number of values, and its compatible with named
257
+ parameters as well:
258
+
259
+ task :email, [:message] do |t, args|
260
+ mail = Mail.new(args.message)
261
+ recipients = args.extras
262
+ recipients.each do |target|
263
+ mail.send_to(target)
264
+ end
265
+ end
266
+
267
+ There is also the convenience method to_a that returns all parameters
268
+ in the sequential order they were given, including those associated
269
+ with named parameters.
270
+
271
+ === Deprecated Task Parameters Format
272
+
273
+ There is an older format for declaring task parameters that omitted
274
+ the task argument array and used the :needs keyword to introduce the
275
+ dependencies. That format is still supported for compatibility, but
276
+ is not recommended for use. The older format may be dropped in future
277
+ versions of rake.
278
+
279
+ == Accessing Task Programmatically
280
+
281
+ Sometimes it is useful to manipulate tasks programmatically in a
282
+ Rakefile. To find a task object use Rake::Task.[].
283
+
284
+ === Programmatic Task Example
285
+
286
+ For example, the following Rakefile defines two tasks. The :doit task
287
+ simply prints a simple "DONE" message. The :dont class will lookup
288
+ the doit class and remove (clear) all of its prerequisites and
289
+ actions.
290
+
291
+ task :doit do
292
+ puts "DONE"
293
+ end
294
+
295
+ task :dont do
296
+ Rake::Task[:doit].clear
297
+ end
298
+
299
+ Running this example:
300
+
301
+ $ rake doit
302
+ (in /Users/jim/working/git/rake/x)
303
+ DONE
304
+ $ rake dont doit
305
+ (in /Users/jim/working/git/rake/x)
306
+ $
307
+
308
+ The ability to programmatically manipulate tasks gives rake very
309
+ powerful meta-programming capabilities w.r.t. task execution, but
310
+ should be used with caution.
311
+
312
+ == Rules
313
+
314
+ When a file is named as a prerequisite, but does not have a file task
315
+ defined for it, Rake will attempt to synthesize a task by looking at a
316
+ list of rules supplied in the Rakefile.
317
+
318
+ Suppose we were trying to invoke task "mycode.o", but no task is
319
+ defined for it. But the rakefile has a rule that look like this ...
320
+
321
+ rule '.o' => ['.c'] do |t|
322
+ sh "cc #{t.source} -c -o #{t.name}"
323
+ end
324
+
325
+ This rule will synthesize any task that ends in ".o". It has a
326
+ prerequisite a source file with an extension of ".c" must exist. If
327
+ Rake is able to find a file named "mycode.c", it will automatically
328
+ create a task that builds "mycode.o" from "mycode.c".
329
+
330
+ If the file "mycode.c" does not exist, rake will attempt
331
+ to recursively synthesize a rule for it.
332
+
333
+ When a task is synthesized from a rule, the +source+ attribute of the
334
+ task is set to the matching source file. This allows us to write
335
+ rules with actions that reference the source file.
336
+
337
+ === Advanced Rules
338
+
339
+ Any regular expression may be used as the rule pattern. Additionally,
340
+ a proc may be used to calculate the name of the source file. This
341
+ allows for complex patterns and sources.
342
+
343
+ The following rule is equivalent to the example above.
344
+
345
+ rule( /\.o$/ => [
346
+ proc {|task_name| task_name.sub(/\.[^.]+$/, '.c') }
347
+ ]) do |t|
348
+ sh "cc #{t.source} -c -o #{t.name}"
349
+ end
350
+
351
+ *NOTE:* Because of a _quirk_ in Ruby syntax, parenthesis are
352
+ required on *rule* when the first argument is a regular expression.
353
+
354
+ The following rule might be used for Java files ...
355
+
356
+ rule '.class' => [
357
+ proc { |tn| tn.sub(/\.class$/, '.java').sub(/^classes\//, 'src/') }
358
+ ] do |t|
359
+ java_compile(t.source, t.name)
360
+ end
361
+
362
+ *NOTE:* +java_compile+ is a hypothetical method that invokes the
363
+ java compiler.
364
+
365
+ == Importing Dependencies
366
+
367
+ Any ruby file (including other rakefiles) can be included with a
368
+ standard Ruby +require+ command. The rules and declarations in the
369
+ required file are just added to the definitions already accumulated.
370
+
371
+ Because the files are loaded _before_ the rake targets are evaluated,
372
+ the loaded files must be "ready to go" when the rake command is
373
+ invoked. This makes generated dependency files difficult to use. By
374
+ the time rake gets around to updating the dependencies file, it is too
375
+ late to load it.
376
+
377
+ The +import+ command addresses this by specifying a file to be loaded
378
+ _after_ the main rakefile is loaded, but _before_ any targets on the
379
+ command line are invoked. In addition, if the file name matches an
380
+ explicit task, that task is invoked before loading the file. This
381
+ allows dependency files to be generated and used in a single rake
382
+ command invocation.
383
+
384
+ Example:
385
+
386
+ require 'rake/loaders/makefile'
387
+
388
+ file ".depends.mf" => [SRC_LIST] do |t|
389
+ sh "makedepend -f- -- #{CFLAGS} -- #{t.prerequisites} > #{t.name}"
390
+ end
391
+
392
+ import ".depends.mf"
393
+
394
+ If ".depends" does not exist, or is out of date w.r.t. the source
395
+ files, a new ".depends" file is generated using +makedepend+ before
396
+ loading.
397
+
398
+ == Comments
399
+
400
+ Standard Ruby comments (beginning with "#") can be used anywhere it is
401
+ legal in Ruby source code, including comments for tasks and rules.
402
+ However, if you wish a task to be described using the "-T" switch,
403
+ then you need to use the +desc+ command to describe the task.
404
+
405
+ Example:
406
+
407
+ desc "Create a distribution package"
408
+ task package: %w[ ... ] do ... end
409
+
410
+ The "-T" switch (or "--tasks" if you like to spell things out) will
411
+ display a list of tasks that have a description. If you use +desc+ to
412
+ describe your major tasks, you have a semi-automatic way of generating
413
+ a summary of your Rake file.
414
+
415
+ traken$ rake -T
416
+ (in /home/.../rake)
417
+ rake clean # Remove any temporary products.
418
+ rake clobber # Remove any generated file.
419
+ rake clobber_rdoc # Remove rdoc products
420
+ rake contrib_test # Run tests for contrib_test
421
+ rake default # Default Task
422
+ rake install # Install the application
423
+ rake lines # Count lines in the main rake file
424
+ rake rdoc # Build the rdoc HTML Files
425
+ rake rerdoc # Force a rebuild of the RDOC files
426
+ rake test # Run tests
427
+ rake testall # Run all test targets
428
+
429
+ Only tasks with descriptions will be displayed with the "-T" switch.
430
+ Use "-P" (or "--prereqs") to get a list of all tasks and their
431
+ prerequisites.
432
+
433
+ == Namespaces
434
+
435
+ As projects grow (and along with it, the number of tasks), it is
436
+ common for task names to begin to clash. For example, if you might
437
+ have a main program and a set of sample programs built by a single
438
+ Rakefile. By placing the tasks related to the main program in one
439
+ namespace, and the tasks for building the sample programs in a
440
+ different namespace, the task names will not interfere with each other.
441
+
442
+ For example:
443
+
444
+ namespace "main" do
445
+ task :build do
446
+ # Build the main program
447
+ end
448
+ end
449
+
450
+ namespace "samples" do
451
+ task :build do
452
+ # Build the sample programs
453
+ end
454
+ end
455
+
456
+ task build: %w[main:build samples:build]
457
+
458
+ Referencing a task in a separate namespace can be achieved by
459
+ prefixing the task name with the namespace and a colon
460
+ (e.g. "main:build" refers to the :build task in the +main+ namespace).
461
+ Nested namespaces are supported.
462
+
463
+ Note that the name given in the +task+ command is always the unadorned
464
+ task name without any namespace prefixes. The +task+ command always
465
+ defines a task in the current namespace.
466
+
467
+ === FileTasks
468
+
469
+ File task names are not scoped by the namespace command. Since the
470
+ name of a file task is the name of an actual file in the file system,
471
+ it makes little sense to include file task names in name space.
472
+ Directory tasks (created by the +directory+ command) are a type of
473
+ file task and are also not affected by namespaces.
474
+
475
+ === Name Resolution
476
+
477
+ When looking up a task name, rake will start with the current
478
+ namespace and attempt to find the name there. If it fails to find a
479
+ name in the current namespace, it will search the parent namespaces
480
+ until a match is found (or an error occurs if there is no match).
481
+
482
+ The "rake" namespace is a special implicit namespace that refers to
483
+ the toplevel names.
484
+
485
+ If a task name begins with a "^" character, the name resolution will
486
+ start in the parent namespace. Multiple "^" characters are allowed.
487
+
488
+ Here is an example file with multiple :run tasks and how various names
489
+ resolve in different locations.
490
+
491
+ task :run
492
+
493
+ namespace "one" do
494
+ task :run
495
+
496
+ namespace "two" do
497
+ task :run
498
+
499
+ # :run => "one:two:run"
500
+ # "two:run" => "one:two:run"
501
+ # "one:two:run" => "one:two:run"
502
+ # "one:run" => "one:run"
503
+ # "^run" => "one:run"
504
+ # "^^run" => "rake:run" (the top level task)
505
+ # "rake:run" => "rake:run" (the top level task)
506
+ end
507
+
508
+ # :run => "one:run"
509
+ # "two:run" => "one:two:run"
510
+ # "^run" => "rake:run"
511
+ end
512
+
513
+ # :run => "rake:run"
514
+ # "one:run" => "one:run"
515
+ # "one:two:run" => "one:two:run"
516
+
517
+ == FileLists
518
+
519
+ FileLists are the way Rake manages lists of files. You can treat a
520
+ FileList as an array of strings for the most part, but FileLists
521
+ support some additional operations.
522
+
523
+ === Creating a FileList
524
+
525
+ Creating a file list is easy. Just give it the list of file names:
526
+
527
+ fl = FileList['file1.rb', file2.rb']
528
+
529
+ Or give it a glob pattern:
530
+
531
+ fl = FileList['*.rb']
532
+
533
+ == Odds and Ends
534
+
535
+ === do/end versus { }
536
+
537
+ Blocks may be specified with either a +do+/+end+ pair, or with curly
538
+ braces in Ruby. We _strongly_ recommend using +do+/+end+ to specify the
539
+ actions for tasks and rules. Because the rakefile idiom tends to
540
+ leave off parentheses on the task/file/rule methods, unusual
541
+ ambiguities can arise when using curly braces.
542
+
543
+ For example, suppose that the method +object_files+ returns a list of
544
+ object files in a project. Now we use +object_files+ as the
545
+ prerequisites in a rule specified with actions in curly braces.
546
+
547
+ # DON'T DO THIS!
548
+ file "prog" => object_files {
549
+ # Actions are expected here (but it doesn't work)!
550
+ }
551
+
552
+ Because curly braces have a higher precedence than +do+/+end+, the
553
+ block is associated with the +object_files+ method rather than the
554
+ +file+ method.
555
+
556
+ This is the proper way to specify the task ...
557
+
558
+ # THIS IS FINE
559
+ file "prog" => object_files do
560
+ # Actions go here
561
+ end
562
+
563
+ == Rakefile Path
564
+
565
+ When issuing the +rake+ command in a terminal, Rake will look
566
+ for a Rakefile in the current directory. If a Rakefile is not found,
567
+ it will search parent directories until one is found.
568
+
569
+ For example, if a Rakefile resides in the +project/+ directory,
570
+ moving deeper into the project's directory tree will not have an adverse
571
+ effect on rake tasks:
572
+
573
+ $ pwd
574
+ /home/user/project
575
+
576
+ $ cd lib/foo/bar
577
+ $ pwd
578
+ /home/user/project/lib/foo/bar
579
+
580
+ $ rake run_pwd
581
+ /home/user/project
582
+
583
+ As far as rake is concerned, all tasks are run from the directory in
584
+ which the Rakefile resides.
585
+
586
+ === Multiple Rake Files
587
+
588
+ Not all tasks need to be included in a single Rakefile. Additional
589
+ rake files (with the file extension "+.rake+") may be placed in
590
+ +rakelib+ directory located at the top level of a project (i.e.
591
+ the same directory that contains the main +Rakefile+).
592
+
593
+ Also, rails projects may include additional rake files in the
594
+ +lib/tasks+ directory.
595
+
596
+ === Clean and Clobber Tasks
597
+
598
+ Through <tt>require 'rake/clean'</tt> Rake provides +clean+ and +clobber+
599
+ tasks:
600
+
601
+ +clean+ ::
602
+ Clean up the project by deleting scratch files and backup files. Add files
603
+ to the +CLEAN+ FileList to have the +clean+ target handle them.
604
+
605
+ +clobber+ ::
606
+ Clobber all generated and non-source files in a project. The task depends
607
+ on +clean+, so all the +CLEAN+ files will be deleted as well as files in the
608
+ +CLOBBER+ FileList. The intent of this task is to return a project to its
609
+ pristine, just unpacked state.
610
+
611
+ You can add file names or glob patterns to both the +CLEAN+ and +CLOBBER+
612
+ lists.
613
+
614
+ === Phony Task
615
+
616
+ The phony task can be used as a dependency to allow file-based tasks to use
617
+ non-file-based-tasks as prerequisites without forcing them to rebuild. You
618
+ can <tt>require 'rake/phony'</tt> to add the +phony+ task.
619
+
620
+ ----
621
+
622
+ == See
623
+
624
+ * README.rdoc -- Main documentation for Rake.