mast 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,10 +4,6 @@ module Mast
4
4
  require 'shellwords'
5
5
  require 'mast/core_ext'
6
6
 
7
- # Manifest stores a list of package files, and optionally checksums.
8
- #
9
- # The class can be used to create and compare package manifests and digests.
10
- #
11
7
  # TODO: Integrate file signing and general manifest better (?)
12
8
  #
13
9
  # TODO: Digester is in sign.rb too. Dry-up?
@@ -20,6 +16,13 @@ module Mast
20
16
  # to just [doc]. Otherwise we will get duplicate entries, b/c the #output
21
17
  # method is written for speed and low memory footprint. This might mean @include
22
18
  # can't use file globs.
19
+
20
+ # Manifest stores a list of package files, and optionally checksums.
21
+ #
22
+ # The class can be used to create and compare package manifests and digests.
23
+ #
24
+ # Note that the #diff method currently shells out. Eventually this will be
25
+ # internalized.
23
26
  #
24
27
  class Manifest
25
28
 
@@ -29,7 +32,9 @@ module Mast
29
32
 
30
33
  # No Manifest File Error.
31
34
  #
32
- NoManifestError = Class.new(LoadError)
35
+ NoManifestError = Class.new(LoadError) do
36
+ def message; "ERROR: no manifest file"; end
37
+ end
33
38
 
34
39
  # By default mast will exclude any pathname matching
35
40
  # 'CVS', '_darcs', '.git*' or '.config'.
@@ -74,6 +79,9 @@ module Mast
74
79
  # Show as if another manifest (i.e. use file's bang options).
75
80
  attr_accessor :bang
76
81
 
82
+ # Omit mast header from manifest output.
83
+ attr_accessor :headless
84
+
77
85
  # What files to include. Defaults to ['*'].
78
86
  # Note that Mast automatically recurses through
79
87
  # directory entries, so using '**/*' would simply
@@ -92,6 +100,9 @@ module Mast
92
100
  # Files and checksums listed in file.
93
101
  #attr_reader :list
94
102
 
103
+ # An IO object to output manifest. Default is `$stdout`.
104
+ attr_accessor :io
105
+
95
106
  #
96
107
  alias_method :all?, :all
97
108
 
@@ -101,6 +112,10 @@ module Mast
101
112
  #
102
113
  alias_method :bang?, :bang
103
114
 
115
+ #
116
+ alias_method :headless?, :headless
117
+
118
+
104
119
  # New Manifest object.
105
120
  #
106
121
  def initialize(options={})
@@ -113,6 +128,7 @@ module Mast
113
128
  @bang = false
114
129
  @digest = nil
115
130
  @directory = Dir.pwd
131
+ @io = $stdout
116
132
 
117
133
  change_options(options)
118
134
 
@@ -173,9 +189,10 @@ module Mast
173
189
  #end
174
190
 
175
191
  # Generate manifest.
176
- def generate(out=$stdout)
192
+ def generate(out=nil)
193
+ out ||= self.io
177
194
  parse_topline unless read? if bang?
178
- out << topline_string
195
+ out << topline_string unless headless?
179
196
  output(out)
180
197
  end
181
198
 
@@ -304,7 +321,8 @@ module Mast
304
321
  private
305
322
 
306
323
  #
307
- def output(out=$stdout)
324
+ def output(out=nil)
325
+ out ||= self.io
308
326
  Dir.chdir(directory) do
309
327
  exclusions # seed exclusions
310
328
  #rec_output('*', out)
@@ -315,7 +333,8 @@ module Mast
315
333
  end
316
334
 
317
335
  # Generate listing on the fly.
318
- def rec_output(match, out=$stdout)
336
+ def rec_output(match, out=nil)
337
+ out ||= self.io
319
338
  out.flush unless Array === out
320
339
  #match = (location == dir ? '*' : File.join(dir,'*'))
321
340
  files = Dir.glob(match, File::FNM_DOTMATCH) - exclusions
File without changes
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "MAST" "1" "November 2010" "RubyWorks" "Mast"
4
+ .TH "MAST" "1" "October 2011" "RubyWorks" "Mast"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBmast\fR \- manifest generator
@@ -46,6 +46,10 @@ List files given in the manifest but are non\-existent\.
46
46
  Verify that a manifest matches actual\.
47
47
  .
48
48
  .TP
49
+ \fB\-r\fR, \fB\-\-recent\fR
50
+ Verify that a manifest is more recent than actual\.
51
+ .
52
+ .TP
49
53
  \fB\-\-clean\fR
50
54
  Remove non\-manifest files\. (Will ask for confirmation first\.)
51
55
  .
