rake 11.3.0 → 13.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/macos.yml +22 -0
  3. data/.github/workflows/ubuntu-rvm.yml +28 -0
  4. data/.github/workflows/ubuntu.yml +20 -0
  5. data/.github/workflows/windows.yml +20 -0
  6. data/CONTRIBUTING.rdoc +11 -4
  7. data/Gemfile +8 -1
  8. data/History.rdoc +171 -37
  9. data/README.rdoc +9 -11
  10. data/Rakefile +21 -13
  11. data/bin/bundle +105 -0
  12. data/bin/rake +29 -0
  13. data/bin/rdoc +29 -0
  14. data/bin/rubocop +29 -0
  15. data/doc/jamis.rb +1 -0
  16. data/doc/rake.1 +139 -124
  17. data/doc/rakefile.rdoc +2 -4
  18. data/exe/rake +1 -1
  19. data/lib/rake/application.rb +119 -79
  20. data/lib/rake/backtrace.rb +3 -2
  21. data/lib/rake/clean.rb +7 -5
  22. data/lib/rake/cloneable.rb +1 -0
  23. data/lib/rake/cpu_counter.rb +3 -2
  24. data/lib/rake/default_loader.rb +1 -0
  25. data/lib/rake/dsl_definition.rb +5 -4
  26. data/lib/rake/early_time.rb +1 -0
  27. data/lib/rake/ext/core.rb +1 -0
  28. data/lib/rake/ext/string.rb +22 -21
  29. data/lib/rake/file_creation_task.rb +4 -3
  30. data/lib/rake/file_list.rb +13 -14
  31. data/lib/rake/file_task.rb +12 -4
  32. data/lib/rake/file_utils.rb +17 -22
  33. data/lib/rake/file_utils_ext.rb +8 -18
  34. data/lib/rake/invocation_chain.rb +1 -0
  35. data/lib/rake/invocation_exception_mixin.rb +1 -0
  36. data/lib/rake/late_time.rb +2 -1
  37. data/lib/rake/linked_list.rb +1 -0
  38. data/lib/rake/loaders/makefile.rb +5 -4
  39. data/lib/rake/multi_task.rb +2 -1
  40. data/lib/rake/name_space.rb +1 -1
  41. data/lib/rake/packagetask.rb +28 -16
  42. data/lib/rake/phony.rb +2 -1
  43. data/lib/rake/private_reader.rb +1 -0
  44. data/lib/rake/promise.rb +13 -12
  45. data/lib/rake/pseudo_status.rb +1 -0
  46. data/lib/rake/rake_module.rb +30 -1
  47. data/lib/rake/rake_test_loader.rb +18 -12
  48. data/lib/rake/rule_recursion_overflow_error.rb +2 -1
  49. data/lib/rake/scope.rb +3 -2
  50. data/lib/rake/task.rb +70 -27
  51. data/lib/rake/task_argument_error.rb +1 -0
  52. data/lib/rake/task_arguments.rb +10 -4
  53. data/lib/rake/task_manager.rb +54 -39
  54. data/lib/rake/tasklib.rb +2 -1
  55. data/lib/rake/testtask.rb +28 -16
  56. data/lib/rake/thread_history_display.rb +4 -3
  57. data/lib/rake/thread_pool.rb +15 -14
  58. data/lib/rake/trace_output.rb +1 -0
  59. data/lib/rake/version.rb +3 -2
  60. data/lib/rake/win32.rb +9 -8
  61. data/lib/rake.rb +34 -33
  62. data/rake.gemspec +22 -9
  63. metadata +25 -108
  64. data/.gitignore +0 -14
  65. data/.rubocop.yml +0 -18
  66. data/.travis.yml +0 -28
  67. data/appveyor.yml +0 -22
  68. data/doc/release_notes/README.md +0 -4
  69. data/doc/release_notes/rake-0.4.14.rdoc +0 -23
  70. data/doc/release_notes/rake-0.4.15.rdoc +0 -35
  71. data/doc/release_notes/rake-0.5.0.rdoc +0 -53
  72. data/doc/release_notes/rake-0.5.3.rdoc +0 -78
  73. data/doc/release_notes/rake-0.5.4.rdoc +0 -46
  74. data/doc/release_notes/rake-0.6.0.rdoc +0 -141
  75. data/doc/release_notes/rake-0.7.0.rdoc +0 -119
  76. data/doc/release_notes/rake-0.7.1.rdoc +0 -59
  77. data/doc/release_notes/rake-0.7.2.rdoc +0 -121
  78. data/doc/release_notes/rake-0.7.3.rdoc +0 -47
  79. data/doc/release_notes/rake-0.8.0.rdoc +0 -114
  80. data/doc/release_notes/rake-0.8.2.rdoc +0 -165
  81. data/doc/release_notes/rake-0.8.3.rdoc +0 -112
  82. data/doc/release_notes/rake-0.8.4.rdoc +0 -147
  83. data/doc/release_notes/rake-0.8.5.rdoc +0 -53
  84. data/doc/release_notes/rake-0.8.6.rdoc +0 -37
  85. data/doc/release_notes/rake-0.8.7.rdoc +0 -55
  86. data/doc/release_notes/rake-0.9.0.rdoc +0 -112
  87. data/doc/release_notes/rake-0.9.1.rdoc +0 -52
  88. data/doc/release_notes/rake-0.9.2.2.rdoc +0 -55
  89. data/doc/release_notes/rake-0.9.2.rdoc +0 -49
  90. data/doc/release_notes/rake-0.9.3.rdoc +0 -102
  91. data/doc/release_notes/rake-0.9.4.rdoc +0 -60
  92. data/doc/release_notes/rake-0.9.5.rdoc +0 -55
  93. data/doc/release_notes/rake-0.9.6.rdoc +0 -64
  94. data/doc/release_notes/rake-10.0.0.rdoc +0 -178
  95. data/doc/release_notes/rake-10.0.1.rdoc +0 -58
  96. data/doc/release_notes/rake-10.0.2.rdoc +0 -53
  97. data/doc/release_notes/rake-10.0.3.rdoc +0 -191
  98. data/doc/release_notes/rake-10.1.0.rdoc +0 -61
  99. data/lib/rake/contrib/compositepublisher.rb +0 -21
  100. data/lib/rake/contrib/ftptools.rb +0 -137
  101. data/lib/rake/contrib/sshpublisher.rb +0 -60
  102. data/lib/rake/ext/pathname.rb +0 -25
