rubu 0.0.6 → 0.0.7

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.
data/doc/index.html CHANGED
@@ -157,8 +157,8 @@ make the build process convenient.</p>
157
157
  <p><strong>Step</strong> is build action that transforms source file(s) to
158
158
  target file(s). For example, a C source file compilation is a
159
159
  <strong>Step</strong> where one source file is converted to a corresponding
160
- object file. <strong>Step</strong> is given source <strong>Mark</strong>
161
- and target <strong>Mark</strong> as arguments. Hence this type of
160
+ object file. <strong>Step</strong> is given <strong>Source-Mark</strong>
161
+ and <strong>Target-Mark</strong> as arguments. Hence this type of
162
162
  <strong>Step</strong> a is one-to-one mapping.</p>
163
163
 
164
164
  <p>Linking multiple objects to an executable is a many-to-one mapping. This is
@@ -205,7 +205,7 @@ example.</p>
205
205
  <p>To summarize and highlight the relationships between concepts, see the
206
206
  diagram below:</p>
207
207
 
208
- <pre class="code ruby"><code class="ruby">RBP =&gt; Trail+ =&gt; Step+ [s/p] =&gt; Move+ [s/p] =&gt; SourceMark*, TargetMark*
208
+ <pre class="code ruby"><code class="ruby">RBP =&gt; Trail+ =&gt; Step+ [s/p] =&gt; Move+ [s/p] =&gt; Source-Mark*, Target-Mark*
209
209
  =&gt; Order+
210
210
  =&gt; Var*
211
211
  =&gt; Info*
@@ -223,8 +223,8 @@ sequence or in parallel.</p>
223
223
 
224
224
  <p><strong>Step</strong> includes one or more <strong>Moves</strong>, and they
225
225
  can also be sequential or parallel. <strong>Move</strong> has typically at
226
- least one <strong>SourceMark</strong> and at least one
227
- <strong>TargetMark</strong>. However, there are exceptions as well.</p>
226
+ least one <strong>Source-Mark</strong> and at least one
227
+ <strong>Target-Mark</strong>. However, there are exceptions as well.</p>
228
228
 
229
229
  <p>The suggested ordering within <span class='object_link'><a href="Rubu.html" title="Rubu (module)">Rubu</a></span> Build Program is:</p>
230
230
  <dl class="rdoc-list label-list"><dt>configuration
@@ -235,7 +235,8 @@ the build process.</p>
235
235
  <dd>
236
236
  <p>Collect source and target files either using Ruby with glob pattern, direct
237
237
  references, or through manifest files. Convert file names to
238
- <strong>Mark</strong> objects.</p>
238
+ <strong>Mark</strong> objects (<strong>Source-Mark</strong>,
239
+ <strong>Target-Mark</strong>).</p>
239
240
  </dd><dt>step definition
240
241
  <dd>
241
242
  <p>Define <strong>Steps</strong>. Inherit one of the <strong>Step</strong>
@@ -274,7 +275,8 @@ all C source files:</p>
274
275
  </code></pre>
275
276
 
276
277
  <p>This creates a list of <strong>Mark</strong> objects which are source
277
- files. The corresponding object files can be created with “peer” method:</p>
278
+ files, i.e. <strong>Source-Marks</strong>. The corresponding object
279
+ (target) files can be created with “peer” method:</p>
278
280
 
279
281
  <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_obj_files'>obj_files</span> <span class='op'>=</span> <span class='id identifier rubyid_cee_files'>cee_files</span><span class='period'>.</span><span class='id identifier rubyid_peer'>peer</span><span class='lparen'>(</span> <span class='const'>Var</span><span class='lbracket'>[</span> <span class='symbol'>:build_dir</span> <span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.o</span><span class='tstring_end'>&#39;</span></span> <span class='rparen'>)</span>
280
282
  </code></pre>
@@ -303,8 +305,8 @@ additional “setup” method can be defined as well.</p>
303
305
  configuration. “step” method is the action for <strong>Step</strong>.
304
306
  <span class='object_link'><a href="Rubu.html" title="Rubu (module)">Rubu</a></span> executes it, if necessary. For example, if <strong>Step</strong> is
305
307
  a <strong>StepAged</strong> class, then the “step” method is only called if
306
- the source <strong>Mark</strong> is newer than the target
307
- <strong>Mark</strong>.</p>
308
+ the <strong>Source-Mark</strong> is newer than the
309
+ <strong>Target-Mark</strong>.</p>
308
310
 
309
311
  <p>“step” method may include only one command or a set of commands. If one
310
312
  command is needed, it can be simply executed:</p>
