ratch 0.4.1 → 1.0.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.
Files changed (107) hide show
  1. data/COPYING +17 -669
  2. data/HISTORY +6 -0
  3. data/MANIFEST +36 -0
  4. data/METADATA +14 -0
  5. data/NEWS +7 -0
  6. data/README +67 -17
  7. data/bin/ratch +5 -78
  8. data/demo/tryme-task.ratch +12 -0
  9. data/demo/tryme1.ratch +6 -0
  10. data/lib/ratch/core_ext.rb +6 -0
  11. data/lib/ratch/core_ext/facets.rb +1 -0
  12. data/lib/ratch/core_ext/filetest.rb +52 -0
  13. data/lib/ratch/core_ext/object.rb +8 -0
  14. data/lib/ratch/core_ext/pathname.rb +38 -0
  15. data/lib/ratch/core_ext/string.rb +44 -0
  16. data/lib/ratch/{dsl/console.rb → core_ext/to_console.rb} +2 -76
  17. data/lib/ratch/core_ext/to_list.rb +29 -0
  18. data/lib/ratch/dsl.rb +494 -49
  19. data/lib/ratch/index.rb +4 -0
  20. data/lib/ratch/io.rb +116 -0
  21. data/lib/ratch/pathglob.rb +73 -0
  22. data/lib/ratch/plugin.rb +55 -0
  23. data/lib/ratch/runmode.rb +69 -0
  24. data/lib/ratch/script.rb +52 -0
  25. data/lib/ratch/service.rb +33 -0
  26. data/lib/ratch/task.rb +249 -0
  27. data/lib/ratch/task2.rb +298 -0
  28. data/test/README +1 -0
  29. data/test/test_helper.rb +4 -0
  30. data/test/test_task.rb +46 -0
  31. metadata +90 -150
  32. data/CHANGES +0 -22
  33. data/TODO +0 -2
  34. data/bin/lt +0 -56
  35. data/bin/ludo +0 -14
  36. data/bin/manifest +0 -451
  37. data/bin/ratch-find +0 -21
  38. data/demo/WILMA +0 -1
  39. data/demo/XR +0 -9
  40. data/demo/lib/foo/foo.rb +0 -7
  41. data/demo/p.rb +0 -9
  42. data/demo/r.rb +0 -6
  43. data/demo/t.rb +0 -3
  44. data/demo/task/config.yaml +0 -4
  45. data/demo/task/one +0 -6
  46. data/demo/task/simplebuild +0 -15
  47. data/demo/task/stats +0 -4
  48. data/demo/task/task +0 -6
  49. data/demo/task/tryme +0 -10
  50. data/lib/ratch/dsl/argv.rb +0 -112
  51. data/lib/ratch/dsl/batch.rb +0 -232
  52. data/lib/ratch/dsl/build.rb +0 -174
  53. data/lib/ratch/dsl/email.rb +0 -108
  54. data/lib/ratch/dsl/file.rb +0 -205
  55. data/lib/ratch/dsl/meta.rb +0 -125
  56. data/lib/ratch/dsl/options.rb +0 -98
  57. data/lib/ratch/dsl/setup.rb +0 -124
  58. data/lib/ratch/dsl/sign.rb +0 -243
  59. data/lib/ratch/dsl/stage.rb +0 -147
  60. data/lib/ratch/dsl/task.rb +0 -139
  61. data/lib/ratch/dsl/upload.rb +0 -436
  62. data/lib/ratch/dsl/zip.rb +0 -59
  63. data/lib/ratch/extra/email.rb +0 -5
  64. data/lib/ratch/extra/stage.rb +0 -5
  65. data/lib/ratch/extra/zip.rb +0 -5
  66. data/lib/ratch/manager.rb +0 -53
  67. data/lib/ratch/manifest.rb +0 -540
  68. data/lib/ratch/metadata/information.rb +0 -258
  69. data/lib/ratch/metadata/package.rb +0 -108
  70. data/lib/ratch/metadata/project.rb +0 -523
  71. data/lib/ratch/metadata/release.rb +0 -108
  72. data/lib/ratch/support/errors.rb +0 -4
  73. data/lib/ratch/support/filename.rb +0 -18
  74. data/lib/ratch/support/filetest.rb +0 -29
  75. data/lib/ratch/toolset/ruby/announce +0 -224
  76. data/lib/ratch/toolset/ruby/compile +0 -49
  77. data/lib/ratch/toolset/ruby/install +0 -77
  78. data/lib/ratch/toolset/ruby/notes +0 -185
  79. data/lib/ratch/toolset/ruby/pack/gem +0 -93
  80. data/lib/ratch/toolset/ruby/pack/tgz +0 -46
  81. data/lib/ratch/toolset/ruby/pack/zip +0 -46
  82. data/lib/ratch/toolset/ruby/publish +0 -57
  83. data/lib/ratch/toolset/ruby/release +0 -8
  84. data/lib/ratch/toolset/ruby/setup +0 -1616
  85. data/lib/ratch/toolset/ruby/stamp +0 -33
  86. data/lib/ratch/toolset/ruby/stats +0 -138
  87. data/lib/ratch/toolset/ruby/test/crosstest +0 -305
  88. data/lib/ratch/toolset/ruby/test/extest +0 -129
  89. data/lib/ratch/toolset/ruby/test/isotest +0 -293
  90. data/lib/ratch/toolset/ruby/test/load +0 -39
  91. data/lib/ratch/toolset/ruby/test/loadtest +0 -28
  92. data/lib/ratch/toolset/ruby/test/syntax +0 -29
  93. data/lib/ratch/toolset/ruby/test/test +0 -26
  94. data/lib/ratch/toolset/sandbox/query +0 -11
  95. data/man/ratch.man +0 -73
  96. data/meta/MANIFEST +0 -130
  97. data/meta/config.yaml +0 -9
  98. data/meta/icli.yaml +0 -16
  99. data/meta/project.yaml +0 -20
  100. data/meta/ratch.roll +0 -2
  101. data/meta/xProjectInfo +0 -41
  102. data/task/clobber/package +0 -10
  103. data/task/man +0 -14
  104. data/task/publish +0 -57
  105. data/task/release +0 -9
  106. data/task/setup +0 -1616
  107. data/task/stats +0 -138
