Permalink
Browse files

Clean up trailing whitespace.

  • Loading branch information...
1 parent 16ec262 commit af62240122cac37ade5d3d67445e077e78489355 @rtlechow rtlechow committed Jan 13, 2011
@@ -9,7 +9,7 @@ Options are:
[<tt><em>name</em>=<em>value</em></tt>]
Set the environment variable <em>name</em> to <em>value</em>
during the execution of the <b>rake</b> command. You can access
- the value by using ENV['<em>name</em>'].
+ the value by using ENV['<em>name</em>'].
[<tt>--classic-namespace</tt> (-n)]
Import the Task, FileTask, and FileCreateTask into the top-level
View
@@ -39,7 +39,7 @@
[<b>prerequisites</b>]
Every task has a set (possibility empty) of prerequisites. A
prerequisite P to Task T is itself a task that must be invoked
- before Task T.
+ before Task T.
[<b>rule</b>]
A rule is a recipe for synthesizing a task when no task is
View
@@ -183,7 +183,7 @@ module Page
CSS
XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
-<!DOCTYPE html
+<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
}
@@ -510,7 +510,7 @@ module Page
<!--
body {
background-color: #EEE;
- font-family: #{FONTS};
+ font-family: #{FONTS};
color: #000;
margin: 0px;
}
View
@@ -4,54 +4,54 @@ This is the original 100 line prototype rake program.
---
#!/usr/bin/env ruby
-
+
require 'ftools'
-
+
class Task
TASKS = Hash.new
-
+
attr_reader :prerequisites
-
+
def initialize(task_name)
@name = task_name
@prerequisites = []
@actions = []
end
-
+
def enhance(deps=nil, &block)
@prerequisites |= deps if deps
@actions << block if block_given?
self
end
-
+
def name
@name.to_s
end
-
+
def invoke
@prerequisites.each { |n| Task[n].invoke }
execute if needed?
end
-
+
def execute
return if @triggered
@triggered = true
@actions.collect { |act| result = act.call(self) }.last
end
-
+
def needed?
true
end
-
+
def timestamp
Time.now
end
-
+
class << self
def [](task_name)
TASKS[intern(task_name)] or fail "Don't know how to rake #{task_name}"
end
-
+
def define_task(args, &block)
case args
when Hash
@@ -66,44 +66,44 @@ This is the original 100 line prototype rake program.
deps = deps.collect {|d| intern(d) }
get(task_name).enhance(deps, &block)
end
-
+
def get(task_name)
name = intern(task_name)
TASKS[name] ||= self.new(name)
end
-
+
def intern(task_name)
(Symbol === task_name) ? task_name : task_name.intern
end
end
end
-
+
class FileTask < Task
def needed?
return true unless File.exist?(name)
latest_prereq = @prerequisites.collect{|n| Task[n].timestamp}.max
return false if latest_prereq.nil?
timestamp < latest_prereq
end
-
+
def timestamp
File.new(name.to_s).mtime
end
end
-
+
def task(args, &block)
Task.define_task(args, &block)
end
-
+
def file(args, &block)
FileTask.define_task(args, &block)
end
-
+
def sys(cmd)
puts cmd
system(cmd) or fail "Command Failed: [#{cmd}]"
end
-
+
def rake
begin
here = Dir.pwd
@@ -119,9 +119,9 @@ This is the original 100 line prototype rake program.
rescue Exception => ex
puts "rake aborted ... #{ex.message}"
puts ex.backtrace.find {|str| str =~ /Rakefile/ } || ""
- end
+ end
end
-
+
if __FILE__ == $0 then
rake
end
View
Binary file not shown.
View
@@ -38,7 +38,7 @@ too much work. And that was the end of that!
... Except I couldn't get the thought out of my head. What exactly
would be needed to make the about syntax work as a make file? Hmmm, you
would need to register the tasks, you need some way of specifying
-dependencies between tasks, and some way of kicking off the process.
+dependencies between tasks, and some way of kicking off the process.
Hey! What if we did ... and fifteen minutes later I had a working
prototype of Ruby make, complete with dependencies and actions.
@@ -97,7 +97,7 @@ Here's another task with dependencies ...
end
Task :clobber depends upon task :clean, so :clean will be run before
-:clobber is executed.
+:clobber is executed.
Files are specified by using the "file" command. It is similar to the
task command, except that the task name represents a file, and the task
@@ -115,7 +115,7 @@ Here is a file based dependency that will compile "hello.cc" to
I normally specify file tasks with string (rather than symbols). Some
file names can't be represented by symbols. Plus it makes the
-distinction between them more clear to the casual reader.
+distinction between them more clear to the casual reader.
Currently writing a task for each and every file in the project would be
tedious at best. I envision a set of libraries to make this job
@@ -9,7 +9,7 @@ changes. This release includes:
revised for 1.8.2 test task.
* Updated the docs on --trace to indicate that it also enables a full
- backtrace on errors.
+ backtrace on errors.
* Several fixes for new warnings generated.
@@ -1,7 +1,7 @@
= Rake 0.5.0 Released
It has been a long time in coming, but we finally have a new version
-of Rake available.
+of Rake available.
== Changes
@@ -7,12 +7,12 @@ class CompositePublisher
def initialize
@publishers = []
end
-
+
# Add a publisher to the composite.
def add(pub)
@publishers << pub
end
-
+
# Upload all the individual publishers.
def upload
@publishers.each { |p| p.upload }
@@ -133,7 +133,7 @@ def upload_files(wildcard)
upload(fn)
end
end
-
+
# Close the uploader.
def close
@ftp.close
@@ -6,13 +6,13 @@ module Rake
class RubyForgePublisher < SshDirPublisher
attr_reader :project, :proj_id, :user
-
+
def initialize(projname, user)
super(
"#{user}@rubyforge.org",
"/var/www/gforge-projects/#{projname}",
"html")
end
end
-
+
end
@@ -1,5 +1,5 @@
module Rake
-
+
# Default Rakefile loader used by +import+.
class DefaultLoader
def load(fn)
@@ -33,7 +33,7 @@ def process_line(line)
file file_task => dependents
end
end
-
+
def respace(str)
str.gsub(/#{SPACE_MARK}/, ' ')
end
@@ -25,13 +25,13 @@ module Rake
# of date.
#
# [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.tgz"</b>]
- # Create a gzipped tar package (if <em>need_tar</em> is true).
+ # Create a gzipped tar package (if <em>need_tar</em> is true).
#
# [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.tar.gz"</b>]
- # Create a gzipped tar package (if <em>need_tar_gz</em> is true).
+ # Create a gzipped tar package (if <em>need_tar_gz</em> is true).
#
# [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.tar.bz2"</b>]
- # Create a bzip2'd tar package (if <em>need_tar_bz2</em> is true).
+ # Create a bzip2'd tar package (if <em>need_tar_bz2</em> is true).
#
# [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.zip"</b>]
# Create a zip package archive (if <em>need_zip</em> is true).
@@ -74,7 +74,7 @@ class PackageTask < TaskLib
# Zip command for zipped archives. The default is 'zip'.
attr_accessor :zip_command
- # Create a Package Task with the given name and version.
+ # Create a Package Task with the given name and version.
def initialize(name=nil, version=nil)
init(name, version)
yield self if block_given?
@@ -102,11 +102,11 @@ def define
desc "Build all the packages"
task :package
-
+
desc "Force a rebuild of the package files"
task :repackage => [:clobber_package, :package]
-
- desc "Remove package products"
+
+ desc "Remove package products"
task :clobber_package do
rm_r package_dir rescue nil
end
@@ -127,7 +127,7 @@ def define
end
end
end
-
+
if need_zip
task :package => ["#{package_dir}/#{zip_file}"]
file "#{package_dir}/#{zip_file}" => [package_dir_path] + package_files do
@@ -159,7 +159,7 @@ def define
def package_name
@version ? "#{@name}-#{@version}" : @name
end
-
+
def package_dir_path
"#{package_dir}/#{package_name}"
end
View
@@ -5,12 +5,12 @@ module Rake
# Win 32 interface methods for Rake. Windows specific functionality
# will be placed here to collect that knowledge in one spot.
module Win32
-
+
# Error indicating a problem in locating the home directory on a
# Win32 system.
class Win32HomeError < RuntimeError
end
-
+
class << self
# True if running on a windows system.
def windows?
@@ -21,7 +21,7 @@ def windows?
def rake_system(*cmd)
AltSystem.system(*cmd)
end
-
+
# The standard directory containing system wide rake files on
# Win 32 systems. Try the following environment variables (in
# order):
@@ -49,7 +49,7 @@ def win32_system_dir #:nodoc:
def normalize(path)
path.gsub(/\\/, '/')
end
-
+
end
end
end
Oops, something went wrong. Retry.

0 comments on commit af62240

Please sign in to comment.