inochi 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,3 +1,5 @@
1
+ (the ISC license)
2
+
1
3
  Copyright 2008 Suraj N. Kurapati <sunaku@gmail.com>
2
4
 
3
5
  Permission to use, copy, modify, and/or distribute this software for any
data/bin/inochi CHANGED
@@ -3,8 +3,8 @@
3
3
  # Generates a project scaffold using the given information.
4
4
  #
5
5
  # Existing files are backed up and NOT overwritten. It is your
6
- # responsibility to merge changes between the existing files and
7
- # the newly generated files. See the --merge option for details.
6
+ # responsibility to merge changes (see the --merger option)
7
+ # between the existing files and the newly generated files.
8
8
  #
9
9
  # This tool announces its progress as it runs, using these indicators:
10
10
  #
@@ -12,8 +12,8 @@
12
12
  #
13
13
  # skip: A file is being skipped because it is already up to date.
14
14
  #
15
- # update: A file will be updated because it is out of date. A text
16
- # merging tool (see the "--merger" option) will be launched to
15
+ # update: A file is being updated because it is out of date. A text
16
+ # merging tool (see the --merger option) will be launched to
17
17
  # transfer content from the old file (*.old) and the new file
18
18
  # (*.new) to the out of date file. If a text merging tool is
19
19
  # not specified, then you will have to do the merging by hand.
@@ -39,7 +39,7 @@
39
39
  require File.join(File.dirname(__FILE__), '..', 'lib', 'inochi')
40
40
 
41
41
  @options = Inochi.main :Inochi do
42
- opt :merger, 'A command that invokes a text merging tool with three arguments: (1) old file, (2) new file, (3) output file. The command should write the result of merging the old file and the new file to the output file. The command may only modify the output file; it must NOT modify the old file or the new file.', :type => :string
42
+ opt :merger, 'A command that invokes a text merging tool with three arguments: (1) old file, (2) new file, (3) output file. The command should direct the result of merging the old file and the new file to the output file. In addition, the command *must not* modify the old file or the new file.', :type => :string
43
43
  end
44
44
 
45
45
  # utility logic
@@ -100,6 +100,8 @@
100
100
  }.strip
101
101
 
102
102
  create "#{program_name}/LICENSE", %{
103
+ (the ISC license)
104
+
103
105
  Copyright #{Time.now.year} Your Name <your@email.here>
104
106
 
105
107
  Permission to use, copy, modify, and/or distribute this software for any
@@ -293,6 +295,14 @@
293
295
 
294
296
  <% section "Credits" do %>
295
297
  > TODO: give attribution to your predecessors and contributors
298
+
299
+ **<%= $project %>** is made possible by
300
+ <%= xref "History", "contributions" %>
301
+ from users like you:
302
+
303
+ * __________ (contributor name)
304
+ * __________ (contributor name)
305
+ * __________ (contributor name)
296
306
  <% end %>
297
307
  <% end %>
298
308
  }
@@ -311,7 +321,7 @@
311
321
  <% section "Installation" do %>
312
322
  You can install **<%= $project %>** by running this command:
313
323
 
314
- gem install <%= $program %>
324
+ gem install -f <%= $program %>
315
325
 
316
326
  To check whether the installation was sucessful, run this command:
317
327
 
@@ -351,6 +361,8 @@
351
361
 
352
362
  * <tt>index.erb</tt> --- source of this user manual.
353
363
 
364
+ * <tt>lang/</tt> --- translations of language phrases.
365
+
354
366
  * <tt>LICENSE</tt> --- copyright notice and legal conditions.
355
367
  <% end %>
356
368
  <% end %>
@@ -404,56 +416,45 @@
404
416
 
405
417
  This release changes __________, adds __________, and fixes __________.
406
418
 
407
- <% paragraph "Contributor kudos" do %>
408
- > TODO: list everyone who contributed to this
409
- > release and what their contribution was
410
-
411
- * __________ contributed __________ which __________.
412
-
413
- * __________ fixed __________ which __________.
414
-
415
- * __________ added __________ which __________.
416
- <% end %>
417
-
418
419
  <% paragraph "Incompatible changes" do %>
419
420
  > TODO: list all backward-incompatible changes in this release
420
421
 
421
- * __________ has been __________ to __________.
422
+ * __________ has been __________ to __________. (contributor name)
422
423
 
423
- * __________.
424
+ * __________. (contributor name)
424
425
 
425
- * __________.
426
+ * __________. (contributor name)
426
427
  <% end %>
427
428
 
428
429
  <% paragraph "New features" do %>
429
430
  > TODO: list new features added in this release
430
431
 
431
- * __________.
432
+ * __________. (contributor name)
432
433
 
433
- * __________.
434
+ * __________. (contributor name)
434
435
 
435
- * __________.
436
+ * __________. (contributor name)
436
437
  <% end %>
437
438
 
438
439
  <% paragraph "Bug fixes" do %>
439
440
  > TODO: describe all bugs that are fixed in this release
440
441
 
441
- * __________ was __________.
442
+ * __________ was __________. (contributor name)
442
443
 
443
- * __________ were __________.
444
+ * __________ were __________. (contributor name)
444
445
 
445
- * __________ did __________.
446
+ * __________ did __________. (contributor name)
446
447
  <% end %>
447
448
 
448
449
  <% paragraph "Housekeeping" do %>
449
450
  > TODO: list the refactorings, clean ups, and other
450
451
  > improvements that were done for this release
451
452
 
452
- * __________.
453
+ * __________. (contributor name)
453
454
 
454
- * __________.
455
+ * __________. (contributor name)
455
456
 
456
- * __________.
457
+ * __________. (contributor name)
457
458
  <% end %>
458
459
  <% end %>
459
460
  <% end %>
@@ -24,7 +24,7 @@
24
24
 
25
25
  <tr>
26
26
  <th class="signature">
27
- <span class='name'><a href="#book-class_method" title="book">book</a></span><span class='args'>(project_symbol, book_template)</span>
27
+ <span class='name'><a title="book" href="#book-class_method">book</a></span><span class='args'>(project_symbol, book_template)</span>
28
28
  <span class='block'></span>
29
29
 
30
30
  </th>
@@ -39,7 +39,7 @@ Provides a common configuration for the project&#8217;s user manual:.
39
39
 
40
40
  <tr>
41
41
  <th class="signature">
42
- <span class='name'><a href="#calc_program_name-class_method" title="calc_program_name">calc_program_name</a></span><span class='args'>(project_symbol)</span>
42
+ <span class='name'><a title="calc_program_name" href="#calc_program_name-class_method">calc_program_name</a></span><span class='args'>(project_symbol)</span>
43
43
  <span class='block'></span>
44
44
 
45
45
  </th>
@@ -55,7 +55,7 @@ project name fully in lowercase.
55
55
 
56
56
  <tr>
57
57
  <th class="signature">
58
- <span class='name'><a href="#calc_project_symbol-class_method" title="calc_project_symbol">calc_project_symbol</a></span><span class='args'>(project_name)</span>
58
+ <span class='name'><a title="calc_project_symbol" href="#calc_project_symbol-class_method">calc_project_symbol</a></span><span class='args'>(project_name)</span>
59
59
  <span class='block'></span>
60
60
 
61
61
  </th>
@@ -70,7 +70,7 @@ Calculates the name of the project module from the given project name.
70
70
 
71
71
  <tr>
72
72
  <th class="signature">