@@ -84,8 +88,12 @@ Exclude a file or dir from the manifest matching against full pathname\. You can
84
88
  Exclude a file or dir from the manifest matching against an entries basename\. You can use \-\-ignore repeatedly\.
85
89
  .
86
90
  .TP
87
- \fB\-q\fR, \fB\-\-quiet\fR
88
- Suppress any extraneous output\.
91
+ \fB\-\-no\-head\fR
92
+ Suppress mast header from output\.
93
+ .
94
+ .TP
95
+ \fB\-\-debug\fR
96
+ Run command with Ruby\'s $DEBUG flag set to \fBtrue\fR\.
89
97
  .
90
98
  .SH "EXAMPLES"
91
99
  \fBmast\fR
@@ -0,0 +1,154 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
5
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
6
+ <title>mast(1) - manifest generator</title>
7
+ <style type='text/css' media='all'>
8
+ /* style: man */
9
+ body#manpage {margin:0}
10
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
11
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
12
+ .mp h2 {margin:10px 0 0 0}
13
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
14
+ .mp h3 {margin:0 0 0 4ex}
15
+ .mp dt {margin:0;clear:left}
16
+ .mp dt.flush {float:left;width:8ex}
17
+ .mp dd {margin:0 0 0 9ex}
18
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
19
+ .mp pre {margin-bottom:20px}
20
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
21
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
22
+ .mp img {display:block;margin:auto}
23
+ .mp h1.man-title {display:none}
24
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
25
+ .mp h2 {font-size:16px;line-height:1.25}
26
+ .mp h1 {font-size:20px;line-height:2}
27
+ .mp {text-align:justify;background:#fff}
28
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
29
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
30
+ .mp u {text-decoration:underline}
31
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
32
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
33
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
34
+ .mp b.man-ref {font-weight:normal;color:#434241}
35
+ .mp pre {padding:0 4ex}
36
+ .mp pre code {font-weight:normal;color:#434241}
37
+ .mp h2+pre,h3+pre {padding-left:0}
38
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
39
+ ol.man-decor {width:100%}
40
+ ol.man-decor li.tl {text-align:left}
41
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
42
+ ol.man-decor li.tr {text-align:right;float:right}
43
+ </style>
44
+ <style type='text/css' media='all'>
45
+ /* style: toc */
46
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
47
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
48
+ .man-navigation a:hover {color:#111;text-decoration:underline}
49
+ </style>
50
+ </head>
51
+ <!--
52
+ The following styles are deprecated and will be removed at some point:
53
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
54
+
55
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
56
+ .man-navigation should be used instead.
57
+ -->
58
+ <body id='manpage'>
59
+ <div class='mp' id='man'>
60
+
61
+ <div class='man-navigation' style='display:none'>
62
+ <a href="#NAME">NAME</a>
63
+ <a href="#SYNOPSIS">SYNOPSIS</a>
64
+ <a href="#DESCRIPTION">DESCRIPTION</a>
65
+ <a href="#COMMANDS">COMMANDS</a>
66
+ <a href="#OPTIONS">OPTIONS</a>
67
+ <a href="#EXAMPLES">EXAMPLES</a>
68
+ <a href="#SEE-ALSO">SEE ALSO</a>
69
+ </div>
70
+
71
+ <ol class='man-decor man-head man head'>
72
+ <li class='tl'>mast(1)</li>
73
+ <li class='tc'>Mast</li>
74
+ <li class='tr'>mast(1)</li>
75
+ </ol>
76
+
77
+ <h2 id="NAME">NAME</h2>
78
+ <p class="man-name">
79
+ <code>mast</code> - <span class="man-whatis">manifest generator</span>
80
+ </p>
81
+
82
+ <h2 id="SYNOPSIS">SYNOPSIS</h2>
83
+
84
+ <p><code>mast [&lt;command>] [&lt;options>...]</code></p>
85
+
86
+ <h2 id="DESCRIPTION">DESCRIPTION</h2>
87
+
88
+ <p>The manifest listing tool is used to list, create or update a
89
+ manifest for a directory (eg. to define a "package"), or compare
90
+ a manifest to actual directory contents. Mast is part of the
91
+ ProUtils set of tools.</p>
92
+
93
+ <p>When no command is given, a manifest is dumped to standard out.
94
+ If --file is specified, it will generate to that file instead.</p>
95
+
96
+ <h2 id="COMMANDS">COMMANDS</h2>
97
+
98
+ <dl>
99
+ <dt><code>-c</code>, <code>--create</code></dt><dd><p> Generate a new manifest. (default)</p></dd>
100
+ <dt><code>-u</code>, <code>--update</code></dt><dd><p>Update an existing manifest.</p></dd>
101
+ <dt><code>-l</code>, <code>--list</code></dt><dd><p>List the files given in the manifest file. (Use -f to specify an alternate file.)</p></dd>
102
+ <dt><code>-D</code>, <code>--diff</code></dt><dd><p>Diff manifest file against actual.</p></dd>
103
+ <dt><code>-n</code>, <code>--new</code></dt><dd><p>List existant files that are not given in the manifest.</p></dd>
104
+ <dt><code>-o</code>, <code>--old</code></dt><dd><p>List files given in the manifest but are non-existent.</p></dd>
105
+ <dt><code>-v</code>, <code>--verify</code></dt><dd><p>Verify that a manifest matches actual.</p></dd>
106
+ <dt><code>-r</code>, <code>--recent</code></dt><dd><p>Verify that a manifest is more recent than actual.</p></dd>
107
+ <dt class="flush"><code>--clean</code></dt><dd><p>Remove non-manifest files. (Will ask for confirmation first.)</p></dd>
108
+ <dt><code>-h</code>, <code>--help</code></dt><dd><p>Display this help message.</p></dd>
109
+ </dl>
110
+
111
+
112
+ <h2 id="OPTIONS">OPTIONS</h2>
113
+
114
+ <dl>
115
+ <dt><code>-a</code>, <code>--all</code></dt><dd><p>Include all files. This deactivates deafult exclusions
116
+ so it is possible to make complete list of all contents.</p></dd>
117
+ <dt><code>-d</code>, <code>--dir</code></dt><dd><p>When creating a list include directory paths; by default
118
+ only files are listed.</p></dd>
119
+ <dt><code>-b</code>, <code>--bang</code></dt><dd><p>Generate manifest using the options from the bang line of the manifest file.</p></dd>
120
+ <dt><code>-f</code>, <code>--file PATH</code></dt><dd><p>Path to manifest file. This applies to comparison commands.
121
+ If not given then the file matching 'MANIFEST', case-insensitive
122
+ and with an optional '.txt' extension, in the current directory
123
+ is used. If the path of the manifest file is anything else then
124
+ the --file option must be specified.</p></dd>
125
+ <dt><code>-g</code>, <code>--digest TYPE</code></dt><dd><p>Include crytographic signiture. Type can be either
126
+ md5, sha1, sha128, sha256, or sha512.</p></dd>
127
+ <dt><code>-x</code>, <code>--exclude PATH</code></dt><dd><p>Exclude a file or dir from the manifest matching against
128
+ full pathname. You can use --exclude repeatedly.</p></dd>
129
+ <dt><code>-i</code>, <code>--ignore PATH</code></dt><dd><p>Exclude a file or dir from the manifest matching against
130
+ an entries basename. You can use --ignore repeatedly.</p></dd>
131
+ <dt><code>--no-head</code></dt><dd><p>Suppress mast header from output.</p></dd>
132
+ <dt class="flush"><code>--debug</code></dt><dd><p>Run command with Ruby's $DEBUG flag set to <code>true</code>.</p></dd>
133
+ </dl>
134
+
135
+
136
+ <h2 id="EXAMPLES">EXAMPLES</h2>
137
+
138
+ <p><code>mast</code><br />
139
+ <code>mast -u -f PUBLISH</code></p>
140
+
141
+ <h2 id="SEE-ALSO">SEE ALSO</h2>
142
+
143
+ <p><span class="man-ref">ls<span class="s">(1)</span></span></p>
144
+
145
+
146
+ <ol class='man-decor man-foot man foot'>
147
+ <li class='tl'>RubyWorks</li>
148
+ <li class='tc'>October 2011</li>
149
+ <li class='tr'>mast(1)</li>
150
+ </ol>
151
+
152
+ </div>
153
+ </body>
154
+ </html>
@@ -15,6 +15,7 @@ ProUtils set of tools.
15
15
  When no command is given, a manifest is dumped to standard out.
16
16
  If --file is specified, it will generate to that file instead.
17
17
 
18
+
18
19
  ## COMMANDS
19
20
 
20
21
  * `-c`, `--create`:
@@ -38,12 +39,16 @@ If --file is specified, it will generate to that file instead.
38
39
  * `-v`, `--verify`:
39
40
  Verify that a manifest matches actual.
40
41
 
42
+ * `-r`, `--recent`:
43
+ Verify that a manifest is more recent than actual.
44
+
41
45
  * `--clean`:
42
46
  Remove non-manifest files. (Will ask for confirmation first.)
43
47
 
44
48
  * `-h`, `--help`:
45
49
  Display this help message.
46
50
 
51
+
47
52
  ## OPTIONS
48
53
 
49
54
  * `-a`, `--all`:
@@ -76,14 +81,19 @@ If --file is specified, it will generate to that file instead.
76
81
  Exclude a file or dir from the manifest matching against
77
82
  an entries basename. You can use --ignore repeatedly.
78
83
 
79
- * `-q`, `--quiet`:
80
- Suppress any extraneous output.
84
+ * `--no-head`:
85
+ Suppress mast header from output.
86
+
87
+ * `--debug`:
88
+ Run command with Ruby's $DEBUG flag set to `true`.
89
+
81
90
 
82
91
  ## EXAMPLES
83
92
 
84
93
  `mast`<br>
85
94
  `mast -u -f PUBLISH`
86
95
 
96
+
87
97
  ## SEE ALSO
88
98
 
89
99
  ls(1)
metadata CHANGED
@@ -1,116 +1,95 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mast
3
- version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 3
9
- - 0
10
- version: 1.3.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.4.0
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
13
- - Thomas Sawyer
7
+ authors:
8
+ - Trans
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2010-11-20 00:00:00 -05:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: syckle
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
12
+ date: 2011-10-30 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: detroit
16
+ requirement: &21819740 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
33
22
  type: :development
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: qed
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *21819740
25
+ - !ruby/object:Gem::Dependency
26
+ name: qed
27
+ requirement: &21810260 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
47
33
  type: :development
48
- version_requirements: *id002
49
- description: Mast is a command line tool for generating manifests and digests. Mast makes it easy to compare a manifest to a current directory structure, and to update the manifest with a simple command by storing the command option it the manifest file itself.
50
- email: proutils@googlegroups.com
51
- executables:
34
+ prerelease: false
35
+ version_requirements: *21810260
36
+ description: ! 'Mast is a command line tool for generating manifests and digests.
37
+ Mast makes
38
+
39
+ it easy to compare a manifest to a current directory structure, and to update
40
+
41
+ the manifest with a simple command by storing the command options it the
42
+
43
+ manifest file itself.'
44
+ email:
45
+ - transfire@gmail.com
46
+ executables:
52
47
  - mast
53
48
  extensions: []
54
-
55
- extra_rdoc_files:
49
+ extra_rdoc_files:
50
+ - HISTORY.rdoc
56
51
  - README.rdoc
57
- files:
52
+ - QED.rdoc
53
+ - COPYING.rdoc
54
+ files:
55
+ - .ruby
58
56
  - bin/mast
59
57
  - lib/mast/cli.rb
60
58
  - lib/mast/core_ext.rb
61
59
  - lib/mast/manifest.rb
62
- - lib/mast/meta/data.rb
63
- - lib/mast/meta/package
64
- - lib/mast/meta/profile
65
60
  - lib/mast.rb
61
+ - lib/mast.yml
66
62
  - lib/plugins/syckle/mast.rb
63
+ - man/man1/index.txt
67
64
  - man/man1/mast.1
68
- - meta/data.rb
69
- - meta/package
70
- - meta/profile
71
- - qed/cli/applique/env.rb
72
- - qed/cli/overview.rdoc
73
- - ronn/index.txt
74
- - ronn/mast.1.ronn
65
+ - man/man1/mast.1.html
66
+ - man/man1/mast.1.ronn
75
67
  - HISTORY.rdoc
76
- - LICENSE
77
68
  - README.rdoc
78
- has_rdoc: true
79
- homepage: http://proutils.github.com/mast
80
- licenses:
81
- - ""
69
+ - QED.rdoc
70
+ - COPYING.rdoc
71
+ homepage: http://rubyworks.github.com/mast/
72
+ licenses: []
82
73
  post_install_message:
83
- rdoc_options:
84
- - --title
85
- - Mast API
86
- - --main
87
- - README.rdoc
88
- require_paths:
74
+ rdoc_options: []
75
+ require_paths:
89
76
  - lib
90
- required_ruby_version: !ruby/object:Gem::Requirement
77
+ required_ruby_version: !ruby/object:Gem::Requirement
91
78
  none: false
92
- requirements:
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- hash: 3
96
- segments:
97
- - 0
98
- version: "0"
99
- required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
100
84
  none: false
101
- requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- hash: 3
105
- segments:
106
- - 0
107
- version: "0"
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
108
89
  requirements: []
109
-
110
- rubyforge_project: mast
111
- rubygems_version: 1.3.7
90
+ rubyforge_project:
91
+ rubygems_version: 1.8.10
112
92
  signing_key:
113
93
  specification_version: 3
114
94
  summary: Mast is a command line tool for generating manifests and digests.
115
95
  test_files: []
116
-