data/CHANGES DELETED
@@ -1,22 +0,0 @@
1
- = Ratch Revision History
2
-
3
- == 0.4.1 / 2007-12-18
4
-
5
- * #rollrc will be deprecated, it is now just an alias of #release.
6
- * #release gets it's data from the .roll file (no longer ROLLRC).
7
- * Split ruby/svn/log task into two; one for text log and the other for xml log.
8
-
9
- == 0.4.0 / 2007-12-14
10
-
11
- * Reorganized batch scripts --eventually to simplify the code a bit more.
12
- * Made bin? and safe? functions of FileTest.
13
- * Added #rollrc allows quick access to contents of roll metadata file.
14
-
15
- == 0.2.3 / 2007-11-12
16
-
17
- * Major Changes
18
- * Removed BatchFile context and now execute files in top-level.
19
- * Buildable iis working now.
20
- * Minor Changes
21
- * Improved webpage; added news items.
22
- * Generate RDocs for the first time. Yep, they need work ;)
data/TODO DELETED
@@ -1,2 +0,0 @@
1
- = Ratch To Do List
2
-
data/bin/lt DELETED
@@ -1,56 +0,0 @@
1
- #! /usr/bin/ruby1.8
2
-
3
- # scan task scripts for descriptions
4
-
5
- def script_desc(dir)
6
- help = {}
7
- files = Dir.glob(File.join(dir,'**/*'))
8
- files.each do |fname|
9
- next if FileTest.directory?(fname)
10
- next unless FileTest.executable?(fname)
11
- desc = ''
12
- File.open(fname) do |f|
13
- line = ''
14
- until f.eof?
15
- line = f.gets
16
- case line
17
- when /^(#!|\s*$)/
18
- next
19
- when /^\s*#(.*)/
20
- desc = $1.strip; break
21
- else
22
- desc = nil; break
23
- end
24
- end
25
- end
26
- help[fname] = desc
27
- end
28
- help
29
- end
30
-
31
- def show(dir)
32
- tasks = script_desc(dir)
33
- max = tasks.keys.max{ |a,b| a.size <=> b.size }.size
34
- if dir == ''
35
- max += 4 + 2
36
- else
37
- max += dir.size + 2
38
- end
39
- tasks = tasks.sort_by{|k,v| k }
40
- tasks.each do |name, sum|
41
- if dir == ''
42
- cmd = "ratch #{name}"
43
- else
44
- cmd = name
45
- end
46
- puts "%-#{max}s # %s" % [cmd, sum]
47
- end
48
- end
49
-
50
- dir = ARGV[0] || '.'
51
-
52
- if File.directory?(dir)
53
- show( dir )
54
- else
55
- puts "#{dir} is not a directory"
56
- end
data/bin/ludo DELETED
@@ -1,14 +0,0 @@
1
- #! /usr/bin/ruby1.8
2
-
3
- require 'facets/filetest'
4
-
5
- name = ARGV[0]
6
-
7
- if name
8
- Dir.chdir '..' until FileTest.executable?(name) or FileTest.root?(Dir.pwd)
9
- if FileTest.executable?( name )
10
- system name
11
- end
12
- else
13
- puts "Script #{name} not found."
14
- end
@@ -1,451 +0,0 @@
1
- #! /usr/bin/ruby1.8
2
-
3
- # TITLE
4
- #
5
- # Manifest Command
6
- #
7
- # SUMMARY:
8
- #
9
- # Commandline tool for generating and comparing package manifest.
10
- #
11
- # AUTHOR:
12
- #
13
- # - Thomas Sawyer
14
-
15
- require 'facets/command'
16
- require 'facets/module/alias'
17
- require 'ratch/manifest'
18
-
19
- module Ratch
20
-
21
- # def optparse
22
- # opts = GetoptLong.new(
23
- # [ '--file' , '-f', GetoptLong::REQUIRED_ARGUMENT ],
24
- # [ '--digest' , '-g', GetoptLong::REQUIRED_ARGUMENT ],
25
- # [ '--exclude', '-x', GetoptLong::REQUIRED_ARGUMENT ],
26
- # [ '--all' , '-a', GetoptLong::NO_ARGUMENT ],
27
- # [ '--update' , '-u', GetoptLong::NO_ARGUMENT ],
28
- # [ '--list' , '-l', GetoptLong::NO_ARGUMENT ],
29
- # [ '--diff' , '-d', GetoptLong::NO_ARGUMENT ],
30
- # [ '--new' , '-n', GetoptLong::NO_ARGUMENT ],
31
- # [ '--old' , '-o', GetoptLong::NO_ARGUMENT ],
32
- # [ '--clean' , GetoptLong::NO_ARGUMENT ],
33
- # [ '--help' , '-h', GetoptLong::NO_ARGUMENT ]
34
- # )
35
-
36
-
37
- # unless args.empty?
38
- # if File.file?(args[0])
39
- # opts[:file] = args[0]
40
- # opts[:directory] = args[1] if args[1]
41
- # else
42
- # opts[:directory] = args[0]
43
- # opts[:file] = args[1] if args[1]
44
- # end
45
- # end
46
- #
47
- # @quiet = opts.delete(:quiet)
48
- # @options = opts
49
- # @command = cmd
50
- # end
51
-
52
-
53
- # Manifest Console Command
54
-
55
- class ManifestCommand < Console::MasterCommand
56
- include UniversalOptions
57
-
58
- option_arity(
59
- 'x' => 1, 'exclude' => 1,
60
- 'f' => 1, 'file' => 1,
61
- 'g' => 1, 'digest' => 1
62
- )
63
-
64
- attr_accessor :quiet
65
-
66
- attr_accessor :file
67
- attr_accessor :digest
68
- attr_accessor :exclude
69
- attr_accessor :all
70
-
71
- # shorcuts
72
- alias_accessor :f, :file
73
- alias_accessor :x, :exclude
74
- alias_accessor :g, :digest
75
- alias_accessor :a, :all
76
-
77
- # Default command -- output manifest.
78
-
79
- def generate
80
- if file
81
- update
82
- else
83
- manifest = Manifest.new(manifest_options)
84
- manifest.generate
85
- end
86
- end
87
-
88
- alias_method :default, :generate
89
-
90
- # Update a MANIFEST file for this package.
91
-
92
- def update
93
- begin
94
- file = manifest.update
95
- rescue NoManifestError => e
96
- puts e.message
97
- exit -1
98
- end
99
- report_updated(file)
100
- end
101
- alias_method :up, :update
102
-
103
- # List files in manifest file.
104
-
105
- def list
106
- puts manifest.filelist
107
- end
108
-
109
- # Show diff comparison between listed and actual.
110
-
111
- def diff
112
- #begin
113
- result = manifest.diff
114
- report_difference(result)
115
- #rescue NoManifestError
116
- # report_manifest_missing
117
- #end
118
- end
119
-
120
- # Files listed in manifest, but not found.
121
-
122
- def old
123
- #begin
124
- list = manifest.whatsold
125
- unless list.empty?
126
- report_whatsold(list)
127
- end
128
- #rescue NoManifestError
129
- # report_manifest_missing
130
- # exit 0
131
- #end
132
- end
133
-
134
- # Files found, but not listed in manifest.
135
-
136
- def new
137
- #begin
138
- list = manifest.whatsnew
139
- unless list.empty?
140
- report_whatsnew(list)
141
- end
142
- #rescue NoManifestError
143
- # report_manifest_missing
144
- # exit!
145
- #end
146
- end
147
-
148
- # Clean (or clobber if you prefer) non-manifest files.
149
-
150
- def clean
151
- ansr = confirm_clean(manifest.clean_files)
152
- case ansr.downcase
153
- when 'y', 'yes'
154
- manifest.clean
155
- else
156
- report_cancelled('Clean')
157
- exit!
158
- end
159
- end
160
-
161
- # Display command help information.
162
-
163
- def help
164
- report_help
165
- end
166
-
167
- private
168
-
169
- # Load manifest.
170
- #--
171
- # TODO Manifest lookup needs to go in Manifest class?
172
- #++
173
-
174
- def manifest
175
- @manifest ||= (
176
- begin
177
- manifest = Manifest.open(file)
178
- manifest.change_options(manifest_options)
179
- manifest
180
- rescue LoadError
181
- report_manifest_missing
182
- exit 0
183
- end
184
- )
185
- end
186
-
187
- def manifest_options
188
- { :file=>file, :digest=>digest, :exclude=>exclude, :all=>all }
189
- end
190
-
191
- # Quiet opertation?
192
-
193
- def quiet?; @quiet; end
194
-
195
- # Get confirmation for clean.
196
-
197
- def confirm_clean(list)
198
- puts list.join("\n")
199
- ask("The above files will be removed. Continue?", "yN")
200
- end
201
-
202
- # Get confirmation for clobber.
203
-
204
- def confirm_clobber(list)
205
- puts list.join("\n")
206
- ask("The above files will be removed. Continue?", "yN")
207
- end
208
-
209
- # Report manifest created.
210
-
211
- def report_created(file)
212
- file = File.basename(file)
213
- puts "#{file} created." unless quiet?
214
- end
215
-
216
- # Report manifest updated.
217
-
218
- def report_updated(file)
219
- if file
220
- file = File.basename(file)
221
- puts "#{file} updated." unless quiet?
222
- else
223
- puts "Manifest file doesn't exit."
224
- end
225
- end
226
-
227
- # Display diff between file and actual.
228
- #--
229
- # TODO What about checkmode?
230
- #++
231
-
232
- def report_difference(result)
233
- output = nil
234
- if pass = result.empty?
235
- if @checkmode
236
- output = justified('Manifest', '[PASS]') + "\n"
237
- else
238
- #"Manifest is current."
239
- end
240
- else
241
- output = result
242
- end
243
- puts output if output
244
- end
245
-
246
- # Report missing manifest file.
247
-
248
- def report_whatsnew(list)
249
- puts list.join("\n")
250
- end
251
-
252
- # Report missing manifest file.
253
-
254
- def report_whatsold(list)
255
- puts list.join("\n")
256
- end
257
-
258
- # Show help.
259
-
260
- def report_help
261
- puts DATA.read % [ File.mtime(__FILE__).strftime("%Y-%m-%d") ]
262
- end
263
-
264
- # Report missing manifest file.
265
-
266
- def report_manifest_missing
267
- puts "No manifest file."
268
- end
269
-
270
- # Report action cancelled.
271
-
272
- def report_cancelled(action)
273
- puts "#{action} cancelled"
274
- end
275
-
276
- # Report manifest overwrite.
277
-
278
- def report_overwrite(manifest)
279
- puts "#{manifest.filename} already exists."
280
- end
281
-
282
- # Warn that a manifest already exist higher in this hierarchy.
283
-
284
- def report_warn_shadowing(manifest)
285
- puts "Shadowing #{manifest.file}"
286
- end
287
- end
288
-
289
- end
290
-
291
- Ratch::ManifestCommand.start
292
-
293
- =begin scrap
294
-
295
- # # Lookup manifest.
296
- #
297
- # def manifest(create_missing=false)
298
- # @manifest ||= (
299
- # file = @options[:file]
300
- # #manifest = file ? Manifest.open(file) : Manifest.lookup
301
- # manifest = nil
302
- #
303
- # if file
304
- # manifest = Manifest.open(file, @options)
305
- # elsif create_missing
306
- # manifest = Manifest.new(@options)
307
- # else
308
- # manifest = nil
309
- # end
310
- #
311
- # if manifest
312
- # #manifest.send(:set, @options)
313
- # else
314
- # report_manifest_missing
315
- # exit 0
316
- # end
317
- # manifest
318
- # )
319
- # end
320
-
321
- # @manifest ||= (
322
- # file = @options[:file]
323
- # #manifest = file ? Manifest.open(file) : Manifest.lookup
324
- # manifest = nil
325
- #
326
- # if file
327
- # manifest = Manifest.open(file)
328
- # elsif create_missing
329
- # manifest = Manifest.new
330
- # else
331
- # manifest = nil
332
- # end
333
- #
334
- # if manifest
335
- # manifest.change_options(@options)
336
- # else
337
- # report_manifest_missing
338
- # exit 0
339
- # end
340
- # manifest
341
- # )
342
- # end
343
-
344
- # # Generate manifest. By default it is a very simple filename
345
- # # list. The digest can be supplied and a checksum will
346
- # # be given before each filename.
347
- #
348
- # def create
349
- # manifest = Manifest.new #lookup
350
- #
351
- # return report_overwrite(manifest) if (
352
- # manifest and manifest.location == Dir.pwd
353
- # )
354
- #
355
- # report_warn_shadowing(manifest) if manifest
356
- #
357
- # manifest = Manifest.new(options)
358
- # file = manifest.create
359
- # report_created(file)
360
- # end
361
-
362
- # # Clobber non-manifest files.
363
- # #--
364
- # # TODO Should clobber work off the manifest file itself
365
- # #++
366
- #
367
- # def clobber
368
- # ansr = confirm_clobber(manifest.toss)
369
- # case ansr.downcase
370
- # when 'y', 'yes'
371
- # manifest.clobber
372
- # else
373
- # report_cancelled('Clobber')
374
- # exit!
375
- # end
376
- # end
377
-
378
- =end
379
-
380
-
381
- __END__
382
- manifest (%s)
383
-
384
- The manifest listing tool is used to list or create and update a
385
- manifest file for a package (eg. a directory), or compare a manifest
386
- to actual contents. lmf is part of the ProUtils set of tools.
387
-
388
- USAGE:
389
-
390
- lmf [command] [options...] [file] [dir]
391
-
392
- EXAMPLES:
393
-
394
- manifest
395
- manifest update -f READEME.manifest
396
-
397
- COMMANDS:
398
-
399
- When no command is given, a manifest is generated to standard out.
400
- If --file is specified, it will generate to that file instead.
401
-
402
- generate
403
- Create a manifest and send it to stdout. This is the default
404
- action when no command is given.
405
-
406
- update up
407
- Update an existing manifest/digest file using
408
- any previous parameters set for that file.
409
-
410
- list
411
- Show all files listed in the manifest file.
412
-
413
- diff
414
- Diff manifest file against actual.
415
-
416
- new
417
- List existant files not given in the manifest.
418
-
419
- old
420
- Show files listed in manifest but are not in the
421
- the package.
422
-
423
- clean
424
- Remove non-manifest files. (Will ask for confirmation first.)
425
-
426
- help
427
- Display this help message.
428
-
429
- OPTIONS:
430
-
431
- -a --all
432
- Include all files. This deactivates deafult exclusions so
433
- it is possible to make complete list of a contents.
434
-
435
- -f --file [name]
436
- Path to manifest file. By defualt this is the 'manifest' with
437
- optional '.txt' or '.list' extension. it is case-insensitive and
438
- it can also be in a meta/ subdirectory. If the path of the file is
439
- anything else then --file option must be specified.
440
-
441
- -g --digest [type]
442
- Include crytogrpahic signiture. Type can be either
443
- md5, sha1, sha128, sha256, or sha512. The default if
444
- the type is not given id sha1.
445
-
446
- -x --exclude [path]
447
- Exclude a file or dir from the manifest. You can
448
- use --exclude repeatedly.
449
-
450
- -q --quiet
451
- Suppress extraneous output.