73
- <span class='name'><a href="#camel_to_snake_case-class_method" title="camel_to_snake_case">camel_to_snake_case</a></span><span class='args'>(input)</span>
73
+ <span class='name'><a title="camel_to_snake_case" href="#camel_to_snake_case-class_method">camel_to_snake_case</a></span><span class='args'>(input)</span>
74
74
  <span class='block'></span>
75
75
 
76
76
  </th>
@@ -85,7 +85,7 @@ Transforms the given input from CamelCase to snake_case.
85
85
 
86
86
  <tr>
87
87
  <th class="signature">
88
- <span class='name'><a href="#init-class_method" title="init">init</a></span><span class='args'>(project_symbol, project_config = )</span>
88
+ <span class='name'><a title="init" href="#init-class_method">init</a></span><span class='args'>(project_symbol, project_config = )</span>
89
89
  <span class='block'></span>
90
90
 
91
91
  </th>
@@ -109,7 +109,7 @@ project) and providing a common configuration for the project module:.
109
109
 
110
110
  <tr>
111
111
  <th class="signature">
112
- <span class='name'><a href="#main-class_method" title="main">main</a></span><span class='args'>(project_symbol, *trollop_args, &amp;trollop_config)</span>
112
+ <span class='name'><a title="main" href="#main-class_method">main</a></span><span class='args'>(project_symbol, *trollop_args, &amp;trollop_config)</span>
113
113
  <span class='block'></span>
114
114
 
115
115
  </th>
@@ -124,7 +124,7 @@ Provides a common configuration for the main project executable:.
124
124
 
125
125
  <tr>
126
126
  <th class="signature">
127
- <span class='name'><a href="#rake-class_method" title="rake">rake</a></span><span class='args'>(project_symbol, options = )</span>
127
+ <span class='name'><a title="rake" href="#rake-class_method">rake</a></span><span class='args'>(project_symbol, options = )</span>
128
128
  <span class='block'>{|gem_spec| ... }</span>
129
129
 
130
130
  </th>
@@ -241,48 +241,32 @@ The eRuby template which serves as the documentation for the project.
241
241
  <pre class="lines">
242
242
 
243
243
 
244
- 951
245
- 952
246
- 953
247
- 954
248
- 955
249
- 956
250
- 957
251
- 958
252
- 959
253
- 960
254
- 961
255
- 962
256
- 963
257
- 964
258
- 965
259
- 966
260
- 967
261
- 968
262
- 969
263
- 970
264
- 971
265
- 972
266
- 973
267
- 974
268
- 975
269
- 976
270
- 977
271
- 978
272
- 979
273
- 980
274
- 981
275
- 982
276
- 983
277
- 984
278
- 985
279
- 986
280
- 987
281
- 988
282
- 989</pre>
244
+ 35
245
+ 36
246
+ 37
247
+ 38
248
+ 39
249
+ 40
250
+ 41
251
+ 42
252
+ 43
253
+ 44
254
+ 45
255
+ 46
256
+ 47
257
+ 48
258
+ 49
259
+ 50
260
+ 51
261
+ 52
262
+ 53
263
+ 54
264
+ 55
265
+ 56
266
+ 57</pre>
283
267
  </td>
284
268
  <td>
285
- <pre class="code"><span class="info file"># File 'lib/inochi/inochi.rb', line 951</span>
269
+ <pre class="code"><span class="info file"># File 'lib/inochi/book.rb', line 35</span>
286
270
 
287
271
  <span class='def def kw'>def</span> <span class='book identifier id'>book</span> <span class='project_symbol identifier id'>project_symbol</span><span class='comma token'>,</span> <span class='book_template identifier id'>book_template</span>
288
272
  <span class='project_module identifier id'>project_module</span> <span class='assign token'>=</span> <span class='fetch_project_module identifier id'>fetch_project_module</span><span class='lparen token'>(</span><span class='project_symbol identifier id'>project_symbol</span><span class='rparen token'>)</span>
@@ -305,23 +289,7 @@ The eRuby template which serves as the documentation for the project.
305
289
  <span class='end end kw'>end</span><span class='dot token'>.</span><span class='flatten identifier id'>flatten</span>
306
290
  <span class='rbrack token'>]</span>
307
291
 
308
- <span class='class class kw'>class</span> <span class='lshft op'>&lt;&lt;</span> <span class='book_template identifier id'>book_template</span>
309
- <span class='def def kw'>def</span> <span class='project_summary identifier id'>project_summary</span>
310
- <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='string val'>'block must be given'</span> <span class='unless unless_mod kw'>unless</span> <span class='block_given? fid id'>block_given?</span>
311
- <span class='node identifier id'>node</span> <span class='do do kw'>do</span>
312
- <span class='$project_summary_node gvar id'>$project_summary_node</span> <span class='assign token'>=</span> <span class='@nodes ivar id'>@nodes</span><span class='dot token'>.</span><span class='last identifier id'>last</span>
313
- <span class='yield yield kw'>yield</span>
314
- <span class='end end kw'>end</span>
315
- <span class='end end kw'>end</span>
316
-
317
- <span class='def def kw'>def</span> <span class='project_history identifier id'>project_history</span>
318
- <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='string val'>'block must be given'</span> <span class='unless unless_mod kw'>unless</span> <span class='block_given? fid id'>block_given?</span>
319
- <span class='node identifier id'>node</span> <span class='do do kw'>do</span>
320
- <span class='$project_history_node gvar id'>$project_history_node</span> <span class='assign token'>=</span> <span class='@nodes ivar id'>@nodes</span><span class='dot token'>.</span><span class='last identifier id'>last</span>
321
- <span class='yield yield kw'>yield</span>
322
- <span class='end end kw'>end</span>
323
- <span class='end end kw'>end</span>
324
- <span class='end end kw'>end</span>
292
+ <span class='book_template identifier id'>book_template</span><span class='dot token'>.</span><span class='extend identifier id'>extend</span> <span class='Manual constant id'>Manual</span>
325
293
  <span class='end end kw'>end</span>
326
294
  </pre>
327
295
  </td>
@@ -361,12 +329,12 @@ project name fully in lowercase.
361
329
  <pre class="lines">
362
330
 
363
331
 
364
- 995
365
- 996
366
- 997</pre>
332
+ 6
333
+ 7
334
+ 8</pre>
367
335
  </td>
368
336
  <td>
369
- <pre class="code"><span class="info file"># File 'lib/inochi/inochi.rb', line 995</span>
337
+ <pre class="code"><span class="info file"># File 'lib/inochi/util.rb', line 6</span>
370
338
 
371
339
  <span class='def def kw'>def</span> <span class='calc_program_name identifier id'>calc_program_name</span> <span class='project_symbol identifier id'>project_symbol</span>