data/doc/rakefile.rdoc CHANGED
@@ -223,9 +223,7 @@ behaviour can now accept a second parameter:
223
223
  The first argument of the block "t" is always bound to the current
224
224
  task object. The second argument "args" is an open-struct like object
225
225
  that allows access to the task arguments. Extra command line
226
- arguments to a task are ignored. Missing command line arguments are
227
- picked up from matching environment variables. If there are no
228
- matching environment variables, they are given the nil value.
226
+ arguments to a task are ignored.
229
227
 
230
228
  If you wish to specify default values for the arguments, you can use
231
229
  the with_defaults method in the task body. Here is the above example
@@ -412,7 +410,7 @@ display a list of tasks that have a description. If you use +desc+ to
412
410
  describe your major tasks, you have a semi-automatic way of generating
413
411
  a summary of your Rake file.
414
412
 
415
- traken$ rake -T
413
+ $ rake -T
416
414
  (in /home/.../rake)
417
415
  rake clean # Remove any temporary products.
418
416
  rake clobber # Remove any generated file.
data/exe/rake CHANGED
@@ -22,6 +22,6 @@
22
22
  # IN THE SOFTWARE.
23
23
  #++
24
24
 
25
- require 'rake'
25
+ require "rake"
26
26
 
27
27
  Rake.application.run
@@ -1,11 +1,12 @@
1
- require 'optparse'
1
+ # frozen_string_literal: true
2
+ require "optparse"
2
3
 
