ratch 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/{log/history → CHANGES} +0 -0
- data/{log/todo → TODO} +0 -0
- data/bin/manifest +451 -0
- data/bin/ratch +3 -3
- data/demo/task/config.yaml +4 -0
- data/lib/ratch/{batch/argvutils.rb → dsl/argv.rb} +9 -4
- data/lib/ratch/dsl/batch.rb +226 -0
- data/lib/ratch/{batch → dsl}/build.rb +83 -4
- data/lib/ratch/{batch/consoleutils.rb → dsl/console.rb} +13 -5
- data/lib/ratch/{batch/emailutils.rb → dsl/email.rb} +21 -25
- data/lib/ratch/{batch/fileutils.rb → dsl/file.rb} +56 -56
- data/lib/ratch/dsl/meta.rb +132 -0
- data/lib/ratch/{batch → dsl}/options.rb +7 -5
- data/lib/ratch/dsl/setup.rb +124 -0
- data/lib/ratch/{support/signiture.rb → dsl/sign.rb} +9 -18
- data/lib/ratch/dsl/stage.rb +147 -0
- data/lib/ratch/dsl/task.rb +139 -0
- data/lib/ratch/{uploadutils.rb → dsl/upload.rb} +7 -5
- data/lib/ratch/{batch/task.rb → dsl/zip.rb} +30 -14
- data/lib/ratch/dsl.rb +52 -0
- data/lib/ratch/extra/email.rb +5 -0
- data/lib/ratch/extra/stage.rb +5 -0
- data/lib/ratch/extra/zip.rb +5 -0
- data/lib/ratch/manifest.rb +540 -0
- data/lib/ratch/{project → metadata}/information.rb +1 -0
- data/lib/ratch/{project → metadata}/package.rb +28 -2
- data/lib/ratch/{project → metadata}/project.rb +8 -16
- data/lib/ratch/{project → metadata}/release.rb +6 -6
- data/lib/ratch/support/errors.rb +4 -0
- data/lib/ratch/support/filename.rb +18 -0
- data/lib/ratch/toolset/ruby/compile +49 -0
- data/lib/ratch/toolset/ruby/pack/gem +26 -18
- data/lib/ratch/toolset/ruby/pack/tgz +25 -64
- data/lib/ratch/toolset/ruby/pack/zip +46 -0
- data/lib/ratch/toolset/ruby/publish +23 -24
- data/lib/ratch/toolset/ruby/release +8 -0
- data/lib/ratch/toolset/ruby/stamp +33 -0
- data/lib/ratch/toolset/sandbox +11 -0
- data/meta/MANIFEST +101 -23
- data/meta/ROLLRC +1 -1
- data/meta/config.yaml +10 -0
- data/meta/icli.yaml +2 -2
- data/meta/project.yaml +9 -10
- data/meta/xProjectInfo +41 -0
- data/task/release +1 -4
- metadata +82 -156
- data/demo/task/rdoc +0 -88
- data/demo/task/rdoc-old +0 -182
- data/doc/images/clipboard.jpg +0 -0
- data/doc/images/clipboard2.png +0 -0
- data/doc/images/milles-tn.jpg +0 -0
- data/doc/images/mints.png +0 -0
- data/doc/images/ratch2.png +0 -0
- data/doc/images/ruby-sm.png +0 -0
- data/doc/images/silver.gif +0 -0
- data/doc/images/toolbox.jpg +0 -0
- data/doc/index.html +0 -181
- data/doc/notes/original.rb +0 -308
- data/doc/rdoc/classes/Array.html +0 -194
- data/doc/rdoc/classes/Dir.html +0 -317
- data/doc/rdoc/classes/Hash.html +0 -217
- data/doc/rdoc/classes/Ratch/ArgvUtils/Ext.html +0 -285
- data/doc/rdoc/classes/Ratch/ArgvUtils.html +0 -173
- data/doc/rdoc/classes/Ratch/BatchFile.html +0 -207
- data/doc/rdoc/classes/Ratch/BatchManager.html +0 -250
- data/doc/rdoc/classes/Ratch/BatchScript.html +0 -127
- data/doc/rdoc/classes/Ratch/Batchable.html +0 -373
- data/doc/rdoc/classes/Ratch/Build.html +0 -321
- data/doc/rdoc/classes/Ratch/BuildManager.html +0 -319
- data/doc/rdoc/classes/Ratch/Buildable.html +0 -202
- data/doc/rdoc/classes/Ratch/ConfigUtils.html +0 -281
- data/doc/rdoc/classes/Ratch/ConsoleUtils.html +0 -189
- data/doc/rdoc/classes/Ratch/EmailUtils.html +0 -209
- data/doc/rdoc/classes/Ratch/FileUtils.html +0 -674
- data/doc/rdoc/classes/Ratch/GeneralOptions.html +0 -430
- data/doc/rdoc/classes/Ratch/Task.html +0 -201
- data/doc/rdoc/classes/Ratch/TaskManager.html +0 -330
- data/doc/rdoc/classes/Ratch/Taskable.html +0 -231
- data/doc/rdoc/classes/Ratch/UploadUtils.html +0 -566
- data/doc/rdoc/classes/Ratch.html +0 -201
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/COPYING.html +0 -1003
- data/doc/rdoc/files/README.html +0 -143
- data/doc/rdoc/files/lib/ratch/argvutils_rb.html +0 -131
- data/doc/rdoc/files/lib/ratch/batch_rb.html +0 -155
- data/doc/rdoc/files/lib/ratch/batchable_rb.html +0 -131
- data/doc/rdoc/files/lib/ratch/batchfile_rb.html +0 -148
- data/doc/rdoc/files/lib/ratch/buildable_rb.html +0 -131
- data/doc/rdoc/files/lib/ratch/consoleutils_rb.html +0 -131
- data/doc/rdoc/files/lib/ratch/emailutils_rb.html +0 -139
- data/doc/rdoc/files/lib/ratch/facets/multiglob_rb.html +0 -137
- data/doc/rdoc/files/lib/ratch/fileutils_rb.html +0 -139
- data/doc/rdoc/files/lib/ratch/options_rb.html +0 -131
- data/doc/rdoc/files/lib/ratch/taskable_rb.html +0 -131
- data/doc/rdoc/files/lib/ratch/uploadutils_rb.html +0 -150
- data/doc/rdoc/fr_class_index.html +0 -48
- data/doc/rdoc/fr_file_index.html +0 -41
- data/doc/rdoc/fr_method_index.html +0 -133
- data/doc/rdoc/index.html +0 -24
- data/doc/rdoc/rdoc-style.css +0 -208
- data/doc/scrap/flexihead-flip.jpg +0 -0
- data/doc/scrap/flexihead.jpg +0 -0
- data/doc/scrap/head1.jpg +0 -0
- data/doc/scrap/ratch.jpg +0 -0
- data/doc/scrap/ratch1.png +0 -0
- data/doc/scrap/ratch2.jpg +0 -0
- data/doc/scrap/ratch3.png +0 -0
- data/doc/scrap/red-ratch.jpg +0 -0
- data/doc/scrap/redratchet.jpg +0 -0
- data/doc/scrap/ruby-kit/ruby.png +0 -0
- data/doc/scrap/scrap.red +0 -256
- data/doc/sitemap.yaml +0 -10
- data/doc/siteparts/index.red +0 -100
- data/doc/siteparts/layout.rhtml +0 -56
- data/doc/siteparts/tutorial.red +0 -578
- data/doc/style.css +0 -112
- data/doc/tutorial.html +0 -722
- data/lib/ratch/batch.rb +0 -488
- data/lib/ratch/support/setuputils.rb +0 -124
- data/lib/ratch/support/stage.rb +0 -292
- data/lib/ratch/toolset/ruby/rdoc +0 -88
- data/task/rdoc +0 -6
- data/work/old/batchfile.rb +0 -95
- data/work/project-old.rb +0 -67
- data/work/scrap/install +0 -89
- data/work/scrap/install.0 +0 -49
- data/work/scrap/install.1 +0 -63
- data/work/scrap/ludo +0 -25
- data/work/scrap/oldtaskable.rb +0 -573
- data/work/scrap/ratch.man +0 -39
- data/work/scrap/taskable-simple.rb +0 -42
- data/work/scrap/taskable.rb +0 -120
data/doc/rdoc/rdoc-style.css
DELETED
@@ -1,208 +0,0 @@
|
|
1
|
-
|
2
|
-
body {
|
3
|
-
font-family: Verdana,Arial,Helvetica,sans-serif;
|
4
|
-
font-size: 90%;
|
5
|
-
margin: 0;
|
6
|
-
margin-left: 40px;
|
7
|
-
padding: 0;
|
8
|
-
background: white;
|
9
|
-
}
|
10
|
-
|
11
|
-
h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
|
12
|
-
h1 { font-size: 150%; }
|
13
|
-
h2,h3,h4 { margin-top: 1em; }
|
14
|
-
|
15
|
-
a { background: #eef; color: #039; text-decoration: none; }
|
16
|
-
a:hover { background: #039; color: #eef; }
|
17
|
-
|
18
|
-
/* Override the base stylesheet's Anchor inside a table cell */
|
19
|
-
td > a {
|
20
|
-
background: transparent;
|
21
|
-
color: #039;
|
22
|
-
text-decoration: none;
|
23
|
-
}
|
24
|
-
|
25
|
-
/* and inside a section title */
|
26
|
-
.section-title > a {
|
27
|
-
background: transparent;
|
28
|
-
color: #eee;
|
29
|
-
text-decoration: none;
|
30
|
-
}
|
31
|
-
|
32
|
-
/* === Structural elements =================================== */
|
33
|
-
|
34
|
-
div#index {
|
35
|
-
margin: 0;
|
36
|
-
margin-left: -40px;
|
37
|
-
padding: 0;
|
38
|
-
font-size: 90%;
|
39
|
-
}
|
40
|
-
|
41
|
-
|
42
|
-
div#index a {
|
43
|
-
margin-left: 0.7em;
|
44
|
-
}
|
45
|
-
|
46
|
-
div#index .section-bar {
|
47
|
-
margin-left: 0px;
|
48
|
-
padding-left: 0.7em;
|
49
|
-
background: #ccc;
|
50
|
-
font-size: small;
|
51
|
-
}
|
52
|
-
|
53
|
-
|
54
|
-
div#classHeader, div#fileHeader {
|
55
|
-
width: auto;
|
56
|
-
color: white;
|
57
|
-
padding: 0.5em 1.5em 0.5em 1.5em;
|
58
|
-
margin: 0;
|
59
|
-
margin-left: -40px;
|
60
|
-
border-bottom: 3px solid #006;
|
61
|
-
}
|
62
|
-
|
63
|
-
div#classHeader a, div#fileHeader a {
|
64
|
-
background: inherit;
|
65
|
-
color: white;
|
66
|
-
}
|
67
|
-
|
68
|
-
div#classHeader td, div#fileHeader td {
|
69
|
-
background: inherit;
|
70
|
-
color: white;
|
71
|
-
}
|
72
|
-
|
73
|
-
|
74
|
-
div#fileHeader {
|
75
|
-
background: #057;
|
76
|
-
}
|
77
|
-
|
78
|
-
div#classHeader {
|
79
|
-
background: #048;
|
80
|
-
}
|
81
|
-
|
82
|
-
|
83
|
-
.class-name-in-header {
|
84
|
-
font-size: 180%;
|
85
|
-
font-weight: bold;
|
86
|
-
}
|
87
|
-
|
88
|
-
|
89
|
-
div#bodyContent {
|
90
|
-
padding: 0 1.5em 0 1.5em;
|
91
|
-
}
|
92
|
-
|
93
|
-
div#description {
|
94
|
-
padding: 0.5em 1.5em;
|
95
|
-
background: #efefef;
|
96
|
-
border: 1px dotted #999;
|
97
|
-
}
|
98
|
-
|
99
|
-
div#description h1,h2,h3,h4,h5,h6 {
|
100
|
-
color: #125;;
|
101
|
-
background: transparent;
|
102
|
-
}
|
103
|
-
|
104
|
-
div#validator-badges {
|
105
|
-
text-align: center;
|
106
|
-
}
|
107
|
-
div#validator-badges img { border: 0; }
|
108
|
-
|
109
|
-
div#copyright {
|
110
|
-
color: #333;
|
111
|
-
background: #efefef;
|
112
|
-
font: 0.75em sans-serif;
|
113
|
-
margin-top: 5em;
|
114
|
-
margin-bottom: 0;
|
115
|
-
padding: 0.5em 2em;
|
116
|
-
}
|
117
|
-
|
118
|
-
|
119
|
-
/* === Classes =================================== */
|
120
|
-
|
121
|
-
table.header-table {
|
122
|
-
color: white;
|
123
|
-
font-size: small;
|
124
|
-
}
|
125
|
-
|
126
|
-
.type-note {
|
127
|
-
font-size: small;
|
128
|
-
color: #DEDEDE;
|
129
|
-
}
|
130
|
-
|
131
|
-
.xxsection-bar {
|
132
|
-
background: #eee;
|
133
|
-
color: #333;
|
134
|
-
padding: 3px;
|
135
|
-
}
|
136
|
-
|
137
|
-
.section-bar {
|
138
|
-
color: #333;
|
139
|
-
border-bottom: 1px solid #999;
|
140
|
-
margin-left: -20px;
|
141
|
-
}
|
142
|
-
|
143
|
-
|
144
|
-
.section-title {
|
145
|
-
background: #79a;
|
146
|
-
color: #eee;
|
147
|
-
padding: 3px;
|
148
|
-
margin-top: 2em;
|
149
|
-
margin-left: -30px;
|
150
|
-
border: 1px solid #999;
|
151
|
-
}
|
152
|
-
|
153
|
-
.top-aligned-row { vertical-align: top }
|
154
|
-
.bottom-aligned-row { vertical-align: bottom }
|
155
|
-
|
156
|
-
/* --- Context section classes ----------------------- */
|
157
|
-
|
158
|
-
.context-row { }
|
159
|
-
.context-item-name { font-family: monospace; font-weight: bold; color: black; }
|
160
|
-
.context-item-value { font-size: small; color: #448; }
|
161
|
-
.context-item-desc { color: #333; padding-left: 2em; }
|
162
|
-
|
163
|
-
/* --- Method classes -------------------------- */
|
164
|
-
.method-detail {
|
165
|
-
background: #efefef;
|
166
|
-
padding: 0;
|
167
|
-
margin-top: 0.5em;
|
168
|
-
margin-bottom: 1em;
|
169
|
-
border: 1px dotted #ccc;
|
170
|
-
}
|
171
|
-
.method-heading {
|
172
|
-
color: black;
|
173
|
-
background: #ccc;
|
174
|
-
border-bottom: 1px solid #666;
|
175
|
-
padding: 0.2em 0.5em 0 0.5em;
|
176
|
-
}
|
177
|
-
.method-signature { color: black; background: inherit; }
|
178
|
-
.method-name { font-weight: bold; }
|
179
|
-
.method-args { font-style: italic; }
|
180
|
-
.method-description { padding: 0 0.5em 0 0.5em; }
|
181
|
-
|
182
|
-
/* --- Source code sections -------------------- */
|
183
|
-
|
184
|
-
a.source-toggle { font-size: 90%; }
|
185
|
-
div.method-source-code {
|
186
|
-
background: #262626;
|
187
|
-
color: #ffdead;
|
188
|
-
margin: 1em;
|
189
|
-
padding: 0.5em;
|
190
|
-
border: 1px dashed #999;
|
191
|
-
overflow: hidden;
|
192
|
-
}
|
193
|
-
|
194
|
-
div.method-source-code pre { color: #ffdead; overflow: hidden; }
|
195
|
-
|
196
|
-
/* --- Ruby keyword styles --------------------- */
|
197
|
-
|
198
|
-
.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
|
199
|
-
|
200
|
-
.ruby-constant { color: #7fffd4; background: transparent; }
|
201
|
-
.ruby-keyword { color: #00ffff; background: transparent; }
|
202
|
-
.ruby-ivar { color: #eedd82; background: transparent; }
|
203
|
-
.ruby-operator { color: #00ffee; background: transparent; }
|
204
|
-
.ruby-identifier { color: #ffdead; background: transparent; }
|
205
|
-
.ruby-node { color: #ffa07a; background: transparent; }
|
206
|
-
.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
|
207
|
-
.ruby-regexp { color: #ffa07a; background: transparent; }
|
208
|
-
.ruby-value { color: #7fffd4; background: transparent; }
|
Binary file
|
data/doc/scrap/flexihead.jpg
DELETED
Binary file
|
data/doc/scrap/head1.jpg
DELETED
Binary file
|
data/doc/scrap/ratch.jpg
DELETED
Binary file
|
data/doc/scrap/ratch1.png
DELETED
Binary file
|
data/doc/scrap/ratch2.jpg
DELETED
Binary file
|
data/doc/scrap/ratch3.png
DELETED
Binary file
|
data/doc/scrap/red-ratch.jpg
DELETED
Binary file
|
data/doc/scrap/redratchet.jpg
DELETED
Binary file
|
data/doc/scrap/ruby-kit/ruby.png
DELETED
Binary file
|
data/doc/scrap/scrap.red
DELETED
@@ -1,256 +0,0 @@
|
|
1
|
-
h1. UNDER CONSTRUCTION
|
2
|
-
|
3
|
-
h1. Interoperability
|
4
|
-
|
5
|
-
h2. Ratch a la Rake
|
6
|
-
|
7
|
-
Rake is the the popular choice for Ruby delvelopers. Since Ratch is alsow written Ruby it is possible
|
8
|
-
to use Ratch tasks via one;s Rakefile. This can be approached in either of two ways.
|
9
|
-
|
10
|
-
Since Ratch' project tools are designed as stand-alone reusable modules, one can
|
11
|
-
access them directly. For instance let's define an RDoc task by calling directly on
|
12
|
-
Ratcehts' <code>Doc.rdoc</code> module method.
|
13
|
-
|
14
|
-
<pre class="script">
|
15
|
-
require 'ratchets/doc'
|
16
|
-
|
17
|
-
desc 'rdoc the project'
|
18
|
-
|
19
|
-
task :rdoc do
|
20
|
-
Ratchets::Doc.rdoc do |r|
|
21
|
-
r.title = "MyApplication"
|
22
|
-
r.main = "README"
|
23
|
-
r.template = "html"
|
24
|
-
r.options = ["--all", "--inline-source"]
|
25
|
-
r.include = ["lib/**/*", "bin/*", "[A-Z]*"]
|
26
|
-
r.basedir = "src"
|
27
|
-
r.output = "rdoc"
|
28
|
-
end
|
29
|
-
end
|
30
|
-
</pre>
|
31
|
-
|
32
|
-
This usage leaves everything up to the the Rake file. Although most of these fields have reasonable
|
33
|
-
defaults. Nonetheless, no information is being provided to the tool via a project information file,
|
34
|
-
becuase we are invoking Ratchet's underlying rdoc tool directly.
|
35
|
-
|
36
|
-
Now let's do the same thing, but via the Project class.
|
37
|
-
|
38
|
-
<pre>
|
39
|
-
require 'ratchets/project'
|
40
|
-
|
41
|
-
project = Project.new do |info|
|
42
|
-
info.title = "MyApplication"
|
43
|
-
info.basedir = "src"
|
44
|
-
end
|
45
|
-
|
46
|
-
|
47
|
-
desc 'rdoc the project'
|
48
|
-
|
49
|
-
task :rdoc do
|
50
|
-
project.rdoc do |r|
|
51
|
-
r.main = "README"
|
52
|
-
r.template = "html"
|
53
|
-
r.options = ["--all", "--inline-source"]
|
54
|
-
r.include = ["lib/**/*", "bin/*", "[A-Z]*"]
|
55
|
-
r.output = "rdoc"
|
56
|
-
end
|
57
|
-
end
|
58
|
-
</pre>
|
59
|
-
|
60
|
-
Here we have created a new Project object and have invoked the rdoc tool <i>via</i> it's interface.
|
61
|
-
This automatically incorporates general information about the project of use to the tool --in this case
|
62
|
-
the project's title and it's basedir. The other fields are rdoc specific so they cannot be shared.
|
63
|
-
But we can go a step further and define a set of <i>tool specific defaults</i> for any rdoc task.
|
64
|
-
|
65
|
-
<pre>
|
66
|
-
require 'ratchets/project'
|
67
|
-
|
68
|
-
project = Project.new(
|
69
|
-
:title => "MyApplication"
|
70
|
-
:basedir => "src"
|
71
|
-
:rdoc => {
|
72
|
-
:main => 'README'
|
73
|
-
:template => "html"
|
74
|
-
:options => ["--all", "--inline-source"]
|
75
|
-
:include => ["lib/**/*", "bin/*", "[A-Z]*"]
|
76
|
-
:output => "rdoc"
|
77
|
-
}
|
78
|
-
)
|
79
|
-
|
80
|
-
desc 'rdoc the project'
|
81
|
-
|
82
|
-
task :rdoc do
|
83
|
-
project.rdoc
|
84
|
-
end
|
85
|
-
</pre>
|
86
|
-
|
87
|
-
You'll also notice that we are demonstrating Ratchet's versitility in accepting arguments.
|
88
|
-
The <code>Project.new</code> method can take either a hash <u>or</u> a block. In fact, this is
|
89
|
-
a widely used pattern throughout Ratchets.
|
90
|
-
|
91
|
-
One final step. It's is likely we don't need to fuss with each and every tool Ratchets
|
92
|
-
provides us. All-in-all we will probably want most, if not all, of them avaialble to us, and
|
93
|
-
since Ratcehts generally provides reasonable defaults for most fields, we will rarely have
|
94
|
-
to explicitly fill out each one. In fact, every field we gave thus far for rdoc, except
|
95
|
-
title and basedir, are the default settings. So to facilitate this, the project class has an
|
96
|
-
<code>autonew</code> method which automatically generates all the tasks for every project tool
|
97
|
-
Ratchets offers.
|
98
|
-
|
99
|
-
<pre>
|
100
|
-
require 'ratchets/project'
|
101
|
-
|
102
|
-
project = Project.autonew(
|
103
|
-
:title => "MyApplication"
|
104
|
-
:basedir => "src"
|
105
|
-
)
|
106
|
-
</pre>
|
107
|
-
|
108
|
-
Now when you invoke <code>Rake -T</code> you will see a good sized list of available tasks.
|
109
|
-
|
110
|
-
The techinque as discussed thus far is quite usable, and those heavily favoring pure Rake usage
|
111
|
-
may wish to venture no further than right here. But there are is one final variation that has
|
112
|
-
it's own benefits. Rather then store the project information as Ruby code within one's Rakefile,
|
113
|
-
the information can be placed in a separate <i>ProjectInfo</i> file (something you are already
|
114
|
-
familiar with if you read about Project Generation). To utilize this file, instead of using the
|
115
|
-
<code>new</code> or <code>autonew</code> methods you instead use the <code>load</code> and
|
116
|
-
<code>autoload</code> methods. The upshot is that your typical Rakefile may have little more
|
117
|
-
than these two-lines:
|
118
|
-
|
119
|
-
<pre>
|
120
|
-
require 'ratchets/project'
|
121
|
-
Project.autoload
|
122
|
-
</pre>
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
<!--Adding code to a rakefile or a sake-style script is fine for one-off tasks. But what if you
|
131
|
-
need a more versitle and reusable tool --one you can add to your projectinfo file like Ratchets
|
132
|
-
built-in tools? In that case you need to build a <i>custom tool</i>.
|
133
|
-
|
134
|
-
If you have custom tools you'd like to use for all your projects you can place them
|
135
|
-
either in you home directory under ~/.share/ratchets/tools/, or you could make them
|
136
|
-
universally available to all users in the shared data directory, on Debian,
|
137
|
-
/usr/share/ratchets/tools/. If, on the other hand, the tool is specific to a project,
|
138
|
-
place it in a project tools/ folder.-->
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
<!--h2. Task Versitility
|
145
|
-
|
146
|
-
Ratchets is a very versitile application. Ratchets supports a number of techniques
|
147
|
-
for utilizing it's built-in tools and defining new tasks. Depedending on the desired usage,
|
148
|
-
Ratchets can be a build tool <i>library</i>, or taking advantage of it's own system, can
|
149
|
-
be used as a build tool in its own right.
|
150
|
-
|
151
|
-
One easily adopted usage of Ratchets is as a build library invoked from Rake.
|
152
|
-
Rake is the prevalent build tool for Ruby, and an excellent one at that. Ratchets
|
153
|
-
tools can be easily called from any application, so calling them from a Rake task
|
154
|
-
is a natural endeavor. Ratchets goes a step further in its support of Rake however
|
155
|
-
by allowing the built-in tools to be setup as Rake tasks automatically.
|
156
|
-
If this is intended usage jump down to <a href="#ch4">Ratchets a la Rake</a>
|
157
|
-
to learn more.
|
158
|
-
|
159
|
-
On the other hand, forgoing a separate build tool, tasks can instead be defined
|
160
|
-
as YAML descriptors and invoked via thae <code>project</code> command-line utility.
|
161
|
-
This makes tasks extremely easy to read and write, and allows project information
|
162
|
-
and task definitions to be jointly located but still universally accessible as
|
163
|
-
pure data. We will cover this usage in <a href="#ch2">Describing Tasks
|
164
|
-
via YAML</a>.
|
165
|
-
|
166
|
-
The other alternative, which we will discuss last, is for tasks to be defined as
|
167
|
-
stand-alone executables. This approach is in the spirit of Unix --it's favor of many
|
168
|
-
small tools over single monolithic applications. Ratchets provides strong support
|
169
|
-
for this mode of operation, which we have dubbed the <a href="#ch3">Sake Technique</a>.
|
170
|
-
[ed- In fact, it is my prefered usage.]
|
171
|
-
|
172
|
-
In any case, no matter which technique is used. The centralized data resource
|
173
|
-
for project information is readily available. This <i>reapability</i> of
|
174
|
-
information, probably more than any other feature, makes Ratchets so effective.-->
|
175
|
-
|
176
|
-
<!--
|
177
|
-
|
178
|
-
<p>The conversion is almost seemless. The task class needs only conform to some simple conventions (in this case
|
179
|
-
for example you can see the package_file.include needs to be reduced to a single 'include' attribnute) which are farily
|
180
|
-
trivial to implement. This format has been a big hit with Reap's users. Of course it's optional, one can still do
|
181
|
-
everything through the Reapfile (but why?).</p>
|
182
|
-
|
183
|
-
|
184
|
-
<h2>Sake may have some nice built-in tasks, but we use Rake. So what good is it?</h2>
|
185
|
-
|
186
|
-
<p>Sake's unix style of many small scripts is fairly orthongonal to Rake's,
|
187
|
-
So you can still call upon Sake's built-in scripts in your Rakefile, if you so prefer.
|
188
|
-
Check it out:</p>
|
189
|
-
|
190
|
-
<pre>
|
191
|
-
require 'sake/project'
|
192
|
-
|
193
|
-
desc "Generate RDocs"
|
194
|
-
|
195
|
-
task :rdoc do
|
196
|
-
Automation.rdoc do |s|
|
197
|
-
s.template = 'jamis'
|
198
|
-
s.include = 'lib/**/*'
|
199
|
-
end
|
200
|
-
end
|
201
|
-
</pre>
|
202
|
-
|
203
|
-
<p>Of course, you don't have to use Reap's task system. You can still use Rake's for all your project tasks if
|
204
|
-
you prefer or for some reason must, and you can still get Reap's task functionality. Reap provides a simple interface
|
205
|
-
for doing this. Here's an example of a Rakefile using Reap.</p>
|
206
|
-
|
207
|
-
<pre>
|
208
|
-
require 'reap/reap'
|
209
|
-
|
210
|
-
task_package 'pack' do |pkg|
|
211
|
-
pkg.distribute = [ 'gem' ]
|
212
|
-
pkg.dependencies = [ facets ]
|
213
|
-
end
|
214
|
-
</pre>
|
215
|
-
|
216
|
-
<p>In the above, all information is provided directly via the Ruby task code. No information is coming from the
|
217
|
-
projectinfo file (same is tru for a Reapfile). But you can also use Rake while utilizing the projectinfo file if
|
218
|
-
you wish. In your Rakefile simple put:</p>
|
219
|
-
|
220
|
-
<pre>
|
221
|
-
require 'reap/rake'
|
222
|
-
</pre>
|
223
|
-
|
224
|
-
<p>Then all the tasks defined in the projectinfo file will be available via Rake. You can still add additional
|
225
|
-
Rake tasks, of course.</p>
|
226
|
-
|
227
|
-
<p>Reap can be used in the same fashion as Rake. Simply create a Reapfile and use the <code>reap</code>
|
228
|
-
command to utilize your tasks.</p>
|
229
|
-
|
230
|
-
<p>Adding a extra Reap task is pretty easy. Just define a task in a the special <i>meta/reapfile</i>.
|
231
|
-
If you have ever created a task in Rake's 'Rakefile' then you know how to do it here too. A simple
|
232
|
-
task would look like this:</p>
|
233
|
-
|
234
|
-
<pre>
|
235
|
-
desc "My special task"
|
236
|
-
task :hello do
|
237
|
-
puts "Hello, World!"
|
238
|
-
end
|
239
|
-
</pre>
|
240
|
-
|
241
|
-
<p>You may not like keeping a "monolithic" file of tasks and instead prefer to keep a collection of
|
242
|
-
individual task scripts. You can do this by placing your script in the <i>meta/tasks</i> folder and
|
243
|
-
encapsulating your task defintion in the Tasks module.</p>
|
244
|
-
|
245
|
-
<pre>
|
246
|
-
module Tasks
|
247
|
-
|
248
|
-
desc "My special task"
|
249
|
-
task :hello do
|
250
|
-
puts "Hello, World!"
|
251
|
-
end
|
252
|
-
|
253
|
-
end
|
254
|
-
</pre>
|
255
|
-
|
256
|
-
-->
|
data/doc/sitemap.yaml
DELETED
data/doc/siteparts/index.red
DELETED
@@ -1,100 +0,0 @@
|
|
1
|
-
h1(top). Welcome
|
2
|
-
|
3
|
-
Ratch is a Ruby-based build tool in the linage of Rake and Reap, but distinguishes
|
4
|
-
itself in it's closer adherence to the UNIX-way in that Ratch "targets" are independent
|
5
|
-
scripts. In fact, the name "ratch" derives from the phrase
|
6
|
-
"<u>R</u>uby b<u>atch</u> file".
|
7
|
-
|
8
|
-
Ratch is part of the ProUtils collection. In particular Ratch scripts might take
|
9
|
-
advantage of the "Box":http://proutils.rubyforge.org/box system and can easily be
|
10
|
-
copied and updated via "Mint":http://proutils.rubyforge.org/mint.
|
11
|
-
|
12
|
-
h1. News
|
13
|
-
|
14
|
-
h3(date). 2007-11-11
|
15
|
-
|
16
|
-
h2. From Special to Main
|
17
|
-
|
18
|
-
Ratch is really starting to come together. And I dare say that's no small statement.
|
19
|
-
I started development many, many months ago with only a hunch that the basic
|
20
|
-
design would be effective --was it even possible to effectively bridge the gap
|
21
|
-
between the shell and script? We may never have found out. Implementation has been
|
22
|
-
challenge at times and more than once a little voice in the back of my head would
|
23
|
-
say "just use Rake". But if I am anything, it is determined. I really believe
|
24
|
-
in the underlying design of this project --as hard as it might have been get "right".
|
25
|
-
|
26
|
-
But "right" is where I may finally be. Granted I'm still worried about tricky
|
27
|
-
dependency loops, but that's a rare bird and I have yet to see it happen in practice.
|
28
|
-
And, sure there's areas of the code that could just use some general spit-and-shine.
|
29
|
-
But in practice, it's really starting to look good.
|
30
|
-
|
31
|
-
For instance, this evening I transitioned from executing all ratch files in an
|
32
|
-
instance of a special runner class (a subclass of Module), to executing
|
33
|
-
in top-level 'main' space. This simplifies the start up code a fair bit and now allows
|
34
|
-
@load()@ to work for ratch files just as it does for ruby files --where as before
|
35
|
-
I had to create a special #import method to load the ratch file into the special object.
|
36
|
-
The benefit of this change is that one no longer _has_ to copy any of the pre-made tools
|
37
|
-
distributed with ratch. Instead one can just depend on them like normal code.
|
38
|
-
For instance, my projects tool/stats file looks like this:
|
39
|
-
|
40
|
-
<pre>
|
41
|
-
#!/usr/bin/env ratch
|
42
|
-
# code stats
|
43
|
-
load('ratch/toolset/ruby/stats')
|
44
|
-
</pre>
|
45
|
-
|
46
|
-
Of course if you want to make project specific modifications you can still grab a copy
|
47
|
-
and have at it.
|
48
|
-
|
49
|
-
|
50
|
-
h1. Installation
|
51
|
-
|
52
|
-
Via RubyGems:
|
53
|
-
|
54
|
-
$ gem install ratch
|
55
|
-
|
56
|
-
With the source code:
|
57
|
-
|
58
|
-
$ tar -xzf ratch-x.y.z.tar.gz
|
59
|
-
$ cd ratch-x.y.z
|
60
|
-
$ sudo task/setup
|
61
|
-
|
62
|
-
Microsoft Windows users, you'll have to use '@ruby task/setup@' instead.
|
63
|
-
|
64
|
-
|
65
|
-
h1. Development
|
66
|
-
|
67
|
-
Ratch is part of the "ProUtils":http://protuils.rubyforge.org project.
|
68
|
-
|
69
|
-
h2. Anonymous Subversion Access
|
70
|
-
|
71
|
-
This project's SVN repository can be checked out through anonymous access with the following command(s).
|
72
|
-
|
73
|
-
svn checkout svn://rubyforge.org/var/svn/proutils/ratch
|
74
|
-
svn checkout http://proutils.rubyforge.org/svn/ratch
|
75
|
-
|
76
|
-
h2. Developer Subversion Access via SSH
|
77
|
-
|
78
|
-
Only project developers can access the SVN tree via this method. SSH must be installed on your client machine. Substitute developername with the proper values. Enter your site password when prompted.
|
79
|
-
|
80
|
-
svn checkout svn+ssh://developername@rubyforge.org/var/svn/proutils/ratch
|
81
|
-
|
82
|
-
|
83
|
-
h1. Copying
|
84
|
-
|
85
|
-
Ratch -- Ruby-based Batch Files
|
86
|
-
|
87
|
-
Copyright © 2007 Ψ Τ Corporation
|
88
|
-
|
89
|
-
This program is free software: you can redistribute it and/or modify
|
90
|
-
it under the terms of the GNU General Public License as published by
|
91
|
-
the Free Software Foundation, either version 3 of the License, or
|
92
|
-
(at your option) any later version.
|
93
|
-
|
94
|
-
This program is distributed in the hope that it will be useful,
|
95
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
96
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
97
|
-
GNU General Public License for more details.
|
98
|
-
|
99
|
-
You should have received a copy of the GNU General Public License
|
100
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
data/doc/siteparts/layout.rhtml
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>Ratch</title>
|
4
|
-
<link href="style.css" rel="stylesheet" type="text/css"/>
|
5
|
-
<LINK REL="SHORTCUT ICON" HREF="images/ratch1.png"/>
|
6
|
-
</head>
|
7
|
-
<body>
|
8
|
-
|
9
|
-
<div class="promenu">
|
10
|
-
ProUtils :: <a href="http://proutils.rubyforge.org/">Home</a> ·
|
11
|
-
<a href="http://rubyforge.org/news/?group_id=4438">News</a> ·
|
12
|
-
<a href="http://rubyforge.org/frs/?group_id=4438">Download</a> ·
|
13
|
-
<a href="http://rubyforge.org/mail/?group_id=4438">Mail</a> ·
|
14
|
-
<a href="http://rubyforge.org/forum/?group_id=4438">Forum</a> ·
|
15
|
-
<a href="http://rubyforge.org/scm/?group_id=4438">Source</a> ·
|
16
|
-
<a href="http://rubyforge.org/tracker/?group_id=4438">Ticket</a>
|
17
|
-
</div>
|
18
|
-
|
19
|
-
<div class="container">
|
20
|
-
|
21
|
-
<div class="banner">
|
22
|
-
RATCH <img src="images/ruby-sm.png"/>
|
23
|
-
</div>
|
24
|
-
|
25
|
-
<div class="menu">
|
26
|
-
<a href="index.html">Welcome</a>
|
27
|
-
<a href="tutorial.html">Tutorial</a>
|
28
|
-
<a href="rdoc/index.html">Library</a>
|
29
|
-
</div>
|
30
|
-
|
31
|
-
<div class="ad">
|
32
|
-
<script type="text/javascript"><!--
|
33
|
-
google_ad_client = "pub-1126154564663472";
|
34
|
-
//RATCH 728x90, 11/8/07
|
35
|
-
google_ad_slot = "6500283279";
|
36
|
-
google_ad_width = 728;
|
37
|
-
google_ad_height = 90;
|
38
|
-
//--></script>
|
39
|
-
<script type="text/javascript"
|
40
|
-
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
41
|
-
</script>
|
42
|
-
</div>
|
43
|
-
|
44
|
-
<div class="content">
|
45
|
-
<%= part :content %>
|
46
|
-
</div>
|
47
|
-
|
48
|
-
<div class="copyright">
|
49
|
-
Ratch, Copyright © 2007 <a href="http://psytower.info">Ψ Τ Corp.</a> <br/><br/>
|
50
|
-
Website design by <a href="http://psytower.info/transcode/">TransCrankItOut</a> using <a href="">Webrite</a>!
|
51
|
-
</div>
|
52
|
-
|
53
|
-
</div>
|
54
|
-
|
55
|
-
</body>
|
56
|
-
</html>
|