lgrgic_palindrome_detector 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/.travis.yml +7 -0
  4. data/Gemfile +8 -0
  5. data/Gemfile.lock +31 -0
  6. data/README.md +39 -0
  7. data/Rakefile +10 -0
  8. data/bin/console +14 -0
  9. data/bin/setup +8 -0
  10. data/lgrgic_palindrome_detector.gemspec +37 -0
  11. data/lib/lgrgic_palindrome_detector.rb +16 -0
  12. data/lib/lgrgic_palindrome_detector/version.rb +3 -0
  13. data/vendor/cache/ansi-1.5.0.gem +0 -0
  14. data/vendor/cache/bin/rake +27 -0
  15. data/vendor/cache/builder-3.2.3.gem +0 -0
  16. data/vendor/cache/cache/ansi-1.5.0.gem +0 -0
  17. data/vendor/cache/cache/builder-3.2.3.gem +0 -0
  18. data/vendor/cache/cache/minitest-5.11.3.gem +0 -0
  19. data/vendor/cache/cache/minitest-reporters-1.2.0.gem +0 -0
  20. data/vendor/cache/cache/rake-10.5.0.gem +0 -0
  21. data/vendor/cache/cache/ruby-progressbar-1.10.0.gem +0 -0
  22. data/vendor/cache/gems/ansi-1.5.0/.index +77 -0
  23. data/vendor/cache/gems/ansi-1.5.0/.yardopts +8 -0
  24. data/vendor/cache/gems/ansi-1.5.0/DEMO.md +451 -0
  25. data/vendor/cache/gems/ansi-1.5.0/HISTORY.md +217 -0
  26. data/vendor/cache/gems/ansi-1.5.0/LICENSE.txt +23 -0
  27. data/vendor/cache/gems/ansi-1.5.0/NOTICE.md +170 -0
  28. data/vendor/cache/gems/ansi-1.5.0/README.md +91 -0
  29. data/vendor/cache/gems/ansi-1.5.0/demo/01_ansicode.md +65 -0
  30. data/vendor/cache/gems/ansi-1.5.0/demo/02_core.md +11 -0
  31. data/vendor/cache/gems/ansi-1.5.0/demo/03_logger.md +30 -0
  32. data/vendor/cache/gems/ansi-1.5.0/demo/04_progressbar.md +62 -0
  33. data/vendor/cache/gems/ansi-1.5.0/demo/05_mixin.md +37 -0
  34. data/vendor/cache/gems/ansi-1.5.0/demo/06_string.md +56 -0
  35. data/vendor/cache/gems/ansi-1.5.0/demo/07_columns.md +89 -0
  36. data/vendor/cache/gems/ansi-1.5.0/demo/08_table.md +28 -0
  37. data/vendor/cache/gems/ansi-1.5.0/demo/09_diff.md +47 -0
  38. data/vendor/cache/gems/ansi-1.5.0/demo/10_bbcode.md +24 -0
  39. data/vendor/cache/gems/ansi-1.5.0/demo/11_terminal.md +8 -0
  40. data/vendor/cache/gems/ansi-1.5.0/demo/applique/ae.rb +1 -0
  41. data/vendor/cache/gems/ansi-1.5.0/demo/applique/output.rb +5 -0
  42. data/vendor/cache/gems/ansi-1.5.0/lib/ansi.rb +22 -0
  43. data/vendor/cache/gems/ansi-1.5.0/lib/ansi.yml +77 -0
  44. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/bbcode.rb +334 -0
  45. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/chain.rb +50 -0
  46. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/chart.rb +100 -0
  47. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/code.rb +349 -0
  48. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/columns.rb +197 -0
  49. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/constants.rb +25 -0
  50. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/core.rb +30 -0
  51. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/diff.rb +215 -0
  52. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/hexdump.rb +122 -0
  53. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/logger.rb +211 -0
  54. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/mixin.rb +121 -0
  55. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/progressbar.rb +292 -0
  56. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/string.rb +254 -0
  57. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/table.rb +179 -0
  58. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/terminal.rb +44 -0
  59. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/terminal/curses.rb +26 -0
  60. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/terminal/stty.rb +62 -0
  61. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/terminal/termios.rb +68 -0
  62. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/terminal/win32.rb +107 -0
  63. data/vendor/cache/gems/ansi-1.5.0/lib/ansi/version.rb +15 -0
  64. data/vendor/cache/gems/ansi-1.5.0/test/case_ansicode.rb +43 -0
  65. data/vendor/cache/gems/ansi-1.5.0/test/case_bbcode.rb +35 -0
  66. data/vendor/cache/gems/ansi-1.5.0/test/case_mixin.rb +35 -0
  67. data/vendor/cache/gems/ansi-1.5.0/test/case_progressbar.rb +21 -0
  68. data/vendor/cache/gems/ansi-1.5.0/test/test_helper.rb +3 -0
  69. data/vendor/cache/gems/builder-3.2.3/CHANGES +107 -0
  70. data/vendor/cache/gems/builder-3.2.3/MIT-LICENSE +20 -0
  71. data/vendor/cache/gems/builder-3.2.3/README.md +258 -0
  72. data/vendor/cache/gems/builder-3.2.3/Rakefile +195 -0
  73. data/vendor/cache/gems/builder-3.2.3/doc/jamis.rb +591 -0
  74. data/vendor/cache/gems/builder-3.2.3/doc/releases/builder-1.2.4.rdoc +31 -0
  75. data/vendor/cache/gems/builder-3.2.3/doc/releases/builder-2.0.0.rdoc +46 -0
  76. data/vendor/cache/gems/builder-3.2.3/doc/releases/builder-2.1.1.rdoc +58 -0
  77. data/vendor/cache/gems/builder-3.2.3/lib/blankslate.rb +137 -0
  78. data/vendor/cache/gems/builder-3.2.3/lib/builder.rb +13 -0
  79. data/vendor/cache/gems/builder-3.2.3/lib/builder/blankslate.rb +23 -0
  80. data/vendor/cache/gems/builder-3.2.3/lib/builder/version.rb +8 -0
  81. data/vendor/cache/gems/builder-3.2.3/lib/builder/xchar.rb +197 -0
  82. data/vendor/cache/gems/builder-3.2.3/lib/builder/xmlbase.rb +199 -0
  83. data/vendor/cache/gems/builder-3.2.3/lib/builder/xmlevents.rb +63 -0
  84. data/vendor/cache/gems/builder-3.2.3/lib/builder/xmlmarkup.rb +339 -0
  85. data/vendor/cache/gems/builder-3.2.3/rakelib/publish.rake +20 -0
  86. data/vendor/cache/gems/builder-3.2.3/rakelib/tags.rake +62 -0
  87. data/vendor/cache/gems/builder-3.2.3/rakelib/testing.rake +7 -0
  88. data/vendor/cache/gems/builder-3.2.3/test/helper.rb +12 -0
  89. data/vendor/cache/gems/builder-3.2.3/test/performance.rb +41 -0
  90. data/vendor/cache/gems/builder-3.2.3/test/preload.rb +39 -0
  91. data/vendor/cache/gems/builder-3.2.3/test/test_blankslate.rb +213 -0
  92. data/vendor/cache/gems/builder-3.2.3/test/test_eventbuilder.rb +150 -0
  93. data/vendor/cache/gems/builder-3.2.3/test/test_markupbuilder.rb +611 -0
  94. data/vendor/cache/gems/builder-3.2.3/test/test_method_caching.rb +62 -0
  95. data/vendor/cache/gems/builder-3.2.3/test/test_namecollision.rb +39 -0
  96. data/vendor/cache/gems/builder-3.2.3/test/test_xchar.rb +78 -0
  97. data/vendor/cache/gems/minitest-5.11.3/.autotest +34 -0
  98. data/vendor/cache/gems/minitest-5.11.3/History.rdoc +1310 -0
  99. data/vendor/cache/gems/minitest-5.11.3/Manifest.txt +26 -0
  100. data/vendor/cache/gems/minitest-5.11.3/README.rdoc +746 -0
  101. data/vendor/cache/gems/minitest-5.11.3/Rakefile +86 -0
  102. data/vendor/cache/gems/minitest-5.11.3/design_rationale.rb +52 -0
  103. data/vendor/cache/gems/minitest-5.11.3/lib/hoe/minitest.rb +32 -0
  104. data/vendor/cache/gems/minitest-5.11.3/lib/minitest.rb +987 -0
  105. data/vendor/cache/gems/minitest-5.11.3/lib/minitest/assertions.rb +693 -0
  106. data/vendor/cache/gems/minitest-5.11.3/lib/minitest/autorun.rb +13 -0
  107. data/vendor/cache/gems/minitest-5.11.3/lib/minitest/benchmark.rb +455 -0
  108. data/vendor/cache/gems/minitest-5.11.3/lib/minitest/expectations.rb +284 -0
  109. data/vendor/cache/gems/minitest-5.11.3/lib/minitest/hell.rb +11 -0
  110. data/vendor/cache/gems/minitest-5.11.3/lib/minitest/mock.rb +240 -0
  111. data/vendor/cache/gems/minitest-5.11.3/lib/minitest/parallel.rb +70 -0
  112. data/vendor/cache/gems/minitest-5.11.3/lib/minitest/pride.rb +4 -0
  113. data/vendor/cache/gems/minitest-5.11.3/lib/minitest/pride_plugin.rb +142 -0
  114. data/vendor/cache/gems/minitest-5.11.3/lib/minitest/spec.rb +331 -0
  115. data/vendor/cache/gems/minitest-5.11.3/lib/minitest/test.rb +220 -0
  116. data/vendor/cache/gems/minitest-5.11.3/lib/minitest/unit.rb +45 -0
  117. data/vendor/cache/gems/minitest-5.11.3/test/minitest/metametameta.rb +102 -0
  118. data/vendor/cache/gems/minitest-5.11.3/test/minitest/test_minitest_benchmark.rb +137 -0
  119. data/vendor/cache/gems/minitest-5.11.3/test/minitest/test_minitest_mock.rb +874 -0
  120. data/vendor/cache/gems/minitest-5.11.3/test/minitest/test_minitest_reporter.rb +299 -0
  121. data/vendor/cache/gems/minitest-5.11.3/test/minitest/test_minitest_spec.rb +987 -0
  122. data/vendor/cache/gems/minitest-5.11.3/test/minitest/test_minitest_test.rb +2142 -0
  123. data/vendor/cache/gems/minitest-reporters-1.2.0/.gitignore +27 -0
  124. data/vendor/cache/gems/minitest-reporters-1.2.0/.ruby-gemset +1 -0
  125. data/vendor/cache/gems/minitest-reporters-1.2.0/.travis.yml +10 -0
  126. data/vendor/cache/gems/minitest-reporters-1.2.0/.yardopts +6 -0
  127. data/vendor/cache/gems/minitest-reporters-1.2.0/CHANGELOG.md +40 -0
  128. data/vendor/cache/gems/minitest-reporters-1.2.0/Gemfile +2 -0
  129. data/vendor/cache/gems/minitest-reporters-1.2.0/LICENSE +20 -0
  130. data/vendor/cache/gems/minitest-reporters-1.2.0/README.md +115 -0
  131. data/vendor/cache/gems/minitest-reporters-1.2.0/Rakefile +60 -0
  132. data/vendor/cache/gems/minitest-reporters-1.2.0/assets/default-reporter.png +0 -0
  133. data/vendor/cache/gems/minitest-reporters-1.2.0/assets/mean_time_reporter.png +0 -0
  134. data/vendor/cache/gems/minitest-reporters-1.2.0/assets/progress-reporter.png +0 -0
  135. data/vendor/cache/gems/minitest-reporters-1.2.0/assets/spec-reporter.png +0 -0
  136. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/extensible_backtrace_filter.rb +67 -0
  137. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/minitest_reporter_plugin.rb +75 -0
  138. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/old_activesupport_fix.rb +24 -0
  139. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/relative_position.rb +26 -0
  140. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/reporters.rb +89 -0
  141. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/reporters/ansi.rb +31 -0
  142. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/reporters/base_reporter.rb +117 -0
  143. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/reporters/default_reporter.rb +228 -0
  144. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/reporters/html_reporter.rb +221 -0
  145. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/reporters/junit_reporter.rb +157 -0
  146. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/reporters/mean_time_reporter.rb +392 -0
  147. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/reporters/progress_reporter.rb +96 -0
  148. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/reporters/ruby_mate_reporter.rb +54 -0
  149. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/reporters/rubymine_reporter.rb +117 -0
  150. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/reporters/spec_reporter.rb +61 -0
  151. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/reporters/version.rb +5 -0
  152. data/vendor/cache/gems/minitest-reporters-1.2.0/lib/minitest/templates/index.html.erb +83 -0
  153. data/vendor/cache/gems/minitest-reporters-1.2.0/minitest-reporters.gemspec +31 -0
  154. data/vendor/cache/gems/minitest-reporters-1.2.0/test/fixtures/junit_filename_bug_example_test.rb +21 -0
  155. data/vendor/cache/gems/minitest-reporters-1.2.0/test/fixtures/mean_time_test.rb +8 -0
  156. data/vendor/cache/gems/minitest-reporters-1.2.0/test/fixtures/progress_detailed_skip_test.rb +8 -0
  157. data/vendor/cache/gems/minitest-reporters-1.2.0/test/fixtures/progress_test.rb +8 -0
  158. data/vendor/cache/gems/minitest-reporters-1.2.0/test/fixtures/sample_test.rb +15 -0
  159. data/vendor/cache/gems/minitest-reporters-1.2.0/test/fixtures/spec_test.rb +13 -0
  160. data/vendor/cache/gems/minitest-reporters-1.2.0/test/gallery/bad_test.rb +25 -0
  161. data/vendor/cache/gems/minitest-reporters-1.2.0/test/gallery/good_test.rb +14 -0
  162. data/vendor/cache/gems/minitest-reporters-1.2.0/test/integration/reporters/junit_reporter_test.rb +12 -0
  163. data/vendor/cache/gems/minitest-reporters-1.2.0/test/integration/reporters/mean_time_reporter_test.rb +7 -0
  164. data/vendor/cache/gems/minitest-reporters-1.2.0/test/integration/reporters/progress_reporter_test.rb +34 -0
  165. data/vendor/cache/gems/minitest-reporters-1.2.0/test/test_helper.rb +22 -0
  166. data/vendor/cache/gems/minitest-reporters-1.2.0/test/unit/minitest/extensible_backtrace_filter_test.rb +42 -0
  167. data/vendor/cache/gems/minitest-reporters-1.2.0/test/unit/minitest/mean_time_reporter_unit_test.rb +152 -0
  168. data/vendor/cache/gems/minitest-reporters-1.2.0/test/unit/minitest/minitest_reporter_plugin_test.rb +14 -0
  169. data/vendor/cache/gems/minitest-reporters-1.2.0/test/unit/minitest/reporters_test.rb +52 -0
  170. data/vendor/cache/gems/minitest-reporters-1.2.0/test/unit/minitest/spec_reporter_test.rb +41 -0
  171. data/vendor/cache/gems/rake-10.5.0/.autotest +7 -0
  172. data/vendor/cache/gems/rake-10.5.0/.rubocop.yml +27 -0
  173. data/vendor/cache/gems/rake-10.5.0/.togglerc +7 -0
  174. data/vendor/cache/gems/rake-10.5.0/CONTRIBUTING.rdoc +38 -0
  175. data/vendor/cache/gems/rake-10.5.0/History.rdoc +659 -0
  176. data/vendor/cache/gems/rake-10.5.0/MIT-LICENSE +21 -0
  177. data/vendor/cache/gems/rake-10.5.0/Manifest.txt +166 -0
  178. data/vendor/cache/gems/rake-10.5.0/README.rdoc +139 -0
  179. data/vendor/cache/gems/rake-10.5.0/Rakefile +81 -0
  180. data/vendor/cache/gems/rake-10.5.0/bin/rake +33 -0
  181. data/vendor/cache/gems/rake-10.5.0/doc/command_line_usage.rdoc +158 -0
  182. data/vendor/cache/gems/rake-10.5.0/doc/example/Rakefile1 +38 -0
  183. data/vendor/cache/gems/rake-10.5.0/doc/example/Rakefile2 +35 -0
  184. data/vendor/cache/gems/rake-10.5.0/doc/example/a.c +6 -0
  185. data/vendor/cache/gems/rake-10.5.0/doc/example/b.c +6 -0
  186. data/vendor/cache/gems/rake-10.5.0/doc/example/main.c +11 -0
  187. data/vendor/cache/gems/rake-10.5.0/doc/glossary.rdoc +42 -0
  188. data/vendor/cache/gems/rake-10.5.0/doc/jamis.rb +591 -0
  189. data/vendor/cache/gems/rake-10.5.0/doc/proto_rake.rdoc +127 -0
  190. data/vendor/cache/gems/rake-10.5.0/doc/rake.1 +141 -0
  191. data/vendor/cache/gems/rake-10.5.0/doc/rakefile.rdoc +624 -0
  192. data/vendor/cache/gems/rake-10.5.0/doc/rational.rdoc +151 -0
  193. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.4.14.rdoc +23 -0
  194. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.4.15.rdoc +35 -0
  195. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.5.0.rdoc +53 -0
  196. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.5.3.rdoc +78 -0
  197. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.5.4.rdoc +46 -0
  198. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.6.0.rdoc +141 -0
  199. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.7.0.rdoc +119 -0
  200. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.7.1.rdoc +59 -0
  201. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.7.2.rdoc +121 -0
  202. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.7.3.rdoc +47 -0
  203. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.8.0.rdoc +114 -0
  204. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.8.2.rdoc +165 -0
  205. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.8.3.rdoc +112 -0
  206. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.8.4.rdoc +147 -0
  207. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.8.5.rdoc +53 -0
  208. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.8.6.rdoc +37 -0
  209. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.8.7.rdoc +55 -0
  210. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.9.0.rdoc +112 -0
  211. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.9.1.rdoc +52 -0
  212. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
  213. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.rdoc +49 -0
  214. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.9.3.rdoc +102 -0
  215. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.9.4.rdoc +60 -0
  216. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.9.5.rdoc +55 -0
  217. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-0.9.6.rdoc +64 -0
  218. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-10.0.0.rdoc +178 -0
  219. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-10.0.1.rdoc +58 -0
  220. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-10.0.2.rdoc +53 -0
  221. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-10.0.3.rdoc +191 -0
  222. data/vendor/cache/gems/rake-10.5.0/doc/release_notes/rake-10.1.0.rdoc +61 -0
  223. data/vendor/cache/gems/rake-10.5.0/lib/rake.rb +79 -0
  224. data/vendor/cache/gems/rake-10.5.0/lib/rake/alt_system.rb +110 -0
  225. data/vendor/cache/gems/rake-10.5.0/lib/rake/application.rb +790 -0
  226. data/vendor/cache/gems/rake-10.5.0/lib/rake/backtrace.rb +23 -0
  227. data/vendor/cache/gems/rake-10.5.0/lib/rake/clean.rb +76 -0
  228. data/vendor/cache/gems/rake-10.5.0/lib/rake/cloneable.rb +16 -0
  229. data/vendor/cache/gems/rake-10.5.0/lib/rake/contrib/.document +1 -0
  230. data/vendor/cache/gems/rake-10.5.0/lib/rake/contrib/compositepublisher.rb +21 -0
  231. data/vendor/cache/gems/rake-10.5.0/lib/rake/contrib/ftptools.rb +137 -0
  232. data/vendor/cache/gems/rake-10.5.0/lib/rake/contrib/publisher.rb +81 -0
  233. data/vendor/cache/gems/rake-10.5.0/lib/rake/contrib/rubyforgepublisher.rb +18 -0
  234. data/vendor/cache/gems/rake-10.5.0/lib/rake/contrib/sshpublisher.rb +61 -0
  235. data/vendor/cache/gems/rake-10.5.0/lib/rake/contrib/sys.rb +4 -0
  236. data/vendor/cache/gems/rake-10.5.0/lib/rake/cpu_counter.rb +125 -0
  237. data/vendor/cache/gems/rake-10.5.0/lib/rake/default_loader.rb +14 -0
  238. data/vendor/cache/gems/rake-10.5.0/lib/rake/dsl_definition.rb +201 -0
  239. data/vendor/cache/gems/rake-10.5.0/lib/rake/early_time.rb +21 -0
  240. data/vendor/cache/gems/rake-10.5.0/lib/rake/ext/core.rb +25 -0
  241. data/vendor/cache/gems/rake-10.5.0/lib/rake/ext/module.rb +2 -0
  242. data/vendor/cache/gems/rake-10.5.0/lib/rake/ext/pathname.rb +25 -0
  243. data/vendor/cache/gems/rake-10.5.0/lib/rake/ext/string.rb +175 -0
  244. data/vendor/cache/gems/rake-10.5.0/lib/rake/ext/time.rb +18 -0
  245. data/vendor/cache/gems/rake-10.5.0/lib/rake/file_creation_task.rb +24 -0
  246. data/vendor/cache/gems/rake-10.5.0/lib/rake/file_list.rb +428 -0
  247. data/vendor/cache/gems/rake-10.5.0/lib/rake/file_task.rb +46 -0
  248. data/vendor/cache/gems/rake-10.5.0/lib/rake/file_utils.rb +128 -0
  249. data/vendor/cache/gems/rake-10.5.0/lib/rake/file_utils_ext.rb +144 -0
  250. data/vendor/cache/gems/rake-10.5.0/lib/rake/gempackagetask.rb +4 -0
  251. data/vendor/cache/gems/rake-10.5.0/lib/rake/invocation_chain.rb +56 -0
  252. data/vendor/cache/gems/rake-10.5.0/lib/rake/invocation_exception_mixin.rb +16 -0
  253. data/vendor/cache/gems/rake-10.5.0/lib/rake/late_time.rb +17 -0
  254. data/vendor/cache/gems/rake-10.5.0/lib/rake/linked_list.rb +103 -0
  255. data/vendor/cache/gems/rake-10.5.0/lib/rake/loaders/makefile.rb +53 -0
  256. data/vendor/cache/gems/rake-10.5.0/lib/rake/multi_task.rb +13 -0
  257. data/vendor/cache/gems/rake-10.5.0/lib/rake/name_space.rb +38 -0
  258. data/vendor/cache/gems/rake-10.5.0/lib/rake/packagetask.rb +199 -0
  259. data/vendor/cache/gems/rake-10.5.0/lib/rake/pathmap.rb +3 -0
  260. data/vendor/cache/gems/rake-10.5.0/lib/rake/phony.rb +15 -0
  261. data/vendor/cache/gems/rake-10.5.0/lib/rake/private_reader.rb +20 -0
  262. data/vendor/cache/gems/rake-10.5.0/lib/rake/promise.rb +99 -0
  263. data/vendor/cache/gems/rake-10.5.0/lib/rake/pseudo_status.rb +29 -0
  264. data/vendor/cache/gems/rake-10.5.0/lib/rake/rake_module.rb +38 -0
  265. data/vendor/cache/gems/rake-10.5.0/lib/rake/rake_test_loader.rb +22 -0
  266. data/vendor/cache/gems/rake-10.5.0/lib/rake/rdoctask.rb +4 -0
  267. data/vendor/cache/gems/rake-10.5.0/lib/rake/ruby182_test_unit_fix.rb +29 -0
  268. data/vendor/cache/gems/rake-10.5.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
  269. data/vendor/cache/gems/rake-10.5.0/lib/rake/runtest.rb +27 -0
  270. data/vendor/cache/gems/rake-10.5.0/lib/rake/scope.rb +42 -0
  271. data/vendor/cache/gems/rake-10.5.0/lib/rake/task.rb +383 -0
  272. data/vendor/cache/gems/rake-10.5.0/lib/rake/task_argument_error.rb +7 -0
  273. data/vendor/cache/gems/rake-10.5.0/lib/rake/task_arguments.rb +98 -0
  274. data/vendor/cache/gems/rake-10.5.0/lib/rake/task_manager.rb +307 -0
  275. data/vendor/cache/gems/rake-10.5.0/lib/rake/tasklib.rb +24 -0
  276. data/vendor/cache/gems/rake-10.5.0/lib/rake/testtask.rb +213 -0
  277. data/vendor/cache/gems/rake-10.5.0/lib/rake/thread_history_display.rb +48 -0
  278. data/vendor/cache/gems/rake-10.5.0/lib/rake/thread_pool.rb +164 -0
  279. data/vendor/cache/gems/rake-10.5.0/lib/rake/trace_output.rb +22 -0
  280. data/vendor/cache/gems/rake-10.5.0/lib/rake/version.rb +7 -0
  281. data/vendor/cache/gems/rake-10.5.0/lib/rake/win32.rb +56 -0
  282. data/vendor/cache/gems/rake-10.5.0/rakelib/publish.rake +20 -0
  283. data/vendor/cache/gems/rake-10.5.0/rakelib/test_times.rake +25 -0
  284. data/vendor/cache/gems/rake-10.5.0/test/file_creation.rb +34 -0
  285. data/vendor/cache/gems/rake-10.5.0/test/helper.rb +129 -0
  286. data/vendor/cache/gems/rake-10.5.0/test/support/rakefile_definitions.rb +478 -0
  287. data/vendor/cache/gems/rake-10.5.0/test/support/ruby_runner.rb +34 -0
  288. data/vendor/cache/gems/rake-10.5.0/test/test_private_reader.rb +42 -0
  289. data/vendor/cache/gems/rake-10.5.0/test/test_rake.rb +40 -0
  290. data/vendor/cache/gems/rake-10.5.0/test/test_rake_application.rb +643 -0
  291. data/vendor/cache/gems/rake-10.5.0/test/test_rake_application_options.rb +468 -0
  292. data/vendor/cache/gems/rake-10.5.0/test/test_rake_backtrace.rb +119 -0
  293. data/vendor/cache/gems/rake-10.5.0/test/test_rake_clean.rb +61 -0
  294. data/vendor/cache/gems/rake-10.5.0/test/test_rake_cpu_counter.rb +68 -0
  295. data/vendor/cache/gems/rake-10.5.0/test/test_rake_definitions.rb +84 -0
  296. data/vendor/cache/gems/rake-10.5.0/test/test_rake_directory_task.rb +76 -0
  297. data/vendor/cache/gems/rake-10.5.0/test/test_rake_dsl.rb +40 -0
  298. data/vendor/cache/gems/rake-10.5.0/test/test_rake_early_time.rb +31 -0
  299. data/vendor/cache/gems/rake-10.5.0/test/test_rake_extension.rb +59 -0
  300. data/vendor/cache/gems/rake-10.5.0/test/test_rake_file_creation_task.rb +56 -0
  301. data/vendor/cache/gems/rake-10.5.0/test/test_rake_file_list.rb +670 -0
  302. data/vendor/cache/gems/rake-10.5.0/test/test_rake_file_list_path_map.rb +8 -0
  303. data/vendor/cache/gems/rake-10.5.0/test/test_rake_file_task.rb +197 -0
  304. data/vendor/cache/gems/rake-10.5.0/test/test_rake_file_utils.rb +314 -0
  305. data/vendor/cache/gems/rake-10.5.0/test/test_rake_ftp_file.rb +74 -0
  306. data/vendor/cache/gems/rake-10.5.0/test/test_rake_functional.rb +482 -0
  307. data/vendor/cache/gems/rake-10.5.0/test/test_rake_invocation_chain.rb +64 -0
  308. data/vendor/cache/gems/rake-10.5.0/test/test_rake_late_time.rb +18 -0
  309. data/vendor/cache/gems/rake-10.5.0/test/test_rake_linked_list.rb +84 -0
  310. data/vendor/cache/gems/rake-10.5.0/test/test_rake_makefile_loader.rb +46 -0
  311. data/vendor/cache/gems/rake-10.5.0/test/test_rake_multi_task.rb +64 -0
  312. data/vendor/cache/gems/rake-10.5.0/test/test_rake_name_space.rb +57 -0
  313. data/vendor/cache/gems/rake-10.5.0/test/test_rake_package_task.rb +79 -0
  314. data/vendor/cache/gems/rake-10.5.0/test/test_rake_path_map.rb +168 -0
  315. data/vendor/cache/gems/rake-10.5.0/test/test_rake_path_map_explode.rb +34 -0
  316. data/vendor/cache/gems/rake-10.5.0/test/test_rake_path_map_partial.rb +18 -0
  317. data/vendor/cache/gems/rake-10.5.0/test/test_rake_pathname_extensions.rb +15 -0
  318. data/vendor/cache/gems/rake-10.5.0/test/test_rake_pseudo_status.rb +21 -0
  319. data/vendor/cache/gems/rake-10.5.0/test/test_rake_rake_test_loader.rb +20 -0
  320. data/vendor/cache/gems/rake-10.5.0/test/test_rake_reduce_compat.rb +26 -0
  321. data/vendor/cache/gems/rake-10.5.0/test/test_rake_require.rb +40 -0
  322. data/vendor/cache/gems/rake-10.5.0/test/test_rake_rules.rb +388 -0
  323. data/vendor/cache/gems/rake-10.5.0/test/test_rake_scope.rb +44 -0
  324. data/vendor/cache/gems/rake-10.5.0/test/test_rake_task.rb +393 -0
  325. data/vendor/cache/gems/rake-10.5.0/test/test_rake_task_argument_parsing.rb +119 -0
  326. data/vendor/cache/gems/rake-10.5.0/test/test_rake_task_arguments.rb +127 -0
  327. data/vendor/cache/gems/rake-10.5.0/test/test_rake_task_lib.rb +9 -0
  328. data/vendor/cache/gems/rake-10.5.0/test/test_rake_task_manager.rb +178 -0
  329. data/vendor/cache/gems/rake-10.5.0/test/test_rake_task_manager_argument_resolution.rb +19 -0
  330. data/vendor/cache/gems/rake-10.5.0/test/test_rake_task_with_arguments.rb +172 -0
  331. data/vendor/cache/gems/rake-10.5.0/test/test_rake_test_task.rb +146 -0
  332. data/vendor/cache/gems/rake-10.5.0/test/test_rake_thread_pool.rb +145 -0
  333. data/vendor/cache/gems/rake-10.5.0/test/test_rake_top_level_functions.rb +71 -0
  334. data/vendor/cache/gems/rake-10.5.0/test/test_rake_win32.rb +72 -0
  335. data/vendor/cache/gems/rake-10.5.0/test/test_thread_history_display.rb +101 -0
  336. data/vendor/cache/gems/rake-10.5.0/test/test_trace_output.rb +52 -0
  337. data/vendor/cache/gems/ruby-progressbar-1.10.0/LICENSE.txt +19 -0
  338. data/vendor/cache/gems/ruby-progressbar-1.10.0/README.md +38 -0
  339. data/vendor/cache/gems/ruby-progressbar-1.10.0/Rakefile +2 -0
  340. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar.rb +18 -0
  341. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/base.rb +183 -0
  342. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/calculators/length.rb +100 -0
  343. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/calculators/running_average.rb +9 -0
  344. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/components.rb +5 -0
  345. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/components/bar.rb +102 -0
  346. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/components/percentage.rb +29 -0
  347. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/components/rate.rb +43 -0
  348. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/components/time.rb +107 -0
  349. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/components/title.rb +13 -0
  350. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/errors/invalid_progress_error.rb +4 -0
  351. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/format.rb +3 -0
  352. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/format/formatter.rb +27 -0
  353. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/format/molecule.rb +60 -0
  354. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/format/string.rb +36 -0
  355. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/output.rb +68 -0
  356. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/outputs/non_tty.rb +47 -0
  357. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/outputs/null.rb +33 -0
  358. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/outputs/tty.rb +32 -0
  359. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/progress.rb +118 -0
  360. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/refinements.rb +1 -0
  361. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/refinements/enumerator.rb +23 -0
  362. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/throttle.rb +25 -0
  363. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/time.rb +32 -0
  364. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/timer.rb +72 -0
  365. data/vendor/cache/gems/ruby-progressbar-1.10.0/lib/ruby-progressbar/version.rb +3 -0
  366. data/vendor/cache/minitest-5.11.3.gem +0 -0
  367. data/vendor/cache/minitest-reporters-1.2.0.gem +0 -0
  368. data/vendor/cache/rake-10.5.0.gem +0 -0
  369. data/vendor/cache/ruby-progressbar-1.10.0.gem +0 -0
  370. data/vendor/cache/specifications/ansi-1.5.0.gemspec +49 -0
  371. data/vendor/cache/specifications/builder-3.2.3.gemspec +21 -0
  372. data/vendor/cache/specifications/minitest-5.11.3.gemspec +39 -0
  373. data/vendor/cache/specifications/minitest-reporters-1.2.0.gemspec +49 -0
  374. data/vendor/cache/specifications/rake-10.5.0.gemspec +43 -0
  375. data/vendor/cache/specifications/ruby-progressbar-1.10.0.gemspec +46 -0
  376. metadata +460 -0