3
- require 'rake/task_manager'
4
- require 'rake/file_list'
5
- require 'rake/thread_pool'
6
- require 'rake/thread_history_display'
7
- require 'rake/trace_output'
8
- require 'rake/win32'
4
+ require "rake/task_manager"
5
+ require "rake/file_list"
6
+ require "rake/thread_pool"
7
+ require "rake/thread_history_display"
8
+ require "rake/trace_output"
9
+ require "rake/win32"
9
10
 
10
11
  module Rake
11
12
 
@@ -38,16 +39,16 @@ module Rake
38
39
  attr_writer :tty_output
39
40
 
40
41
  DEFAULT_RAKEFILES = [
41
- 'rakefile',
42
- 'Rakefile',
43
- 'rakefile.rb',
44
- 'Rakefile.rb'
42
+ "rakefile",
43
+ "Rakefile",
44
+ "rakefile.rb",
45
+ "Rakefile.rb"
45
46
  ].freeze
46
47
 
47
48
  # Initialize a Rake::Application object.
48
49
  def initialize
49
50
  super
50
- @name = 'rake'
51
+ @name = "rake"
51
52
  @rakefiles = DEFAULT_RAKEFILES.dup
52
53
  @rakefile = nil
53
54
  @pending_imports = []
@@ -56,11 +57,13 @@ module Rake
56
57
  @default_loader = Rake::DefaultLoader.new
57
58
  @original_dir = Dir.pwd
58
59
  @top_level_tasks = []
59
- add_loader('rb', DefaultLoader.new)
60
- add_loader('rf', DefaultLoader.new)
61
- add_loader('rake', DefaultLoader.new)
60
+ add_loader("rb", DefaultLoader.new)
61
+ add_loader("rf", DefaultLoader.new)
62
+ add_loader("rake", DefaultLoader.new)
62
63
  @tty_output = STDOUT.tty?
63
- @terminal_columns = ENV['RAKE_COLUMNS'].to_i
64
+ @terminal_columns = ENV["RAKE_COLUMNS"].to_i
65
+
66
+ set_default_options
64
67
  end
65
68
 
66
69
  # Run the Rake application. The run method performs the following
@@ -73,19 +76,24 @@ module Rake
73
76
  # If you wish to build a custom rake command, you should call
74
77
  # +init+ on your application. Then define any tasks. Finally,
75
78
  # call +top_level+ to run your top level tasks.
76
- def run
79
+ def run(argv = ARGV)
77
80
  standard_exception_handling do
78
- init
81
+ init "rake", argv
79
82
  load_rakefile
80
83
  top_level
81
84
  end
82
85
  end
83
86
 
84
87
  # Initialize the command line parameters and app name.
85
- def init(app_name='rake')
88
+ def init(app_name="rake", argv = ARGV)
86
89
  standard_exception_handling do
87
90
  @name = app_name
88
- args = handle_options
91
+ begin
92
+ args = handle_options argv
93
+ rescue ArgumentError
94
+ # Backward compatibility for capistrano
95
+ args = handle_options
96
+ end
89
97
  collect_command_line_tasks(args)
90
98
  end
91
99
  end
@@ -164,7 +172,7 @@ module Rake
164
172
  args = []
165
173
 
166
174
  begin
167
- /((?:[^\\,]|\\.)*?)\s*(?:,\s*(.*))?$/ =~ remaining_args
175
+ /\s*((?:[^\\,]|\\.)*?)\s*(?:,\s*(.*))?$/ =~ remaining_args
168
176
 
169
177
  remaining_args = $2
170
178
  args << $1.gsub(/\\(.)/, '\1')
@@ -204,13 +212,22 @@ module Rake
204
212
  end
205
213
 
206
214
  def display_exception_details(ex) # :nodoc:
207
- seen = Thread.current[:rake_display_exception_details_seen] ||= []
208
- return if seen.include? ex
209
- seen << ex
215
+ display_exception_details_seen << ex
210
216
 
211
217
  display_exception_message_details(ex)
212
218
  display_exception_backtrace(ex)
