warbler 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (288) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -1
  3. data/Gemfile +6 -1
  4. data/bin/warble +1 -1
  5. data/lib/warbler/application.rb +16 -7
  6. data/lib/warbler/gems.rb +1 -0
  7. data/lib/warbler/jar.rb +2 -2
  8. data/lib/warbler/templates/bundler.erb +3 -1
  9. data/lib/warbler/templates/jar.erb +10 -8
  10. data/lib/warbler/templates/rails.erb +1 -1
  11. data/lib/warbler/templates/war.erb +12 -7
  12. data/lib/warbler/traits/bundler.rb +16 -12
  13. data/lib/warbler/traits/gemspec.rb +4 -4
  14. data/lib/warbler/traits/nogemspec.rb +2 -4
  15. data/lib/warbler/traits/rails.rb +5 -5
  16. data/lib/warbler/traits/war.rb +28 -9
  17. data/lib/warbler/version.rb +1 -1
  18. data/spec/sample_bundler/Gemfile +1 -1
  19. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/cache/rake-10.5.0.gem +0 -0
  20. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/.autotest +7 -0
  21. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/.rubocop.yml +27 -0
  22. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/.togglerc +7 -0
  23. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/CONTRIBUTING.rdoc +38 -0
  24. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/History.rdoc +659 -0
  25. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/MIT-LICENSE +21 -0
  26. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/Manifest.txt +166 -0
  27. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/README.rdoc +139 -0
  28. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/Rakefile +81 -0
  29. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/bin/rake +33 -0
  30. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake.rb +79 -0
  31. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/alt_system.rb +110 -0
  32. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/application.rb +790 -0
  33. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/backtrace.rb +23 -0
  34. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/clean.rb +76 -0
  35. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/cloneable.rb +16 -0
  36. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/contrib/.document +1 -0
  37. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/contrib/compositepublisher.rb +21 -0
  38. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/contrib/ftptools.rb +137 -0
  39. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/contrib/publisher.rb +81 -0
  40. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/contrib/rubyforgepublisher.rb +18 -0
  41. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/contrib/sshpublisher.rb +61 -0
  42. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/contrib/sys.rb +4 -0
  43. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/cpu_counter.rb +125 -0
  44. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/default_loader.rb +14 -0
  45. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/dsl_definition.rb +201 -0
  46. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/early_time.rb +21 -0
  47. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/ext/core.rb +25 -0
  48. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/ext/module.rb +2 -0
  49. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/ext/pathname.rb +25 -0
  50. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/ext/string.rb +175 -0
  51. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/ext/time.rb +18 -0
  52. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/file_creation_task.rb +24 -0
  53. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/file_list.rb +428 -0
  54. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/file_task.rb +46 -0
  55. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/file_utils.rb +128 -0
  56. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/file_utils_ext.rb +144 -0
  57. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/gempackagetask.rb +4 -0
  58. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/invocation_chain.rb +56 -0
  59. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/invocation_exception_mixin.rb +16 -0
  60. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/late_time.rb +17 -0
  61. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/linked_list.rb +103 -0
  62. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/loaders/makefile.rb +53 -0
  63. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/multi_task.rb +13 -0
  64. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/name_space.rb +38 -0
  65. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/packagetask.rb +199 -0
  66. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/pathmap.rb +3 -0
  67. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/phony.rb +15 -0
  68. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/private_reader.rb +20 -0
  69. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/promise.rb +99 -0
  70. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/pseudo_status.rb +29 -0
  71. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/rake_module.rb +38 -0
  72. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb +22 -0
  73. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/rdoctask.rb +4 -0
  74. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/ruby182_test_unit_fix.rb +29 -0
  75. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
  76. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/runtest.rb +27 -0
  77. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/scope.rb +42 -0
  78. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/task.rb +383 -0
  79. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/task_argument_error.rb +7 -0
  80. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/task_arguments.rb +98 -0
  81. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/task_manager.rb +307 -0
  82. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/tasklib.rb +24 -0
  83. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/testtask.rb +213 -0
  84. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/thread_history_display.rb +48 -0
  85. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/thread_pool.rb +164 -0
  86. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/trace_output.rb +22 -0
  87. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/version.rb +7 -0
  88. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/lib/rake/win32.rb +56 -0
  89. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/rakelib/publish.rake +20 -0
  90. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/rakelib/test_times.rake +25 -0
  91. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/file_creation.rb +34 -0
  92. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/helper.rb +129 -0
  93. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/support/rakefile_definitions.rb +478 -0
  94. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/support/ruby_runner.rb +34 -0
  95. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_private_reader.rb +42 -0
  96. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake.rb +40 -0
  97. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_application.rb +643 -0
  98. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_application_options.rb +468 -0
  99. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_backtrace.rb +119 -0
  100. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_clean.rb +61 -0
  101. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_cpu_counter.rb +68 -0
  102. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_definitions.rb +84 -0
  103. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_directory_task.rb +76 -0
  104. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_dsl.rb +40 -0
  105. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_early_time.rb +31 -0
  106. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_extension.rb +59 -0
  107. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_file_creation_task.rb +56 -0
  108. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_file_list.rb +670 -0
  109. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_file_list_path_map.rb +8 -0
  110. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_file_task.rb +197 -0
  111. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_file_utils.rb +314 -0
  112. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_ftp_file.rb +74 -0
  113. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_functional.rb +482 -0
  114. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_invocation_chain.rb +64 -0
  115. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_late_time.rb +18 -0
  116. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_linked_list.rb +84 -0
  117. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_makefile_loader.rb +46 -0
  118. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_multi_task.rb +64 -0
  119. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_name_space.rb +57 -0
  120. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_package_task.rb +79 -0
  121. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_path_map.rb +168 -0
  122. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_path_map_explode.rb +34 -0
  123. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_path_map_partial.rb +18 -0
  124. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_pathname_extensions.rb +15 -0
  125. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_pseudo_status.rb +21 -0
  126. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_rake_test_loader.rb +20 -0
  127. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_reduce_compat.rb +26 -0
  128. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_require.rb +40 -0
  129. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_rules.rb +388 -0
  130. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_scope.rb +44 -0
  131. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_task.rb +393 -0
  132. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_task_argument_parsing.rb +119 -0
  133. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_task_arguments.rb +127 -0
  134. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_task_lib.rb +9 -0
  135. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_task_manager.rb +178 -0
  136. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_task_manager_argument_resolution.rb +19 -0
  137. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_task_with_arguments.rb +172 -0
  138. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_test_task.rb +146 -0
  139. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_thread_pool.rb +145 -0
  140. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_top_level_functions.rb +71 -0
  141. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_rake_win32.rb +72 -0
  142. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_thread_history_display.rb +101 -0
  143. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/gems/rake-10.5.0/test/test_trace_output.rb +52 -0
  144. data/spec/sample_bundler/vendor/bundle/jruby/2.2.0/specifications/rake-10.5.0.gemspec +43 -0
  145. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/bin/rake +22 -0
  146. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/cache/rake-10.5.0.gem +0 -0
  147. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/.autotest +7 -0
  148. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/.rubocop.yml +27 -0
  149. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/.togglerc +7 -0
  150. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/CONTRIBUTING.rdoc +38 -0
  151. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/History.rdoc +659 -0
  152. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/MIT-LICENSE +21 -0
  153. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/Manifest.txt +166 -0
  154. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/README.rdoc +139 -0
  155. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/Rakefile +81 -0
  156. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/bin/rake +33 -0
  157. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake.rb +79 -0
  158. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/alt_system.rb +110 -0
  159. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/application.rb +790 -0
  160. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/backtrace.rb +23 -0
  161. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/clean.rb +76 -0
  162. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/cloneable.rb +16 -0
  163. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/contrib/.document +1 -0
  164. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/contrib/compositepublisher.rb +21 -0
  165. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/contrib/ftptools.rb +137 -0
  166. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/contrib/publisher.rb +81 -0
  167. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/contrib/rubyforgepublisher.rb +18 -0
  168. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/contrib/sshpublisher.rb +61 -0
  169. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/contrib/sys.rb +4 -0
  170. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/cpu_counter.rb +125 -0
  171. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/default_loader.rb +14 -0
  172. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/dsl_definition.rb +201 -0
  173. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/early_time.rb +21 -0
  174. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/ext/core.rb +25 -0
  175. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/ext/module.rb +2 -0
  176. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/ext/pathname.rb +25 -0
  177. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/ext/string.rb +175 -0
  178. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/ext/time.rb +18 -0
  179. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/file_creation_task.rb +24 -0
  180. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/file_list.rb +428 -0
  181. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/file_task.rb +46 -0
  182. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/file_utils.rb +128 -0
  183. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/file_utils_ext.rb +144 -0
  184. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/gempackagetask.rb +4 -0
  185. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/invocation_chain.rb +56 -0
  186. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/invocation_exception_mixin.rb +16 -0
  187. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/late_time.rb +17 -0
  188. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/linked_list.rb +103 -0
  189. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/loaders/makefile.rb +53 -0
  190. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/multi_task.rb +13 -0
  191. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/name_space.rb +38 -0
  192. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/packagetask.rb +199 -0
  193. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/pathmap.rb +3 -0
  194. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/phony.rb +15 -0
  195. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/private_reader.rb +20 -0
  196. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/promise.rb +99 -0
  197. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/pseudo_status.rb +29 -0
  198. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/rake_module.rb +38 -0
  199. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb +22 -0
  200. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/rdoctask.rb +4 -0
  201. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/ruby182_test_unit_fix.rb +29 -0
  202. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
  203. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/runtest.rb +27 -0
  204. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/scope.rb +42 -0
  205. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/task.rb +383 -0
  206. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/task_argument_error.rb +7 -0
  207. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/task_arguments.rb +98 -0
  208. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/task_manager.rb +307 -0
  209. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/tasklib.rb +24 -0
  210. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/testtask.rb +213 -0
  211. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/thread_history_display.rb +48 -0
  212. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/thread_pool.rb +164 -0
  213. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/trace_output.rb +22 -0
  214. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/version.rb +7 -0
  215. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/win32.rb +56 -0
  216. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/rakelib/publish.rake +20 -0
  217. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/rakelib/test_times.rake +25 -0
  218. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/file_creation.rb +34 -0
  219. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/helper.rb +129 -0
  220. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/support/rakefile_definitions.rb +478 -0
  221. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/support/ruby_runner.rb +34 -0
  222. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_private_reader.rb +42 -0
  223. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake.rb +40 -0
  224. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_application.rb +643 -0
  225. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_application_options.rb +468 -0
  226. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_backtrace.rb +119 -0
  227. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_clean.rb +61 -0
  228. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_cpu_counter.rb +68 -0
  229. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_definitions.rb +84 -0
  230. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_directory_task.rb +76 -0
  231. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_dsl.rb +40 -0
  232. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_early_time.rb +31 -0
  233. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_extension.rb +59 -0
  234. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_file_creation_task.rb +56 -0
  235. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_file_list.rb +670 -0
  236. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_file_list_path_map.rb +8 -0
  237. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_file_task.rb +197 -0
  238. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_file_utils.rb +314 -0
  239. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_ftp_file.rb +74 -0
  240. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_functional.rb +482 -0
  241. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_invocation_chain.rb +64 -0
  242. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_late_time.rb +18 -0
  243. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_linked_list.rb +84 -0
  244. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_makefile_loader.rb +46 -0
  245. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_multi_task.rb +64 -0
  246. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_name_space.rb +57 -0
  247. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_package_task.rb +79 -0
  248. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_path_map.rb +168 -0
  249. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_path_map_explode.rb +34 -0
  250. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_path_map_partial.rb +18 -0
  251. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_pathname_extensions.rb +15 -0
  252. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_pseudo_status.rb +21 -0
  253. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_rake_test_loader.rb +20 -0
  254. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_reduce_compat.rb +26 -0
  255. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_require.rb +40 -0
  256. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_rules.rb +388 -0
  257. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_scope.rb +44 -0
  258. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_task.rb +393 -0
  259. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_task_argument_parsing.rb +119 -0
  260. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_task_arguments.rb +127 -0
  261. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_task_lib.rb +9 -0
  262. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_task_manager.rb +178 -0
  263. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_task_manager_argument_resolution.rb +19 -0
  264. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_task_with_arguments.rb +172 -0
  265. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_test_task.rb +146 -0
  266. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_thread_pool.rb +145 -0
  267. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_top_level_functions.rb +71 -0
  268. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_rake_win32.rb +72 -0
  269. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_thread_history_display.rb +101 -0
  270. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/gems/rake-10.5.0/test/test_trace_output.rb +52 -0
  271. data/spec/sample_bundler/vendor/bundle/jruby/2.3.0/specifications/rake-10.5.0.gemspec +43 -0
  272. data/spec/sample_jbundler/vendor/bundle/jruby/1.8/gems +1 -0
  273. data/spec/sample_jbundler/vendor/bundle/jruby/1.8/specifications +1 -0
  274. data/spec/sample_jbundler/vendor/bundle/jruby/1.9/gems +1 -0
  275. data/spec/sample_jbundler/vendor/bundle/jruby/1.9/specifications +1 -0
  276. data/spec/sample_jbundler/vendor/bundle/ruby/1.8/gems +1 -0
  277. data/spec/sample_jbundler/vendor/bundle/ruby/1.8/specifications +1 -0
  278. data/spec/sample_jbundler/vendor/bundle/ruby/1.9.1/gems +1 -0
  279. data/spec/sample_jbundler/vendor/bundle/ruby/1.9.1/specifications +1 -0
  280. data/spec/sample_war/gems/.keep +1 -0
  281. data/spec/spec_helper.rb +48 -36
  282. data/spec/warbler/bundler_spec.rb +26 -2
  283. data/spec/warbler/config_spec.rb +28 -1
  284. data/spec/warbler/jar_spec.rb +45 -7
  285. data/warble.rb +12 -8
  286. data/warbler.gemspec +6 -7
  287. data/web.xml.erb +27 -6
  288. metadata +527 -17