@@ -0,0 +1,8 @@
1
+ require File.expand_path('../helper', __FILE__)
2
+
3
+ class TestRakeFileListPathMap < Rake::TestCase
4
+ def test_file_list_supports_pathmap
5
+ assert_equal ['a', 'b'], FileList['dir/a.rb', 'dir/b.rb'].pathmap("%n")
6
+ end
7
+ end
8
+
@@ -0,0 +1,197 @@
1
+ require File.expand_path('../helper', __FILE__)
2
+ require 'fileutils'
3
+ require 'pathname'
4
+
5
+ class TestRakeFileTask < Rake::TestCase
6
+ include Rake
7
+
8
+ def setup
9
+ super
10
+
11
+ Task.clear
12
+ @runs = Array.new
13
+ FileUtils.rm_f NEWFILE
14
+ FileUtils.rm_f OLDFILE
15
+ end
16
+
17
+ def test_file_need
18
+ name = "dummy"
19
+ file name
20
+
21
+ ftask = Task[name]
22
+
23
+ assert_equal name.to_s, ftask.name
24
+ File.delete(ftask.name) rescue nil
25
+
26
+ assert ftask.needed?, "file should be needed"
27
+ assert_equal Rake::LATE, ftask.timestamp
28
+
29
+ open(ftask.name, "w") { |f| f.puts "HI" }
30
+
31
+ assert_equal nil, ftask.prerequisites.map { |n| Task[n].timestamp }.max
32
+ assert ! ftask.needed?, "file should not be needed"
33
+ ensure
34
+ File.delete(ftask.name) rescue nil
35
+ end
36
+
37
+ def test_file_times_new_depends_on_old
38
+ create_timed_files(OLDFILE, NEWFILE)
39
+
40
+ t1 = Rake.application.intern(FileTask, NEWFILE).enhance([OLDFILE])
41
+ t2 = Rake.application.intern(FileTask, OLDFILE)
42
+ assert ! t2.needed?, "Should not need to build old file"
43
+ assert ! t1.needed?, "Should not need to rebuild new file because of old"
44
+ end
45
+
46
+ def test_file_times_new_depend_on_regular_task_timestamps
47
+ load_phony
48
+
49
+ name = "dummy"
50
+ task name
51
+
52
+ create_timed_files(NEWFILE)
53
+
54
+ t1 = Rake.application.intern(FileTask, NEWFILE).enhance([name])
55
+
56
+ assert t1.needed?, "depending on non-file task uses Time.now"
57
+
58
+ task(name => :phony)
59
+
60
+ assert t1.needed?, "unless the non-file task has a timestamp"
61
+ end
62
+
63
+ def test_file_times_old_depends_on_new
64
+ create_timed_files(OLDFILE, NEWFILE)
65
+
66
+ t1 = Rake.application.intern(FileTask, OLDFILE).enhance([NEWFILE])
67
+ t2 = Rake.application.intern(FileTask, NEWFILE)
68
+ assert ! t2.needed?, "Should not need to build new file"
69
+ preq_stamp = t1.prerequisites.map { |t| Task[t].timestamp }.max
70
+ assert_equal t2.timestamp, preq_stamp
71
+ assert t1.timestamp < preq_stamp, "T1 should be older"
72
+ assert t1.needed?, "Should need to rebuild old file because of new"
73
+ end
74
+
75
+ def test_file_depends_on_task_depend_on_file
76
+ create_timed_files(OLDFILE, NEWFILE)
77
+
78
+ file NEWFILE => [:obj] do |t| @runs << t.name end
79
+ task :obj => [OLDFILE] do |t| @runs << t.name end
80
+ file OLDFILE do |t| @runs << t.name end
81
+
82
+ Task[:obj].invoke
83
+ Task[NEWFILE].invoke
84
+ assert @runs.include?(NEWFILE)
85
+ end
86
+
87
+ def test_existing_file_depends_on_non_existing_file
88
+ create_file(OLDFILE)
89
+ delete_file(NEWFILE)
90
+ file NEWFILE do |t| @runs << t.name end
91
+ file OLDFILE => NEWFILE do |t| @runs << t.name end
92
+
93
+ Task[OLDFILE].invoke
94
+
95
+ assert_equal [NEWFILE, OLDFILE], @runs
96
+ end
97
+
98
+ def test_needed_eh_build_all
99
+ create_file 'a'
100
+
101
+ file 'a'
102
+
103
+ a_task = Task['a']
104
+
105
+ refute a_task.needed?
106
+
107
+ Rake.application.options.build_all = true
108
+
109
+ assert a_task.needed?
110
+ ensure
111
+ delete_file 'a'
112
+ end
113
+
114
+ def test_needed_eh_dependency
115
+ create_file 'a', Time.now
116
+ create_file 'b', Time.now - 60
117
+
118
+ create_file 'c', Time.now
119
+ create_file 'd', Time.now - 60
120
+
121
+ file 'b' => 'a'
122
+
123
+ b_task = Task['b']
124
+
125
+ assert b_task.needed?
126
+
127
+ file 'c' => 'd'
128
+
129
+ c_task = Task['c']
130
+
131
+ refute c_task.needed?
132
+ ensure
133
+ delete_file 'old'
134
+ delete_file 'new'
135
+ end
136
+
137
+ def test_needed_eh_exists
138
+ name = "dummy"
139
+ file name
140
+
141
+ ftask = Task[name]
142
+
143
+ assert ftask.needed?
144
+
145
+ create_file name
146
+
147
+ refute ftask.needed?
148
+ ensure
149
+ delete_file name
150
+ end
151
+
152
+ def test_source_is_first_prerequisite
153
+ t = file :f => ["preqA", "preqB"]
154
+ assert_equal "preqA", t.source
155
+ end
156
+
157
+ def test_sources_is_all_prerequisites
158
+ t = file :f => ["preqA", "preqB"]
159
+ assert_equal ["preqA", "preqB"], t.sources
160
+ end
161
+
162
+ def test_task_can_be_pathname
163
+ name = "dummy"
164
+ file Pathname.new name
165
+
166
+ ftask = Task[name]
167
+
168
+ assert_equal name.to_s, ftask.name
169
+ end
170
+
171
+ def test_prerequisite_can_be_pathname
172
+ t = file :f => Pathname.new("preq")
173
+ assert_equal "preq", t.source
174
+ end
175
+
176
+ # I have currently disabled this test. I'm not convinced that
177
+ # deleting the file target on failure is always the proper thing to
178
+ # do. I'm willing to hear input on this topic.
179
+ def ztest_file_deletes_on_failure
180
+ task :obj
181
+ file NEWFILE => [:obj] do |t|
182
+ FileUtils.touch NEWFILE
183
+ fail "Ooops"
184
+ end
185
+ assert Task[NEWFILE]
186
+ begin
187
+ Task[NEWFILE].invoke
188
+ rescue Exception
189
+ end
190
+ assert(! File.exist?(NEWFILE), "NEWFILE should be deleted")
191
+ end
192
+
193
+ def load_phony
194
+ load File.join(@rake_lib, "rake/phony.rb")
195
+ end
196
+
197
+ end
@@ -0,0 +1,314 @@
1
+ require File.expand_path('../helper', __FILE__)
2
+ require 'fileutils'
3
+ require 'stringio'
4
+
5
+ class TestRakeFileUtils < Rake::TestCase
6
+ def setup
7
+ super
8
+ @rake_test_sh = ENV['RAKE_TEST_SH']
9
+ end
10
+
11
+ def teardown
12
+ FileUtils::LN_SUPPORTED[0] = true
13
+ RakeFileUtils.verbose_flag = Rake::FileUtilsExt::DEFAULT
14
+ ENV['RAKE_TEST_SH'] = @rake_test_sh
15
+
16
+ super
17
+ end
18
+
19
+ def test_rm_one_file
20
+ create_file("a")
21
+ FileUtils.rm_rf "a"
22
+ refute File.exist?("a")
23
+ end
24
+
25
+ def test_rm_two_files
26
+ create_file("a")
27
+ create_file("b")
28
+ FileUtils.rm_rf ["a", "b"]
29
+ refute File.exist?("a")
30
+ refute File.exist?("b")
31
+ end
32
+
33
+ def test_rm_filelist
34
+ list = Rake::FileList.new << "a" << "b"
35
+ list.each { |fn| create_file(fn) }
36
+ FileUtils.rm_r list
37
+ refute File.exist?("a")
38
+ refute File.exist?("b")
39
+ end
40
+
41
+ def test_ln
42
+ open("a", "w") { |f| f.puts "TEST_LN" }
43
+
44
+ Rake::FileUtilsExt.safe_ln("a", "b", :verbose => false)
45
+
46
+ assert_equal "TEST_LN\n", File.read('b')
47
+ end
48
+
49
+ class BadLink
50
+ include Rake::FileUtilsExt
51
+ attr_reader :cp_args
52
+
53
+ def initialize(klass)
54
+ @failure_class = klass
55
+ end
56
+
57
+ def cp(*args)
58
+ @cp_args = args
59
+ end
60
+
61
+ def ln(*args)
62
+ fail @failure_class, "ln not supported"
63
+ end
64
+
65
+ public :safe_ln
66
+ end
67
+
68
+ def test_safe_ln_failover_to_cp_on_standard_error
69
+ FileUtils::LN_SUPPORTED[0] = true
70
+ c = BadLink.new(StandardError)
71
+ c.safe_ln "a", "b"
72
+ assert_equal ['a', 'b'], c.cp_args
73
+ c.safe_ln "x", "y"
74
+ assert_equal ['x', 'y'], c.cp_args
75
+ end
76
+
77
+ def test_safe_ln_failover_to_cp_on_not_implemented_error
78
+ FileUtils::LN_SUPPORTED[0] = true
79
+ c = BadLink.new(NotImplementedError)
80
+ c.safe_ln "a", "b"
81
+ assert_equal ['a', 'b'], c.cp_args
82
+ end
83
+
84
+ def test_safe_ln_fails_on_script_error
85
+ FileUtils::LN_SUPPORTED[0] = true
86
+ c = BadLink.new(ScriptError)
87
+ assert_raises(ScriptError) do c.safe_ln "a", "b" end
88
+ end
89
+
90
+ def test_verbose
91
+ verbose true
92
+ assert_equal true, verbose
93
+ verbose false
94
+ assert_equal false, verbose
95
+ verbose(true) {
96
+ assert_equal true, verbose
97
+ }
98
+ assert_equal false, verbose
99
+ end
100
+
101
+ def test_nowrite
102
+ nowrite true
103
+ assert_equal true, nowrite
104
+ nowrite false
105
+ assert_equal false, nowrite
106
+ nowrite(true) {
107
+ assert_equal true, nowrite
108
+ }
109
+ assert_equal false, nowrite
110
+ end
111
+
112
+ def test_file_utils_methods_are_available_at_top_level
113
+ create_file("a")
114
+
115
+ capture_io do
116
+ rm_rf "a"
117
+ end
118
+
119
+ refute File.exist?("a")
120
+ end
121
+
122
+ def test_fileutils_methods_dont_leak
123
+ obj = Object.new
124
+ assert_raises(NoMethodError) { obj.copy } # from FileUtils
125
+ assert_raises(NoMethodError) { obj.ruby "-v" } # from RubyFileUtils
126
+ end
127
+
128
+ def test_sh
129
+ shellcommand
130
+
131
+ verbose(false) { sh %{#{Rake::TestCase::RUBY} shellcommand.rb} }
132
+ assert true, "should not fail"
133
+ end
134
+
135
+ def test_sh_with_a_single_string_argument
136
+ check_expansion
137
+
138
+ ENV['RAKE_TEST_SH'] = 'someval'
139
+ verbose(false) {
140
+ sh %{#{RUBY} check_expansion.rb #{env_var} someval}
141
+ }
142
+ end
143
+
144
+ def test_sh_with_multiple_arguments
145
+ check_no_expansion
146
+ ENV['RAKE_TEST_SH'] = 'someval'
147
+
148
+ verbose(false) {
149
+ sh RUBY, 'check_no_expansion.rb', env_var, 'someval'
150
+ }
151
+ end
152
+
153
+ def test_sh_failure
154
+ shellcommand
155
+
156
+ assert_raises(RuntimeError) {
157
+ verbose(false) { sh %{#{RUBY} shellcommand.rb 1} }
158
+ }
159
+ end
160
+
161
+ def test_sh_special_handling
162
+ shellcommand
163
+
164
+ count = 0
165
+ verbose(false) {
166
+ sh(%{#{RUBY} shellcommand.rb}) do |ok, res|
167
+ assert(ok)
168
+ assert_equal 0, res.exitstatus
169
+ count += 1
170
+ end
171
+ sh(%{#{RUBY} shellcommand.rb 1}) do |ok, res|
172
+ assert(!ok)
173
+ assert_equal 1, res.exitstatus
174
+ count += 1
175
+ end
176
+ }
177
+ assert_equal 2, count, "Block count should be 2"
178
+ end
179
+
180
+ def test_sh_noop
181
+ shellcommand
182
+
183
+ verbose(false) { sh %{shellcommand.rb 1}, :noop=>true }
184
+ assert true, "should not fail"
185
+ end
186
+
187
+ def test_sh_bad_option
188
+ shellcommand
189
+
190
+ ex = assert_raises(ArgumentError) {
191
+ verbose(false) { sh %{shellcommand.rb}, :bad_option=>true }
192
+ }
193
+ assert_match(/bad_option/, ex.message)
194
+ end
195
+
196
+ def test_sh_verbose
197
+ shellcommand
198
+
199
+ _, err = capture_io do
200
+ verbose(true) {
201
+ sh %{shellcommand.rb}, :noop=>true
202
+ }
203
+ end
204
+
205
+ assert_equal "shellcommand.rb\n", err
206
+ end
207
+
208
+ def test_sh_verbose_false
209
+ shellcommand
210
+
211
+ _, err = capture_io do
212
+ verbose(false) {
213
+ sh %{shellcommand.rb}, :noop=>true
214
+ }
215
+ end
216
+
217
+ assert_equal '', err
218
+ end
219
+
220
+ def test_sh_verbose_flag_nil
221
+ shellcommand
222
+
223
+ RakeFileUtils.verbose_flag = nil
224
+
225
+ assert_silent do
226
+ sh %{shellcommand.rb}, :noop=>true
227
+ end
228
+ end
229
+
230
+ def test_ruby_with_a_single_string_argument
231
+ check_expansion
232
+
233
+ ENV['RAKE_TEST_SH'] = 'someval'
234
+
235
+ verbose(false) {
236
+ replace_ruby {
237
+ ruby %{check_expansion.rb #{env_var} someval}
238
+ }
239
+ }
240
+ end
241
+
242
+ def test_ruby_with_multiple_arguments
243
+ check_no_expansion
244
+
245
+ ENV['RAKE_TEST_SH'] = 'someval'
246
+ verbose(false) {
247
+ replace_ruby {
248
+ ruby 'check_no_expansion.rb', env_var, 'someval'
249
+ }
250
+ }
251
+ end
252
+
253
+ def test_split_all
254
+ assert_equal ['a'], Rake::FileUtilsExt.split_all('a')
255
+ assert_equal ['..'], Rake::FileUtilsExt.split_all('..')
256
+ assert_equal ['/'], Rake::FileUtilsExt.split_all('/')
257
+ assert_equal ['a', 'b'], Rake::FileUtilsExt.split_all('a/b')
258
+ assert_equal ['/', 'a', 'b'], Rake::FileUtilsExt.split_all('/a/b')
259
+ assert_equal ['..', 'a', 'b'], Rake::FileUtilsExt.split_all('../a/b')
260
+ end
261
+
262
+ def command(name, text)
263
+ open name, 'w', 0750 do |io|
264
+ io << text
265
+ end
266
+ end
267
+
268
+ def check_no_expansion
269
+ command 'check_no_expansion.rb', <<-CHECK_EXPANSION
270
+ if ARGV[0] != ARGV[1]
271
+ exit 0
272
+ else
273
+ exit 1
274
+ end
275
+ CHECK_EXPANSION
276
+ end
277
+
278
+ def check_expansion
279
+ command 'check_expansion.rb', <<-CHECK_EXPANSION
280
+ if ARGV[0] != ARGV[1]
281
+ exit 1
282
+ else
283
+ exit 0
284
+ end
285
+ CHECK_EXPANSION
286
+ end
287
+
288
+ def replace_ruby
289
+ ruby = FileUtils::RUBY
290
+ FileUtils.send :remove_const, :RUBY
291
+ FileUtils.const_set :RUBY, RUBY
292
+ yield
293
+ ensure
294
+ FileUtils.send :remove_const, :RUBY
295
+ FileUtils.const_set:RUBY, ruby
296
+ end
297
+
298
+ def shellcommand
299
+ command 'shellcommand.rb', <<-SHELLCOMMAND
300
+ #!/usr/bin/env ruby
301
+
302
+ exit((ARGV[0] || "0").to_i)
303
+ SHELLCOMMAND
304
+ end
305
+
306
+ def env_var
307
+ windows? ? '%RAKE_TEST_SH%' : '$RAKE_TEST_SH'
308
+ end
309
+
310
+ def windows?
311
+ ! File::ALT_SEPARATOR.nil?
312
+ end
313
+
314
+ end