allegro_api_client 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (296) hide show
  1. checksums.yaml +7 -0
  2. data/.bundle/config +3 -0
  3. data/Gemfile +3 -0
  4. data/Gemfile.lock +25 -0
  5. data/README.md +19 -0
  6. data/apiclient.gemspec +24 -0
  7. data/gems/ruby/2.1.0/bin/httparty +23 -0
  8. data/gems/ruby/2.1.0/bin/rake +23 -0
  9. data/gems/ruby/2.1.0/build_info/git_repository-0.0.11.info +1 -0
  10. data/gems/ruby/2.1.0/build_info/httparty-0.13.1.info +1 -0
  11. data/gems/ruby/2.1.0/build_info/multi_xml-0.5.5.info +1 -0
  12. data/gems/ruby/2.1.0/build_info/rake-10.3.2.info +1 -0
  13. data/gems/ruby/2.1.0/cache/git_repository-0.0.11.gem +0 -0
  14. data/gems/ruby/2.1.0/cache/httparty-0.13.1.gem +0 -0
  15. data/gems/ruby/2.1.0/cache/multi_xml-0.5.5.gem +0 -0
  16. data/gems/ruby/2.1.0/cache/rake-10.3.2.gem +0 -0
  17. data/gems/ruby/2.1.0/gems/git_repository-0.0.11/lib/git_repository.rb +62 -0
  18. data/gems/ruby/2.1.0/gems/httparty-0.13.1/.gitignore +10 -0
  19. data/gems/ruby/2.1.0/gems/httparty-0.13.1/.travis.yml +7 -0
  20. data/gems/ruby/2.1.0/gems/httparty-0.13.1/Gemfile +14 -0
  21. data/gems/ruby/2.1.0/gems/httparty-0.13.1/Guardfile +16 -0
  22. data/gems/ruby/2.1.0/gems/httparty-0.13.1/History +303 -0
  23. data/gems/ruby/2.1.0/gems/httparty-0.13.1/MIT-LICENSE +20 -0
  24. data/gems/ruby/2.1.0/gems/httparty-0.13.1/README.md +74 -0
  25. data/gems/ruby/2.1.0/gems/httparty-0.13.1/Rakefile +12 -0
  26. data/gems/ruby/2.1.0/gems/httparty-0.13.1/bin/httparty +117 -0
  27. data/gems/ruby/2.1.0/gems/httparty-0.13.1/cucumber.yml +1 -0
  28. data/gems/ruby/2.1.0/gems/httparty-0.13.1/examples/aaws.rb +32 -0
  29. data/gems/ruby/2.1.0/gems/httparty-0.13.1/examples/basic.rb +28 -0
  30. data/gems/ruby/2.1.0/gems/httparty-0.13.1/examples/crack.rb +19 -0
  31. data/gems/ruby/2.1.0/gems/httparty-0.13.1/examples/custom_parsers.rb +67 -0
  32. data/gems/ruby/2.1.0/gems/httparty-0.13.1/examples/delicious.rb +37 -0
  33. data/gems/ruby/2.1.0/gems/httparty-0.13.1/examples/google.rb +16 -0
  34. data/gems/ruby/2.1.0/gems/httparty-0.13.1/examples/headers_and_user_agents.rb +6 -0
  35. data/gems/ruby/2.1.0/gems/httparty-0.13.1/examples/nokogiri_html_parser.rb +22 -0
  36. data/gems/ruby/2.1.0/gems/httparty-0.13.1/examples/rubyurl.rb +14 -0
  37. data/gems/ruby/2.1.0/gems/httparty-0.13.1/examples/stackexchange.rb +24 -0
  38. data/gems/ruby/2.1.0/gems/httparty-0.13.1/examples/tripit_sign_in.rb +33 -0
  39. data/gems/ruby/2.1.0/gems/httparty-0.13.1/examples/twitter.rb +31 -0
  40. data/gems/ruby/2.1.0/gems/httparty-0.13.1/examples/whoismyrep.rb +10 -0
  41. data/gems/ruby/2.1.0/gems/httparty-0.13.1/features/basic_authentication.feature +20 -0
  42. data/gems/ruby/2.1.0/gems/httparty-0.13.1/features/command_line.feature +7 -0
  43. data/gems/ruby/2.1.0/gems/httparty-0.13.1/features/deals_with_http_error_codes.feature +26 -0
  44. data/gems/ruby/2.1.0/gems/httparty-0.13.1/features/digest_authentication.feature +20 -0
  45. data/gems/ruby/2.1.0/gems/httparty-0.13.1/features/handles_compressed_responses.feature +27 -0
  46. data/gems/ruby/2.1.0/gems/httparty-0.13.1/features/handles_multiple_formats.feature +57 -0
  47. data/gems/ruby/2.1.0/gems/httparty-0.13.1/features/steps/env.rb +22 -0
  48. data/gems/ruby/2.1.0/gems/httparty-0.13.1/features/steps/httparty_response_steps.rb +52 -0
  49. data/gems/ruby/2.1.0/gems/httparty-0.13.1/features/steps/httparty_steps.rb +43 -0
  50. data/gems/ruby/2.1.0/gems/httparty-0.13.1/features/steps/mongrel_helper.rb +94 -0
  51. data/gems/ruby/2.1.0/gems/httparty-0.13.1/features/steps/remote_service_steps.rb +74 -0
  52. data/gems/ruby/2.1.0/gems/httparty-0.13.1/features/supports_read_timeout_option.feature +13 -0
  53. data/gems/ruby/2.1.0/gems/httparty-0.13.1/features/supports_redirection.feature +22 -0
  54. data/gems/ruby/2.1.0/gems/httparty-0.13.1/features/supports_timeout_option.feature +13 -0
  55. data/gems/ruby/2.1.0/gems/httparty-0.13.1/httparty.gemspec +26 -0
  56. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty.rb +600 -0
  57. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/connection_adapter.rb +187 -0
  58. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/cookie_hash.rb +22 -0
  59. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/core_extensions.rb +32 -0
  60. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/exceptions.rb +29 -0
  61. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/hash_conversions.rb +51 -0
  62. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/logger/apache_logger.rb +22 -0
  63. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/logger/curl_logger.rb +48 -0
  64. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/logger/logger.rb +18 -0
  65. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/module_inheritable_attributes.rb +56 -0
  66. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/net_digest_auth.rb +84 -0
  67. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/parser.rb +141 -0
  68. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/request.rb +331 -0
  69. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/response.rb +72 -0
  70. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/response/headers.rb +31 -0
  71. data/gems/ruby/2.1.0/gems/httparty-0.13.1/lib/httparty/version.rb +3 -0
  72. data/gems/ruby/2.1.0/gems/httparty-0.13.1/script/release +42 -0
  73. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/delicious.xml +23 -0
  74. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/empty.xml +0 -0
  75. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/google.html +3 -0
  76. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/ssl/generate.sh +29 -0
  77. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/ssl/generated/1fe462c2.0 +16 -0
  78. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/ssl/generated/bogushost.crt +13 -0
  79. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/ssl/generated/ca.crt +16 -0
  80. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/ssl/generated/ca.key +15 -0
  81. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/ssl/generated/selfsigned.crt +14 -0
  82. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/ssl/generated/server.crt +13 -0
  83. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/ssl/generated/server.key +15 -0
  84. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/ssl/openssl-exts.cnf +9 -0
  85. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/twitter.csv +2 -0
  86. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/twitter.json +1 -0
  87. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/twitter.xml +403 -0
  88. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/fixtures/undefined_method_add_node_for_nil.xml +2 -0
  89. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/httparty/connection_adapter_spec.rb +354 -0
  90. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/httparty/cookie_hash_spec.rb +83 -0
  91. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/httparty/exception_spec.rb +23 -0
  92. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/httparty/logger/apache_logger_spec.rb +26 -0
  93. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/httparty/logger/curl_logger_spec.rb +18 -0
  94. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/httparty/logger/logger_spec.rb +22 -0
  95. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/httparty/net_digest_auth_spec.rb +152 -0
  96. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/httparty/parser_spec.rb +165 -0
  97. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/httparty/request_spec.rb +638 -0
  98. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/httparty/response_spec.rb +221 -0
  99. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/httparty/ssl_spec.rb +74 -0
  100. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/httparty_spec.rb +764 -0
  101. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/spec.opts +2 -0
  102. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/spec_helper.rb +37 -0
  103. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/support/ssl_test_helper.rb +47 -0
  104. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/support/ssl_test_server.rb +80 -0
  105. data/gems/ruby/2.1.0/gems/httparty-0.13.1/spec/support/stub_response.rb +43 -0
  106. data/gems/ruby/2.1.0/gems/httparty-0.13.1/website/css/common.css +47 -0
  107. data/gems/ruby/2.1.0/gems/httparty-0.13.1/website/index.html +73 -0
  108. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/.yardopts +8 -0
  109. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/CHANGELOG.md +93 -0
  110. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/CONTRIBUTING.md +49 -0
  111. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/LICENSE.md +20 -0
  112. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/README.md +97 -0
  113. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/Rakefile +21 -0
  114. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml.rb +296 -0
  115. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/libxml.rb +30 -0
  116. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/libxml2_parser.rb +74 -0
  117. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb +32 -0
  118. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/ox.rb +97 -0
  119. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/parsers/rexml.rb +113 -0
  120. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/lib/multi_xml/version.rb +3 -0
  121. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/multi_xml.gemspec +24 -0
  122. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/spec/helper.rb +17 -0
  123. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/spec/multi_xml_spec.rb +43 -0
  124. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/spec/parser_shared_example.rb +694 -0
  125. data/gems/ruby/2.1.0/gems/multi_xml-0.5.5/spec/speed.rb +63 -0
  126. data/gems/ruby/2.1.0/gems/rake-10.3.2/.autotest +7 -0
  127. data/gems/ruby/2.1.0/gems/rake-10.3.2/.gemtest +0 -0
  128. data/gems/ruby/2.1.0/gems/rake-10.3.2/.rubocop.yml +27 -0
  129. data/gems/ruby/2.1.0/gems/rake-10.3.2/.togglerc +7 -0
  130. data/gems/ruby/2.1.0/gems/rake-10.3.2/CONTRIBUTING.rdoc +34 -0
  131. data/gems/ruby/2.1.0/gems/rake-10.3.2/History.rdoc +609 -0
  132. data/gems/ruby/2.1.0/gems/rake-10.3.2/MIT-LICENSE +21 -0
  133. data/gems/ruby/2.1.0/gems/rake-10.3.2/Manifest.txt +162 -0
  134. data/gems/ruby/2.1.0/gems/rake-10.3.2/README.rdoc +137 -0
  135. data/gems/ruby/2.1.0/gems/rake-10.3.2/Rakefile +81 -0
  136. data/gems/ruby/2.1.0/gems/rake-10.3.2/bin/rake +33 -0
  137. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/command_line_usage.rdoc +158 -0
  138. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/example/Rakefile1 +38 -0
  139. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/example/Rakefile2 +35 -0
  140. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/example/a.c +6 -0
  141. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/example/b.c +6 -0
  142. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/example/main.c +11 -0
  143. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/glossary.rdoc +43 -0
  144. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/jamis.rb +591 -0
  145. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/proto_rake.rdoc +127 -0
  146. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/rake.1.gz +0 -0
  147. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/rakefile.rdoc +653 -0
  148. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/rational.rdoc +151 -0
  149. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.4.14.rdoc +23 -0
  150. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.4.15.rdoc +35 -0
  151. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.5.0.rdoc +53 -0
  152. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.5.3.rdoc +78 -0
  153. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.5.4.rdoc +46 -0
  154. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.6.0.rdoc +141 -0
  155. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.7.0.rdoc +119 -0
  156. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.7.1.rdoc +59 -0
  157. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.7.2.rdoc +121 -0
  158. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.7.3.rdoc +47 -0
  159. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.8.0.rdoc +114 -0
  160. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.8.2.rdoc +165 -0
  161. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.8.3.rdoc +112 -0
  162. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.8.4.rdoc +147 -0
  163. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.8.5.rdoc +53 -0
  164. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.8.6.rdoc +37 -0
  165. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.8.7.rdoc +55 -0
  166. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.9.0.rdoc +112 -0
  167. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.9.1.rdoc +52 -0
  168. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
  169. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.9.2.rdoc +49 -0
  170. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.9.3.rdoc +102 -0
  171. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.9.4.rdoc +60 -0
  172. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.9.5.rdoc +55 -0
  173. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-0.9.6.rdoc +64 -0
  174. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-10.0.0.rdoc +178 -0
  175. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-10.0.1.rdoc +58 -0
  176. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-10.0.2.rdoc +53 -0
  177. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-10.0.3.rdoc +191 -0
  178. data/gems/ruby/2.1.0/gems/rake-10.3.2/doc/release_notes/rake-10.1.0.rdoc +61 -0
  179. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake.rb +78 -0
  180. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/alt_system.rb +110 -0
  181. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/application.rb +783 -0
  182. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/backtrace.rb +23 -0
  183. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/clean.rb +76 -0
  184. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/cloneable.rb +16 -0
  185. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/contrib/.document +0 -0
  186. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/contrib/compositepublisher.rb +21 -0
  187. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/contrib/ftptools.rb +137 -0
  188. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/contrib/publisher.rb +81 -0
  189. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/contrib/rubyforgepublisher.rb +18 -0
  190. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/contrib/sshpublisher.rb +61 -0
  191. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/contrib/sys.rb +4 -0
  192. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/cpu_counter.rb +109 -0
  193. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/default_loader.rb +14 -0
  194. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/dsl_definition.rb +198 -0
  195. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/early_time.rb +21 -0
  196. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/ext/core.rb +25 -0
  197. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/ext/module.rb +1 -0
  198. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/ext/string.rb +173 -0
  199. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/ext/time.rb +15 -0
  200. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/file_creation_task.rb +24 -0
  201. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/file_list.rb +414 -0
  202. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/file_task.rb +46 -0
  203. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/file_utils.rb +116 -0
  204. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/file_utils_ext.rb +144 -0
  205. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/gempackagetask.rb +4 -0
  206. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/invocation_chain.rb +56 -0
  207. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/invocation_exception_mixin.rb +16 -0
  208. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/linked_list.rb +103 -0
  209. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/loaders/makefile.rb +40 -0
  210. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/multi_task.rb +13 -0
  211. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/name_space.rb +38 -0
  212. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/packagetask.rb +202 -0
  213. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/pathmap.rb +3 -0
  214. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/phony.rb +15 -0
  215. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/private_reader.rb +20 -0
  216. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/promise.rb +99 -0
  217. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/pseudo_status.rb +29 -0
  218. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/rake_module.rb +38 -0
  219. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/rake_test_loader.rb +22 -0
  220. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/rdoctask.rb +4 -0
  221. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/ruby182_test_unit_fix.rb +29 -0
  222. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/rule_recursion_overflow_error.rb +20 -0
  223. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/runtest.rb +27 -0
  224. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/scope.rb +42 -0
  225. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/task.rb +383 -0
  226. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/task_argument_error.rb +7 -0
  227. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/task_arguments.rb +98 -0
  228. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/task_manager.rb +310 -0
  229. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/tasklib.rb +24 -0
  230. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/testtask.rb +212 -0
  231. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/thread_history_display.rb +48 -0
  232. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/thread_pool.rb +164 -0
  233. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/trace_output.rb +22 -0
  234. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/version.rb +7 -0
  235. data/gems/ruby/2.1.0/gems/rake-10.3.2/lib/rake/win32.rb +56 -0
  236. data/gems/ruby/2.1.0/gems/rake-10.3.2/rakelib/publish.rake +20 -0
  237. data/gems/ruby/2.1.0/gems/rake-10.3.2/rakelib/test_times.rake +25 -0
  238. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/file_creation.rb +34 -0
  239. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/helper.rb +127 -0
  240. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/support/rakefile_definitions.rb +478 -0
  241. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/support/ruby_runner.rb +33 -0
  242. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_private_reader.rb +42 -0
  243. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake.rb +40 -0
  244. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_application.rb +641 -0
  245. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_application_options.rb +466 -0
  246. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_backtrace.rb +119 -0
  247. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_clean.rb +55 -0
  248. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_cpu_counter.rb +50 -0
  249. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_definitions.rb +79 -0
  250. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_directory_task.rb +63 -0
  251. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_dsl.rb +40 -0
  252. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_early_time.rb +31 -0
  253. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_extension.rb +59 -0
  254. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_file_creation_task.rb +56 -0
  255. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_file_list.rb +627 -0
  256. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_file_list_path_map.rb +8 -0
  257. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_file_task.rb +186 -0
  258. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_file_utils.rb +309 -0
  259. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_ftp_file.rb +74 -0
  260. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_functional.rb +482 -0
  261. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_invocation_chain.rb +64 -0
  262. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_linked_list.rb +84 -0
  263. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_makefile_loader.rb +46 -0
  264. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_multi_task.rb +58 -0
  265. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_name_space.rb +57 -0
  266. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_package_task.rb +79 -0
  267. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_path_map.rb +168 -0
  268. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_path_map_explode.rb +34 -0
  269. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_path_map_partial.rb +18 -0
  270. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_pseudo_status.rb +21 -0
  271. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_rake_test_loader.rb +20 -0
  272. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_reduce_compat.rb +26 -0
  273. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_require.rb +40 -0
  274. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_rules.rb +388 -0
  275. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_scope.rb +44 -0
  276. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_task.rb +392 -0
  277. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_task_argument_parsing.rb +109 -0
  278. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_task_arguments.rb +127 -0
  279. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_task_lib.rb +9 -0
  280. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_task_manager.rb +178 -0
  281. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_task_manager_argument_resolution.rb +19 -0
  282. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_task_with_arguments.rb +171 -0
  283. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_test_task.rb +141 -0
  284. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_thread_pool.rb +142 -0
  285. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_top_level_functions.rb +71 -0
  286. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_rake_win32.rb +72 -0
  287. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_thread_history_display.rb +101 -0
  288. data/gems/ruby/2.1.0/gems/rake-10.3.2/test/test_trace_output.rb +52 -0
  289. data/gems/ruby/2.1.0/specifications/git_repository-0.0.11.gemspec +16 -0
  290. data/gems/ruby/2.1.0/specifications/httparty-0.13.1.gemspec +36 -0
  291. data/gems/ruby/2.1.0/specifications/multi_xml-0.5.5.gemspec +31 -0
  292. data/gems/ruby/2.1.0/specifications/rake-10.3.2.gemspec +43 -0
  293. data/rakefile.rb +33 -0
  294. data/src/APIClient.rb +23 -0
  295. data/test/test_git_repository_commit.rb +19 -0
  296. metadata +395 -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,653 @@
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
+ === Task Arguments and the Environment
201
+
202
+ Task argument values can also be picked up from the environment. For
203
+ example, if the "release" task expected a parameter named
204
+ "release_version", then either
205
+
206
+ rake release[0.8.2]
207
+
208
+ or
209
+
210
+ RELEASE_VERSION=0.8.2 rake release
211
+
212
+ or, alternatively
213
+
214
+ rake release RELEASE_VERSION=0.8.2
215
+
216
+ will work. Environment variable names must either match the task
217
+ parameter exactly, or match an all-uppercase version of the task
218
+ parameter.
219
+
220
+ *NOTE:* A variable declared within a rake command will
221
+ not persist in the environment:
222
+
223
+ $ export VALUE=old
224
+ $ rake print_value VALUE=new
225
+ new
226
+ $ rake print_value
227
+ old
228
+
229
+ === Tasks that Expect Parameters
230
+
231
+ Parameters are only given to tasks that are setup to expect them. In
232
+ order to handle named parameters, the task declaration syntax for
233
+ tasks has been extended slightly.
234
+
235
+ For example, a task that needs a first name and last name might be
236
+ declared as:
237
+
238
+ task :name, [:first_name, :last_name]
239
+
240
+ The first argument is still the name of the task (:name in this case).
241
+ The next two arguments are the names of the parameters expected by
242
+ :name in an array (:first_name and :last_name in the example).
243
+
244
+ To access the values of the parameters, the block defining the task
245
+ behaviour can now accept a second parameter:
246
+
247
+ task :name, [:first_name, :last_name] do |t, args|
248
+ puts "First name is #{args.first_name}"
249
+ puts "Last name is #{args.last_name}"
250
+ end
251
+
252
+ The first argument of the block "t" is always bound to the current
253
+ task object. The second argument "args" is an open-struct like object
254
+ that allows access to the task arguments. Extra command line
255
+ arguments to a task are ignored. Missing command line arguments are
256
+ picked up from matching environment variables. If there are no
257
+ matching environment variables, they are given the nil value.
258
+
259
+ If you wish to specify default values for the arguments, you can use
260
+ the with_defaults method in the task body. Here is the above example
261
+ where we specify default values for the first and last names:
262
+
263
+ task :name, [:first_name, :last_name] do |t, args|
264
+ args.with_defaults(:first_name => "John", :last_name => "Dough")
265
+ puts "First name is #{args.first_name}"
266
+ puts "Last name is #{args.last_name}"
267
+ end
268
+
269
+ === Tasks that Expect Parameters and Have Prerequisites
270
+
271
+ Tasks that use parameters have a slightly different format for
272
+ prerequisites. Use the arrow notation to indicate the prerequisites
273
+ for tasks with arguments. For example:
274
+
275
+ task :name, [:first_name, :last_name] => [:pre_name] do |t, args|
276
+ args.with_defaults(:first_name => "John", :last_name => "Dough")
277
+ puts "First name is #{args.first_name}"
278
+ puts "Last name is #{args.last_name}"
279
+ end
280
+
281
+ === Tasks that take Variable-length Parameters
282
+
283
+ Tasks that need to handle a list of values as a parameter can use the
284
+ extras method of the args variable. This allows for tasks that can
285
+ loop over a variable number of values, and its compatible with named
286
+ parameters as well:
287
+
288
+ task :email, [:message] do |t, args|
289
+ mail = Mail.new(args.message)
290
+ recipients = args.extras
291
+ recipients.each do |target|
292
+ mail.send_to(target)
293
+ end
294
+ end
295
+
296
+ There is also the convenience method to_a that returns all parameters
297
+ in the sequential order they were given, including those associated
298
+ with named parameters.
299
+
300
+ === Deprecated Task Parameters Format
301
+
302
+ There is an older format for declaring task parameters that omitted
303
+ the task argument array and used the :needs keyword to introduce the
304
+ dependencies. That format is still supported for compatibility, but
305
+ is not recommended for use. The older format may be dropped in future
306
+ versions of rake.
307
+
308
+ == Accessing Task Programmatically
309
+
310
+ Sometimes it is useful to manipulate tasks programmatically in a
311
+ Rakefile. To find a task object use Rake::Task.[].
312
+
313
+ === Programmatic Task Example
314
+
315
+ For example, the following Rakefile defines two tasks. The :doit task
316
+ simply prints a simple "DONE" message. The :dont class will lookup
317
+ the doit class and remove (clear) all of its prerequisites and
318
+ actions.
319
+
320
+ task :doit do
321
+ puts "DONE"
322
+ end
323
+
324
+ task :dont do
325
+ Rake::Task[:doit].clear
326
+ end
327
+
328
+ Running this example:
329
+
330
+ $ rake doit
331
+ (in /Users/jim/working/git/rake/x)
332
+ DONE
333
+ $ rake dont doit
334
+ (in /Users/jim/working/git/rake/x)
335
+ $
336
+
337
+ The ability to programmatically manipulate tasks gives rake very
338
+ powerful meta-programming capabilities w.r.t. task execution, but
339
+ should be used with caution.
340
+
341
+ == Rules
342
+
343
+ When a file is named as a prerequisite, but does not have a file task
344
+ defined for it, Rake will attempt to synthesize a task by looking at a
345
+ list of rules supplied in the Rakefile.
346
+
347
+ Suppose we were trying to invoke task "mycode.o", but no task is
348
+ defined for it. But the rakefile has a rule that look like this ...
349
+
350
+ rule '.o' => ['.c'] do |t|
351
+ sh "cc #{t.source} -c -o #{t.name}"
352
+ end
353
+
354
+ This rule will synthesize any task that ends in ".o". It has a
355
+ prerequisite a source file with an extension of ".c" must exist. If
356
+ Rake is able to find a file named "mycode.c", it will automatically
357
+ create a task that builds "mycode.o" from "mycode.c".
358
+
359
+ If the file "mycode.c" does not exist, rake will attempt
360
+ to recursively synthesize a rule for it.
361
+
362
+ When a task is synthesized from a rule, the +source+ attribute of the
363
+ task is set to the matching source file. This allows us to write
364
+ rules with actions that reference the source file.
365
+
366
+ === Advanced Rules
367
+
368
+ Any regular expression may be used as the rule pattern. Additionally,
369
+ a proc may be used to calculate the name of the source file. This
370
+ allows for complex patterns and sources.
371
+
372
+ The following rule is equivalent to the example above.
373
+
374
+ rule( /\.o$/ => [
375
+ proc {|task_name| task_name.sub(/\.[^.]+$/, '.c') }
376
+ ]) do |t|
377
+ sh "cc #{t.source} -c -o #{t.name}"
378
+ end
379
+
380
+ *NOTE:* Because of a _quirk_ in Ruby syntax, parenthesis are
381
+ required on *rule* when the first argument is a regular expression.
382
+
383
+ The following rule might be used for Java files ...
384
+
385
+ rule '.class' => [
386
+ proc { |tn| tn.sub(/\.class$/, '.java').sub(/^classes\//, 'src/') }
387
+ ] do |t|
388
+ java_compile(t.source, t.name)
389
+ end
390
+
391
+ *NOTE:* +java_compile+ is a hypothetical method that invokes the
392
+ java compiler.
393
+
394
+ == Importing Dependencies
395
+
396
+ Any ruby file (including other rakefiles) can be included with a
397
+ standard Ruby +require+ command. The rules and declarations in the
398
+ required file are just added to the definitions already accumulated.
399
+
400
+ Because the files are loaded _before_ the rake targets are evaluated,
401
+ the loaded files must be "ready to go" when the rake command is
402
+ invoked. This makes generated dependency files difficult to use. By
403
+ the time rake gets around to updating the dependencies file, it is too
404
+ late to load it.
405
+
406
+ The +import+ command addresses this by specifying a file to be loaded
407
+ _after_ the main rakefile is loaded, but _before_ any targets on the
408
+ command line are invoked. In addition, if the file name matches an
409
+ explicit task, that task is invoked before loading the file. This
410
+ allows dependency files to be generated and used in a single rake
411
+ command invocation.
412
+
413
+ Example:
414
+
415
+ require 'rake/loaders/makefile'
416
+
417
+ file ".depends.mf" => [SRC_LIST] do |t|
418
+ sh "makedepend -f- -- #{CFLAGS} -- #{t.prerequisites} > #{t.name}"
419
+ end
420
+
421
+ import ".depends.mf"
422
+
423
+ If ".depends" does not exist, or is out of date w.r.t. the source
424
+ files, a new ".depends" file is generated using +makedepend+ before
425
+ loading.
426
+
427
+ == Comments
428
+
429
+ Standard Ruby comments (beginning with "#") can be used anywhere it is
430
+ legal in Ruby source code, including comments for tasks and rules.
431
+ However, if you wish a task to be described using the "-T" switch,
432
+ then you need to use the +desc+ command to describe the task.
433
+
434
+ Example:
435
+
436
+ desc "Create a distribution package"
437
+ task package: %w[ ... ] do ... end
438
+
439
+ The "-T" switch (or "--tasks" if you like to spell things out) will
440
+ display a list of tasks that have a description. If you use +desc+ to
441
+ describe your major tasks, you have a semi-automatic way of generating
442
+ a summary of your Rake file.
443
+
444
+ traken$ rake -T
445
+ (in /home/.../rake)
446
+ rake clean # Remove any temporary products.
447
+ rake clobber # Remove any generated file.
448
+ rake clobber_rdoc # Remove rdoc products
449
+ rake contrib_test # Run tests for contrib_test
450
+ rake default # Default Task
451
+ rake install # Install the application
452
+ rake lines # Count lines in the main rake file
453
+ rake rdoc # Build the rdoc HTML Files
454
+ rake rerdoc # Force a rebuild of the RDOC files
455
+ rake test # Run tests
456
+ rake testall # Run all test targets
457
+
458
+ Only tasks with descriptions will be displayed with the "-T" switch.
459
+ Use "-P" (or "--prereqs") to get a list of all tasks and their
460
+ prerequisites.
461
+
462
+ == Namespaces
463
+
464
+ As projects grow (and along with it, the number of tasks), it is
465
+ common for task names to begin to clash. For example, if you might
466
+ have a main program and a set of sample programs built by a single
467
+ Rakefile. By placing the tasks related to the main program in one
468
+ namespace, and the tasks for building the sample programs in a
469
+ different namespace, the task names will not interfere with each other.
470
+
471
+ For example:
472
+
473
+ namespace "main" do
474
+ task :build do
475
+ # Build the main program
476
+ end
477
+ end
478
+
479
+ namespace "samples" do
480
+ task :build do
481
+ # Build the sample programs
482
+ end
483
+ end
484
+
485
+ task build: %w[main:build samples:build]
486
+
487
+ Referencing a task in a separate namespace can be achieved by
488
+ prefixing the task name with the namespace and a colon
489
+ (e.g. "main:build" refers to the :build task in the +main+ namespace).
490
+ Nested namespaces are supported.
491
+
492
+ Note that the name given in the +task+ command is always the unadorned
493
+ task name without any namespace prefixes. The +task+ command always
494
+ defines a task in the current namespace.
495
+
496
+ === FileTasks
497
+
498
+ File task names are not scoped by the namespace command. Since the
499
+ name of a file task is the name of an actual file in the file system,
500
+ it makes little sense to include file task names in name space.
501
+ Directory tasks (created by the +directory+ command) are a type of
502
+ file task and are also not affected by namespaces.
503
+
504
+ === Name Resolution
505
+
506
+ When looking up a task name, rake will start with the current
507
+ namespace and attempt to find the name there. If it fails to find a
508
+ name in the current namespace, it will search the parent namespaces
509
+ until a match is found (or an error occurs if there is no match).
510
+
511
+ The "rake" namespace is a special implicit namespace that refers to
512
+ the toplevel names.
513
+
514
+ If a task name begins with a "^" character, the name resolution will
515
+ start in the parent namespace. Multiple "^" characters are allowed.
516
+
517
+ Here is an example file with multiple :run tasks and how various names
518
+ resolve in different locations.
519
+
520
+ task :run
521
+
522
+ namespace "one" do
523
+ task :run
524
+
525
+ namespace "two" do
526
+ task :run
527
+
528
+ # :run => "one:two:run"
529
+ # "two:run" => "one:two:run"
530
+ # "one:two:run" => "one:two:run"
531
+ # "one:run" => "one:run"
532
+ # "^run" => "one:run"
533
+ # "^^run" => "rake:run" (the top level task)
534
+ # "rake:run" => "rake:run" (the top level task)
535
+ end
536
+
537
+ # :run => "one:run"
538
+ # "two:run" => "one:two:run"
539
+ # "^run" => "rake:run"
540
+ end
541
+
542
+ # :run => "rake:run"
543
+ # "one:run" => "one:run"
544
+ # "one:two:run" => "one:two:run"
545
+
546
+ == FileLists
547
+
548
+ FileLists are the way Rake manages lists of files. You can treat a
549
+ FileList as an array of strings for the most part, but FileLists
550
+ support some additional operations.
551
+
552
+ === Creating a FileList
553
+
554
+ Creating a file list is easy. Just give it the list of file names:
555
+
556
+ fl = FileList['file1.rb', file2.rb']
557
+
558
+ Or give it a glob pattern:
559
+
560
+ fl = FileList['*.rb']
561
+
562
+ == Odds and Ends
563
+
564
+ === do/end versus { }
565
+
566
+ Blocks may be specified with either a +do+/+end+ pair, or with curly
567
+ braces in Ruby. We _strongly_ recommend using +do+/+end+ to specify the
568
+ actions for tasks and rules. Because the rakefile idiom tends to
569
+ leave off parentheses on the task/file/rule methods, unusual
570
+ ambiguities can arise when using curly braces.
571
+
572
+ For example, suppose that the method +object_files+ returns a list of
573
+ object files in a project. Now we use +object_files+ as the
574
+ prerequisites in a rule specified with actions in curly braces.
575
+
576
+ # DON'T DO THIS!
577
+ file "prog" => object_files {
578
+ # Actions are expected here (but it doesn't work)!
579
+ }
580
+
581
+ Because curly braces have a higher precedence than +do+/+end+, the
582
+ block is associated with the +object_files+ method rather than the
583
+ +file+ method.
584
+
585
+ This is the proper way to specify the task ...
586
+
587
+ # THIS IS FINE
588
+ file "prog" => object_files do
589
+ # Actions go here
590
+ end
591
+
592
+ == Rakefile Path
593
+
594
+ When issuing the +rake+ command in a terminal, Rake will look
595
+ for a Rakefile in the current directory. If a Rakefile is not found,
596
+ it will search parent directories until one is found.
597
+
598
+ For example, if a Rakefile resides in the +project/+ directory,
599
+ moving deeper into the project's directory tree will not have an adverse
600
+ effect on rake tasks:
601
+
602
+ $ pwd
603
+ /home/user/project
604
+
605
+ $ cd lib/foo/bar
606
+ $ pwd
607
+ /home/user/project/lib/foo/bar
608
+
609
+ $ rake run_pwd
610
+ /home/user/project
611
+
612
+ As far as rake is concerned, all tasks are run from the directory in
613
+ which the Rakefile resides.
614
+
615
+ === Multiple Rake Files
616
+
617
+ Not all tasks need to be included in a single Rakefile. Additional
618
+ rake files (with the file extension "+.rake+") may be placed in
619
+ +rakelib+ directory located at the top level of a project (i.e.
620
+ the same directory that contains the main +Rakefile+).
621
+
622
+ Also, rails projects may include additional rake files in the
623
+ +lib/tasks+ directory.
624
+
625
+ === Clean and Clobber Tasks
626
+
627
+ Through <tt>require 'rake/clean'</tt> Rake provides +clean+ and +clobber+
628
+ tasks:
629
+
630
+ +clean+ ::
631
+ Clean up the project by deleting scratch files and backup files. Add files
632
+ to the +CLEAN+ FileList to have the +clean+ target handle them.
633
+
634
+ +clobber+ ::
635
+ Clobber all generated and non-source files in a project. The task depends
636
+ on +clean+, so all the +CLEAN+ files will be deleted as well as files in the
637
+ +CLOBBER+ FileList. The intent of this task is to return a project to its
638
+ pristine, just unpacked state.
639
+
640
+ You can add file names or glob patterns to both the +CLEAN+ and +CLOBBER+
641
+ lists.
642
+
643
+ === Phony Task
644
+
645
+ The phony task can be used as a dependency to allow file-based tasks to use
646
+ non-file-based-tasks as prerequisites without forcing them to rebuild. You
647
+ can <tt>require 'rake/phony'</tt> to add the +phony+ task.
648
+
649
+ ----
650
+
651
+ == See
652
+
653
+ * README.rdoc -- Main documentation for Rake.