@@ -0,0 +1,34 @@
1
+ module RubyRunner
2
+ include FileUtils
3
+
4
+ # Run a shell Ruby command with command line options (using the
5
+ # default test options). Output is captured in @out and @err
6
+ def ruby(*option_list)
7
+ run_ruby(@ruby_options + option_list)
8
+ end
9
+
10
+ # Run a command line rake with the give rake options. Default
11
+ # command line ruby options are included. Output is captured in
12
+ # @out and @err
13
+ def rake(*rake_options)
14
+ run_ruby @ruby_options + [@rake_exec] + rake_options
15
+ end
16
+
17
+ # Low level ruby command runner ...
18
+ def run_ruby(option_list)
19
+ puts "COMMAND: [#{RUBY} #{option_list.join ' '}]" if @verbose
20
+
21
+ Open3.popen3(RUBY, *option_list) {|inn, out, err, wait|
22
+ inn.close
23
+
24
+ @exit = wait ? wait.value : $?
25
+ @out = out.read
26
+ @err = err.read
27
+ }
28
+
29
+ puts "OUTPUT: [#{@out}]" if @verbose
30
+ puts "ERROR: [#{@err}]" if @verbose
31
+ puts "EXIT: [#{@exit.inspect}]" if @verbose
32
+ puts "PWD: [#{Dir.pwd}]" if @verbose
33
+ end
34
+ end
@@ -0,0 +1,42 @@
1
+ require File.expand_path('../helper', __FILE__)
2
+ require 'rake/private_reader'
3
+
4
+ class TestPrivateAttrs < Rake::TestCase
5
+
6
+ class Sample
7
+ include Rake::PrivateReader
8
+
9
+ private_reader :reader, :a
10
+
11
+ def initialize
12
+ @reader = :RVALUE
13
+ end
14
+
15
+ def get_reader
16
+ reader
17
+ end
18
+
19
+ end
20
+
21
+ def setup
22
+ super
23
+ @sample = Sample.new
24
+ end
25
+
26
+ def test_private_reader_is_private
27
+ assert_private do @sample.reader end
28
+ assert_private do @sample.a end
29
+ end
30
+
31
+ def test_private_reader_returns_data
32
+ assert_equal :RVALUE, @sample.get_reader
33
+ end
34
+
35
+ private
36
+
37
+ def assert_private
38
+ ex = assert_raises(NoMethodError) do yield end
39
+ assert_match(/private/, ex.message)
40
+ end
41
+
42
+ end
@@ -0,0 +1,40 @@
1
+ require File.expand_path('../helper', __FILE__)
2
+
3
+ class TestRake < Rake::TestCase
4
+ def test_each_dir_parent
5
+ assert_equal ['a'], alldirs('a')
6
+ assert_equal ['a/b', 'a'], alldirs('a/b')
7
+ assert_equal ['/a/b', '/a', '/'], alldirs('/a/b')
8
+ if File.dirname("c:/foo") == "c:"
9
+ # Under Unix
10
+ assert_equal ['c:/a/b', 'c:/a', 'c:'], alldirs('c:/a/b')
11
+ assert_equal ['c:a/b', 'c:a'], alldirs('c:a/b')
12
+ else
13
+ # Under Windows
14
+ assert_equal ['c:/a/b', 'c:/a', 'c:/'], alldirs('c:/a/b')
15
+ assert_equal ['c:a/b', 'c:a'], alldirs('c:a/b')
16
+ end
17
+ end
18
+
19
+ def alldirs(fn)
20
+ result = []
21
+ Rake.each_dir_parent(fn) { |d| result << d }
22
+ result
23
+ end
24
+
25
+ def test_can_override_application
26
+ old_app = Rake.application
27
+ fake_app = Object.new
28
+ Rake.application = fake_app
29
+
30
+ assert_equal fake_app, Rake.application
31
+
32
+ ensure
33
+ Rake.application = old_app
34
+ end
35
+
36
+ def test_original_dir_reports_current_dir
37
+ assert_equal @tempdir, Rake.original_dir
38
+ end
39
+
40
+ end
@@ -0,0 +1,643 @@
1
+ require File.expand_path('../helper', __FILE__)
2
+
3
+ class TestRakeApplication < Rake::TestCase
4
+
5
+ def setup
6
+ super
7
+
8
+ @app = Rake.application
9
+ @app.options.rakelib = []
10
+ end
11
+
12
+ def setup_command_line(*options)
13
+ ARGV.clear
14
+ options.each do |option|
15
+ ARGV << option
16
+ end
17
+ end
18
+
19
+ def test_display_exception_details
20
+ obj = Object.new
21
+ obj.instance_eval("def #{__method__}; raise 'test'; end", "ruby")
22
+ begin
23
+ obj.__send__(__method__)
24
+ rescue => ex
25
+ end
26
+
27
+ out, err = capture_io do
28
+ @app.display_error_message ex
29
+ end
30
+
31
+ assert_empty out
32
+
33
+ assert_match 'rake aborted!', err
34
+ assert_match __method__.to_s, err
35
+ end
36
+
37
+ def test_display_exception_details_cause
38
+ skip 'Exception#cause not implemented' unless
39
+ Exception.method_defined? :cause
40
+
41
+ begin
42
+ raise 'cause a'
43
+ rescue
44
+ begin
45
+ raise 'cause b'
46
+ rescue => ex
47
+ end
48
+ end
49
+
50
+ out, err = capture_io do
51
+ @app.display_error_message ex
52
+ end
53
+
54
+ assert_empty out
55
+
56
+ assert_match 'cause a', err
57
+ assert_match 'cause b', err
58
+ end
59
+
60
+ def test_display_exception_details_cause_loop
61
+ skip 'Exception#cause not implemented' unless
62
+ Exception.method_defined? :cause
63
+
64
+ begin
65
+ begin
66
+ raise 'cause a'
67
+ rescue => a
68
+ begin
69
+ raise 'cause b'
70
+ rescue
71
+ raise a
72
+ end
73
+ end
74
+ rescue => ex
75
+ end
76
+
77
+ out, err = capture_io do
78
+ @app.display_error_message ex
79
+ end
80
+
81
+ assert_empty out
82
+
83
+ assert_match 'cause a', err
84
+ assert_match 'cause b', err
85
+ end
86
+
87
+ def test_display_tasks
88
+ @app.options.show_tasks = :tasks
89
+ @app.options.show_task_pattern = //
90
+ @app.last_description = "COMMENT"
91
+ @app.define_task(Rake::Task, "t")
92
+ out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
93
+ assert_match(/^rake t/, out)
94
+ assert_match(/# COMMENT/, out)
95
+ end
96
+
97
+ def test_display_tasks_with_long_comments
98
+ @app.terminal_columns = 80
99
+ @app.options.show_tasks = :tasks
100
+ @app.options.show_task_pattern = //
101
+ numbers = "1234567890" * 8
102
+ @app.last_description = numbers
103
+ @app.define_task(Rake::Task, "t")
104
+
105
+ out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
106
+
107
+ assert_match(/^rake t/, out)
108
+ assert_match(/# #{numbers[0, 65]}\.\.\./, out)
109
+ end
110
+
111
+ def test_display_tasks_with_task_name_wider_than_tty_display
112
+ @app.terminal_columns = 80
113
+ @app.options.show_tasks = :tasks
114
+ @app.options.show_task_pattern = //
115
+ task_name = "task name" * 80
116
+ @app.last_description = "something short"
117
+ @app.define_task(Rake::Task, task_name)
118
+
119
+ out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
120
+
121
+ # Ensure the entire task name is output and we end up showing no description
122
+ assert_match(/rake #{task_name} # .../, out)
123
+ end
124
+
125
+ def test_display_tasks_with_very_long_task_name_to_a_non_tty_shows_name_and_comment
126
+ @app.options.show_tasks = :tasks
127
+ @app.options.show_task_pattern = //
128
+ @app.tty_output = false
129
+ description = "something short"
130
+ task_name = "task name" * 80
131
+ @app.last_description = "something short"
132
+ @app.define_task(Rake::Task, task_name)
133
+
134
+ out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
135
+
136
+ # Ensure the entire task name is output and we end up showing no description
137
+ assert_match(/rake #{task_name} # #{description}/, out)
138
+ end
139
+
140
+ def test_display_tasks_with_long_comments_to_a_non_tty_shows_entire_comment
141
+ @app.options.show_tasks = :tasks
142
+ @app.options.show_task_pattern = //
143
+ @app.tty_output = false
144
+ @app.last_description = "1234567890" * 8
145
+ @app.define_task(Rake::Task, "t")
146
+ out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
147
+ assert_match(/^rake t/, out)
148
+ assert_match(/# #{@app.last_description}/, out)
149
+ end
150
+
151
+ def test_truncating_comments_to_a_non_tty
152
+ @app.terminal_columns = 80
153
+ @app.options.show_tasks = :tasks
154
+ @app.options.show_task_pattern = //
155
+ @app.tty_output = false
156
+ numbers = "1234567890" * 8
157
+ @app.last_description = numbers
158
+ @app.define_task(Rake::Task, "t")
159
+
160
+ out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
161
+
162
+ assert_match(/^rake t/, out)
163
+ assert_match(/# #{numbers[0, 65]}\.\.\./, out)
164
+ end
165
+
166
+ def test_describe_tasks
167
+ @app.options.show_tasks = :describe
168
+ @app.options.show_task_pattern = //
169
+ @app.last_description = "COMMENT"
170
+ @app.define_task(Rake::Task, "t")
171
+ out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
172
+ assert_match(/^rake t$/, out)
173
+ assert_match(/^ {4}COMMENT$/, out)
174
+ end
175
+
176
+ def test_show_lines
177
+ @app.options.show_tasks = :lines
178
+ @app.options.show_task_pattern = //
179
+ @app.last_description = "COMMENT"
180
+ @app.define_task(Rake::Task, "t")
181
+ @app['t'].locations << "HERE:1"
182
+ out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
183
+ assert_match(/^rake t +[^:]+:\d+ *$/, out)
184
+ end
185
+
186
+ def test_finding_rakefile
187
+ rakefile_default
188
+
189
+ assert_match(/Rakefile/i, @app.instance_eval { have_rakefile })
190
+ end
191
+
192
+ def test_not_finding_rakefile
193
+ @app.instance_eval { @rakefiles = ['NEVER_FOUND'] }
194
+ assert(! @app.instance_eval do have_rakefile end)
195
+ assert_nil @app.rakefile
196
+ end
197
+
198
+ def test_load_rakefile
199
+ rakefile_unittest
200
+
201
+ @app.instance_eval do
202
+ handle_options
203
+ options.silent = true
204
+ load_rakefile
205
+ end
206
+
207
+ assert_equal "rakefile", @app.rakefile.downcase
208
+ assert_equal @tempdir, Dir.pwd
209
+ end
210
+
211
+ def test_load_rakefile_doesnt_print_rakefile_directory_from_same_dir
212
+ rakefile_unittest
213
+
214
+ _, err = capture_io do
215
+ @app.instance_eval do
216
+ # pretend we started from the unittest dir
217
+ @original_dir = File.expand_path(".")
218
+ raw_load_rakefile
219
+ end
220
+ end
221
+
222
+ assert_empty err
223
+ end
224
+
225
+ def test_load_rakefile_from_subdir
226
+ rakefile_unittest
227
+ Dir.chdir 'subdir'
228
+
229
+ @app.instance_eval do
230
+ handle_options
231
+ options.silent = true
232
+ load_rakefile
233
+ end
234
+
235
+ assert_equal "rakefile", @app.rakefile.downcase
236
+ assert_equal @tempdir, Dir.pwd
237
+ end
238
+
239
+ def test_load_rakefile_prints_rakefile_directory_from_subdir
240
+ rakefile_unittest
241
+ Dir.chdir 'subdir'
242
+
243
+ app = Rake::Application.new
244
+ app.options.rakelib = []
245
+
246
+ _, err = capture_io do
247
+ app.instance_eval do
248
+ raw_load_rakefile
249
+ end
250
+ end
251
+
252
+ assert_equal "(in #{@tempdir}\)\n", err
253
+ end
254
+
255
+ def test_load_rakefile_doesnt_print_rakefile_directory_from_subdir_if_silent
256
+ rakefile_unittest
257
+ Dir.chdir 'subdir'
258
+
259
+ _, err = capture_io do
260
+ @app.instance_eval do
261
+ handle_options
262
+ options.silent = true
263
+ raw_load_rakefile
264
+ end
265
+ end
266
+
267
+ assert_empty err
268
+ end
269
+
270
+ def test_load_rakefile_not_found
271
+ ARGV.clear
272
+ Dir.chdir @tempdir
273
+ ENV['RAKE_SYSTEM'] = 'not_exist'
274
+
275
+ @app.instance_eval do
276
+ handle_options
277
+ options.silent = true
278
+ end
279
+
280
+
281
+ ex = assert_raises(RuntimeError) do
282
+ @app.instance_eval do
283
+ raw_load_rakefile
284
+ end
285
+ end
286
+
287
+ assert_match(/no rakefile found/i, ex.message)
288
+ end
289
+
290
+ def test_load_from_system_rakefile
291
+ rake_system_dir
292
+
293
+ @app.instance_eval do
294
+ handle_options
295
+ options.silent = true
296
+ options.load_system = true
297
+ options.rakelib = []
298
+ load_rakefile
299
+ end
300
+
301
+ assert_equal @system_dir, @app.system_dir
302
+ assert_nil @app.rakefile
303
+ rescue SystemExit
304
+ flunk 'failed to load rakefile'
305
+ end
306
+
307
+ def test_load_from_calculated_system_rakefile
308
+ rakefile_default
309
+ def @app.standard_system_dir
310
+ "__STD_SYS_DIR__"
311
+ end
312
+
313
+ ENV['RAKE_SYSTEM'] = nil
314
+
315
+ @app.instance_eval do
316
+ handle_options
317
+ options.silent = true
318
+ options.load_system = true
319
+ options.rakelib = []
320
+ load_rakefile
321
+ end
322
+
323
+ assert_equal "__STD_SYS_DIR__", @app.system_dir
324
+ rescue SystemExit
325
+ flunk 'failed to find system rakefile'
326
+ end
327
+
328
+ def test_terminal_columns
329
+ old_rake_columns = ENV['RAKE_COLUMNS']
330
+
331
+ ENV['RAKE_COLUMNS'] = '42'
332
+
333
+ app = Rake::Application.new
334
+
335
+ assert_equal 42, app.terminal_columns
336
+ ensure
337
+ if old_rake_columns
338
+ ENV['RAKE_COLUMNS'].delete
339
+ else
340
+ ENV['RAKE_COLUMNS'] = old_rake_columns
341
+ end
342
+ end
343
+
344
+ def test_windows
345
+ assert ! (@app.windows? && @app.unix?)
346
+ end
347
+
348
+ def test_loading_imports
349
+ loader = util_loader
350
+
351
+ @app.instance_eval do
352
+ add_loader("dummy", loader)
353
+ add_import("x.dummy")
354
+ load_imports
355
+ end
356
+
357
+ # HACK no assertions
358
+ end
359
+
360
+ def test_building_imported_files_on_demand
361
+ loader = util_loader
362
+
363
+ @app.instance_eval do
364
+ intern(Rake::Task, "x.dummy").enhance do loader.make_dummy end
365
+ add_loader("dummy", loader)
366
+ add_import("x.dummy")
367
+ load_imports
368
+ end
369
+
370
+ # HACK no assertions
371
+ end
372
+
373
+ def test_handle_options_should_not_strip_options_from_argv
374
+ assert !@app.options.trace
375
+
376
+ valid_option = '--trace'
377
+ setup_command_line(valid_option)
378
+
379
+ @app.handle_options
380
+
381
+ assert ARGV.include?(valid_option)
382
+ assert @app.options.trace
383
+ end
384
+
385
+ def test_handle_options_trace_default_is_stderr
386
+ setup_command_line("--trace")
387
+
388
+ @app.handle_options
389
+
390
+ assert_equal STDERR, @app.options.trace_output
391
+ assert @app.options.trace
392
+ end
393
+
394
+ def test_handle_options_trace_overrides_to_stdout
395
+ setup_command_line("--trace=stdout")
396
+
397
+ @app.handle_options
398
+
399
+ assert_equal STDOUT, @app.options.trace_output
400
+ assert @app.options.trace
401
+ end
402
+
403
+ def test_handle_options_trace_does_not_eat_following_task_names
404
+ assert !@app.options.trace
405
+
406
+ setup_command_line("--trace", "sometask")
407
+
408
+ @app.handle_options
409
+ assert ARGV.include?("sometask")
410
+ assert @app.options.trace
411
+ end
412
+
413
+ def test_good_run
414
+ ran = false
415
+
416
+ ARGV << '--rakelib=""'
417
+
418
+ @app.options.silent = true
419
+
420
+ @app.instance_eval do
421
+ intern(Rake::Task, "default").enhance { ran = true }
422
+ end
423
+
424
+ rakefile_default
425
+
426
+ out, err = capture_io do
427
+ @app.run
428
+ end
429
+
430
+ assert ran
431
+ assert_empty err
432
+ assert_equal "DEFAULT\n", out
433
+ end
434
+
435
+ def test_display_task_run
436
+ ran = false
437
+ setup_command_line('-f', '-s', '--tasks', '--rakelib=""')
438
+ @app.last_description = "COMMENT"
439
+ @app.define_task(Rake::Task, "default")
440
+ out, = capture_io { @app.run }
441
+ assert @app.options.show_tasks
442
+ assert ! ran
443
+ assert_match(/rake default/, out)
444
+ assert_match(/# COMMENT/, out)
445
+ end
446
+
447
+ def test_display_prereqs
448
+ ran = false
449
+ setup_command_line('-f', '-s', '--prereqs', '--rakelib=""')
450
+ @app.last_description = "COMMENT"
451
+ t = @app.define_task(Rake::Task, "default")
452
+ t.enhance([:a, :b])
453
+ @app.define_task(Rake::Task, "a")
454
+ @app.define_task(Rake::Task, "b")
455
+ out, = capture_io { @app.run }
456
+ assert @app.options.show_prereqs
457
+ assert ! ran
458
+ assert_match(/rake a$/, out)
459
+ assert_match(/rake b$/, out)
460
+ assert_match(/rake default\n( *(a|b)\n){2}/m, out)
461
+ end
462
+
463
+ def test_bad_run
464
+ @app.intern(Rake::Task, "default").enhance { fail }
465
+ setup_command_line('-f', '-s', '--rakelib=""')
466
+ _, err = capture_io {
467
+ assert_raises(SystemExit){ @app.run }
468
+ }
469
+ assert_match(/see full trace/i, err)
470
+ ensure
471
+ ARGV.clear
472
+ end
473
+
474
+ def test_bad_run_with_trace
475
+ @app.intern(Rake::Task, "default").enhance { fail }
476
+ setup_command_line('-f', '-s', '-t')
477
+ _, err = capture_io {
478
+ assert_raises(SystemExit) { @app.run }
479
+ }
480
+ refute_match(/see full trace/i, err)
481
+ ensure
482
+ ARGV.clear
483
+ end
484
+
485
+ def test_bad_run_with_backtrace
486
+ @app.intern(Rake::Task, "default").enhance { fail }
487
+ setup_command_line('-f', '-s', '--backtrace')
488
+ _, err = capture_io {
489
+ assert_raises(SystemExit) {
490
+ @app.run
491
+ }
492
+ }
493
+ refute_match(/see full trace/, err)
494
+ ensure
495
+ ARGV.clear
496
+ end
497
+
498
+ CustomError = Class.new(RuntimeError)
499
+
500
+ def test_bad_run_includes_exception_name
501
+ @app.intern(Rake::Task, "default").enhance {
502
+ raise CustomError, "intentional"
503
+ }
504
+ setup_command_line('-f', '-s')
505
+ _, err = capture_io {
506
+ assert_raises(SystemExit) {
507
+ @app.run
508
+ }
509
+ }
510
+ assert_match(/CustomError: intentional/, err)
511
+ end
512
+
513
+ def test_rake_error_excludes_exception_name
514
+ @app.intern(Rake::Task, "default").enhance {
515
+ fail "intentional"
516
+ }
517
+ setup_command_line('-f', '-s')
518
+ _, err = capture_io {
519
+ assert_raises(SystemExit) {
520
+ @app.run
521
+ }
522
+ }
523
+ refute_match(/RuntimeError/, err)
524
+ assert_match(/intentional/, err)
525
+ end
526
+
527
+ def cause_supported?
528
+ ex = StandardError.new
529
+ ex.respond_to?(:cause)
530
+ end
531
+
532
+ def test_printing_original_exception_cause
533
+ custom_error = Class.new(StandardError)
534
+ @app.intern(Rake::Task, "default").enhance {
535
+ begin
536
+ raise custom_error, "Original Error"
537
+ rescue custom_error
538
+ raise custom_error, "Secondary Error"
539
+ end
540
+ }
541
+ setup_command_line('-f', '-s')
542
+ _ ,err = capture_io {
543
+ assert_raises(SystemExit) {
544
+ @app.run
545
+ }
546
+ }
547
+ if cause_supported?
548
+ assert_match(/Original Error/, err)
549
+ end
550
+ assert_match(/Secondary Error/, err)
551
+ ensure
552
+ ARGV.clear
553
+ end
554
+
555
+ def test_run_with_bad_options
556
+ @app.intern(Rake::Task, "default").enhance { fail }
557
+ setup_command_line('-f', '-s', '--xyzzy')
558
+ assert_raises(SystemExit) {
559
+ capture_io { @app.run }
560
+ }
561
+ ensure
562
+ ARGV.clear
563
+ end
564
+
565
+ def test_standard_exception_handling_invalid_option
566
+ out, err = capture_io do
567
+ e = assert_raises SystemExit do
568
+ @app.standard_exception_handling do
569
+ raise OptionParser::InvalidOption, 'blah'
570
+ end
571
+ end
572
+
573
+ assert_equal 1, e.status
574
+ end
575
+
576
+ assert_empty out
577
+ assert_equal "invalid option: blah\n", err
578
+ end
579
+
580
+ def test_standard_exception_handling_other
581
+ out, err = capture_io do
582
+ e = assert_raises SystemExit do
583
+ @app.standard_exception_handling do
584
+ raise 'blah'
585
+ end
586
+ end
587
+
588
+ assert_equal 1, e.status
589
+ end
590
+
591
+ assert_empty out
592
+ assert_match "rake aborted!\n", err
593
+ assert_match "blah\n", err
594
+ end
595
+
596
+ def test_standard_exception_handling_system_exit
597
+ out, err = capture_io do
598
+ e = assert_raises SystemExit do
599
+ @app.standard_exception_handling do
600
+ exit 0
601
+ end
602
+ end
603
+
604
+ assert_equal 0, e.status
605
+ end
606
+
607
+ assert_empty out
608
+ assert_empty err
609
+ end
610
+
611
+ def test_standard_exception_handling_system_exit_nonzero
612
+ out, err = capture_io do
613
+ e = assert_raises SystemExit do
614
+ @app.standard_exception_handling do
615
+ exit 5
616
+ end
617
+ end
618
+
619
+ assert_equal 5, e.status
620
+ end
621
+
622
+ assert_empty out
623
+ assert_empty err
624
+ end
625
+
626
+ def util_loader
627
+ loader = Object.new
628
+
629
+ loader.instance_variable_set :@load_called, false
630
+ def loader.load arg
631
+ raise ArgumentError, arg unless arg == 'x.dummy'
632
+ @load_called = true
633
+ end
634
+
635
+ loader.instance_variable_set :@make_dummy_called, false
636
+ def loader.make_dummy
637
+ @make_dummy_called = true
638
+ end
639
+
640
+ loader
641
+ end
642
+
643
+ end