213
- display_exception_details(ex.cause) if has_cause?(ex)
219
+ display_cause_details(ex.cause) if has_cause?(ex)
220
+ end
221
+
222
+ def display_cause_details(ex) # :nodoc:
223
+ return if display_exception_details_seen.include? ex
224
+
225
+ trace "\nCaused by:"
226
+ display_exception_details(ex)
227
+ end
228
+
229
+ def display_exception_details_seen # :nodoc:
230
+ Thread.current[:rake_display_exception_details_seen] ||= []
214
231
  end
215
232
 
216
233
  def has_cause?(ex) # :nodoc:
@@ -259,7 +276,7 @@ module Rake
259
276
  if File.exist?(fn)
260
277
  others = FileList.glob(fn, File::FNM_CASEFOLD)
261
278
  return others.size == 1 ? others.first : fn
262
- elsif fn == ''
279
+ elsif fn == ""
263
280
  return fn
264
281
  end
265
282
  end
@@ -342,7 +359,7 @@ module Rake
342
359
  end
343
360
 
344
361
  def unix? # :nodoc:
345
- RbConfig::CONFIG['host_os'] =~
362
+ RbConfig::CONFIG["host_os"] =~
346
363
  /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris|irix|hpux)/i
347
364
  end
348
365
 
@@ -375,7 +392,7 @@ module Rake
375
392
 
376
393
  def sort_options(options) # :nodoc:
377
394
  options.sort_by { |opt|
378
- opt.select { |o| o =~ /^-/ }.map { |o| o.downcase }.sort.reverse
395
+ opt.select { |o| o.is_a?(String) && o =~ /^-/ }.map(&:downcase).sort.reverse
379
396
  }
380
397
  end
381
398
  private :sort_options
@@ -385,38 +402,38 @@ module Rake
385
402
  def standard_rake_options # :nodoc:
