require 'rake/classic_namespace'
to the
Rakefile to get the old behavior.
rake will print a rather annoying warning whenever a
deprecated class name is referenced without enabling classic
namespace.
===== Bug Fixes
* Several unit tests and functional tests were fixed to run better
under windows.
* Directory tasks are now a specialized version of a File task. A
directory task will only be triggered if it doesn't exist. It will
not be triggered if it is out of date w.r.t. any of its
prerequisites.
* Fixed a bug in the Rake::GemPackageTask class so that the gem now
properly contains the platform name.
* Fixed a bug where a prerequisite on a file task would cause
an exception if the prerequisite did not exist.
==== Thanks
As usual, it was input from users that drove a alot of these changes.
The following people either contributed patches, made suggestions or
made otherwise helpful comments. Thanks to ...
* Greg Fast (better ruby_opt test options)
* Kelly Felkins (requested by better namespace support)
* Martin Fowler (suggested Task.investigation)
* Stuart Jansen (send initial patch for multiple prerequisites).
* Masao Mutch (better support for non-ruby Gem platforms)
* Philipp Neubeck (patch for file task exception fix)
-- Jim Weirich
=== 0.5.4
Time for some minor bug fixes and small enhancements
==== Changes
Here are the changes for version 0.5.4 ...
* Added double quotes to the test runner. This allows the location of
the tests (and runner) to be in a directory path that contains
spaces (e.g. "C:/Program Files/ruby/bin").
* Added .svn to default ignore list. Now subversion project metadata
is automatically ignored by Rake's FileList.
* Updated FileList#include to support nested arrays and filelists.
FileLists are flat lists of file names. Using a FileList in an
include will flatten out the nested file names.
== Thanks
As usual, it was input from users that drove a alot of these changes.
Thanks to ...
* Tilman Sauerbeck for the nested FileList suggestion.
* Josh Knowles for pointing out the spaces in directory name problem.
-- Jim Weirich
=== 0.5.3
Although it has only been two weeks since the last release, we have
enough updates to the Rake program to make it time for another
release.
==== Changes
Here are the changes for version 0.5.3 ...
* FileLists have been extensively changed so that they mimic the
behavior of real arrays even more closely. In particular,
operations on FileLists that return a new collection (e.g. collect,
reject) will now return a FileList rather than an array. In
addition, several places where FileLists were not properly expanded
before use have been fixed.
* A method (+ext+) to simplify the handling of file extensions was
added to String and to Array.
* The 'testrb' script in test/unit tends to silently swallow syntax
errors in test suites. Because of that, the default test loader is
now a rake-provided script. You can still use 'testrb' by setting
the loader flag in the test task to :testrb. (See the API documents
for TestTask for all the loader flag values).
* FileUtil methods (e.g. cp, mv, install) are now declared to be
private. This will cut down on the interference with user defined
methods of the same name.
* Fixed the verbose flag in the TestTask so that the test code is
controlled by the flag. Also shortened up some failure messages.
(Thanks to Tobias Luetke for the suggestion).
* Rules will now properly detect a task that can generate a source
file. Previously rules would only consider source files that were
already present.
* Added an +import+ command that allows Rake to dynamically import
dependendencies into a running Rake session. The +import+ command
can run tasks to update the dependency file before loading them.
Dependency files can be in rake or make format, allowing rake to
work with tools designed to generate dependencies for make.
==== Thanks
As usual, it was input from users that drove a alot of these changes.
Thanks to ...
* Brian Gernhardt for the rules fix (especially for the patience to
explain the problem to me until I got what he was talking about).
* Stefan Lang for pointing out problems in the dark corners of the
FileList implementation.
* Alexey Verkhovsky pointing out the silently swallows syntax errors
in tests.
* Tobias Luetke for beautifying the test task output.
* Sam Roberts for some of the ideas behind dependency loading.
-- Jim Weirich
=== 0.5.0
It has been a long time in coming, but we finally have a new version
of Rake available.
==== Changes
* Fixed documentation that was lacking the Rake module name (Tilman
Sauerbeck).
* Added tar.gz and tar.bz2 support to package task (Tilman Sauerbeck).
* Recursive rules are now supported (Tilman Sauerbeck).
* Added warning option for the Test Task (requested by Eric Hodel).
* The jamis rdoc template is only used if it exists.
* Added fix for Ruby 1.8.2 test/unit and rails problem.
* Added contributed rake man file (Jani Monoses).
* Added Brian Candler's fix for problems in --trace and --dry-run
mode.
==== Thanks
Lots of people provided input to this release. Thanks to Tilman
Sauerbeck for numerous patches, documentation fixes and suggestions.
And for also pushing me to get this release out. Also, thanks to
Brian Candler for the finding and fixing --trace/dry-run fix. That
was an obscure bug. Also to Eric Hodel for some good suggestions.
-- Jim Weirich
=== 0.4.15
==== Changes
Version 0.4.15 is a bug fix update for the Ruby 1.8.2 compatibility
changes. This release includes:
* Fixed a bug that prevented the TESTOPTS flag from working with the
revised for 1.8.2 test task.
* Updated the docs on --trace to indicate that it also enables a full
backtrace on errors.
* Several fixes for new warnings generated.
==== Mini-Roadmap
I will continue to issue Rake updates in the 0.4.xx series as new
Ruby-1.8.2 issues become manifest. Once the codebase stabilizes, I
will release a 0.5.0 version incorporating all the changes. If you
are not using Ruby-1.8.2 and wish to avoid version churn, I recommend
staying with a release prior to Rake-0.4.14.
=== 0.4.14
Version 0.4.14 is a compatibility fix to allow Rake's test task to
work under Ruby 1.8.2. A change in the Test::Unit autorun feature
prevented Rake from running any tests. This release fixes the
problem.
Rake 0.4.14 is the recommended release for anyone using Ruby 1.8.2.
=== 0.4.13
* Fixed the dry-run flag so it is operating again.
* Multiple arguments to sh and ruby commands will not be interpreted
by the shell (patch provided by Jonathan Paisley).
=== 0.4.12
* Added --silent (-s) to suppress the (in directory) rake message.
=== 0.4.11
* Changed the "don't know how to rake" message (finally)
* Changes references to a literal "Rakefile" to reference the global
variable $rakefile (which contains the actual name of the rakefile).
=== 0.4.10
* Added block support to the "sh" command, allowing users to take
special actions on the result of the system call. E.g.
sh "shell_command" do |ok, res|
puts "Program returned #{res.exitstatus}" if ! ok
end
=== 0.4.9
* Switched to Jamis Buck's RDoc template.
* Removed autorequire from Rake's gem spec. This prevents the Rake
libraries from loading while using rails.
=== 0.4.8
* Added support for .rb versions of Rakefile.
* Removed \\\n's from test task.
* Fixed Ruby 1.9 compatibility issue with FileList.
=== 0.4.7
* Fixed problem in FileList that caused Ruby 1.9 to go into infinite
recursion. Since to_a was removed from Object, it does not need to
added back into the list of methods to rewrite in FileList. (Thanks
to Kent Sibilev for pointing this out).
=== 0.4.6
* Removed test version of ln in FileUtils that prevented safe_ln from
using ln.
=== 0.4.5
* Upgraded comments in TestTask.
* FileList to_s and inspect now automatically resolve pending changes.
* FileList#exclude properly returns the FileList.
=== 0.4.4
* Fixed initialization problem with @comment.
* Now using multi -r technique in TestTask. Switch Rakefile back to
using the built-in test task macros because the rake runtime is no
longer needed.
* Added 'TEST=filename' and 'TESTOPTS=options' to the Test Task
macros.
* Allow a +test_files+ attribute in test tasks. This allows more
flexibility in specifying test files.
=== 0.4.3
* Fixed Comment leakage.
=== 0.4.2
* Added safe_ln that falls back to a copy if a file link is not supported.
* Package builder now uses safe\_ln.
=== 0.4.1
* Task comments are now additive, combined with "/".
* Works with (soon to be released) rubygems 0.6.2 (or 0.7.0)
=== 0.4.0
* FileList now uses deferred loading. The file system is not searched
until the first call that needs the file names.
* VAR=VALUE options are now accepted on the command line and are
treated like environment variables. The values may be tested in a
Rakefile by referencing ENV['VAR'].
* File.mtime is now used (instead of File.new().mtime).
=== 0.3.2.x
* Removed some hidden dependencies on rubygems. Tests now will test
gems only if they are installed.
* Removed Sys from some example files. I believe that is that last
reference to Sys outside of the contrib area.
* Updated all copyright notices to include 2004.
=== 0.3.2
* GEM Installation now works with the application stub.
=== 0.3.1
* FileLists now automatically ignore CVS, .bak, !
* GEM Installation now works.
=== 0.3.0
Promoted 0.2.10.
=== 0.2.10
General
* Added title to Rake's rdocs
* Contrib packages are no longer included in the documentation.
RDoc Issues
* Removed default for the '--main' option
* Fixed rendering of the rdoc options
* Fixed clean/clobber confusion with rerdoc
* 'title' attribute added
Package Task Library Issues
* Version (or explicit :noversion) is required.
* +package_file+ attribute is now writable
FileList Issues
* Dropped bang version of exclude. Now using ant-like include/exclude semantics.
* Enabled the "yield self" idiom in FileList#initialize.
=== 0.2.9
This version contains numerous changes as the RubyConf.new(2003)
presentation was being prepared. The changes include:
* The monolithic rubyapp task library is in the process of being
dropped in favor of lighter weight task libraries.
=== 0.2.7
* Added "desc" for task descriptions.
* -T will now display tasks with descriptions.
* -P will display tasks and prerequisites.
* Dropped the Sys module in favor of the 1.8.x FileUtils module. Sys
is still supported in the contrib area.
=== 0.2.6
* Moved to RubyForge
=== 0.2.5
* Switched to standard ruby app builder.
* Added no_match option to file matcher.
=== 0.2.4
* Fixed indir, which neglected to actually change directories.
=== 0.2.3
* Added rake module for a help target
* Added 'for\_files' to Sys
* Added a $rakefile constant
* Added test for selecting proper rule with multiple targets.
rake-13.0.6/MIT-LICENSE 0000664 0000000 0000000 00000002033 14071734706 0014166 0 ustar 00root root 0000000 0000000 Copyright (c) Jim Weirich
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
rake-13.0.6/README.rdoc 0000664 0000000 0000000 00000011535 14071734706 0014347 0 ustar 00root root 0000000 0000000 = RAKE -- Ruby Make
home :: https://github.com/ruby/rake
bugs :: https://github.com/ruby/rake/issues
docs :: https://ruby.github.io/rake
== Description
Rake is a Make-like program implemented in Ruby. Tasks and dependencies are
specified in standard Ruby syntax.
Rake has the following features:
* Rakefiles (rake's version of Makefiles) are completely defined in
standard Ruby syntax. No XML files to edit. No quirky Makefile
syntax to worry about (is that a tab or a space?)
* Users can specify tasks with prerequisites.
* Rake supports rule patterns to synthesize implicit tasks.
* Flexible FileLists that act like arrays but know about manipulating
file names and paths.
* A library of prepackaged tasks to make building rakefiles easier. For example,
tasks for building tarballs. (Formerly
tasks for building RDoc, Gems, and publishing to FTP were included in rake but they're now
available in RDoc, RubyGems, and rake-contrib respectively.)
* Supports parallel execution of tasks.
== Installation
=== Gem Installation
Download and install rake with the following.
gem install rake
== Usage
=== Simple Example
First, you must write a "Rakefile" file which contains the build rules. Here's
a simple example:
task default: %w[test]
task :test do
ruby "test/unittest.rb"
end
This Rakefile has two tasks:
* A task named "test", which -- upon invocation -- will run a unit test file
in Ruby.
* A task named "default". This task does nothing by itself, but it has exactly
one dependency, namely the "test" task. Invoking the "default" task will
cause Rake to invoke the "test" task as well.
Running the "rake" command without any options will cause it to run the
"default" task in the Rakefile:
% ls
Rakefile test/
% rake
(in /home/some_user/Projects/rake)
ruby test/unittest.rb
....unit test output here...
Type "rake --help" for all available options.
== Resources
=== Rake Information
* {Rake command-line}[link:doc/command_line_usage.rdoc]
* {Writing Rakefiles}[link:doc/rakefile.rdoc]
* The original {Rake announcement}[link:doc/rational.rdoc]
* Rake {glossary}[link:doc/glossary.rdoc]
=== Presentations and Articles about Rake
* Avdi Grimm's rake series:
1. {Rake Basics}[https://avdi.codes/rake-part-1-basics/]
2. {Rake File Lists}[https://avdi.codes/rake-part-2-file-lists-2/]
3. {Rake Rules}[https://avdi.codes/rake-part-3-rules/]
4. {Rake Pathmap}[https://avdi.codes/rake-part-4-pathmap/]
5. {File Operations}[https://avdi.codes/rake-part-5-file-operations/]
6. {Clean and Clobber}[https://avdi.codes/rake-part-6-clean-and-clobber/]
7. {MultiTask}[https://avdi.codes/rake-part-7-multitask/]
* {Jim Weirich's 2003 RubyConf presentation}[https://web.archive.org/web/20140221123354/http://onestepback.org/articles/buildingwithrake/]
* Martin Fowler's article on Rake: https://martinfowler.com/articles/rake.html
== Other Make Re-envisionings ...
Rake is a late entry in the make replacement field. Here are links to
other projects with similar (and not so similar) goals.
* https://directory.fsf.org/wiki/Bras -- Bras, one of earliest
implementations of "make in a scripting language".
* http://www.a-a-p.org -- Make in Python
* https://ant.apache.org -- The Ant project
* https://search.cpan.org/search?query=PerlBuildSystem -- The Perl Build System
* https://www.rubydoc.info/gems/rant/0.5.7/frames -- Rant, another Ruby make tool.
== Credits
[Jim Weirich] Who originally created Rake.
[Ryan Dlugosz] For the initial conversation that sparked Rake.
[Nobuyoshi Nakada File %short_name% |
|
In: | START:infiles HREF:full_path_url:full_path: IF:cvsurl (CVS) ENDIF:cvsurl END:infiles |
Parent: | IF:par_url ENDIF:par_url %parent% IF:par_url ENDIF:par_url |
%diagram% |
%name% | = | %value% |
%desc% |
IF:rw [%rw%] ENDIF:rw | %name% | %a_desc% |
[ show source ]
%sourcecode%
%code%HTML ########################## Index ################################ FR_INDEX_BODY = <
rake -T
(up to the first
# sentence) and rake -D
(the entire description).
#
# Example:
# desc "Run the Unit Tests"
# task test: [:build]
# # ... run tests
# end
#
def desc(description) # :doc:
Rake.application.last_description = description
end
# Import the partial Rakefiles +fn+. Imported files are loaded
# _after_ the current file is completely loaded. This allows the
# import statement to appear anywhere in the importing file, and yet
# allowing the imported files to depend on objects defined in the
# importing file.
#
# A common use of the import statement is to include files
# containing dependency declarations.
#
# See also the --rakelibdir command line option.
#
# Example:
# import ".depend", "my_rules"
#
def import(*fns) # :doc:
fns.each do |fn|
Rake.application.add_import(fn)
end
end
end
extend FileUtilsExt
end
# Extend the main object with the DSL commands. This allows top-level
# calls to task, etc. to work from a Rakefile without polluting the
# object inheritance tree.
self.extend Rake::DSL
rake-13.0.6/lib/rake/early_time.rb 0000664 0000000 0000000 00000000562 14071734706 0016706 0 ustar 00root root 0000000 0000000 # frozen_string_literal: true
module Rake
# EarlyTime is a fake timestamp that occurs _before_ any other time value.
class EarlyTime
include Comparable
include Singleton
##
# The EarlyTime always comes before +other+!
def <=>(other)
-1
end
def to_s # :nodoc:
"; rm # -rf /
.
#
# If a block is given, upon command completion the block is called with an
# OK flag (true on a zero exit status) and a Process::Status object.
# Without a block a RuntimeError is raised when the command exits non-zero.
#
# Examples:
#
# sh 'ls -ltr'
#
# sh 'ls', 'file with spaces'
#
# # check exit status after command runs
# sh %{grep pattern file} do |ok, res|
# if !ok
# puts "pattern not found (status = #{res.exitstatus})"
# end
# end
#
def sh(*cmd, &block)
options = (Hash === cmd.last) ? cmd.pop : {}
shell_runner = block_given? ? block : create_shell_runner(cmd)
set_verbose_option(options)
verbose = options.delete :verbose
noop = options.delete(:noop) || Rake::FileUtilsExt.nowrite_flag
Rake.rake_output_message sh_show_command cmd if verbose
unless noop
res = (Hash === cmd.last) ? system(*cmd) : system(*cmd, options)
status = $?
status = Rake::PseudoStatus.new(1) if !res && status.nil?
shell_runner.call(res, status)
end
end
def create_shell_runner(cmd) # :nodoc:
show_command = sh_show_command cmd
show_command = show_command[0, 42] + "..." unless $trace
lambda do |ok, status|
ok or
fail "Command failed with status (#{status.exitstatus}): " +
"[#{show_command}]"
end
end
private :create_shell_runner
def sh_show_command(cmd) # :nodoc:
cmd = cmd.dup
if Hash === cmd.first
env = cmd.first
env = env.map { |name, value| "#{name}=#{value}" }.join " "
cmd[0] = env
end
cmd.join " "
end
private :sh_show_command
def set_verbose_option(options) # :nodoc:
unless options.key? :verbose
options[:verbose] =
(Rake::FileUtilsExt.verbose_flag == Rake::FileUtilsExt::DEFAULT) ||
Rake::FileUtilsExt.verbose_flag
end
end
private :set_verbose_option
# Run a Ruby interpreter with the given arguments.
#
# Example:
# ruby %{-pe '$_.upcase!'