diy_rails 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -2
- data/lib/diy_rails/array.rb +5 -0
- data/lib/diy_rails/routing.rb +10 -0
- data/lib/diy_rails/version.rb +1 -1
- data/lib/diy_rails.rb +25 -3
- metadata +28 -151
- data/vendor/bundle/ruby/3.0.0/bin/rackup +0 -29
- data/vendor/bundle/ruby/3.0.0/bin/rake +0 -29
- data/vendor/bundle/ruby/3.0.0/cache/rack-2.2.4.gem +0 -0
- data/vendor/bundle/ruby/3.0.0/cache/rake-13.0.6.gem +0 -0
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/CHANGELOG.md +0 -708
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/CONTRIBUTING.md +0 -136
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/MIT-LICENSE +0 -20
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/README.rdoc +0 -306
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/Rakefile +0 -130
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/SPEC.rdoc +0 -288
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/bin/rackup +0 -5
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/contrib/rack.png +0 -0
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/contrib/rack.svg +0 -150
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/contrib/rack_logo.svg +0 -164
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/contrib/rdoc.css +0 -412
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/example/lobster.ru +0 -6
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/example/protectedlobster.rb +0 -16
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/example/protectedlobster.ru +0 -10
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/abstract/handler.rb +0 -39
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/abstract/request.rb +0 -47
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/basic.rb +0 -61
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/digest/md5.rb +0 -131
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/digest/nonce.rb +0 -54
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/digest/params.rb +0 -54
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/digest/request.rb +0 -43
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/body_proxy.rb +0 -45
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/builder.rb +0 -257
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/cascade.rb +0 -68
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/chunked.rb +0 -117
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/common_logger.rb +0 -83
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/conditional_get.rb +0 -83
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/config.rb +0 -22
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/content_length.rb +0 -38
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/content_type.rb +0 -30
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/core_ext/regexp.rb +0 -14
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/deflater.rb +0 -144
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/directory.rb +0 -199
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/etag.rb +0 -77
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/events.rb +0 -153
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/file.rb +0 -7
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/files.rb +0 -218
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/handler/cgi.rb +0 -59
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/handler/fastcgi.rb +0 -100
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/handler/lsws.rb +0 -61
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/handler/scgi.rb +0 -71
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/handler/thin.rb +0 -36
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/handler/webrick.rb +0 -129
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/handler.rb +0 -104
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/head.rb +0 -25
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/lint.rb +0 -806
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/lobster.rb +0 -70
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/lock.rb +0 -32
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/logger.rb +0 -20
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/media_type.rb +0 -43
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/method_override.rb +0 -52
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/mime.rb +0 -685
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/mock.rb +0 -273
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/multipart/generator.rb +0 -97
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/multipart/parser.rb +0 -365
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/multipart/uploaded_file.rb +0 -41
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/multipart.rb +0 -64
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/null_logger.rb +0 -39
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/query_parser.rb +0 -221
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/recursive.rb +0 -64
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/reloader.rb +0 -114
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/request.rb +0 -659
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/response.rb +0 -318
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/rewindable_input.rb +0 -94
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/runtime.rb +0 -34
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/sendfile.rb +0 -162
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/server.rb +0 -466
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/session/abstract/id.rb +0 -523
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/session/cookie.rb +0 -203
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/session/memcache.rb +0 -10
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/session/pool.rb +0 -85
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/show_exceptions.rb +0 -390
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/show_status.rb +0 -113
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/static.rb +0 -187
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/tempfile_reaper.rb +0 -22
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/urlmap.rb +0 -97
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/utils.rb +0 -616
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/version.rb +0 -29
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack.rb +0 -141
- data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/rack.gemspec +0 -46
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/History.rdoc +0 -2403
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/MIT-LICENSE +0 -21
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/README.rdoc +0 -155
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/command_line_usage.rdoc +0 -158
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/example/Rakefile1 +0 -38
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/example/Rakefile2 +0 -35
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/example/a.c +0 -6
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/example/b.c +0 -6
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/example/main.c +0 -11
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/glossary.rdoc +0 -42
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/jamis.rb +0 -592
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/proto_rake.rdoc +0 -127
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/rake.1 +0 -156
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/rakefile.rdoc +0 -622
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/rational.rdoc +0 -151
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake +0 -27
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb +0 -831
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/backtrace.rb +0 -24
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/clean.rb +0 -78
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/cloneable.rb +0 -17
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/cpu_counter.rb +0 -107
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/default_loader.rb +0 -15
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/dsl_definition.rb +0 -195
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/early_time.rb +0 -22
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/ext/core.rb +0 -26
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/ext/string.rb +0 -176
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/file_creation_task.rb +0 -25
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/file_list.rb +0 -435
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/file_task.rb +0 -54
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/file_utils.rb +0 -134
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/file_utils_ext.rb +0 -134
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/invocation_chain.rb +0 -57
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/invocation_exception_mixin.rb +0 -17
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/late_time.rb +0 -18
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/linked_list.rb +0 -112
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/loaders/makefile.rb +0 -54
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/multi_task.rb +0 -14
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/name_space.rb +0 -38
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/packagetask.rb +0 -222
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/phony.rb +0 -16
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/private_reader.rb +0 -21
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/promise.rb +0 -100
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/pseudo_status.rb +0 -30
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rake_module.rb +0 -67
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb +0 -27
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rule_recursion_overflow_error.rb +0 -20
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/scope.rb +0 -43
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb +0 -434
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task_argument_error.rb +0 -8
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task_arguments.rb +0 -109
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task_manager.rb +0 -331
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/tasklib.rb +0 -12
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/testtask.rb +0 -189
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/thread_history_display.rb +0 -49
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/thread_pool.rb +0 -163
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/trace_output.rb +0 -23
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/version.rb +0 -10
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/win32.rb +0 -51
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake.rb +0 -71
- data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/rake.gemspec +0 -100
- data/vendor/bundle/ruby/3.0.0/specifications/rack-2.2.4.gemspec +0 -41
- data/vendor/bundle/ruby/3.0.0/specifications/rake-13.0.6.gemspec +0 -26
@@ -1,151 +0,0 @@
|
|
1
|
-
= Why rake?
|
2
|
-
|
3
|
-
Ok, let me state from the beginning that I never intended to write this
|
4
|
-
code. I'm not convinced it is useful, and I'm not convinced anyone
|
5
|
-
would even be interested in it. All I can say is that Why's onion truck
|
6
|
-
must by been passing through the Ohio valley.
|
7
|
-
|
8
|
-
What am I talking about? ... A Ruby version of Make.
|
9
|
-
|
10
|
-
See, I can sense you cringing already, and I agree. The world certainly
|
11
|
-
doesn't need yet another reworking of the "make" program. I mean, we
|
12
|
-
already have "ant". Isn't that enough?
|
13
|
-
|
14
|
-
It started yesterday. I was helping a coworker fix a problem in one of
|
15
|
-
the Makefiles we use in our project. Not a particularly tough problem,
|
16
|
-
but during the course of the conversation I began lamenting some of the
|
17
|
-
shortcomings of make. In particular, in one of my makefiles I wanted to
|
18
|
-
determine the name of a file dynamically and had to resort to some
|
19
|
-
simple scripting (in Ruby) to make it work. "Wouldn't it be nice if you
|
20
|
-
could just use Ruby inside a Makefile" I said.
|
21
|
-
|
22
|
-
My coworker (a recent convert to Ruby) agreed, but wondered what it
|
23
|
-
would look like. So I sketched the following on the whiteboard...
|
24
|
-
|
25
|
-
"What if you could specify the make tasks in Ruby, like this ..."
|
26
|
-
|
27
|
-
task "build" do
|
28
|
-
java_compile(...args, etc ...)
|
29
|
-
end
|
30
|
-
|
31
|
-
"The task function would register "build" as a target to be made,
|
32
|
-
and the block would be the action executed whenever the build
|
33
|
-
system determined that it was time to do the build target."
|
34
|
-
|
35
|
-
We agreed that would be cool, but writing make from scratch would be WAY
|
36
|
-
too much work. And that was the end of that!
|
37
|
-
|
38
|
-
... Except I couldn't get the thought out of my head. What exactly
|
39
|
-
would be needed to make the about syntax work as a make file? Hmmm, you
|
40
|
-
would need to register the tasks, you need some way of specifying
|
41
|
-
dependencies between tasks, and some way of kicking off the process.
|
42
|
-
Hey! What if we did ... and fifteen minutes later I had a working
|
43
|
-
prototype of Ruby make, complete with dependencies and actions.
|
44
|
-
|
45
|
-
I showed the code to my coworker and we had a good laugh. It was just
|
46
|
-
about a page worth of code that reproduced an amazing amount of the
|
47
|
-
functionality of make. We were both truly stunned with the power of
|
48
|
-
Ruby.
|
49
|
-
|
50
|
-
But it didn't do everything make did. In particular, it didn't have
|
51
|
-
timestamp based file dependencies (where a file is rebuilt if any of its
|
52
|
-
prerequisite files have a later timestamp). Obviously THAT would be a
|
53
|
-
pain to add and so Ruby Make would remain an interesting experiment.
|
54
|
-
|
55
|
-
... Except as I walked back to my desk, I started thinking about what
|
56
|
-
file based dependencies would really need. Rats! I was hooked again,
|
57
|
-
and by adding a new class and two new methods, file/timestamp
|
58
|
-
dependencies were implemented.
|
59
|
-
|
60
|
-
Ok, now I was really hooked. Last night (during CSI!) I massaged the
|
61
|
-
code and cleaned it up a bit. The result is a bare-bones replacement
|
62
|
-
for make in exactly 100 lines of code.
|
63
|
-
|
64
|
-
For the curious, you can see it at ...
|
65
|
-
* doc/proto_rake.rdoc
|
66
|
-
|
67
|
-
Oh, about the name. When I wrote the example Ruby Make task on my
|
68
|
-
whiteboard, my coworker exclaimed "Oh! I have the perfect name: Rake ...
|
69
|
-
Get it? Ruby-Make. Rake!" He said he envisioned the tasks as leaves
|
70
|
-
and Rake would clean them up ... or something like that. Anyways, the
|
71
|
-
name stuck.
|
72
|
-
|
73
|
-
Some quick examples ...
|
74
|
-
|
75
|
-
A simple task to delete backup files ...
|
76
|
-
|
77
|
-
task :clean do
|
78
|
-
Dir['*~'].each {|fn| rm fn rescue nil}
|
79
|
-
end
|
80
|
-
|
81
|
-
Note that task names are symbols (they are slightly easier to type
|
82
|
-
than quoted strings ... but you may use quoted string if you would
|
83
|
-
rather). Rake makes the methods of the FileUtils module directly
|
84
|
-
available, so we take advantage of the <tt>rm</tt> command. Also note
|
85
|
-
the use of "rescue nil" to trap and ignore errors in the <tt>rm</tt>
|
86
|
-
command.
|
87
|
-
|
88
|
-
To run it, just type "rake clean". Rake will automatically find a
|
89
|
-
Rakefile in the current directory (or above!) and will invoke the
|
90
|
-
targets named on the command line. If there are no targets explicitly
|
91
|
-
named, rake will invoke the task "default".
|
92
|
-
|
93
|
-
Here's another task with dependencies ...
|
94
|
-
|
95
|
-
task :clobber => [:clean] do
|
96
|
-
rm_r "tempdir"
|
97
|
-
end
|
98
|
-
|
99
|
-
Task :clobber depends upon task :clean, so :clean will be run before
|
100
|
-
:clobber is executed.
|
101
|
-
|
102
|
-
Files are specified by using the "file" command. It is similar to the
|
103
|
-
task command, except that the task name represents a file, and the task
|
104
|
-
will be run only if the file doesn't exist, or if its modification time
|
105
|
-
is earlier than any of its prerequisites.
|
106
|
-
|
107
|
-
Here is a file based dependency that will compile "hello.cc" to
|
108
|
-
"hello.o".
|
109
|
-
|
110
|
-
file "hello.cc"
|
111
|
-
file "hello.o" => ["hello.cc"] do |t|
|
112
|
-
srcfile = t.name.sub(/\.o$/, ".cc")
|
113
|
-
sh %{g++ #{srcfile} -c -o #{t.name}}
|
114
|
-
end
|
115
|
-
|
116
|
-
I normally specify file tasks with string (rather than symbols). Some
|
117
|
-
file names can't be represented by symbols. Plus it makes the
|
118
|
-
distinction between them more clear to the casual reader.
|
119
|
-
|
120
|
-
Currently writing a task for each and every file in the project would be
|
121
|
-
tedious at best. I envision a set of libraries to make this job
|
122
|
-
easier. For instance, perhaps something like this ...
|
123
|
-
|
124
|
-
require 'rake/ctools'
|
125
|
-
Dir['*.c'].each do |fn|
|
126
|
-
c_source_file(fn)
|
127
|
-
end
|
128
|
-
|
129
|
-
where "c_source_file" will create all the tasks need to compile all the
|
130
|
-
C source files in a directory. Any number of useful libraries could be
|
131
|
-
created for rake.
|
132
|
-
|
133
|
-
That's it. There's no documentation (other than whats in this
|
134
|
-
message). Does this sound interesting to anyone? If so, I'll continue
|
135
|
-
to clean it up and write it up and publish it on RAA. Otherwise, I'll
|
136
|
-
leave it as an interesting exercise and a tribute to the power of Ruby.
|
137
|
-
|
138
|
-
Why /might/ rake be interesting to Ruby programmers. I don't know,
|
139
|
-
perhaps ...
|
140
|
-
|
141
|
-
* No weird make syntax (only weird Ruby syntax :-)
|
142
|
-
* No need to edit or read XML (a la ant)
|
143
|
-
* Platform independent build scripts.
|
144
|
-
* Will run anywhere Ruby exists, so no need to have "make" installed.
|
145
|
-
If you stay away from the "sys" command and use things like
|
146
|
-
'ftools', you can have a perfectly platform independent
|
147
|
-
build script. Also rake is only 100 lines of code, so it can
|
148
|
-
easily be packaged along with the rest of your code.
|
149
|
-
|
150
|
-
So ... Sorry for the long rambling message. Like I said, I never
|
151
|
-
intended to write this code at all.
|
@@ -1,27 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
#--
|
4
|
-
# Copyright (c) 2003, 2004, 2005, 2006, 2007 Jim Weirich
|
5
|
-
#
|
6
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
-
# of this software and associated documentation files (the "Software"), to
|
8
|
-
# deal in the Software without restriction, including without limitation the
|
9
|
-
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
10
|
-
# sell copies of the Software, and to permit persons to whom the Software is
|
11
|
-
# furnished to do so, subject to the following conditions:
|
12
|
-
#
|
13
|
-
# The above copyright notice and this permission notice shall be included in
|
14
|
-
# all copies or substantial portions of the Software.
|
15
|
-
#
|
16
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
-
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
22
|
-
# IN THE SOFTWARE.
|
23
|
-
#++
|
24
|
-
|
25
|
-
require "rake"
|
26
|
-
|
27
|
-
Rake.application.run
|