rake 0.9.2.2 → 13.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +7 -0
  2. data/History.rdoc +2403 -0
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +64 -106
  5. data/doc/command_line_usage.rdoc +65 -21
  6. data/doc/glossary.rdoc +40 -49
  7. data/doc/jamis.rb +1 -0
  8. data/doc/rake.1 +156 -0
  9. data/doc/rakefile.rdoc +127 -62
  10. data/{bin → exe}/rake +1 -7
  11. data/lib/rake/application.rb +507 -271
  12. data/lib/rake/backtrace.rb +24 -0
  13. data/lib/rake/clean.rb +54 -8
  14. data/lib/rake/cloneable.rb +11 -19
  15. data/lib/rake/cpu_counter.rb +107 -0
  16. data/lib/rake/default_loader.rb +5 -0
  17. data/lib/rake/dsl_definition.rb +67 -48
  18. data/lib/rake/early_time.rb +5 -1
  19. data/lib/rake/ext/core.rb +5 -6
  20. data/lib/rake/ext/string.rb +61 -52
  21. data/lib/rake/file_creation_task.rb +4 -3
  22. data/lib/rake/file_list.rb +81 -49
  23. data/lib/rake/file_task.rb +15 -8
  24. data/lib/rake/file_utils.rb +63 -43
  25. data/lib/rake/file_utils_ext.rb +14 -25
  26. data/lib/rake/invocation_chain.rb +25 -19
  27. data/lib/rake/invocation_exception_mixin.rb +1 -0
  28. data/lib/rake/late_time.rb +18 -0
  29. data/lib/rake/linked_list.rb +112 -0
  30. data/lib/rake/loaders/makefile.rb +23 -9
  31. data/lib/rake/multi_task.rb +4 -6
  32. data/lib/rake/name_space.rb +36 -23
  33. data/lib/rake/packagetask.rb +71 -34
  34. data/lib/rake/phony.rb +16 -0
  35. data/lib/rake/private_reader.rb +21 -0
  36. data/lib/rake/promise.rb +100 -0
  37. data/lib/rake/pseudo_status.rb +8 -2
  38. data/lib/rake/rake_module.rb +41 -3
  39. data/lib/rake/rake_test_loader.rb +9 -4
  40. data/lib/rake/rule_recursion_overflow_error.rb +2 -2
  41. data/lib/rake/scope.rb +43 -0
  42. data/lib/rake/task.rb +186 -79
  43. data/lib/rake/task_argument_error.rb +1 -0
  44. data/lib/rake/task_arguments.rb +46 -15
  45. data/lib/rake/task_manager.rb +91 -67
  46. data/lib/rake/tasklib.rb +2 -12
  47. data/lib/rake/testtask.rb +61 -63
  48. data/lib/rake/thread_history_display.rb +49 -0
  49. data/lib/rake/thread_pool.rb +163 -0
  50. data/lib/rake/trace_output.rb +23 -0
  51. data/lib/rake/version.rb +5 -3
  52. data/lib/rake/win32.rb +14 -18
  53. data/lib/rake.rb +35 -33
  54. data/rake.gemspec +100 -0
  55. metadata +74 -176
  56. data/.gemtest +0 -0
  57. data/CHANGES +0 -522
  58. data/Rakefile +0 -369
  59. data/TODO +0 -20
  60. data/doc/rake.1.gz +0 -0
  61. data/doc/release_notes/rake-0.4.14.rdoc +0 -23
  62. data/doc/release_notes/rake-0.4.15.rdoc +0 -35
  63. data/doc/release_notes/rake-0.5.0.rdoc +0 -53
  64. data/doc/release_notes/rake-0.5.3.rdoc +0 -78
  65. data/doc/release_notes/rake-0.5.4.rdoc +0 -46
  66. data/doc/release_notes/rake-0.6.0.rdoc +0 -141
  67. data/doc/release_notes/rake-0.7.0.rdoc +0 -119
  68. data/doc/release_notes/rake-0.7.1.rdoc +0 -59
  69. data/doc/release_notes/rake-0.7.2.rdoc +0 -121
  70. data/doc/release_notes/rake-0.7.3.rdoc +0 -47
  71. data/doc/release_notes/rake-0.8.0.rdoc +0 -114
  72. data/doc/release_notes/rake-0.8.2.rdoc +0 -165
  73. data/doc/release_notes/rake-0.8.3.rdoc +0 -112
  74. data/doc/release_notes/rake-0.8.4.rdoc +0 -147
  75. data/doc/release_notes/rake-0.8.5.rdoc +0 -53
  76. data/doc/release_notes/rake-0.8.6.rdoc +0 -55
  77. data/doc/release_notes/rake-0.8.7.rdoc +0 -55
  78. data/doc/release_notes/rake-0.9.0.rdoc +0 -112
  79. data/doc/release_notes/rake-0.9.1.rdoc +0 -52
  80. data/doc/release_notes/rake-0.9.2.rdoc +0 -49
  81. data/install.rb +0 -90
  82. data/lib/rake/alt_system.rb +0 -109
  83. data/lib/rake/classic_namespace.rb +0 -11
  84. data/lib/rake/contrib/compositepublisher.rb +0 -21
  85. data/lib/rake/contrib/ftptools.rb +0 -150
  86. data/lib/rake/contrib/publisher.rb +0 -73
  87. data/lib/rake/contrib/rubyforgepublisher.rb +0 -16
  88. data/lib/rake/contrib/sshpublisher.rb +0 -50
  89. data/lib/rake/contrib/sys.rb +0 -191
  90. data/lib/rake/ext/module.rb +0 -39
  91. data/lib/rake/ext/time.rb +0 -14
  92. data/lib/rake/gempackagetask.rb +0 -15
  93. data/lib/rake/pathmap.rb +0 -1
  94. data/lib/rake/rdoctask.rb +0 -234
  95. data/lib/rake/ruby182_test_unit_fix.rb +0 -25
  96. data/lib/rake/runtest.rb +0 -21
  97. data/test/file_creation.rb +0 -34
  98. data/test/helper.rb +0 -492
  99. data/test/test_rake.rb +0 -40
  100. data/test/test_rake_application.rb +0 -489
  101. data/test/test_rake_application_options.rb +0 -335
  102. data/test/test_rake_clean.rb +0 -14
  103. data/test/test_rake_definitions.rb +0 -80
  104. data/test/test_rake_directory_task.rb +0 -46
  105. data/test/test_rake_dsl.rb +0 -77
  106. data/test/test_rake_early_time.rb +0 -31
  107. data/test/test_rake_extension.rb +0 -59
  108. data/test/test_rake_file_creation_task.rb +0 -56
  109. data/test/test_rake_file_list.rb +0 -628
  110. data/test/test_rake_file_list_path_map.rb +0 -8
  111. data/test/test_rake_file_task.rb +0 -102
  112. data/test/test_rake_file_utils.rb +0 -305
  113. data/test/test_rake_ftp_file.rb +0 -59
  114. data/test/test_rake_functional.rb +0 -450
  115. data/test/test_rake_invocation_chain.rb +0 -52
  116. data/test/test_rake_makefile_loader.rb +0 -44
  117. data/test/test_rake_multi_task.rb +0 -51
  118. data/test/test_rake_name_space.rb +0 -43
  119. data/test/test_rake_package_task.rb +0 -79
  120. data/test/test_rake_path_map.rb +0 -157
  121. data/test/test_rake_path_map_explode.rb +0 -34
  122. data/test/test_rake_path_map_partial.rb +0 -18
  123. data/test/test_rake_pseudo_status.rb +0 -21
  124. data/test/test_rake_rake_test_loader.rb +0 -21
  125. data/test/test_rake_rdoc_task.rb +0 -83
  126. data/test/test_rake_require.rb +0 -40
  127. data/test/test_rake_rules.rb +0 -327
  128. data/test/test_rake_task.rb +0 -267
  129. data/test/test_rake_task_argument_parsing.rb +0 -103
  130. data/test/test_rake_task_arguments.rb +0 -88
  131. data/test/test_rake_task_lib.rb +0 -9
  132. data/test/test_rake_task_manager.rb +0 -157
  133. data/test/test_rake_task_manager_argument_resolution.rb +0 -36
  134. data/test/test_rake_task_with_arguments.rb +0 -173
  135. data/test/test_rake_test_task.rb +0 -120
  136. data/test/test_rake_top_level_functions.rb +0 -111
  137. data/test/test_rake_win32.rb +0 -72
  138. data/test/test_sys.rb +0 -20
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+ module Rake
3
+ module Backtrace # :nodoc: all
4
+ SYS_KEYS = RbConfig::CONFIG.keys.grep(/(?:[a-z]prefix|libdir)\z/)
5
+ SYS_PATHS = RbConfig::CONFIG.values_at(*SYS_KEYS).uniq +
6
+ [ File.join(File.dirname(__FILE__), "..") ]
7
+
8
+ SUPPRESSED_PATHS = SYS_PATHS.
9
+ map { |s| s.tr("\\", "/") }.
10
+ map { |f| File.expand_path(f) }.
11
+ reject { |s| s.nil? || s =~ /^ *$/ }
12
+ SUPPRESSED_PATHS_RE = SUPPRESSED_PATHS.map { |f| Regexp.quote(f) }.join("|")
13
+ SUPPRESSED_PATHS_RE << "|^org\\/jruby\\/\\w+\\.java" if
14
+ Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == "jruby"
15
+
16
+ SUPPRESS_PATTERN = %r!(\A(#{SUPPRESSED_PATHS_RE})|bin/rake:\d+)!i
17
+
18
+ def self.collapse(backtrace)
19
+ pattern = Rake.application.options.suppress_backtrace_pattern ||
20
+ SUPPRESS_PATTERN
21
+ backtrace.reject { |elem| elem =~ pattern }
22
+ end
23
+ end
24
+ end
data/lib/rake/clean.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # The 'rake/clean' file defines two file lists (CLEAN and CLOBBER) and
2
3
  # two rake tasks (:clean and :clobber).
3
4
  #
@@ -11,22 +12,67 @@
11
12
  # The intent of this task is to return a project to its
12
13
  # pristine, just unpacked state.
13
14
 
14
- require 'rake'
15
+ require "rake"
15
16
 
16
17
  # :stopdoc:
17
- CLEAN = Rake::FileList["**/*~", "**/*.bak", "**/core"]
18
+
19
+ module Rake
20
+ module Cleaner
21
+ extend FileUtils
22
+
23
+ module_function
24
+
25
+ def cleanup_files(file_names)
26
+ file_names.each do |file_name|
27
+ cleanup(file_name)
28
+ end
29
+ end
30
+
31
+ def cleanup(file_name, **opts)
32
+ begin
33
+ opts = { verbose: Rake.application.options.trace }.merge(opts)
34
+ rm_r file_name, **opts
35
+ rescue StandardError => ex
36
+ puts "Failed to remove #{file_name}: #{ex}" unless file_already_gone?(file_name)
37
+ end
38
+ end
39
+
40
+ def file_already_gone?(file_name)
41
+ return false if File.exist?(file_name)
42
+
43
+ path = file_name
44
+ prev = nil
45
+
46
+ while path = File.dirname(path)
47
+ return false if cant_be_deleted?(path)
48
+ break if [prev, "."].include?(path)
49
+ prev = path
50
+ end
51
+ true
52
+ end
53
+ private_class_method :file_already_gone?
54
+
55
+ def cant_be_deleted?(path_name)
56
+ File.exist?(path_name) &&
57
+ (!File.readable?(path_name) || !File.executable?(path_name))
58
+ end
59
+ private_class_method :cant_be_deleted?
60
+ end
61
+ end
62
+
63
+ CLEAN = ::Rake::FileList["**/*~", "**/*.bak", "**/core"]
18
64
  CLEAN.clear_exclude.exclude { |fn|
19
- fn.pathmap("%f") == 'core' && File.directory?(fn)
65
+ fn.pathmap("%f").downcase == "core" && File.directory?(fn)
20
66
  }
21
67
 
22
68
  desc "Remove any temporary products."
23
69
  task :clean do
24
- CLEAN.each { |fn| rm_r fn rescue nil }
70
+ Rake::Cleaner.cleanup_files(CLEAN)
25
71
  end
26
72
 
27
- CLOBBER = Rake::FileList.new
73
+ CLOBBER = ::Rake::FileList.new
28
74
 
29
- desc "Remove any generated file."
30
- task :clobber => [:clean] do
31
- CLOBBER.each { |fn| rm_r fn rescue nil }
75
+ desc "Remove any generated files."
76
+ task clobber: [:clean] do
77
+ Rake::Cleaner.cleanup_files(CLOBBER)
32
78
  end
@@ -1,25 +1,17 @@
1
+ # frozen_string_literal: true
1
2
  module Rake
2
- # ##########################################################################
3
+ ##
3
4
  # Mixin for creating easily cloned objects.
4
- #
5
- module Cloneable
6
- # Clone an object by making a new object and setting all the instance
7
- # variables to the same values.
8
- def dup
9
- sibling = self.class.new
10
- instance_variables.each do |ivar|
11
- value = self.instance_variable_get(ivar)
12
- new_value = value.clone rescue value
13
- sibling.instance_variable_set(ivar, new_value)
14
- end
15
- sibling.taint if tainted?
16
- sibling
17
- end
18
5
 
19
- def clone
20
- sibling = dup
21
- sibling.freeze if frozen?
22
- sibling
6
+ module Cloneable # :nodoc:
7
+ # The hook that is invoked by 'clone' and 'dup' methods.
8
+ def initialize_copy(source)
9
+ super
10
+ source.instance_variables.each do |var|
11
+ src_value = source.instance_variable_get(var)
12
+ value = src_value.clone rescue src_value
13
+ instance_variable_set(var, value)
14
+ end
23
15
  end
24
16
  end
25
17
  end
@@ -0,0 +1,107 @@
1
+ # frozen_string_literal: true
2
+ module Rake
3
+
4
+ # Based on a script at:
5
+ # http://stackoverflow.com/questions/891537/ruby-detect-number-of-cpus-installed
6
+ class CpuCounter # :nodoc: all
7
+ def self.count
8
+ new.count_with_default
9
+ end
10
+
11
+ def count_with_default(default=4)
12
+ count || default
13
+ rescue StandardError
14
+ default
15
+ end
16
+
17
+ begin
18
+ require "etc"
19
+ rescue LoadError
20
+ else
21
+ if Etc.respond_to?(:nprocessors)
22
+ def count
23
+ return Etc.nprocessors
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+
30
+ unless Rake::CpuCounter.method_defined?(:count)
31
+ Rake::CpuCounter.class_eval <<-'end;', __FILE__, __LINE__+1
32
+ require 'rbconfig'
33
+
34
+ def count
35
+ if RUBY_PLATFORM == 'java'
36
+ count_via_java_runtime
37
+ else
38
+ case RbConfig::CONFIG['host_os']
39
+ when /linux/
40
+ count_via_cpuinfo
41
+ when /darwin|bsd/
42
+ count_via_sysctl
43
+ when /mswin|mingw/
44
+ count_via_win32
45
+ else
46
+ # Try everything
47
+ count_via_win32 ||
48
+ count_via_sysctl ||
49
+ count_via_cpuinfo
50
+ end
51
+ end
52
+ end
53
+
54
+ def count_via_java_runtime
55
+ Java::Java.lang.Runtime.getRuntime.availableProcessors
56
+ rescue StandardError
57
+ nil
58
+ end
59
+
60
+ def count_via_win32
61
+ require 'win32ole'
62
+ wmi = WIN32OLE.connect("winmgmts://")
63
+ cpu = wmi.ExecQuery("select NumberOfCores from Win32_Processor") # TODO count hyper-threaded in this
64
+ cpu.to_enum.first.NumberOfCores
65
+ rescue StandardError, LoadError
66
+ nil
67
+ end
68
+
69
+ def count_via_cpuinfo
70
+ open('/proc/cpuinfo') { |f| f.readlines }.grep(/processor/).size
71
+ rescue StandardError
72
+ nil
73
+ end
74
+
75
+ def count_via_sysctl
76
+ run 'sysctl', '-n', 'hw.ncpu'
77
+ end
78
+
79
+ def run(command, *args)
80
+ cmd = resolve_command(command)
81
+ if cmd
82
+ IO.popen [cmd, *args] do |io|
83
+ io.read.to_i
84
+ end
85
+ else
86
+ nil
87
+ end
88
+ end
89
+
90
+ def resolve_command(command)
91
+ look_for_command("/usr/sbin", command) ||
92
+ look_for_command("/sbin", command) ||
93
+ in_path_command(command)
94
+ end
95
+
96
+ def look_for_command(dir, command)
97
+ path = File.join(dir, command)
98
+ File.exist?(path) ? path : nil
99
+ end
100
+
101
+ def in_path_command(command)
102
+ IO.popen ['which', command] do |io|
103
+ io.eof? ? nil : command
104
+ end
105
+ end
106
+ end;
107
+ end
@@ -1,7 +1,12 @@
1
+ # frozen_string_literal: true
1
2
  module Rake
2
3
 
3
4
  # Default Rakefile loader used by +import+.
4
5
  class DefaultLoader
6
+
7
+ ##
8
+ # Loads a rakefile into the current application from +fn+
9
+
5
10
  def load(fn)
6
11
  Rake.load_rakefile(File.expand_path(fn))
7
12
  end
@@ -1,11 +1,15 @@
1
+ # frozen_string_literal: true
1
2
  # Rake DSL functions.
2
- require 'rake/file_utils_ext'
3
+ require "rake/file_utils_ext"
3
4
 
4
5
  module Rake
5
6
 
6
7
  ##
7
8
  # DSL is a module that provides #task, #desc, #namespace, etc. Use this
8
9
  # when you'd like to use rake outside the top level scope.
10
+ #
11
+ # For a Rakefile you run from the command line this module is automatically
12
+ # included.
9
13
 
10
14
  module DSL
11
15
 
@@ -21,18 +25,41 @@ module Rake
21
25
 
22
26
  private
23
27
 
24
- # Declare a basic task.
28
+ # :call-seq:
29
+ # task(task_name)
30
+ # task(task_name: dependencies)
31
+ # task(task_name, arguments => dependencies)
25
32
  #
26
- # Example:
27
- # task :clobber => [:clean] do
33
+ # Declare a basic task. The +task_name+ is always the first argument. If
34
+ # the task name contains a ":" it is defined in that namespace.
35
+ #
36
+ # The +dependencies+ may be a single task name or an Array of task names.
37
+ # The +argument+ (a single name) or +arguments+ (an Array of names) define
38
+ # the arguments provided to the task.
39
+ #
40
+ # The task, argument and dependency names may be either symbols or
41
+ # strings.
42
+ #
43
+ # A task with a single dependency:
44
+ #
45
+ # task clobber: %w[clean] do
28
46
  # rm_rf "html"
29
47
  # end
30
48
  #
31
- def task(*args, &block)
49
+ # A task with an argument and a dependency:
50
+ #
51
+ # task :package, [:version] => :test do |t, args|
52
+ # # ...
53
+ # end
54
+ #
55
+ # To invoke this task from the command line:
56
+ #
57
+ # $ rake package[1.2.3]
58
+ #
59
+ def task(*args, &block) # :doc:
32
60
  Rake::Task.define_task(*args, &block)
33
61
  end
34
62
 
35
-
36
63
  # Declare a file task.
37
64
  #
38
65
  # Example:
@@ -46,14 +73,14 @@ module Rake
46
73
  # end
47
74
  # end
48
75
  #
49
- def file(*args, &block)
76
+ def file(*args, &block) # :doc:
50
77
  Rake::FileTask.define_task(*args, &block)
51
78
  end
52
79
 
53
80
  # Declare a file creation task.
54
81
  # (Mainly used for the directory command).
55
- def file_create(args, &block)
56
- Rake::FileCreationTask.define_task(args, &block)
82
+ def file_create(*args, &block)
83
+ Rake::FileCreationTask.define_task(*args, &block)
57
84
  end
58
85
 
59
86
  # Declare a set of files tasks to create the given directories on
@@ -62,12 +89,16 @@ module Rake
62
89
  # Example:
63
90
  # directory "testdata/doc"
64
91
  #
65
- def directory(dir)
92
+ def directory(*args, &block) # :doc:
93
+ result = file_create(*args, &block)
94
+ dir, _ = *Rake.application.resolve_args(args)
95
+ dir = Rake.from_pathname(dir)
66
96
  Rake.each_dir_parent(dir) do |d|
67
97
  file_create d do |t|
68
- mkdir_p t.name if ! File.exist?(t.name)
98
+ mkdir_p t.name unless File.exist?(t.name)
69
99
  end
70
100
  end
101
+ result
71
102
  end
72
103
 
73
104
  # Declare a task that performs its prerequisites in
@@ -76,24 +107,32 @@ module Rake
76
107
  # about it)
77
108
  #
78
109
  # Example:
79
- # multitask :deploy => [:deploy_gem, :deploy_rdoc]
110
+ # multitask deploy: %w[deploy_gem deploy_rdoc]
80
111
  #
81
- def multitask(args, &block)
82
- Rake::MultiTask.define_task(args, &block)
112
+ def multitask(*args, &block) # :doc:
113
+ Rake::MultiTask.define_task(*args, &block)
83
114
  end
84
115
 
85
116
  # Create a new rake namespace and use it for evaluating the given
86
117
  # block. Returns a NameSpace object that can be used to lookup
87
118
  # tasks defined in the namespace.
88
119
  #
89
- # E.g.
120
+ # Example:
90
121
  #
91
122
  # ns = namespace "nested" do
123
+ # # the "nested:run" task
92
124
  # task :run
93
125
  # end
94
126
  # task_run = ns[:run] # find :run in the given namespace.
95
127
  #
96
- def namespace(name=nil, &block)
128
+ # Tasks can also be defined in a namespace by using a ":" in the task
129
+ # name:
130
+ #
131
+ # task "nested:test" do
132
+ # # ...
133
+ # end
134
+ #
135
+ def namespace(name=nil, &block) # :doc:
97
136
  name = name.to_s if name.kind_of?(Symbol)
98
137
  name = name.to_str if name.respond_to?(:to_str)
99
138
  unless name.kind_of?(String) || name.nil?
@@ -106,22 +145,24 @@ module Rake
106
145
  #
107
146
  # Example:
108
147
  # rule '.o' => '.c' do |t|
109
- # sh %{cc -o #{t.name} #{t.source}}
148
+ # sh 'cc', '-o', t.name, t.source
110
149
  # end
111
150
  #
112
- def rule(*args, &block)
151
+ def rule(*args, &block) # :doc:
113
152
  Rake::Task.create_rule(*args, &block)
114
153
  end
115
154
 
116
- # Describe the next rake task.
155
+ # Describes the next rake task. Duplicate descriptions are discarded.
156
+ # Descriptions are shown with <code>rake -T</code> (up to the first
157
+ # sentence) and <code>rake -D</code> (the entire description).
117
158
  #
118
159
  # Example:
119
160
  # desc "Run the Unit Tests"
120
- # task :test => [:build]
121
- # runtests
161
+ # task test: [:build]
162
+ # # ... run tests
122
163
  # end
123
164
  #
124
- def desc(description)
165
+ def desc(description) # :doc:
125
166
  Rake.application.last_description = description
126
167
  end
127
168
 
@@ -139,38 +180,16 @@ module Rake
139
180
  # Example:
140
181
  # import ".depend", "my_rules"
141
182
  #
142
- def import(*fns)
183
+ def import(*fns) # :doc:
143
184
  fns.each do |fn|
144
185
  Rake.application.add_import(fn)
145
186
  end
146
187
  end
147
-
148
- end
149
-
150
- DeprecatedCommands = Object.new.extend(DSL)
151
-
152
- module DeprecatedObjectDSL # :nodoc:
153
- DSL.private_instance_methods(false).each do |name|
154
- line = __LINE__+1
155
- class_eval %{
156
- def #{name}(*args, &block)
157
- unless Rake.application.options.ignore_deprecate
158
- unless @rake_dsl_warning
159
- $stderr.puts "WARNING: Global access to Rake DSL methods is deprecated. Please include"
160
- $stderr.puts " ... Rake::DSL into classes and modules which use the Rake DSL methods."
161
- @rake_dsl_warning = true
162
- end
163
- $stderr.puts "WARNING: DSL method \#{self.class}##{name} called at \#{caller.first}"
164
- end
165
- Rake::DeprecatedCommands.send(:#{name}, *args, &block)
166
- end
167
- private :#{name}
168
- }, __FILE__, line
169
- end
170
188
  end
171
-
172
189
  extend FileUtilsExt
173
190
  end
174
191
 
192
+ # Extend the main object with the DSL commands. This allows top-level
193
+ # calls to task, etc. to work from a Rakefile without polluting the
194
+ # object inheritance tree.
175
195
  self.extend Rake::DSL
176
- include Rake::DeprecatedObjectDSL
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Rake
2
3
 
3
4
  # EarlyTime is a fake timestamp that occurs _before_ any other time value.
@@ -5,11 +6,14 @@ module Rake
5
6
  include Comparable
6
7
  include Singleton
7
8
 
9
+ ##
10
+ # The EarlyTime always comes before +other+!
11
+
8
12
  def <=>(other)
9
13
  -1
10
14
  end
11
15
 
12
- def to_s
16
+ def to_s # :nodoc:
13
17
  "<EARLY TIME>"
14
18
  end
15
19
  end
data/lib/rake/ext/core.rb CHANGED
@@ -1,8 +1,6 @@
1
- ######################################################################
2
- # Core extension library
3
- #
1
+ # frozen_string_literal: true
4
2
  class Module
5
- # Check for an existing method in the current class before extending. IF
3
+ # Check for an existing method in the current class before extending. If
6
4
  # the method already exists, then a warning is printed and the extension is
7
5
  # not added. Otherwise the block is yielded and any definitions in the
8
6
  # block will take effect.
@@ -17,9 +15,10 @@ class Module
17
15
  # end
18
16
  # end
19
17
  #
20
- def rake_extension(method)
18
+ def rake_extension(method) # :nodoc:
21
19
  if method_defined?(method)
22
- $stderr.puts "WARNING: Possible conflict with Rake extension: #{self}##{method} already exists"
20
+ $stderr.puts "WARNING: Possible conflict with Rake extension: " +
21
+ "#{self}##{method} already exists"
23
22
  else
24
23
  yield
25
24
  end