386
403
  sort_options(
387
404
  [
388
- ['--all', '-A',
405
+ ["--all", "-A",
389
406
  "Show all tasks, even uncommented ones (in combination with -T or -D)",
390
407
  lambda { |value|
391
408
  options.show_all_tasks = value
392
409
  }
393
410
  ],
394
- ['--backtrace=[OUT]',
411
+ ["--backtrace=[OUT]",
395
412
  "Enable full backtrace. OUT can be stderr (default) or stdout.",
396
413
  lambda { |value|
397
414
  options.backtrace = true
398
- select_trace_output(options, 'backtrace', value)
415
+ select_trace_output(options, "backtrace", value)
399
416
  }
400
417
  ],
401
- ['--build-all', '-B',
418
+ ["--build-all", "-B",
402
419
  "Build all prerequisites, including those which are up-to-date.",
403
420
  lambda { |value|
404
421
  options.build_all = true
405
422
  }
406
423
  ],
407
- ['--comments',
424
+ ["--comments",
408
425
  "Show commented tasks only",
409
426
  lambda { |value|
410
427
  options.show_all_tasks = !value
411
428
  }
412
429
  ],
413
- ['--describe', '-D [PATTERN]',
430
+ ["--describe", "-D [PATTERN]",
414
431
  "Describe the tasks (matching optional PATTERN), then exit.",
415
432
  lambda { |value|
416
433
  select_tasks_to_show(options, :describe, value)
417
434
  }
418
435
  ],
419
- ['--dry-run', '-n',
436
+ ["--dry-run", "-n",
420
437
  "Do a dry run without executing actions.",
421
438
  lambda { |value|
422
439
  Rake.verbose(true)
@@ -425,30 +442,30 @@ module Rake
425
442
  options.trace = true
426
443
  }
427
444
  ],
428
- ['--execute', '-e CODE',
445
+ ["--execute", "-e CODE",
429
446
  "Execute some Ruby code and exit.",
430
447
  lambda { |value|
431
448
  eval(value)
432
449
  exit
433
450
  }
434
451
  ],
435
- ['--execute-print', '-p CODE',
452
+ ["--execute-print", "-p CODE",
436
453
  "Execute some Ruby code, print the result, then exit.",
437
454
  lambda { |value|
438
455
  puts eval(value)
439
456
  exit
440
457
  }
441
458
  ],
442
- ['--execute-continue', '-E CODE',
459
+ ["--execute-continue", "-E CODE",
443
460
  "Execute some Ruby code, " +
444
461
  "then continue with normal task processing.",
445
462
  lambda { |value| eval(value) }
446
463
  ],
447
- ['--jobs', '-j [NUMBER]',
464
+ ["--jobs", "-j [NUMBER]",
448
465
  "Specifies the maximum number of tasks to execute in parallel. " +
449
466
  "(default is number of CPU cores + 4)",
450
467
  lambda { |value|
451
- if value.nil? || value == ''
468
+ if value.nil? || value == ""
452
469
  value = Float::INFINITY
453
470
  elsif value =~ /^\d+$/
454
471
  value = value.to_i
@@ -459,7 +476,7 @@ module Rake
459
476
  options.thread_pool_size = value - 1
460
477
  }
461
478
  ],
462
- ['--job-stats [LEVEL]',
479
+ ["--job-stats [LEVEL]",
463
480
  "Display job statistics. " +
464
481
  "LEVEL=history displays a complete job list",
465
482
  lambda { |value|
@@ -470,42 +487,42 @@ module Rake
470
487
  end
471
488
  }
472
489
  ],
473
- ['--libdir', '-I LIBDIR',
490
+ ["--libdir", "-I LIBDIR",
474
491
  "Include LIBDIR in the search path for required modules.",
475
492
  lambda { |value| $:.push(value) }
476
493
  ],
477
- ['--multitask', '-m',
494
+ ["--multitask", "-m",
478
495
  "Treat all tasks as multitasks.",
479
496
  lambda { |value| options.always_multitask = true }
480
497
  ],
481
- ['--no-search', '--nosearch',
482
- '-N', "Do not search parent directories for the Rakefile.",
498
+ ["--no-search", "--nosearch",
499
+ "-N", "Do not search parent directories for the Rakefile.",
483
500
  lambda { |value| options.nosearch = true }
484
501
  ],
485
- ['--prereqs', '-P',
502
+ ["--prereqs", "-P",
486
503
  "Display the tasks and dependencies, then exit.",
487
504
  lambda { |value| options.show_prereqs = true }
488
505
  ],
489
- ['--quiet', '-q',
506
+ ["--quiet", "-q",
490
507
  "Do not log messages to standard output.",
491
508
  lambda { |value| Rake.verbose(false) }
492
509
  ],
493
- ['--rakefile', '-f [FILENAME]',
510
+ ["--rakefile", "-f [FILENAME]",
494
511
  "Use FILENAME as the rakefile to search for.",
495
512
  lambda { |value|
496
- value ||= ''
513
+ value ||= ""
497
514
  @rakefiles.clear
498
515
  @rakefiles << value
499
516
  }
500
517
  ],
501
- ['--rakelibdir', '--rakelib', '-R RAKELIBDIR',
518
+ ["--rakelibdir", "--rakelib", "-R RAKELIBDIR",
502
519
  "Auto-import any .rake files in RAKELIBDIR. " +
503
520
  "(default is 'rakelib')",
504
521
  lambda { |value|
505
522
  options.rakelib = value.split(File::PATH_SEPARATOR)
506
523
  }
507
524
  ],
508
- ['--require', '-r MODULE',
525
+ ["--require", "-r MODULE",
509
526
  "Require MODULE before executing rakefile.",
510
527
  lambda { |value|
511
528
  begin
@@ -519,11 +536,11 @@ module Rake
519
536
  end
520
537
  }
521
538
  ],
522
- ['--rules',
539
+ ["--rules",
523
540
  "Trace the rules resolution.",
524
541
  lambda { |value| options.trace_rules = true }
525
542
  ],
526
- ['--silent', '-s',
543
+ ["--silent", "-s",
527
544
  "Like --quiet, but also suppresses the " +
528
545
  "'in directory' announcement.",
529
546
  lambda { |value|
@@ -531,59 +548,60 @@ module Rake
531
548
  options.silent = true
532
549
  }
533
550
  ],
534
- ['--suppress-backtrace PATTERN',
551
+ ["--suppress-backtrace PATTERN",
535
552
  "Suppress backtrace lines matching regexp PATTERN. " +
536
553
  "Ignored if --trace is on.",
537
554
  lambda { |value|
538
555
  options.suppress_backtrace_pattern = Regexp.new(value)
539
556
  }
540
557
  ],
541
- ['--system', '-g',
558
+ ["--system", "-g",
542
559
  "Using system wide (global) rakefiles " +
543
560
  "(usually '~/.rake/*.rake').",
544
561
  lambda { |value| options.load_system = true }
545
562
  ],
546
- ['--no-system', '--nosystem', '-G',
563
+ ["--no-system", "--nosystem", "-G",
547
564
  "Use standard project Rakefile search paths, " +
548
565
  "ignore system wide rakefiles.",
549
566
  lambda { |value| options.ignore_system = true }
550
567
  ],
551
- ['--tasks', '-T [PATTERN]',
568
+ ["--tasks", "-T [PATTERN]",
552
569
  "Display the tasks (matching optional PATTERN) " +
553
- "with descriptions, then exit.",
570
+ "with descriptions, then exit. " +
571
+ "-AT combination displays all of tasks contained no description.",
554
572
  lambda { |value|
555
573
  select_tasks_to_show(options, :tasks, value)
556
574
  }
557
575
  ],
558
- ['--trace=[OUT]', '-t',
576
+ ["--trace=[OUT]", "-t",
559
577
  "Turn on invoke/execute tracing, enable full backtrace. " +
560
578
  "OUT can be stderr (default) or stdout.",
561
579
  lambda { |value|
562
580
  options.trace = true
563
581
  options.backtrace = true
564
- select_trace_output(options, 'trace', value)
582
+ select_trace_output(options, "trace", value)
565
583
  Rake.verbose(true)
566
584
  }
567
585
  ],
568
- ['--verbose', '-v',
586
+ ["--verbose", "-v",
569
587
  "Log message to standard output.",
570
588
  lambda { |value| Rake.verbose(true) }
571
589
  ],
572
- ['--version', '-V',
590
+ ["--version", "-V",
573
591
  "Display the program version.",
574
592
  lambda { |value|
575
593
  puts "rake, version #{Rake::VERSION}"
576
594
  exit
577
595
  }
578
596
  ],
579
- ['--where', '-W [PATTERN]',
597
+ ["--where", "-W [PATTERN]",
580
598
  "Describe the tasks (matching optional PATTERN), then exit.",
581
599
  lambda { |value|
582
600
  select_tasks_to_show(options, :lines, value)
583
601
  options.show_all_tasks = true
584
602
  }
585
603
  ],
586
- ['--no-deprecation-warnings', '-X',
604
+ ["--no-deprecation-warnings", "-X",
587
605
  "Disable the deprecation warnings.",
588
606
  lambda { |value|
589
607
  options.ignore_deprecate = true
@@ -594,7 +612,7 @@ module Rake
594
612
 
595
613
  def select_tasks_to_show(options, show_tasks, value) # :nodoc:
596
614
  options.show_tasks = show_tasks
597
- options.show_task_pattern = Regexp.new(value || '')
615
+ options.show_task_pattern = Regexp.new(value || "")
598
616
  Rake::TaskManager.record_task_metadata = true
599
617
  end
600
618
  private :select_tasks_to_show
@@ -602,9 +620,9 @@ module Rake
602
620
  def select_trace_output(options, trace_option, value) # :nodoc:
603
621
  value = value.strip unless value.nil?
604
622
  case value
605
- when 'stdout'
623
+ when "stdout"
606
624
  options.trace_output = $stdout
607
- when 'stderr', nil
625
+ when "stderr", nil
608
626
  options.trace_output = $stderr
609
627
  else
610
628
  fail CommandLineOptionError,
@@ -616,9 +634,8 @@ module Rake
616
634
  # Read and handle the command line options. Returns the command line
617
635
  # arguments that we didn't understand, which should (in theory) be just
618
636
  # task names and env vars.
619
- def handle_options # :nodoc:
620
- options.rakelib = ['rakelib']
621
- options.trace_output = $stderr
637
+ def handle_options(argv) # :nodoc:
638
+ set_default_options
622
639
 
623
640
  OptionParser.new do |opts|
624
641
  opts.banner = "#{Rake.application.name} [-f rakefile] {options} targets..."
@@ -631,8 +648,8 @@ module Rake
631
648
  end
632
649
 
633
650
  standard_rake_options.each { |args| opts.on(*args) }
634
- opts.environment('RAKEOPT')
635
- end.parse(ARGV)
651
+ opts.environment("RAKEOPT")
652
+ end.parse(argv)
636
653
  end
637
654
 
638
655
  # Similar to the regular Ruby +require+ command, but will check
@@ -670,7 +687,7 @@ module Rake
670
687
 
671
688
  def raw_load_rakefile # :nodoc:
672
689
  rakefile, location = find_rakefile_location
673
- if (! options.ignore_system) &&
690
+ if (!options.ignore_system) &&
674
691
  (options.load_system || rakefile.nil?) &&
675
692
  system_dir && File.directory?(system_dir)
676
693
  print_rakefile_directory(location)
@@ -684,7 +701,7 @@ module Rake
684
701
  Dir.chdir(location)
685
702
  print_rakefile_directory(location)
686
703
  Rake.load_rakefile(File.expand_path(@rakefile)) if
687
- @rakefile && @rakefile != ''
704
+ @rakefile && @rakefile != ""
688
705
  options.rakelib.each do |rlib|
689
706
  glob("#{rlib}/*.rake") do |name|
690
707
  add_import name
@@ -695,7 +712,7 @@ module Rake
695
712
  end
696
713
 
697
714
  def glob(path, &block) # :nodoc:
698
- FileList.glob(path.gsub("\\", '/')).each(&block)
715
+ FileList.glob(path.tr("\\", "/")).each(&block)
699
716
  end
700
717
  private :glob
701
718
 
@@ -703,8 +720,8 @@ module Rake
703
720
  def system_dir # :nodoc:
704
721
  @system_dir ||=
705
722
  begin
706
- if ENV['RAKE_SYSTEM']
707
- ENV['RAKE_SYSTEM']
723
+ if ENV["RAKE_SYSTEM"]
724
+ ENV["RAKE_SYSTEM"]
708
725
  else
709
726
  standard_system_dir
710
727
  end
@@ -718,7 +735,7 @@ module Rake
718
735
  end
719
736
  else
720
737
  def standard_system_dir #:nodoc:
721
- File.join(File.expand_path('~'), '.rake')
738
+ File.join(File.expand_path("~"), ".rake")
722
739
  end
723
740
  end
724
741
  private :standard_system_dir
@@ -777,7 +794,30 @@ module Rake
777
794
  re = /^#{@rakefile}$/
778
795
  re = /#{re.source}/i if windows?
779
796
 
780
- backtrace.find { |str| str =~ re } || ''
797
+ backtrace.find { |str| str =~ re } || ""
798
+ end
799
+
800
+ def set_default_options # :nodoc:
801
+ options.always_multitask = false
802
+ options.backtrace = false
803
+ options.build_all = false
804
+ options.dryrun = false
805
+ options.ignore_deprecate = false
806
+ options.ignore_system = false
807
+ options.job_stats = false
808
+ options.load_system = false
809
+ options.nosearch = false
810
+ options.rakelib = %w[rakelib]
811
+ options.show_all_tasks = false
812
+ options.show_prereqs = false
813
+ options.show_task_pattern = nil
814
+ options.show_tasks = nil
815
+ options.silent = false
816
+ options.suppress_backtrace_pattern = nil
817
+ options.thread_pool_size = Rake.suggested_thread_count
818
+ options.trace = false
819
+ options.trace_output = $stderr
820
+ options.trace_rules = false
781
821
  end
782
822
 
783
823
  end