podoy 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +35 -0
  4. data/Rakefile +4 -0
  5. data/lib/podoy/version.rb +5 -0
  6. data/lib/podoy.rb +8 -0
  7. data/sig/podoy.rbs +4 -0
  8. data/vendor/bundle/ruby/3.3.0+0/bin/rake +29 -0
  9. data/vendor/bundle/ruby/3.3.0+0/cache/rake-13.1.0.gem +0 -0
  10. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/History.rdoc +2403 -0
  11. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/MIT-LICENSE +21 -0
  12. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/README.rdoc +155 -0
  13. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/doc/command_line_usage.rdoc +158 -0
  14. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/doc/example/Rakefile1 +38 -0
  15. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/doc/example/Rakefile2 +35 -0
  16. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/doc/example/a.c +6 -0
  17. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/doc/example/b.c +6 -0
  18. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/doc/example/main.c +11 -0
  19. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/doc/glossary.rdoc +42 -0
  20. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/doc/jamis.rb +592 -0
  21. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/doc/proto_rake.rdoc +127 -0
  22. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/doc/rake.1 +156 -0
  23. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/doc/rakefile.rdoc +622 -0
  24. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/doc/rational.rdoc +151 -0
  25. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/exe/rake +27 -0
  26. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/application.rb +855 -0
  27. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/backtrace.rb +24 -0
  28. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/clean.rb +78 -0
  29. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/cloneable.rb +17 -0
  30. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/cpu_counter.rb +107 -0
  31. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/default_loader.rb +15 -0
  32. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/dsl_definition.rb +195 -0
  33. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/early_time.rb +22 -0
  34. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/ext/core.rb +26 -0
  35. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/ext/string.rb +176 -0
  36. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/file_creation_task.rb +25 -0
  37. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/file_list.rb +435 -0
  38. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/file_task.rb +58 -0
  39. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/file_utils.rb +132 -0
  40. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/file_utils_ext.rb +134 -0
  41. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/invocation_chain.rb +57 -0
  42. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/invocation_exception_mixin.rb +17 -0
  43. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/late_time.rb +18 -0
  44. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/linked_list.rb +112 -0
  45. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/loaders/makefile.rb +54 -0
  46. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/multi_task.rb +14 -0
  47. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/name_space.rb +38 -0
  48. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/packagetask.rb +222 -0
  49. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/phony.rb +16 -0
  50. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/private_reader.rb +21 -0
  51. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/promise.rb +100 -0
  52. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/pseudo_status.rb +30 -0
  53. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/rake_module.rb +67 -0
  54. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb +27 -0
  55. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
  56. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/scope.rb +43 -0
  57. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/task.rb +434 -0
  58. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/task_argument_error.rb +8 -0
  59. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/task_arguments.rb +109 -0
  60. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/task_manager.rb +331 -0
  61. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/tasklib.rb +12 -0
  62. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/testtask.rb +189 -0
  63. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/thread_history_display.rb +49 -0
  64. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/thread_pool.rb +163 -0
  65. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/trace_output.rb +23 -0
  66. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/version.rb +10 -0
  67. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake/win32.rb +51 -0
  68. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/lib/rake.rb +71 -0
  69. data/vendor/bundle/ruby/3.3.0+0/gems/rake-13.1.0/rake.gemspec +101 -0
  70. data/vendor/bundle/ruby/3.3.0+0/specifications/rake-13.1.0.gemspec +26 -0
  71. metadata +117 -0
@@ -0,0 +1,151 @@
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.
@@ -0,0 +1,27 @@
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