rake 0.4.8

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rake might be problematic. Click here for more details.

data/CHANGES ADDED
@@ -0,0 +1,132 @@
1
+ = Rake Changelog
2
+
3
+ == Version 0.4.8
4
+
5
+ * Added support for .rb versions of Rakefile.
6
+ * Removed \\\n's from test task.
7
+ * Fixed Ruby 1.9 compatibility issue with FileList.
8
+
9
+ == Version 0.4.7
10
+
11
+ * Fixed problem in FileList that caused Ruby 1.9 to go into infinite
12
+ recursion. Since to_a was removed from Object, it does not need to
13
+ added back into the list of methods to rewrite in FileList. (Thanks
14
+ to Kent Sibilev for pointing this out).
15
+
16
+ == Version 0.4.6
17
+ * Removed test version of ln in FileUtils that prevented safe_ln from
18
+ using ln.
19
+
20
+ == Version 0.4.5
21
+ * Upgraded comments in TestTask.
22
+ * FileList to_s and inspect now automatically resolve pending changes.
23
+ * FileList#exclude properly returns the FileList.
24
+
25
+ == Version 0.4.4
26
+ * Fixed initialization problem with @comment.
27
+ * Now using multi -r technique in TestTask. Switch Rakefile back to
28
+ using the built-in test task macros because the rake runtime is no
29
+ longer needed.
30
+ * Added 'TEST=filename' and 'TESTOPTS=options' to the Test Task
31
+ macros.
32
+ * Allow a +test_files+ attribute in test tasks. This allows more
33
+ flexibility in specifying test files.
34
+
35
+ == Version 0.4.3
36
+ * Fixed Comment leakage.
37
+
38
+ == Version 0.4.2
39
+ * Added safe_ln that falls back to a copy if a file link is not supported.
40
+ * Package builder now uses safe_ln.
41
+
42
+ == Version 0.4.1
43
+ * Task comments are now additive, combined with "/".
44
+ * Works with (soon to be released) rubygems 0.6.2 (or 0.7.0)
45
+
46
+ == Version 0.4.0
47
+ * FileList now uses deferred loading. The file system is not searched
48
+ until the first call that needs the file names.
49
+ * VAR=VALUE options are now accepted on the command line and are
50
+ treated like environment variables. The values may be tested in a
51
+ Rakefile by referencing ENV['VAR'].
52
+ * File.mtime is now used (instead of File.new().mtime).
53
+
54
+ == Version 0.3.2.x
55
+
56
+ * Removed some hidden dependencies on rubygems. Tests now will test
57
+ gems only if they are installed.
58
+ * Removed Sys from some example files. I believe that is that last
59
+ reference to Sys outside of the contrib area.
60
+ * Updated all copyright notices to include 2004.
61
+
62
+ == Version 0.3.2
63
+
64
+ * GEM Installation now works with the application stub.
65
+
66
+ == Version 0.3.1
67
+
68
+ * FileLists now automatically ignore CVS, .bak, !
69
+ * GEM Installation now works.
70
+
71
+ == Version 0.3.0
72
+
73
+ Promoted 0.2.10.
74
+
75
+ == Version 0.2.10
76
+ General
77
+
78
+ * Added title to Rake's rdocs
79
+ * Contrib packages are no longer included in the documentation.
80
+
81
+ RDoc Issues
82
+
83
+ * Removed default for the '--main' option
84
+ * Fixed rendering of the rdoc options
85
+ * Fixed clean/clobber confusion with rerdoc
86
+ * 'title' attribute added
87
+
88
+ Package Task Library Issues
89
+
90
+ * Version (or explicit :noversion) is required.
91
+ * +package_file+ attribute is now writable
92
+
93
+ FileList Issues
94
+
95
+ * Dropped bang version of exclude. Now using ant-like include/exclude semantics.
96
+ * Enabled the "yield self" idiom in FileList#initialize.
97
+
98
+ == Version 0.2.9
99
+
100
+ This version contains numerous changes as the RubyConf.new(2003)
101
+ presentation was being prepared. The changes include:
102
+
103
+ * The monolithic rubyapp task library is in the process of being
104
+ dropped in favor of lighter weight task libraries.
105
+
106
+ == Version 0.2.7
107
+
108
+ * Added "desc" for task descriptions.
109
+ * -T will now display tasks with descriptions.
110
+ * -P will display tasks and prerequisites.
111
+ * Dropped the Sys module in favor of the 1.8.x FileUtils module. Sys
112
+ is still supported in the contrib area.
113
+
114
+ == Version 0.2.6
115
+
116
+ * Moved to RubyForge
117
+
118
+ == Version 0.2.5
119
+
120
+ * Switched to standard ruby app builder.
121
+ * Added no_match option to file matcher.
122
+
123
+ == Version 0.2.4
124
+
125
+ * Fixed indir, which neglected to actually change directories.
126
+
127
+ == Version 0.2.3
128
+
129
+ * Added rake module for a help target
130
+ * Added 'for_files' to Sys
131
+ * Added a $rakefile constant
132
+ * Added test for selecting proper rule with multiple targets.
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2003, 2004 Jim Weirich
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
data/README ADDED
@@ -0,0 +1,209 @@
1
+ = RAKE -- Ruby Make
2
+
3
+ This package contains Rake, a simple ruby build program with
4
+ capabilities similar to make.
5
+
6
+ Rake has the following features:
7
+
8
+ * Rakefiles (rake's version of Makefiles) are completely defined in
9
+ standard Ruby syntax. No XML files to edit. No quirky Makefile
10
+ syntax to worry about (is that a tab or a space?)
11
+
12
+ * Users can specify tasks with prerequisites.
13
+
14
+ * Rake supports rule patterns to sythesize implicit tasks.
15
+
16
+ * Rake is lightweight. It can be distributed with other projects as a
17
+ single file. Projects that depend upon rake do not require that
18
+ rake be installed on target systems.
19
+
20
+ == Download
21
+
22
+ The latest version of rake can be found at
23
+
24
+ * http://rubyforge.org/project/showfiles.php?group_id=50
25
+
26
+ Online Resources can be found at ...
27
+
28
+ * Online Rake Documentation: http://rake.rubyforge.org
29
+ * Rake Project Page: http://rubyforge.org/projects/rake
30
+ * Rake Project Wiki: http://rake.rubyforge.org/wiki/wiki.pl
31
+
32
+ == Installation
33
+
34
+ === Normal Installation
35
+
36
+ You can install rake with the following command.
37
+
38
+ % ruby install.rb
39
+
40
+ from its distribution directory.
41
+
42
+ === GEM Installation
43
+
44
+ Download and install rake with the following.
45
+
46
+ gem install --remote rake
47
+
48
+ == Roadmap
49
+
50
+ * If you want to see how to invoke rake to build your projects, read on.
51
+ * If you want to see the format of a Rakefile, see
52
+ doc/rakefile.rdoc[http://rake.rubyforge.org/files/doc/rakefile_rdoc.html].
53
+ * If you want to see the original announcement of rake, see
54
+ doc/rational.rdoc[http://rake.rubyforge.org/files/doc/rational_rdoc.html].
55
+ * If you want to see a glossary of terms, see
56
+ doc/glossary.rdoc[http://rake.rubyforge.org/files/doc/glossary_rdoc.html].
57
+
58
+
59
+ == Simple Example
60
+
61
+ Once installed, you can run rake as follows ...
62
+
63
+ % rake [options ...] [VAR=VALUE ...] [tasks...]
64
+
65
+ Type "rake --help" for an up-to-date option summary.
66
+
67
+ Invoking <tt>rake</tt> without any options or targets causes rake to
68
+ look for a rakefile and invoke the default task in that rakefile.
69
+
70
+ For example, given a simple rakefile like this ...
71
+
72
+ task :default => [:test]
73
+
74
+ task :test do
75
+ ruby "test/unittest.rb"
76
+ end
77
+
78
+ The command
79
+
80
+ $ rake
81
+
82
+ will invoke the +default+ task. As +default+ satisfies its
83
+ prerequisites, the +test+ task will run the unit tests for the
84
+ package.
85
+
86
+ == Other Make Reinvisionings ...
87
+
88
+ Rake is a late entry in the make replacement field. Here are links to
89
+ other projects with similar (and not so similar) goals.
90
+
91
+ * http://www.a-a-p.org -- Make in Python
92
+ * http://www.aromatic.com/tools/jam.txt -- JAM, Java Automated Make
93
+ * http://ant.apache.org -- The Ant project
94
+ * http://www.perl.com/language/ppt/src/make/index.html -- Make from
95
+ the Perl Power Tools implementation.
96
+
97
+ == Credits
98
+
99
+ [<b>Ryan Dlugosz</b>] For the initial conversation that sparked Rake.
100
+
101
+ [<b>nobu.nokada@softhome.net</b>] For the initial patch for rule support.
102
+
103
+ == License
104
+
105
+ Rake is available under an MIT-style license.
106
+
107
+ :include: MIT-LICENSE
108
+
109
+ == Support
110
+
111
+ The Rake homepage is http://rake.rubyforge.org. You can find the Rake
112
+ RubyForge page at http://rubyforge.org/projects/rake.
113
+
114
+ Feel free to submit commits or feature requests. If you send a patch,
115
+ remember to update the corresponding unit tests. If fact, I prefer
116
+ new feature to be submitted in the form of new unit tests.
117
+
118
+ For other information, feel free to ask on the ruby-talk mailing list
119
+ (which is mirrored to comp.lang.ruby) or contact
120
+ mailto:jim@weirichhouse.org.
121
+
122
+ ----
123
+
124
+ = Usage
125
+
126
+ Rake is invoked from the command line using:
127
+
128
+ % rake [<em>options</em> ...] [<em>VAR</em>=<em>VALUE</em>] [<em>targets</em> ...]
129
+
130
+ Options are:
131
+
132
+ [<tt><em>name</em>=<em>value</em></tt>]
133
+ Set the environment variable <em>name</em> to <em>value</em>
134
+ during the execution of the <b>rake</b> command. You can access
135
+ the value by using ENV['<em>name</em>'].
136
+
137
+ [<tt>--dry-run</tt> (-n)]
138
+ Do a dry run. Print the tasks invoked and executed, but do not
139
+ actually execute any of the actions.
140
+
141
+ [<tt>--help</tt> (-H)]
142
+ Display some help text and exit.
143
+
144
+ [<tt>--libdir</tt> _directory_ (-I)]
145
+ Add _directory_ to the list of directories searched for require.
146
+
147
+ [<tt>--nosearch</tt> (-N)]
148
+ Do not search for a Rakefile in parent directories.
149
+
150
+ [<tt>--prereqs</tt> (-P)]
151
+ Display a list of all tasks and their immediate prerequisites.
152
+
153
+ [<tt>--quiet</tt> (-q)]
154
+ Do not echo commands from FileUtils.
155
+
156
+ [<tt>--rakefile</tt> _filename_ (-f)]
157
+ Use _filename_ as the name of the rakefile. The default rakefile
158
+ names are +rakefile+ and +Rakefile+ (with +rakefile+ taking
159
+ precedence). If the rakefile is not found in the current
160
+ directory, +rake+ will search parent directories for a match. The
161
+ directory where the Rakefile is found will become the current
162
+ directory for the actions executed in the Rakefile.
163
+
164
+ [<tt>--require</tt> _name_ (-r)]
165
+ Require _name_ before executing the Rakefile.
166
+
167
+ [<tt>--tasks</tt> (-T)]
168
+ Display a list of the major tasks and their comments. Comments
169
+ are defined using the "desc" command.
170
+
171
+ [<tt>--trace</tt> (-t)]
172
+ Turn on invoke/execute tracing.
173
+
174
+ [<tt>--usage</tt> (-h)]
175
+ Display a usage message and exit.
176
+
177
+ [<tt>--verbose</tt> (-v)]
178
+ Echo the Sys commands to standard output.
179
+
180
+ [<tt>--version</tt> (-V)]
181
+ Display the program version and exit.
182
+
183
+ In addition, any command line option of the form
184
+ <em>VAR</em>=<em>VALUE</em> will be added to the environment hash
185
+ <tt>ENV</tt> and may be tested in the Rakefile.
186
+
187
+ ---
188
+
189
+ = Rakefile Format
190
+
191
+ See doc/rakefile.rdoc[http://rake.rubyforge.org/files/doc/rakefile_rdoc.html]
192
+ for details on the Rakefile format.
193
+
194
+ ---
195
+
196
+ = Other stuff
197
+
198
+ Author:: Jim Weirich <jim@weirichhouse.org>
199
+ Requires:: Ruby 1.8.0 or later
200
+ License:: Copyright 2003, 2004 by Jim Weirich.
201
+ Released under an MIT-style license. See the LICENSE file
202
+ included in the distribution.
203
+
204
+ == Warranty
205
+
206
+ This software is provided "as is" and without any express or
207
+ implied warranties, including, without limitation, the implied
208
+ warranties of merchantibility and fitness for a particular
209
+ purpose.
@@ -0,0 +1,215 @@
1
+ # Rakefile for rake -*- ruby -*-
2
+
3
+ # Copyright 2003, 2004 by Jim Weirich (jim@weirichhouse.org)
4
+ # All rights reserved.
5
+
6
+ # This file is may be distributed under an MIT style license. See
7
+ # MIT-LICENSE for details.
8
+
9
+ begin
10
+ require 'rubygems'
11
+ require 'rake/gempackagetask'
12
+ rescue Exception
13
+ nil
14
+ end
15
+ require 'rake/clean'
16
+ require 'rake/testtask'
17
+ require 'rake/rdoctask'
18
+
19
+ CLEAN.include('**/*.o')
20
+ CLOBBER.include('doc/example/main')
21
+
22
+ # Determine the current version of the software
23
+
24
+ if `ruby -Ilib ./bin/rake --version` =~ /\S+$/
25
+ PKG_VERSION = $&
26
+ else
27
+ PKG_VERSION = "0.0.0"
28
+ end
29
+
30
+ SRC_RB = FileList['lib/**/*.rb']
31
+
32
+ # The default task is run if rake is given no explicit arguments.
33
+
34
+ desc "Default Task"
35
+ task :default => :test
36
+
37
+ # Test Tasks ---------------------------------------------------------
38
+
39
+ Rake::TestTask.new do |t|
40
+ t.test_files = FileList['test/test*.rb']
41
+ t.verbose = true
42
+ end
43
+
44
+ Rake::TestTask.new(:testfun) do |t|
45
+ t.pattern = 'test/fun*.rb'
46
+ t.verbose = true
47
+ end
48
+
49
+ Rake::TestTask.new(:testcontrib) do |t|
50
+ t.pattern = 'test/contrib/test*.rb'
51
+ t.verbose = true
52
+ end
53
+
54
+ directory 'testdata'
55
+ task :test => ['testdata']
56
+
57
+ desc "Run all test targets"
58
+ task :testall => [:test, :testcontrib, :testfun]
59
+
60
+ # Abbreviations
61
+
62
+ task :ta => [:testall]
63
+ task :tf => [:testfun]
64
+ task :tc => [:testcontrib]
65
+
66
+ # CVS Tasks ----------------------------------------------------------
67
+
68
+ desc "Tag all the CVS files with the latest release number (TAG=x)"
69
+ task :tag do
70
+ rel = "REL_" + PKG_VERSION.gsub(/\./, '_')
71
+ rel << ENV['TAG'] if ENV['TAG']
72
+ puts rel
73
+ sh %{cvs commit -m 'pre-tag commit'}
74
+ sh %{cvs tag #{rel}}
75
+ end
76
+
77
+ # Install rake using the standard install.rb script.
78
+
79
+ desc "Install the application"
80
+ task :install do
81
+ ruby "install.rb"
82
+ end
83
+
84
+ # Create a task to build the RDOC documentation tree.
85
+
86
+ rd = Rake::RDocTask.new("rdoc") { |rdoc|
87
+ rdoc.rdoc_dir = 'html'
88
+ # rdoc.template = 'kilmer'
89
+ # rdoc.template = 'css2'
90
+ rdoc.title = "Rake -- Ruby Make"
91
+ rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
92
+ rdoc.rdoc_files.include('README', 'MIT-LICENSE', 'TODO', 'CHANGES')
93
+ rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
94
+ rdoc.rdoc_files.exclude(/\bcontrib\b/)
95
+ }
96
+
97
+ # ====================================================================
98
+ # Create a task that will package the Rake software into distributable
99
+ # tar, zip and gem files.
100
+
101
+ PKG_FILES = FileList[
102
+ 'install.rb',
103
+ '[A-Z]*',
104
+ 'bin/**/*',
105
+ 'lib/**/*.rb',
106
+ 'test/**/*.rb',
107
+ 'doc/**/*'
108
+ ]
109
+ PKG_FILES.exclude('doc/example/*.o')
110
+ PKG_FILES.exclude(%r{doc/example/main$})
111
+
112
+ if ! defined?(Gem)
113
+ puts "Package Target requires RubyGEMs"
114
+ else
115
+ spec = Gem::Specification.new do |s|
116
+
117
+ #### Basic information.
118
+
119
+ s.name = 'rake'
120
+ s.version = PKG_VERSION
121
+ s.summary = "Ruby based make-like utility."
122
+ s.description = <<-EOF
123
+ Rake is a Make-like program implemented in Ruby. Tasks
124
+ and dependencies are specified in standard Ruby syntax.
125
+ EOF
126
+
127
+ #### Dependencies and requirements.
128
+
129
+ #s.add_dependency('log4r', '> 1.0.4')
130
+ #s.requirements << ""
131
+
132
+ #### Which files are to be included in this gem? Everything! (Except CVS directories.)
133
+
134
+ s.files = PKG_FILES.to_a
135
+
136
+ #### C code extensions.
137
+
138
+ #s.extensions << "ext/rmagic/extconf.rb"
139
+
140
+ #### Load-time details: library and application (you will need one or both).
141
+
142
+ s.require_path = 'lib' # Use these for libraries.
143
+ s.autorequire = 'rake'
144
+
145
+ s.bindir = "bin" # Use these for applications.
146
+ s.executables = ["rake"]
147
+ s.default_executable = "rake"
148
+
149
+ #### Documentation and testing.
150
+
151
+ s.has_rdoc = true
152
+ s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
153
+ s.rdoc_options <<
154
+ '--title' << 'Rake -- Ruby Make' <<
155
+ '--main' << 'README' <<
156
+ '--line-numbers'
157
+
158
+ #### Author and project details.
159
+
160
+ s.author = "Jim Weirich"
161
+ s.email = "jim@weirichhouse.org"
162
+ s.homepage = "http://onestepback.org"
163
+ s.rubyforge_project = "rake"
164
+ end
165
+
166
+ Rake::GemPackageTask.new(spec) do |pkg|
167
+ #pkg.need_zip = true
168
+ pkg.need_tar = true
169
+ end
170
+ end
171
+
172
+ # Misc tasks =========================================================
173
+
174
+ def count_lines(filename)
175
+ lines = 0
176
+ codelines = 0
177
+ open(filename) { |f|
178
+ f.each do |line|
179
+ lines += 1
180
+ next if line =~ /^\s*$/
181
+ next if line =~ /^\s*#/
182
+ codelines += 1
183
+ end
184
+ }
185
+ [lines, codelines]
186
+ end
187
+
188
+ def show_line(msg, lines, loc)
189
+ printf "%6s %6s %s\n", lines.to_s, loc.to_s, msg
190
+ end
191
+
192
+ desc "Count lines in the main rake file"
193
+ task :lines do
194
+ total_lines = 0
195
+ total_code = 0
196
+ show_line("File Name", "LINES", "LOC")
197
+ SRC_RB.each do |fn|
198
+ lines, codelines = count_lines(fn)
199
+ show_line(fn, lines, codelines)
200
+ total_lines += lines
201
+ total_code += codelines
202
+ end
203
+ show_line("TOTAL", total_lines, total_code)
204
+ end
205
+
206
+ ARCHIVEDIR = '/mnt/usb'
207
+
208
+ task :archive => [:package] do
209
+ cp FileList["pkg/*.tgz", "pkg/*.zip", "pkg/*.gem"], ARCHIVEDIR
210
+ end
211
+
212
+ # Define an optional publish target in an external file. If the
213
+ # publish.rf file is not found, the publish targets won't be defined.
214
+
215
+ load "publish.rf" if File.exist? "publish.rf"