372
340
  <span class='camel_to_snake_case identifier id'>camel_to_snake_case</span><span class='lparen token'>(</span><span class='project_symbol identifier id'>project_symbol</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='downcase identifier id'>downcase</span>
@@ -408,13 +376,13 @@ Calculates the name of the project module from the given project name.
408
376
  <pre class="lines">
409
377
 
410
378
 
411
- 1002
412
- 1003
413
- 1004
414
- 1005</pre>
379
+ 13
380
+ 14
381
+ 15
382
+ 16</pre>
415
383
  </td>
416
384
  <td>
417
- <pre class="code"><span class="info file"># File 'lib/inochi/inochi.rb', line 1002</span>
385
+ <pre class="code"><span class="info file"># File 'lib/inochi/util.rb', line 13</span>
418
386
 
419
387
  <span class='def def kw'>def</span> <span class='calc_project_symbol identifier id'>calc_project_symbol</span> <span class='project_name identifier id'>project_name</span>
420
388
  <span class='name identifier id'>name</span> <span class='assign token'>=</span> <span class='project_name identifier id'>project_name</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span><span class='dot token'>.</span><span class='gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='regexp val'>/\W+/</span><span class='comma token'>,</span> <span class='string val'>'_'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='squeeze identifier id'>squeeze</span><span class='lparen token'>(</span><span class='string val'>'_'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='regexp val'>/^_|_$/</span><span class='comma token'>,</span> <span class='string val'>''</span><span class='rparen token'>)</span>
@@ -457,22 +425,22 @@ Transforms the given input from CamelCase to snake_case.
457
425
  <pre class="lines">
458
426
 
459
427
 
460
- 1010
461
- 1011
462
- 1012
463
- 1013
464
- 1014
465
- 1015
466
- 1016
467
- 1017
468
- 1018
469
- 1019
470
- 1020
471
- 1021
472
- 1022</pre>
428
+ 21
429
+ 22
430
+ 23
431
+ 24
432
+ 25
433
+ 26
434
+ 27
435
+ 28
436
+ 29
437
+ 30
438
+ 31
439
+ 32
440
+ 33</pre>
473
441
  </td>
474
442
  <td>
475
- <pre class="code"><span class="info file"># File 'lib/inochi/inochi.rb', line 1010</span>
443
+ <pre class="code"><span class="info file"># File 'lib/inochi/util.rb', line 21</span>
476
444
 
477
445
  <span class='def def kw'>def</span> <span class='camel_to_snake_case identifier id'>camel_to_snake_case</span> <span class='input identifier id'>input</span>
478
446
  <span class='input identifier id'>input</span> <span class='assign token'>=</span> <span class='input identifier id'>input</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span><span class='dot token'>.</span><span class='dup identifier id'>dup</span>
@@ -696,6 +664,7 @@ The newly configured project module.
696
664
  <pre class="lines">
697
665
 
698
666
 
667
+ 87
699
668
  88
700
669
  89
701
670
  90
@@ -743,26 +712,10 @@ The newly configured project module.
743
712
  132
744
713
  133
745
714
  134
746
- 135
747
- 136
748
- 137
749
- 138
750
- 139
751
- 140
752
- 141
753
- 142
754
- 143
755
- 144
756
- 145
757
- 146
758
- 147
759
- 148
760
- 149
761
- 150
762
- 151</pre>
715
+ 135</pre>
763
716
  </td>
764
717
  <td>
765
- <pre class="code"><span class="info file"># File 'lib/inochi/inochi.rb', line 88</span>
718
+ <pre class="code"><span class="info file"># File 'lib/inochi/init.rb', line 87</span>
766
719
 
767
720
  <span class='def def kw'>def</span> <span class='init identifier id'>init</span> <span class='project_symbol identifier id'>project_symbol</span><span class='comma token'>,</span> <span class='project_config identifier id'>project_config</span> <span class='assign token'>=</span> <span class='semicolon token'>;</span><span class='lbrace token'>{</span><span class='rbrace token'>}</span>
768
721
  <span class='project_module identifier id'>project_module</span> <span class='assign token'>=</span> <span class='fetch_project_module identifier id'>fetch_project_module</span><span class='lparen token'>(</span><span class='project_symbol identifier id'>project_symbol</span><span class='rparen token'>)</span>
@@ -803,24 +756,9 @@ The newly configured project module.
803
756
  <span class='end end kw'>end</span>
804
757
 
805
758
  <span class='comment val'># make configuration parameters available as constants</span>
806
- <span class='project_config identifier id'>project_config</span><span class='lbrack token'>[</span><span class='symbol val'>:inochi</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='project_config identifier id'>project_config</span>
807
-
808
- <span class='class class kw'>class</span> <span class='lshft op'>&lt;&lt;</span> <span class='project_config identifier id'>project_config</span><span class='lbrack token'>[</span><span class='symbol val'>:version</span><span class='rbrack token'>]</span>
809
- <span class='comment val'># Returns the major number in this version.</span>
810
- <span class='def def kw'>def</span> <span class='major identifier id'>major</span>
811
- <span class='to_s identifier id'>to_s</span><span class='lbrack token'>[</span><span class='regexp val'>/^\d+/</span><span class='rbrack token'>]</span>
812
- <span class='end end kw'>end</span>
813
-
814
- <span class='comment val'># Returns a string describing any version with the current major number.</span>
815
- <span class='def def kw'>def</span> <span class='series identifier id'>series</span>
816
- <span class='dstring node'>&quot;#{major}.x.x&quot;</span>
817
- <span class='end end kw'>end</span>
818
-
819
- <span class='comment val'># Returns a Gem::Requirement expression.</span>
820
- <span class='def def kw'>def</span> <span class='requirement identifier id'>requirement</span>
821
- <span class='dstring node'>&quot;~&gt; #{major}&quot;</span>
822
- <span class='end end kw'>end</span>
823
- <span class='end end kw'>end</span>
759
+ <span class='project_config identifier id'>project_config</span><span class='lbrack token'>[</span><span class='symbol val'>:inochi</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='project_config identifier id'>project_config</span>
760
+ <span class='project_config identifier id'>project_config</span><span class='lbrack token'>[</span><span class='symbol val'>:phrases</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='Phrases constant id'>Phrases</span><span class='dot token'>.</span><span class='new identifier id'>new</span> <span class='project_config identifier id'>project_config</span><span class='lbrack token'>[</span><span class='symbol val'>:install</span><span class='rbrack token'>]</span>
761
+ <span class='project_config identifier id'>project_config</span><span class='lbrack token'>[</span><span class='symbol val'>:version</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='extend identifier id'>extend</span> <span class='Version constant id'>Version</span>
824
762
 
825
763
  <span class='project_config identifier id'>project_config</span><span class='dot token'>.</span><span class='each_pair identifier id'>each_pair</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='param identifier id'>param</span><span class='comma token'>,</span> <span class='value identifier id'>value</span><span class='bitor op'>|</span>
826
764
  <span class='project_module identifier id'>project_module</span><span class='dot token'>.</span><span class='const_set identifier id'>const_set</span> <span class='param identifier id'>param</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span><span class='dot token'>.</span><span class='upcase identifier id'>upcase</span><span class='comma token'>,</span> <span class='value identifier id'>value</span>
@@ -929,53 +867,58 @@ The result of Trollop::options().
929
867
  <pre class="lines">
930
868
 
931
869
 
932
- 181
933
- 182
934
- 183
935
- 184
936
- 185
937
- 186
938
- 187
939
- 188
940
- 189
941
- 190
942
- 191
943
- 192
944
- 193
945
- 194
946
- 195
947
- 196
948
- 197
949
- 198
950
- 199
951
- 200
952
- 201
953
- 202
954
- 203
955
- 204
956
- 205
957
- 206
958
- 207
959
- 208
960
- 209
961
- 210
962
- 211
963
- 212
964
- 213
965
- 214
966
- 215
967
- 216
968
- 217
969
- 218
970
- 219
971
- 220
972
- 221
973
- 222</pre>
870
+ 29
871
+ 30
872
+ 31
873
+ 32
874
+ 33
875
+ 34
876
+ 35
877
+ 36
878
+ 37
879
+ 38
880
+ 39
881
+ 40
882
+ 41
883
+ 42
884
+ 43
885
+ 44
886
+ 45
887
+ 46
888
+ 47
889
+ 48
890
+ 49
891
+ 50
892
+ 51
893
+ 52
894
+ 53
895
+ 54
896
+ 55
897
+ 56
898
+ 57
899
+ 58
900
+ 59
901
+ 60
902
+ 61
903
+ 62
904
+ 63
905
+ 64
906
+ 65
907
+ 66
908
+ 67
909
+ 68
910
+ 69
911
+ 70
912
+ 71
913
+ 72
914
+ 73
915
+ 74
916
+ 75</pre>
974
917
  </td>
975
918
  <td>
976
- <pre class="code"><span class="info file"># File 'lib/inochi/inochi.rb', line 181</span>
919
+ <pre class="code"><span class="info file"># File 'lib/inochi/main.rb', line 29</span>
977
920
 
978
- <span class='def def kw'>def</span> <span class='main identifier id'>main</span> <span class='project_symbol identifier id'>project_symbol</span><span class='comma token'>,</span> <span class='mult op'>*</span><span class='trollop_args identifier id'>trollop_args</span><span class='comma token'>,</span> <span class='bitand op'>&amp;</span><span class='trollop_config identifier id'>trollop_config</span>
921
+ <span class='def def kw'>def</span> <span class='Inochi constant id'>Inochi</span><span class='dot token'>.</span><span class='main identifier id'>main</span> <span class='project_symbol identifier id'>project_symbol</span><span class='comma token'>,</span> <span class='mult op'>*</span><span class='trollop_args identifier id'>trollop_args</span><span class='comma token'>,</span> <span class='bitand op'>&amp;</span><span class='trollop_config identifier id'>trollop_config</span>
979
922
  <span class='program_file identifier id'>program_file</span> <span class='assign token'>=</span> <span class='first_caller_file identifier id'>first_caller_file</span>
980
923
  <span class='program_name identifier id'>program_name</span> <span class='assign token'>=</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='basename identifier id'>basename</span><span class='lparen token'>(</span><span class='program_file identifier id'>program_file</span><span class='rparen token'>)</span>
981
924
  <span class='program_home identifier id'>program_home</span> <span class='assign token'>=</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='dirname identifier id'>dirname</span><span class='lparen token'>(</span><span class='File constant id'>File</span><span class='dot token'>.</span><span class='dirname identifier id'>dirname</span><span class='lparen token'>(</span><span class='program_file identifier id'>program_file</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
@@ -1007,6 +950,7 @@ The result of Trollop::options().
1007
950
  <span class='rbrace token'>}</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='string val'>&quot;\n&quot;</span><span class='rparen token'>)</span>
1008
951
 
1009
952
  <span class='opt identifier id'>opt</span> <span class='symbol val'>:manual</span><span class='comma token'>,</span> <span class='string val'>'Show the user manual'</span>
953
+ <span class='opt identifier id'>opt</span> <span class='symbol val'>:locale</span><span class='comma token'>,</span> <span class='string val'>'Set preferred language'</span><span class='comma token'>,</span> <span class='symbol val'>:type</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='symbol val'>:string</span>
1010
954
  <span class='end end kw'>end</span>
1011
955
 
1012
956
  <span class='if if kw'>if</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='colon op'>:</span><span class='manual identifier id'>manual</span><span class='rbrack token'>]</span>
@@ -1015,6 +959,10 @@ The result of Trollop::options().
1015
959
  <span class='exit identifier id'>exit</span>
1016
960
  <span class='end end kw'>end</span>
1017
961
 
962
+ <span class='if if kw'>if</span> <span class='locale identifier id'>locale</span> <span class='assign token'>=</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='colon op'>:</span><span class='locale identifier id'>locale</span><span class='rbrack token'>]</span>
963
+ <span class='project_module identifier id'>project_module</span><span class='colon2 op'>::</span><span class='PHRASES constant id'>PHRASES</span><span class='dot token'>.</span><span class='locale identifier id'>locale</span> <span class='assign token'>=</span> <span class='locale identifier id'>locale</span>
964
+ <span class='end end kw'>end</span>
965
+
1018
966
  <span class='options identifier id'>options</span>
1019
967
  <span class='end end kw'>end</span>
1020
968
  </pre>
@@ -1218,6 +1166,229 @@ the gem specification
1218
1166
  <pre class="lines">
1219
1167
 
1220
1168
 
1169
+ 85
1170
+ 86
1171
+ 87
1172
+ 88
1173
+ 89
1174
+ 90
1175
+ 91
1176
+ 92
1177
+ 93
1178
+ 94
1179
+ 95
1180
+ 96
1181
+ 97
1182
+ 98
1183
+ 99
1184
+ 100
1185
+ 101
1186
+ 102
1187
+ 103
1188
+ 104
1189
+ 105
1190
+ 106
1191
+ 107
1192
+ 108
1193
+ 109
1194
+ 110
1195
+ 111
1196
+ 112
1197
+ 113
1198
+ 114
1199
+ 115
1200
+ 116
1201
+ 117
1202
+ 118
1203
+ 119
1204
+ 120
1205
+ 121
1206
+ 122
1207
+ 123
1208
+ 124
1209
+ 125
1210
+ 126
1211
+ 127
1212
+ 128
1213
+ 129
1214
+ 130
1215
+ 131
1216
+ 132
1217
+ 133
1218
+ 134
1219
+ 135
1220
+ 136
1221
+ 137
1222
+ 138
1223
+ 139
1224
+ 140
1225
+ 141
1226
+ 142
1227
+ 143
1228
+ 144
1229
+ 145
1230
+ 146
1231
+ 147
1232
+ 148
1233
+ 149
1234
+ 150
1235
+ 151
1236
+ 152
1237
+ 153
1238
+ 154
1239
+ 155
1240
+ 156
1241
+ 157
1242
+ 158
1243
+ 159
1244
+ 160
1245
+ 161
1246
+ 162
1247
+ 163
1248
+ 164
1249
+ 165
1250
+ 166
1251
+ 167
1252
+ 168
1253
+ 169
1254
+ 170
1255
+ 171
1256
+ 172
1257
+ 173
1258
+ 174
1259
+ 175
1260
+ 176
1261
+ 177
1262
+ 178
1263
+ 179
1264
+ 180
1265
+ 181
1266
+ 182
1267
+ 183
1268
+ 184
1269
+ 185
1270
+ 186
1271
+ 187
1272
+ 188
1273
+ 189
1274
+ 190
1275
+ 191
1276
+ 192
1277
+ 193
1278
+ 194
1279
+ 195
1280
+ 196
1281
+ 197
1282
+ 198
1283
+ 199
1284
+ 200
1285
+ 201
1286
+ 202
1287
+ 203
1288
+ 204
1289
+ 205
1290
+ 206
1291
+ 207
1292
+ 208
1293
+ 209
1294
+ 210
1295
+ 211
1296
+ 212
1297
+ 213
1298
+ 214
1299
+ 215
1300
+ 216
1301
+ 217
1302
+ 218
1303
+ 219
1304
+ 220
1305
+ 221
1306
+ 222
1307
+ 223
1308
+ 224
1309
+ 225
1310
+ 226
1311
+ 227
1312
+ 228
1313
+ 229
1314
+ 230
1315
+ 231
1316
+ 232
1317
+ 233
1318
+ 234
1319
+ 235
1320
+ 236
1321
+ 237
1322
+ 238
1323
+ 239
1324
+ 240
1325
+ 241
1326
+ 242
1327
+ 243
1328
+ 244
1329
+ 245
1330
+ 246
1331
+ 247
1332
+ 248
1333
+ 249
1334
+ 250
1335
+ 251
1336
+ 252
1337
+ 253
1338
+ 254
1339
+ 255
1340
+ 256
1341
+ 257
1342
+ 258
1343
+ 259
1344
+ 260
1345
+ 261
1346
+ 262
1347
+ 263
1348
+ 264
1349
+ 265
1350
+ 266
1351
+ 267
1352
+ 268
1353
+ 269
1354
+ 270
1355
+ 271
1356
+ 272
1357
+ 273
1358
+ 274
1359
+ 275
1360
+ 276
1361
+ 277
1362
+ 278
1363
+ 279
1364
+ 280
1365
+ 281
1366
+ 282
1367
+ 283
1368
+ 284
1369
+ 285
1370
+ 286
1371
+ 287
1372
+ 288
1373
+ 289
1374
+ 290
1375
+ 291
1376
+ 292
1377
+ 293
1378
+ 294
1379
+ 295
1380
+ 296
1381
+ 297
1382
+ 298
1383
+ 299
1384
+ 300
1385
+ 301
1386
+ 302
1387
+ 303
1388
+ 304
1389
+ 305
1390
+ 306
1391
+ 307
1221
1392
  308
1222
1393
  309
1223
1394
  310
@@ -1687,151 +1858,12 @@ the gem specification
1687
1858
  774
1688
1859
  775
1689
1860
  776
1690
- 777
1691
- 778
1692
- 779
1693
- 780
1694
- 781
1695
- 782
1696
- 783
1697
- 784
1698
- 785
1699
- 786
1700
- 787
1701
- 788
1702
- 789
1703
- 790
1704
- 791
1705
- 792
1706
- 793
1707
- 794
1708
- 795
1709
- 796
1710
- 797
1711
- 798
1712
- 799
1713
- 800
1714
- 801
1715
- 802
1716
- 803
1717
- 804
1718
- 805
1719
- 806
1720
- 807
1721
- 808
1722
- 809
1723
- 810
1724
- 811
1725
- 812
1726
- 813
1727
- 814
1728
- 815
1729
- 816
1730
- 817
1731
- 818
1732
- 819
1733
- 820
1734
- 821
1735
- 822
1736
- 823
1737
- 824
1738
- 825
1739
- 826
1740
- 827
1741
- 828
1742
- 829
1743
- 830
1744
- 831
1745
- 832
1746
- 833
1747
- 834
1748
- 835
1749
- 836
1750
- 837
1751
- 838
1752
- 839
1753
- 840
1754
- 841
1755
- 842
1756
- 843
1757
- 844
1758
- 845
1759
- 846
1760
- 847
1761
- 848
1762
- 849
1763
- 850
1764
- 851
1765
- 852
1766
- 853
1767
- 854
1768
- 855
1769
- 856
1770
- 857
1771
- 858
1772
- 859
1773
- 860
1774
- 861
1775
- 862
1776
- 863
1777
- 864
1778
- 865
1779
- 866
1780
- 867
1781
- 868
1782
- 869
1783
- 870
1784
- 871
1785
- 872
1786
- 873
1787
- 874
1788
- 875
1789
- 876
1790
- 877
1791
- 878
1792
- 879
1793
- 880
1794
- 881
1795
- 882
1796
- 883
1797
- 884
1798
- 885
1799
- 886
1800
- 887
1801
- 888
1802
- 889
1803
- 890
1804
- 891
1805
- 892
1806
- 893
1807
- 894
1808
- 895
1809
- 896
1810
- 897
1811
- 898
1812
- 899
1813
- 900
1814
- 901
1815
- 902
1816
- 903
1817
- 904
1818
- 905
1819
- 906
1820
- 907
1821
- 908
1822
- 909
1823
- 910
1824
- 911
1825
- 912
1826
- 913
1827
- 914
1828
- 915
1829
- 916</pre>
1861
+ 777</pre>
1830
1862
  </td>
1831
1863
  <td>
1832
- <pre class="code"><span class="info file"># File 'lib/inochi/inochi.rb', line 308</span>
1864
+ <pre class="code"><span class="info file"># File 'lib/inochi/rake.rb', line 85</span>
1833
1865
 
1834
- <span class='def def kw'>def</span> <span class='rake identifier id'>rake</span> <span class='project_symbol identifier id'>project_symbol</span><span class='comma token'>,</span> <span class='options identifier id'>options</span> <span class='assign token'>=</span> <span class='semicolon token'>;</span><span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='comma token'>,</span> <span class='bitand op'>&amp;</span><span class='gem_config identifier id'>gem_config</span>
1866
+ <span class='def def kw'>def</span> <span class='Inochi constant id'>Inochi</span><span class='dot token'>.</span><span class='rake identifier id'>rake</span> <span class='project_symbol identifier id'>project_symbol</span><span class='comma token'>,</span> <span class='options identifier id'>options</span> <span class='assign token'>=</span> <span class='semicolon token'>;</span><span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='comma token'>,</span> <span class='bitand op'>&amp;</span><span class='gem_config identifier id'>gem_config</span>
1835
1867
  <span class='program_file identifier id'>program_file</span> <span class='assign token'>=</span> <span class='first_caller_file identifier id'>first_caller_file</span>
1836
1868
  <span class='program_home identifier id'>program_home</span> <span class='assign token'>=</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='dirname identifier id'>dirname</span><span class='lparen token'>(</span><span class='program_file identifier id'>program_file</span><span class='rparen token'>)</span>
1837
1869
 
@@ -1846,8 +1878,13 @@ the gem specification
1846
1878
  <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:rubyforge_project</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='program_name identifier id'>program_name</span>
1847
1879
  <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:rubyforge_section</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='program_name identifier id'>program_name</span>
1848
1880
  <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:raa_project</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='program_name identifier id'>program_name</span>
1881
+
1849
1882
  <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:license_file</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='string val'>'LICENSE'</span>
1850
- <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:logins_file</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='ENV constant id'>ENV</span><span class='lbrack token'>[</span><span class='string val'>'HOME'</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='string val'>'.config'</span><span class='comma token'>,</span> <span class='string val'>'inochi'</span><span class='comma token'>,</span> <span class='string val'>'logins.yaml'</span><span class='rparen token'>)</span>
1883
+ <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:logins_file</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span>
1884
+ <span class='ENV constant id'>ENV</span><span class='lbrack token'>[</span><span class='string val'>'HOME'</span><span class='rbrack token'>]</span> <span class='orop op'>||</span> <span class='ENV constant id'>ENV</span><span class='lbrack token'>[</span><span class='string val'>'USERPROFILE'</span><span class='rbrack token'>]</span> <span class='orop op'>||</span> <span class='string val'>'.'</span><span class='comma token'>,</span>
1885
+ <span class='string val'>'.config'</span><span class='comma token'>,</span> <span class='string val'>'inochi'</span><span class='comma token'>,</span> <span class='string val'>'logins.yaml'</span>
1886
+ <span class='rparen token'>)</span>
1887
+
1851
1888
  <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:upload_delete</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='false false kw'>false</span>
1852
1889
  <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:upload_options</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
1853
1890
 
@@ -1865,10 +1902,88 @@ the gem specification
1865
1902
  <span class='Rake constant id'>Rake</span><span class='colon2 op'>::</span><span class='Task constant id'>Task</span><span class='lbrack token'>[</span><span class='name identifier id'>name</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='instance_variable_set identifier id'>instance_variable_set</span> <span class='symbol val'>:@comment</span><span class='comma token'>,</span> <span class='nil nil kw'>nil</span>
1866
1903
  <span class='end end kw'>end</span>
1867
1904
 
1905
+ <span class='comment val'># translation</span>
1906
+ <span class='directory identifier id'>directory</span> <span class='string val'>'lang'</span>
1907
+
1908
+ <span class='lang_dump_deps identifier id'>lang_dump_deps</span> <span class='assign token'>=</span> <span class='string val'>'lang'</span>
1909
+ <span class='lang_dump_file identifier id'>lang_dump_file</span> <span class='assign token'>=</span> <span class='string val'>'lang/phrases.yaml'</span>
1910
+
1911
+ <span class='desc identifier id'>desc</span> <span class='string val'>'Extract language phrases for translation.'</span>
1912
+ <span class='task identifier id'>task</span> <span class='string val'>'lang:dump'</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lang_dump_file identifier id'>lang_dump_file</span>
1913
+
1914
+ <span class='file identifier id'>file</span> <span class='lang_dump_file identifier id'>lang_dump_file</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lang_dump_deps identifier id'>lang_dump_deps</span> <span class='do do kw'>do</span>
1915
+ <span class='ENV constant id'>ENV</span><span class='lbrack token'>[</span><span class='string val'>'dump_lang_phrases'</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='string val'>'1'</span>
1916
+ <span class='Rake constant id'>Rake</span><span class='colon2 op'>::</span><span class='Task constant id'>Task</span><span class='lbrack token'>[</span><span class='symbol val'>:test</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='invoke identifier id'>invoke</span>
1917
+ <span class='end end kw'>end</span>
1918
+
1919
+ <span class='lang_conv_delim identifier id'>lang_conv_delim</span> <span class='assign token'>=</span> <span class='string val'>&quot;\n&quot;</span> <span class='mult op'>*</span> <span class='integer val'>5</span>
1920
+
1921
+ <span class='desc identifier id'>desc</span> <span class='string val'>'Translate extracted language phrases (from=LANGUAGE_CODE).'</span>
1922
+ <span class='task identifier id'>task</span> <span class='string val'>'lang:conv'</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lang_dump_file identifier id'>lang_dump_file</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='t identifier id'>t</span><span class='bitor op'>|</span>
1923
+ <span class='require identifier id'>require</span> <span class='string val'>'babelfish'</span>
1924
+
1925
+ <span class='unless unless kw'>unless</span>
1926
+ <span class='src_lang identifier id'>src_lang</span> <span class='assign token'>=</span> <span class='ENV constant id'>ENV</span><span class='lbrack token'>[</span><span class='string val'>'from'</span><span class='rbrack token'>]</span> <span class='and and kw'>and</span>
1927
+ <span class='BabelFish constant id'>BabelFish</span><span class='colon2 op'>::</span><span class='LANGUAGE_CODES constant id'>LANGUAGE_CODES</span><span class='dot token'>.</span><span class='include? fid id'>include?</span> <span class='src_lang identifier id'>src_lang</span>
1928
+ <span class='then then kw'>then</span>
1929
+ <span class='message identifier id'>message</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='string val'>'The &quot;from&quot; parameter must be specified as follows:'</span><span class='rbrack token'>]</span>
1930
+
1931
+ <span class='BabelFish constant id'>BabelFish</span><span class='colon2 op'>::</span><span class='LANGUAGE_CODES constant id'>LANGUAGE_CODES</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='c identifier id'>c</span><span class='bitor op'>|</span>
1932
+ <span class='n identifier id'>n</span> <span class='assign token'>=</span> <span class='BabelFish constant id'>BabelFish</span><span class='colon2 op'>::</span><span class='LANGUAGE_NAMES constant id'>LANGUAGE_NAMES</span><span class='lbrack token'>[</span><span class='c identifier id'>c</span><span class='rbrack token'>]</span>
1933
+ <span class='message identifier id'>message</span> <span class='lshft op'>&lt;&lt;</span> <span class='dstring node'>&quot; rake #{t.name} from=#{c} # from #{n}&quot;</span>
1934
+ <span class='end end kw'>end</span>
1935
+
1936
+ <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='message identifier id'>message</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='string val'>&quot;\n&quot;</span><span class='rparen token'>)</span>
1937
+ <span class='end end kw'>end</span>
1938
+
1939
+ <span class='begin begin kw'>begin</span>
1940
+ <span class='require identifier id'>require</span> <span class='string val'>'yaml'</span>
1941
+ <span class='phrases identifier id'>phrases</span> <span class='assign token'>=</span> <span class='YAML constant id'>YAML</span><span class='dot token'>.</span><span class='load_file identifier id'>load_file</span><span class='lparen token'>(</span><span class='lang_dump_file identifier id'>lang_dump_file</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='keys identifier id'>keys</span><span class='dot token'>.</span><span class='sort identifier id'>sort</span>
1942
+ <span class='rescue rescue kw'>rescue</span>
1943
+ <span class='warn identifier id'>warn</span> <span class='dstring node'>&quot;Could not load phrases from #{lang_dump_file.inspect}&quot;</span>
1944
+ <span class='raise identifier id'>raise</span>
1945
+ <span class='end end kw'>end</span>
1946
+
1947
+ <span class='src_lang_name identifier id'>src_lang_name</span> <span class='assign token'>=</span> <span class='BabelFish constant id'>BabelFish</span><span class='colon2 op'>::</span><span class='LANGUAGE_NAMES constant id'>LANGUAGE_NAMES</span><span class='lbrack token'>[</span><span class='src_lang identifier id'>src_lang</span><span class='rbrack token'>]</span>
1948
+
1949
+ <span class='BabelFish constant id'>BabelFish</span><span class='colon2 op'>::</span><span class='LANGUAGE_PAIRS constant id'>LANGUAGE_PAIRS</span><span class='lbrack token'>[</span><span class='src_lang identifier id'>src_lang</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='dst_lang identifier id'>dst_lang</span><span class='bitor op'>|</span>
1950
+ <span class='dst_file identifier id'>dst_file</span> <span class='assign token'>=</span> <span class='dstring node'>&quot;lang/#{dst_lang}.yaml&quot;</span>
1951
+ <span class='dst_lang_name identifier id'>dst_lang_name</span> <span class='assign token'>=</span> <span class='BabelFish constant id'>BabelFish</span><span class='colon2 op'>::</span><span class='LANGUAGE_NAMES constant id'>LANGUAGE_NAMES</span><span class='lbrack token'>[</span><span class='dst_lang identifier id'>dst_lang</span><span class='rbrack token'>]</span>
1952
+
1953
+ <span class='puts identifier id'>puts</span> <span class='dstring node'>&quot;Translating phrases from #{src_lang_name} into #{dst_lang_name} as #{dst_file.inspect}&quot;</span>
1954
+
1955
+ <span class='translations identifier id'>translations</span> <span class='assign token'>=</span> <span class='BabelFish constant id'>BabelFish</span><span class='dot token'>.</span><span class='translate identifier id'>translate</span><span class='lparen token'>(</span>
1956
+ <span class='phrases identifier id'>phrases</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='lang_conv_delim identifier id'>lang_conv_delim</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='src_lang identifier id'>src_lang</span><span class='comma token'>,</span> <span class='dst_lang identifier id'>dst_lang</span>
1957
+ <span class='rparen token'>)</span><span class='dot token'>.</span><span class='split identifier id'>split</span><span class='lparen token'>(</span><span class='lang_conv_delim identifier id'>lang_conv_delim</span><span class='rparen token'>)</span>
1958
+
1959
+ <span class='File constant id'>File</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='dst_file identifier id'>dst_file</span><span class='comma token'>,</span> <span class='string val'>'w'</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='f identifier id'>f</span><span class='bitor op'>|</span>
1960
+ <span class='f identifier id'>f</span><span class='dot token'>.</span><span class='puts identifier id'>puts</span> <span class='dstring node'>&quot;# #{dst_lang} (#{dst_lang_name})&quot;</span>
1961
+
1962
+ <span class='phrases identifier id'>phrases</span><span class='dot token'>.</span><span class='zip identifier id'>zip</span><span class='lparen token'>(</span><span class='translations identifier id'>translations</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='a identifier id'>a</span><span class='comma token'>,</span> <span class='b identifier id'>b</span><span class='bitor op'>|</span>
1963
+ <span class='f identifier id'>f</span><span class='dot token'>.</span><span class='puts identifier id'>puts</span> <span class='dstring node'>&quot;#{a}: #{b}&quot;</span>
1964
+ <span class='end end kw'>end</span>
1965
+ <span class='end end kw'>end</span>
1966
+ <span class='end end kw'>end</span>
1967
+ <span class='end end kw'>end</span>
1968
+
1868
1969
  <span class='comment val'># testing</span>
1869
1970
  <span class='desc identifier id'>desc</span> <span class='string val'>'Run all unit tests.'</span>
1870
1971
  <span class='task identifier id'>task</span> <span class='symbol val'>:test</span> <span class='do do kw'>do</span>
1871
1972
  <span class='ruby identifier id'>ruby</span> <span class='string val'>'-w'</span><span class='comma token'>,</span> <span class='string val'>'-I.'</span><span class='comma token'>,</span> <span class='string val'>'-Ilib'</span><span class='comma token'>,</span> <span class='string val'>'-r'</span><span class='comma token'>,</span> <span class='program_name identifier id'>program_name</span><span class='comma token'>,</span> <span class='string val'>'-e'</span><span class='comma token'>,</span> <span class='string val'>%q{
1973
+ # dump language phrases *after* exercising all code (and
1974
+ # thereby populating the phrases cache) in the project
1975
+ at_exit do
1976
+ if ENV['dump_lang_phrases'] == '1'
1977
+ file = %s
1978
+ list = %s::PHRASES.phrases
1979
+ data = list.map {|s| s + ':' }.join(&quot;\n&quot;)
1980
+
1981
+ File.write file, data
1982
+
1983
+ puts &quot;Extracted #{list.length} language phrases into #{file.inspect}&quot;
1984
+ end
1985
+ end
1986
+
1872
1987
  # set title of test suite
1873
1988
  $0 = File.basename(Dir.pwd)
1874
1989
 
@@ -1894,7 +2009,7 @@ the gem specification
1894
2009
  warn &quot;Skipped test #{test.inspect} because it lacks a corresponding #{unit.inspect} unit.&quot;
1895
2010
  end
1896
2011
  end
1897
- }</span>
2012
+ }</span> <span class='mod op'>%</span> <span class='lbrack token'>[</span><span class='lang_dump_file identifier id'>lang_dump_file</span><span class='dot token'>.</span><span class='inspect identifier id'>inspect</span><span class='comma token'>,</span> <span class='project_symbol identifier id'>project_symbol</span><span class='rbrack token'>]</span>
1898
2013
  <span class='end end kw'>end</span>
1899
2014
 
1900
2015
  <span class='comment val'># documentation</span>
@@ -1909,10 +2024,7 @@ the gem specification
1909
2024
  <span class='doc_man_doc identifier id'>doc_man_doc</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span>
1910
2025
  <span class='task identifier id'>task</span> <span class='symbol val'>:doc_man_doc</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='doc_man_src identifier id'>doc_man_src</span> <span class='do do kw'>do</span>
1911
2026
  <span class='unless unless kw'>unless</span> <span class='doc_man_doc identifier id'>doc_man_doc</span>
1912
- <span class='unless unless kw'>unless</span> <span class='project_symbol identifier id'>project_symbol</span> <span class='eq op'>==</span> <span class='colon op'>:</span><span class='ERBook constant id'>ERBook</span>
1913
- <span class='gem identifier id'>gem</span> <span class='string val'>'erbook'</span><span class='comma token'>,</span> <span class='string val'>'~&gt; 6'</span>
1914
- <span class='require identifier id'>require</span> <span class='string val'>'erbook'</span>
1915
- <span class='end end kw'>end</span>
2027
+ <span class='require identifier id'>require</span> <span class='string val'>'erbook'</span> <span class='unless unless_mod kw'>unless</span> <span class='defined? defined kw'>defined?</span> <span class='ERBook constant id'>ERBook</span>
1916
2028
 
1917
2029
  <span class='doc_man_txt identifier id'>doc_man_txt</span> <span class='assign token'>=</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='read identifier id'>read</span><span class='lparen token'>(</span><span class='doc_man_src identifier id'>doc_man_src</span><span class='rparen token'>)</span>
1918
2030
  <span class='doc_man_doc identifier id'>doc_man_doc</span> <span class='assign token'>=</span> <span class='ERBook constant id'>ERBook</span><span class='colon2 op'>::</span><span class='Document constant id'>Document</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='symbol val'>:xhtml</span><span class='comma token'>,</span> <span class='doc_man_txt identifier id'>doc_man_txt</span><span class='comma token'>,</span> <span class='doc_man_src identifier id'>doc_man_src</span><span class='comma token'>,</span> <span class='symbol val'>:unindent</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='true true kw'>true</span><span class='rparen token'>)</span>
@@ -2278,6 +2390,8 @@ the gem specification
2278
2390
 
2279
2391
  <span class='desc identifier id'>desc</span> <span class='string val'>'Announce to RubyForge news.'</span>
2280
2392
  <span class='task identifier id'>task</span> <span class='string val'>'pub:ann:forge'</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='symbol val'>:pub_forge</span> <span class='do do kw'>do</span>
2393
+ <span class='puts identifier id'>puts</span> <span class='string val'>'Announcing to RubyForge news...'</span>
2394
+
2281
2395
  <span class='project identifier id'>project</span> <span class='assign token'>=</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:rubyforge_project</span><span class='rbrack token'>]</span>
2282
2396
 
2283
2397
  <span class='if if kw'>if</span> <span class='group_id identifier id'>group_id</span> <span class='assign token'>=</span> <span class='pub_forge identifier id'>pub_forge</span><span class='dot token'>.</span><span class='autoconfig identifier id'>autoconfig</span><span class='lbrack token'>[</span><span class='string val'>'group_ids'</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='project identifier id'>project</span><span class='rbrack token'>]</span>
@@ -2291,14 +2405,13 @@ the gem specification
2291
2405
  <span class='already_announced identifier id'>already_announced</span> <span class='assign token'>=</span> <span class='posts identifier id'>posts</span><span class='dot token'>.</span><span class='include? fid id'>include?</span> <span class='ann_subject identifier id'>ann_subject</span>
2292
2406
 
2293
2407
  <span class='if if kw'>if</span> <span class='already_announced identifier id'>already_announced</span>
2294
- <span class='warn identifier id'>warn</span> <span class='string val'>&quot;This release was already announced to RubyForge news, so I will NOT announce it there again.&quot;</span>
2408
+ <span class='warn identifier id'>warn</span> <span class='string val'>'This release was already announced to RubyForge news, so I will NOT announce it there again.'</span>
2295
2409
  <span class='else else kw'>else</span>
2296
2410
  <span class='comment val'># make the announcement</span>
2297
2411
  <span class='Rake constant id'>Rake</span><span class='colon2 op'>::</span><span class='Task constant id'>Task</span><span class='lbrack token'>[</span><span class='symbol val'>:ann_text</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='invoke identifier id'>invoke</span>
2298
2412
  <span class='pub_forge identifier id'>pub_forge</span><span class='dot token'>.</span><span class='post_news identifier id'>post_news</span> <span class='project identifier id'>project</span><span class='comma token'>,</span> <span class='ann_subject identifier id'>ann_subject</span><span class='comma token'>,</span> <span class='ann_text identifier id'>ann_text</span>
2299
2413
 
2300
- <span class='puts identifier id'>puts</span> <span class='string val'>&quot;Successfully announced to RubyForge news:&quot;</span>
2301
- <span class='puts identifier id'>puts</span> <span class='page identifier id'>page</span><span class='dot token'>.</span><span class='uri identifier id'>uri</span>
2414
+ <span class='puts identifier id'>puts</span> <span class='string val'>'Successfully announced to RubyForge news:'</span><span class='comma token'>,</span> <span class='page identifier id'>page</span><span class='dot token'>.</span><span class='uri identifier id'>uri</span>
2302
2415
  <span class='end end kw'>end</span>
2303
2416
  <span class='else else kw'>else</span>
2304
2417
  <span class='raise identifier id'>raise</span> <span class='dstring node'>&quot;Could not determine the group_id of the #{project.inspect} RubyForge project. Run `rubyforge config` and try again.&quot;</span>
@@ -2307,6 +2420,8 @@ the gem specification
2307
2420
 
2308
2421
  <span class='desc identifier id'>desc</span> <span class='string val'>'Announce to ruby-talk mailing list.'</span>
2309
2422
  <span class='task identifier id'>task</span> <span class='string val'>'pub:ann:talk'</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='symbol val'>:ann_logins</span> <span class='do do kw'>do</span>
2423
+ <span class='puts identifier id'>puts</span> <span class='string val'>'Announcing to ruby-talk mailing list...'</span>
2424
+
2310
2425
  <span class='host identifier id'>host</span> <span class='assign token'>=</span> <span class='string val'>'http://ruby-forum.com'</span>
2311
2426
  <span class='ruby_talk identifier id'>ruby_talk</span> <span class='assign token'>=</span> <span class='integer val'>4</span> <span class='comment val'># ruby-talk forum ID</span>
2312
2427
 
@@ -2325,7 +2440,7 @@ the gem specification
2325
2440
  <span class='end end kw'>end</span>
2326
2441
 
2327
2442
  <span class='if if kw'>if</span> <span class='already_announced identifier id'>already_announced</span>
2328
- <span class='warn identifier id'>warn</span> <span class='string val'>&quot;This release was already announced to the ruby-talk mailing list, so I will NOT announce it there again.&quot;</span>
2443
+ <span class='warn identifier id'>warn</span> <span class='string val'>'This release was already announced to the ruby-talk mailing list, so I will NOT announce it there again.'</span>
2329
2444
  <span class='else else kw'>else</span>
2330
2445
  <span class='comment val'># log in to RubyForum</span>
2331
2446
  <span class='page identifier id'>page</span> <span class='assign token'>=</span> <span class='www identifier id'>www</span><span class='dot token'>.</span><span class='get identifier id'>get</span> <span class='dstring node'>&quot;#{host}/user/login&quot;</span>
@@ -2354,10 +2469,9 @@ the gem specification
2354
2469
 
2355
2470
  <span class='errors identifier id'>errors</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='page identifier id'>page</span><span class='div op'>/</span><span class='string val'>'//div[@class=&quot;error&quot;]/text()'</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='flatten identifier id'>flatten</span>
2356
2471
  <span class='if if kw'>if</span> <span class='errors identifier id'>errors</span><span class='dot token'>.</span><span class='empty? fid id'>empty?</span>
2357
- <span class='puts identifier id'>puts</span> <span class='string val'>&quot;Successfully announced to ruby-talk mailing list:&quot;</span>
2358
- <span class='puts identifier id'>puts</span> <span class='page identifier id'>page</span><span class='dot token'>.</span><span class='uri identifier id'>uri</span>
2472
+ <span class='puts identifier id'>puts</span> <span class='string val'>'Successfully announced to ruby-talk mailing list:'</span><span class='comma token'>,</span> <span class='page identifier id'>page</span><span class='dot token'>.</span><span class='uri identifier id'>uri</span>
2359
2473
  <span class='else else kw'>else</span>
2360
- <span class='warn identifier id'>warn</span> <span class='string val'>&quot;Could not announce to ruby-talk mailing list:&quot;</span>
2474
+ <span class='warn identifier id'>warn</span> <span class='string val'>'Could not announce to ruby-talk mailing list:'</span>
2361
2475
  <span class='warn identifier id'>warn</span> <span class='errors identifier id'>errors</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='string val'>&quot;\n&quot;</span><span class='rparen token'>)</span>
2362
2476
  <span class='end end kw'>end</span>
2363
2477
  <span class='end end kw'>end</span>
@@ -2366,6 +2480,8 @@ the gem specification
2366
2480
 
2367
2481
  <span class='desc identifier id'>desc</span> <span class='string val'>'Announce to RAA (Ruby Application Archive).'</span>
2368
2482
  <span class='task identifier id'>task</span> <span class='string val'>'pub:ann:raa'</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='symbol val'>:ann_logins</span> <span class='do do kw'>do</span>
2483
+ <span class='puts identifier id'>puts</span> <span class='string val'>'Announcing to RAA (Ruby Application Archive)...'</span>
2484
+
2369
2485
  <span class='show_page_error identifier id'>show_page_error</span> <span class='assign token'>=</span> <span class='lambda identifier id'>lambda</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='page identifier id'>page</span><span class='comma token'>,</span> <span class='message identifier id'>message</span><span class='bitor op'>|</span>
2370
2486
  <span class='warn identifier id'>warn</span> <span class='dstring node'>&quot;#{message}, so I can NOT announce this release to RAA:&quot;</span>
2371
2487
  <span class='warn identifier id'>warn</span> <span class='dstring node'>&quot;#{(page/'h2').text} -- #{(page/'p').first.text.strip}&quot;</span>
@@ -2393,7 +2509,7 @@ the gem specification
2393
2509
  <span class='if if kw'>if</span> <span class='page identifier id'>page</span><span class='dot token'>.</span><span class='title identifier id'>title</span> <span class='match op'>=~</span> <span class='regexp val'>/error/i</span>
2394
2510
  <span class='show_page_error identifier id'>show_page_error</span><span class='lbrack token'>[</span><span class='page identifier id'>page</span><span class='comma token'>,</span> <span class='dstring node'>&quot;Could not update #{resource}&quot;</span><span class='rbrack token'>]</span>
2395
2511
  <span class='else else kw'>else</span>
2396
- <span class='puts identifier id'>puts</span> <span class='string val'>&quot;Successfully announced to RAA (Ruby Application Archive).&quot;</span>
2512
+ <span class='puts identifier id'>puts</span> <span class='string val'>'Successfully announced to RAA (Ruby Application Archive).'</span>
2397
2513
  <span class='end end kw'>end</span>
2398
2514
  <span class='else else kw'>else</span>
2399
2515
  <span class='show_page_error identifier id'>show_page_error</span><span class='lbrack token'>[</span><span class='page identifier id'>page</span><span class='comma token'>,</span> <span class='dstring node'>&quot;Could not access #{resource}&quot;</span><span class='rbrack token'>]</span>