@@ -395,7 +397,7 @@ refer to the source, i.e. the only existing source, you can use the
395
397
  </div></div>
396
398
 
397
399
  <div id="footer">
398
- Generated on Tue Sep 11 08:02:18 2018 by
400
+ Generated on Sat Sep 29 22:28:26 2018 by
399
401
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
400
402
  0.9.16 (ruby-2.5.1).
401
403
  </div>
@@ -102,7 +102,7 @@
102
102
  </div>
103
103
 
104
104
  <div id="footer">
105
- Generated on Tue Sep 11 08:02:18 2018 by
105
+ Generated on Sat Sep 29 22:28:26 2018 by
106
106
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
107
107
  0.9.16 (ruby-2.5.1).
108
108
  </div>
@@ -12,6 +12,7 @@ Spec.command( 'rubu_example', 'Tero Isannainen', '2018',
12
12
  [
13
13
  [ :opt_multi, 'conf', '-c', "Configuration option." ],
14
14
  [ :switch, 'verbose', '-v', "Verbose." ],
15
+ [ :switch, 'noop', '-n', "No operation." ],
15
16
  [ :switch, 'serial', '-s', "Serial execution." ],
16
17
  [ :switch, 'list', '-l', "List defined Trails."],
17
18
  [ :default, nil, nil, "Trail(s) to execute." ],
@@ -33,14 +34,13 @@ Var[ :exe_name ] = 'build/hello'
33
34
  Var[ :fast ] = false
34
35
 
35
36
  # Change Rubu to verbose mode.
36
- if Opt['verbose'].given
37
- Order[ :verbose ] = true
38
- end
37
+ Order[ :verbose ] = Opt['verbose'].given
38
+
39
+ # No operation mode.
40
+ Order[ :noop ] = Opt['noop'].given
39
41
 
40
42
  # Force serial execution.
41
- if Opt[ 'serial' ].given
42
- Order[ :serial ] = true
43
- end
43
+ Order[ :serial ] = Opt[ 'serial' ].given
44
44
 
45
45
  # Read setup files and apply Como command line arguments to Var space.
46
46
  Trail.setup( :como => 'conf' )
data/example/build/hello CHANGED
Binary file
Binary file
data/lib/rubu.rb CHANGED
@@ -133,20 +133,22 @@ module Rubu
133
133
  # Execution content.
134
134
  def run
135
135
  begin
136
- stdout, stderr, status = Open3.capture3( @cmd )
136
+ stdout, stderr, status = Open3.capture3( @cmd ) unless Order[ :noop ]
137
137
 
138
138
  if Order[ :verbose ]
139
139
  STDOUT.puts @cmd
140
140
  end
141
141
 
142
- if status.exitstatus == 0
143
- if Order[ :sh_warn ] && not( stderr.empty? )
144
- warn( stderr )
142
+ unless Order[ :noop ]
143
+ if status.exitstatus == 0
144
+ if Order[ :sh_warn ] && not( stderr.empty? )
145
+ warn( stderr )
146
+ end
147
+ @status = :success
148
+ else
149
+ @status = :error
150
+ error( stderr )
145
151
  end
146
- @status = :success
147
- else
148
- @status = :error
149
- error( stderr )
150
152
  end
151
153
 
152
154
  rescue
@@ -173,7 +175,7 @@ module Rubu
173
175
  # Execution content.
174
176
  def run
175
177
  begin
176
- ret = instance_eval( &@cmd )
178
+ ret = instance_eval( &@cmd ) unless Order[ :noop ]
177
179
  @status = :success
178
180
  if @desc && Order[ :verbose ]
179
181
  STDOUT.puts @desc
@@ -403,6 +405,7 @@ module Rubu
403
405
  # * serial - Force parallel executions to serial (default: parallel).
404
406
  # * parmax - Limit the number of parallel executions (default: 0).
405
407
  # * verbose - Show command executions (default: false).
408
+ # * noop - No operation (default: false).
406
409
  # * force - Force Step updates (default: false).
407
410
  # * sh_warn - Show shell warnings (default: true).
408
411
  class Order
@@ -431,6 +434,9 @@ module Rubu
431
434
  # Verbose execution.
432
435
  Order[ :verbose ] = false
433
436
 
437
+ # No operation.
438
+ Order[ :noop ] = false
439
+
434
440
  # Force Step updates.
435
441
  Order[ :force ] = false
436
442
 
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Rubu
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  def Rubu.version
4
4
  Rubu::VERSION
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tero Isannainen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-11 00:00:00.000000000 Z
11
+ date: 2018-09-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  Rubu (Re-Usable Build Utility) is a library for building