akaer 1.5.5 → 1.5.6
Sign up to get free protection for your applications and to get access to all the features.
- data/akaer.gemspec +2 -2
- data/doc/Akaer/Application.html +225 -243
- data/doc/Akaer/Configuration.html +12 -13
- data/doc/Akaer/Version.html +6 -10
- data/doc/Akaer.html +2 -2
- data/doc/_index.html +2 -2
- data/doc/file.README.html +3 -3
- data/doc/index.html +3 -3
- data/doc/top-level-namespace.html +2 -2
- data/lib/akaer/version.rb +1 -1
- metadata +127 -136
data/doc/Akaer/Application.html
CHANGED
@@ -655,41 +655,40 @@
|
|
655
655
|
<td>
|
656
656
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 23</span>
|
657
657
|
|
658
|
-
<span class='
|
659
|
-
<span class='
|
660
|
-
<span class='
|
661
|
-
|
662
|
-
<span class='comment
|
663
|
-
<span class='
|
664
|
-
<span class='
|
665
|
-
|
666
|
-
<span class='comment
|
667
|
-
<span class='
|
668
|
-
<span class='
|
669
|
-
<span class='symbol
|
670
|
-
<span class='symbol
|
671
|
-
<span class='symbol
|
672
|
-
<span class='symbol
|
673
|
-
<span class='symbol
|
674
|
-
<span class='symbol
|
675
|
-
<span class='symbol
|
676
|
-
<span class='symbol
|
677
|
-
<span class='symbol
|
678
|
-
<span class='symbol
|
679
|
-
<span class='rbrace
|
680
|
-
|
681
|
-
<span class='
|
682
|
-
|
683
|
-
<span class='
|
684
|
-
<span class='
|
685
|
-
<span class='
|
686
|
-
<span class='
|
687
|
-
<span class='
|
688
|
-
<span class='
|
689
|
-
|
690
|
-
<span class='
|
691
|
-
<span class='
|
692
|
-
</pre>
|
658
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_command'>command</span><span class='rparen'>)</span>
|
659
|
+
<span class='ivar'>@command</span> <span class='op'>=</span> <span class='id identifier rubyid_command'>command</span>
|
660
|
+
<span class='id identifier rubyid_application'>application</span> <span class='op'>=</span> <span class='ivar'>@command</span><span class='period'>.</span><span class='id identifier rubyid_application'>application</span>
|
661
|
+
|
662
|
+
<span class='comment'># Setup logger
|
663
|
+
</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_start_time'>start_time</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span>
|
664
|
+
<span class='ivar'>@logger</span> <span class='op'>=</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_get_real_file'>get_real_file</span><span class='lparen'>(</span><span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>log-file</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_default_file'>default_file</span><span class='comma'>,</span> <span class='const'>Logger</span><span class='op'>::</span><span class='const'>INFO</span><span class='rparen'>)</span>
|
665
|
+
|
666
|
+
<span class='comment'># Open configuration
|
667
|
+
</span> <span class='kw'>begin</span>
|
668
|
+
<span class='id identifier rubyid_overrides'>overrides</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
669
|
+
<span class='symbol'>:interface</span> <span class='op'>=></span> <span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>interface</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span>
|
670
|
+
<span class='symbol'>:addresses</span> <span class='op'>=></span> <span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>addresses</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span>
|
671
|
+
<span class='symbol'>:start_address</span> <span class='op'>=></span> <span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>start-address</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span>
|
672
|
+
<span class='symbol'>:aliases</span> <span class='op'>=></span> <span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>aliases</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span>
|
673
|
+
<span class='symbol'>:add_command</span> <span class='op'>=></span> <span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>add-command</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span>
|
674
|
+
<span class='symbol'>:remove_command</span> <span class='op'>=></span> <span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>remove-command</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span>
|
675
|
+
<span class='symbol'>:log_file</span> <span class='op'>=></span> <span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>log-file</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span>
|
676
|
+
<span class='symbol'>:log_level</span> <span class='op'>=></span> <span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>log-level</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span>
|
677
|
+
<span class='symbol'>:dry_run</span> <span class='op'>=></span> <span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>dry-run</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span>
|
678
|
+
<span class='symbol'>:quiet</span> <span class='op'>=></span> <span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>quiet</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span>
|
679
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_reject'>reject</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
|
680
|
+
|
681
|
+
<span class='ivar'>@config</span> <span class='op'>=</span> <span class='const'>Akaer</span><span class='op'>::</span><span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>configuration</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_overrides'>overrides</span><span class='comma'>,</span> <span class='ivar'>@logger</span><span class='rparen'>)</span>
|
682
|
+
|
683
|
+
<span class='ivar'>@logger</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
684
|
+
<span class='ivar'>@logger</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get_logger'>get_logger</span>
|
685
|
+
<span class='kw'>rescue</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>InvalidConfiguration</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
686
|
+
<span class='ivar'>@logger</span> <span class='op'>?</span> <span class='ivar'>@logger</span><span class='period'>.</span><span class='id identifier rubyid_fatal'>fatal</span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>STDERR</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_fatal'>fatal</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Cannot log to {mark=bright}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_log_file'>log_file</span><span class='rbrace'>}</span><span class='tstring_content'>{/mark}. Exiting...</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
687
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='op'>::</span><span class='const'>SystemExit</span>
|
688
|
+
<span class='kw'>end</span>
|
689
|
+
|
690
|
+
<span class='kw'>self</span>
|
691
|
+
<span class='kw'>end</span></pre>
|
693
692
|
</td>
|
694
693
|
</tr>
|
695
694
|
</table>
|
@@ -734,10 +733,9 @@
|
|
734
733
|
<td>
|
735
734
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 15</span>
|
736
735
|
|
737
|
-
<span class='
|
738
|
-
<span class='
|
739
|
-
<span class='
|
740
|
-
</pre>
|
736
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_command'>command</span>
|
737
|
+
<span class='ivar'>@command</span>
|
738
|
+
<span class='kw'>end</span></pre>
|
741
739
|
</td>
|
742
740
|
</tr>
|
743
741
|
</table>
|
@@ -777,10 +775,9 @@
|
|
777
775
|
<td>
|
778
776
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 12</span>
|
779
777
|
|
780
|
-
<span class='
|
781
|
-
<span class='
|
782
|
-
<span class='
|
783
|
-
</pre>
|
778
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_config'>config</span>
|
779
|
+
<span class='ivar'>@config</span>
|
780
|
+
<span class='kw'>end</span></pre>
|
784
781
|
</td>
|
785
782
|
</tr>
|
786
783
|
</table>
|
@@ -820,10 +817,9 @@
|
|
820
817
|
<td>
|
821
818
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 18</span>
|
822
819
|
|
823
|
-
<span class='
|
824
|
-
<span class='
|
825
|
-
<span class='
|
826
|
-
</pre>
|
820
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_logger'>logger</span>
|
821
|
+
<span class='ivar'>@logger</span>
|
822
|
+
<span class='kw'>end</span></pre>
|
827
823
|
</td>
|
828
824
|
</tr>
|
829
825
|
</table>
|
@@ -922,11 +918,10 @@
|
|
922
918
|
<td>
|
923
919
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 304</span>
|
924
920
|
|
925
|
-
<span class='
|
926
|
-
<span class='
|
927
|
-
<span class='
|
928
|
-
<span class='
|
929
|
-
</pre>
|
921
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='lparen'>(</span><span class='id identifier rubyid_command'>command</span><span class='comma'>,</span> <span class='id identifier rubyid_force'>force</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
922
|
+
<span class='ivar'>@instance</span> <span class='op'>=</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='id identifier rubyid_force'>force</span>
|
923
|
+
<span class='ivar'>@instance</span> <span class='op'>||=</span> <span class='const'>Akaer</span><span class='op'>::</span><span class='const'>Application</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_command'>command</span><span class='rparen'>)</span>
|
924
|
+
<span class='kw'>end</span></pre>
|
930
925
|
</td>
|
931
926
|
</tr>
|
932
927
|
</table>
|
@@ -996,19 +991,18 @@
|
|
996
991
|
<td>
|
997
992
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 198</span>
|
998
993
|
|
999
|
-
<span class='
|
1000
|
-
<span class='
|
1001
|
-
|
1002
|
-
<span class='
|
1003
|
-
<span class='comment
|
1004
|
-
<span class='
|
1005
|
-
<span class='
|
1006
|
-
<span class='rbrace
|
1007
|
-
<span class='
|
1008
|
-
<span class='
|
1009
|
-
<span class='
|
1010
|
-
<span class='
|
1011
|
-
</pre>
|
994
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_action_add'>action_add</span>
|
995
|
+
<span class='id identifier rubyid_addresses'>addresses</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_compute_addresses'>compute_addresses</span>
|
996
|
+
|
997
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_addresses'>addresses</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='kw'>then</span>
|
998
|
+
<span class='comment'># Now, for every address, call the command
|
999
|
+
</span> <span class='id identifier rubyid_addresses'>addresses</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_address'>address</span><span class='op'>|</span>
|
1000
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_manage'>manage</span><span class='lparen'>(</span><span class='symbol'>:add</span><span class='comma'>,</span> <span class='id identifier rubyid_address'>address</span><span class='rparen'>)</span>
|
1001
|
+
<span class='rbrace'>}</span>
|
1002
|
+
<span class='kw'>else</span>
|
1003
|
+
<span class='ivar'>@logger</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>No valid addresses to add to the interface found.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_quiet'>quiet</span>
|
1004
|
+
<span class='kw'>end</span>
|
1005
|
+
<span class='kw'>end</span></pre>
|
1012
1006
|
</td>
|
1013
1007
|
</tr>
|
1014
1008
|
</table>
|
@@ -1096,43 +1090,42 @@
|
|
1096
1090
|
<td>
|
1097
1091
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 230</span>
|
1098
1092
|
|
1099
|
-
<span class='
|
1100
|
-
<span class='
|
1101
|
-
|
1102
|
-
<span class='
|
1103
|
-
<span class='
|
1104
|
-
<span class='
|
1105
|
-
<span class='
|
1106
|
-
|
1107
|
-
<span class='
|
1108
|
-
|
1109
|
-
<span class='
|
1110
|
-
<span class='
|
1111
|
-
|
1112
|
-
<span class='
|
1113
|
-
|
1114
|
-
<span class='
|
1115
|
-
<span class='
|
1116
|
-
<span class='
|
1117
|
-
<span class='
|
1118
|
-
<span class='rbrace
|
1119
|
-
<span class='
|
1120
|
-
<span class='
|
1121
|
-
<span class='
|
1122
|
-
<span class='
|
1123
|
-
<span class='
|
1124
|
-
|
1125
|
-
<span class='
|
1126
|
-
<span class='
|
1127
|
-
<span class='
|
1128
|
-
<span class='
|
1129
|
-
<span class='
|
1130
|
-
<span class='
|
1131
|
-
<span class='
|
1132
|
-
|
1133
|
-
<span class='
|
1134
|
-
<span class='
|
1135
|
-
</pre>
|
1093
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_action_install'>action_install</span>
|
1094
|
+
<span class='id identifier rubyid_logger'>logger</span> <span class='op'>=</span> <span class='id identifier rubyid_get_logger'>get_logger</span>
|
1095
|
+
|
1096
|
+
<span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_osx?'>is_osx?</span> <span class='kw'>then</span>
|
1097
|
+
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_fatal'>fatal</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Install akaer on autolaunch is only available on MacOSX.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_quiet'>quiet</span>
|
1098
|
+
<span class='kw'>return</span> <span class='kw'>false</span>
|
1099
|
+
<span class='kw'>end</span>
|
1100
|
+
|
1101
|
+
<span class='id identifier rubyid_launch_agent'>launch_agent</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_launch_agent_path'>launch_agent_path</span>
|
1102
|
+
|
1103
|
+
<span class='kw'>begin</span>
|
1104
|
+
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Creating the launch agent in {mark=bright}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_launch_agent'>launch_agent</span><span class='rbrace'>}</span><span class='tstring_content'>{/mark} ...</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_quiet'>quiet</span>
|
1105
|
+
|
1106
|
+
<span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='gvar'>$ARGV</span> <span class='op'>?</span> <span class='gvar'>$ARGV</span><span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span> <span class='gvar'>$ARGV</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>-</span> <span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1107
|
+
|
1108
|
+
<span class='id identifier rubyid_plist'>plist</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>KeepAlive</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='kw'>false</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>it.cowtech.akaer</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Program</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lparen'>(</span><span class='op'>::</span><span class='const'>Pathname</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_pwd'>pwd</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='gvar'>$0</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ProgramArguments</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>RunAtLoad</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='kw'>true</span><span class='rbrace'>}</span>
|
1109
|
+
<span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_launch_agent'>launch_agent</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>w</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span>
|
1110
|
+
<span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_plist'>plist</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span><span class='rparen'>)</span>
|
1111
|
+
<span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_flush'>flush</span>
|
1112
|
+
<span class='rbrace'>}</span>
|
1113
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_execute_command'>execute_command</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>plutil -convert binary1 \"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_launch_agent'>launch_agent</span><span class='rbrace'>}</span><span class='tstring_content'>\"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1114
|
+
<span class='kw'>rescue</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
1115
|
+
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Cannot create the launch agent.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_quiet'>quiet</span>
|
1116
|
+
<span class='kw'>return</span> <span class='kw'>false</span>
|
1117
|
+
<span class='kw'>end</span>
|
1118
|
+
|
1119
|
+
<span class='kw'>begin</span>
|
1120
|
+
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Loading the launch agent ...</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_quiet'>quiet</span>
|
1121
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_execute_command'>execute_command</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>launchctl load -w \"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_launch_agent'>launch_agent</span><span class='rbrace'>}</span><span class='tstring_content'>\" > /dev/null 2>&1</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1122
|
+
<span class='kw'>rescue</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
1123
|
+
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Cannot load the launch agent.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_quiet'>quiet</span>
|
1124
|
+
<span class='kw'>return</span> <span class='kw'>false</span>
|
1125
|
+
<span class='kw'>end</span>
|
1126
|
+
|
1127
|
+
<span class='kw'>true</span>
|
1128
|
+
<span class='kw'>end</span></pre>
|
1136
1129
|
</td>
|
1137
1130
|
</tr>
|
1138
1131
|
</table>
|
@@ -1196,19 +1189,18 @@
|
|
1196
1189
|
<td>
|
1197
1190
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 214</span>
|
1198
1191
|
|
1199
|
-
<span class='
|
1200
|
-
<span class='
|
1201
|
-
|
1202
|
-
<span class='
|
1203
|
-
<span class='comment
|
1204
|
-
<span class='
|
1205
|
-
<span class='
|
1206
|
-
<span class='rbrace
|
1207
|
-
<span class='
|
1208
|
-
<span class='
|
1209
|
-
<span class='
|
1210
|
-
<span class='
|
1211
|
-
</pre>
|
1192
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_action_remove'>action_remove</span>
|
1193
|
+
<span class='id identifier rubyid_addresses'>addresses</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_compute_addresses'>compute_addresses</span>
|
1194
|
+
|
1195
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_addresses'>addresses</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='kw'>then</span>
|
1196
|
+
<span class='comment'># Now, for every address, call the command
|
1197
|
+
</span> <span class='id identifier rubyid_addresses'>addresses</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_address'>address</span><span class='op'>|</span>
|
1198
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_manage'>manage</span><span class='lparen'>(</span><span class='symbol'>:remove</span><span class='comma'>,</span> <span class='id identifier rubyid_address'>address</span><span class='rparen'>)</span>
|
1199
|
+
<span class='rbrace'>}</span>
|
1200
|
+
<span class='kw'>else</span>
|
1201
|
+
<span class='ivar'>@logger</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>No valid addresses to remove from the interface found.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_quiet'>quiet</span>
|
1202
|
+
<span class='kw'>end</span>
|
1203
|
+
<span class='kw'>end</span></pre>
|
1212
1204
|
</td>
|
1213
1205
|
</tr>
|
1214
1206
|
</table>
|
@@ -1288,35 +1280,34 @@
|
|
1288
1280
|
<td>
|
1289
1281
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 270</span>
|
1290
1282
|
|
1291
|
-
<span class='
|
1292
|
-
<span class='
|
1293
|
-
|
1294
|
-
<span class='
|
1295
|
-
<span class='
|
1296
|
-
<span class='
|
1297
|
-
<span class='
|
1298
|
-
|
1299
|
-
<span class='
|
1300
|
-
|
1301
|
-
<span class='comment
|
1302
|
-
<span class='
|
1303
|
-
<span class='
|
1304
|
-
<span class='
|
1305
|
-
<span class='
|
1306
|
-
<span class='
|
1307
|
-
|
1308
|
-
<span class='comment
|
1309
|
-
<span class='
|
1310
|
-
<span class='
|
1311
|
-
<span class='
|
1312
|
-
<span class='
|
1313
|
-
<span class='
|
1314
|
-
<span class='
|
1315
|
-
<span class='
|
1316
|
-
|
1317
|
-
<span class='
|
1318
|
-
<span class='
|
1319
|
-
</pre>
|
1283
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_action_uninstall'>action_uninstall</span>
|
1284
|
+
<span class='id identifier rubyid_logger'>logger</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get_logger'>get_logger</span>
|
1285
|
+
|
1286
|
+
<span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_osx?'>is_osx?</span> <span class='kw'>then</span>
|
1287
|
+
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_fatal'>fatal</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Install akaer on autolaunch is only available on MacOSX.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_quiet'>quiet</span>
|
1288
|
+
<span class='kw'>return</span> <span class='kw'>false</span>
|
1289
|
+
<span class='kw'>end</span>
|
1290
|
+
|
1291
|
+
<span class='id identifier rubyid_launch_agent'>launch_agent</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_launch_agent_path'>launch_agent_path</span>
|
1292
|
+
|
1293
|
+
<span class='comment'># Unload the launch agent.
|
1294
|
+
</span> <span class='kw'>begin</span>
|
1295
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_execute_command'>execute_command</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>launchctl unload -w \"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_launch_agent'>launch_agent</span><span class='rbrace'>}</span><span class='tstring_content'>\" > /dev/null 2>&1</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1296
|
+
<span class='kw'>rescue</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
1297
|
+
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Cannot unload the launch agent.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_quiet'>quiet</span>
|
1298
|
+
<span class='kw'>end</span>
|
1299
|
+
|
1300
|
+
<span class='comment'># Delete the launch agent.
|
1301
|
+
</span> <span class='kw'>begin</span>
|
1302
|
+
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Deleting the launch agent </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_launch_agent'>launch_agent</span><span class='rbrace'>}</span><span class='tstring_content'> ...</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1303
|
+
<span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_launch_agent'>launch_agent</span><span class='rparen'>)</span>
|
1304
|
+
<span class='kw'>rescue</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
1305
|
+
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Cannot delete the launch agent.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_quiet'>quiet</span>
|
1306
|
+
<span class='kw'>return</span> <span class='kw'>false</span>
|
1307
|
+
<span class='kw'>end</span>
|
1308
|
+
|
1309
|
+
<span class='kw'>true</span>
|
1310
|
+
<span class='kw'>end</span></pre>
|
1320
1311
|
</td>
|
1321
1312
|
</tr>
|
1322
1313
|
</table>
|
@@ -1415,33 +1406,32 @@
|
|
1415
1406
|
<td>
|
1416
1407
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 136</span>
|
1417
1408
|
|
1418
|
-
<span class='
|
1419
|
-
<span class='
|
1420
|
-
|
1421
|
-
<span class='
|
1422
|
-
<span class='
|
1423
|
-
|
1424
|
-
<span class='comment
|
1425
|
-
<span class='
|
1426
|
-
<span class='
|
1427
|
-
<span class='
|
1428
|
-
<span class='rbrace
|
1429
|
-
<span class='
|
1430
|
-
<span class='
|
1431
|
-
<span class='
|
1432
|
-
<span class='
|
1433
|
-
|
1434
|
-
<span class='lparen
|
1435
|
-
<span class='
|
1436
|
-
<span class='
|
1437
|
-
<span class='
|
1438
|
-
<span class='
|
1439
|
-
<span class='
|
1440
|
-
<span class='
|
1441
|
-
|
1442
|
-
<span class='
|
1443
|
-
<span class='
|
1444
|
-
</pre>
|
1409
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_compute_addresses'>compute_addresses</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='symbol'>:all</span><span class='rparen'>)</span>
|
1410
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1411
|
+
|
1412
|
+
<span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_addresses'>addresses</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='comment'># We have an explicit list
|
1413
|
+
</span> <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_addresses'>addresses</span>
|
1414
|
+
|
1415
|
+
<span class='comment'># Now filter the addresses
|
1416
|
+
</span> <span class='id identifier rubyid_filters'>filters</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span> <span class='op'>!=</span> <span class='symbol'>:ipv6</span> <span class='op'>?</span> <span class='symbol'>:ipv4</span> <span class='op'>:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span> <span class='op'>!=</span> <span class='symbol'>:ipv4</span> <span class='op'>?</span> <span class='symbol'>:ipv6</span> <span class='op'>:</span> <span class='kw'>nil</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span>
|
1417
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_address'>address</span><span class='op'>|</span>
|
1418
|
+
<span class='id identifier rubyid_filters'>filters</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_filter'>filter</span><span class='op'>|</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_filter'>filter</span><span class='rbrace'>}</span><span class='tstring_content'>?</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_address'>address</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
1419
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span>
|
1420
|
+
<span class='kw'>else</span>
|
1421
|
+
<span class='kw'>begin</span>
|
1422
|
+
<span class='id identifier rubyid_ip'>ip</span> <span class='op'>=</span> <span class='const'>IPAddr</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_start_address'>start_address</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rparen'>)</span>
|
1423
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:ipv4</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_ip'>ip</span><span class='period'>.</span><span class='id identifier rubyid_ipv4?'>ipv4?</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:ipv6</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_ip'>ip</span><span class='period'>.</span><span class='id identifier rubyid_ipv6?'>ipv6?</span><span class='rparen'>)</span>
|
1424
|
+
|
1425
|
+
<span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</span> <span class='op'>></span> <span class='int'>0</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</span> <span class='op'>:</span> <span class='int'>5</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_times'>times</span> <span class='kw'>do</span>
|
1426
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'><<</span> <span class='id identifier rubyid_ip'>ip</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
1427
|
+
<span class='id identifier rubyid_ip'>ip</span> <span class='op'>=</span> <span class='id identifier rubyid_ip'>ip</span><span class='period'>.</span><span class='id identifier rubyid_succ'>succ</span>
|
1428
|
+
<span class='kw'>end</span>
|
1429
|
+
<span class='kw'>rescue</span> <span class='const'>ArgumentError</span>
|
1430
|
+
<span class='kw'>end</span>
|
1431
|
+
<span class='kw'>end</span>
|
1432
|
+
|
1433
|
+
<span class='id identifier rubyid_rv'>rv</span>
|
1434
|
+
<span class='kw'>end</span></pre>
|
1445
1435
|
</td>
|
1446
1436
|
</tr>
|
1447
1437
|
</table>
|
@@ -1515,10 +1505,9 @@
|
|
1515
1505
|
<td>
|
1516
1506
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 128</span>
|
1517
1507
|
|
1518
|
-
<span class='
|
1519
|
-
<span class='
|
1520
|
-
<span class='
|
1521
|
-
</pre>
|
1508
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_execute_command'>execute_command</span><span class='lparen'>(</span><span class='id identifier rubyid_command'>command</span><span class='rparen'>)</span>
|
1509
|
+
<span class='const'>Kernel</span><span class='period'>.</span><span class='id identifier rubyid_system'>system</span><span class='lparen'>(</span><span class='id identifier rubyid_command'>command</span><span class='rparen'>)</span>
|
1510
|
+
<span class='kw'>end</span></pre>
|
1522
1511
|
</td>
|
1523
1512
|
</tr>
|
1524
1513
|
</table>
|
@@ -1573,10 +1562,9 @@
|
|
1573
1562
|
<td>
|
1574
1563
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 112</span>
|
1575
1564
|
|
1576
|
-
<span class='
|
1577
|
-
<span class='
|
1578
|
-
<span class='
|
1579
|
-
</pre>
|
1565
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_get_logger'>get_logger</span>
|
1566
|
+
<span class='ivar'>@logger</span> <span class='op'>||=</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_log_file'>log_file</span><span class='comma'>,</span> <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_log_level'>log_level</span><span class='comma'>,</span> <span class='ivar'>@log_formatter</span><span class='rparen'>)</span>
|
1567
|
+
<span class='kw'>end</span></pre>
|
1580
1568
|
</td>
|
1581
1569
|
</tr>
|
1582
1570
|
</table>
|
@@ -1653,13 +1641,12 @@
|
|
1653
1641
|
<td>
|
1654
1642
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 71</span>
|
1655
1643
|
|
1656
|
-
<span class='
|
1657
|
-
<span class='
|
1644
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_is_ipv4?'>is_ipv4?</span><span class='lparen'>(</span><span class='id identifier rubyid_address'>address</span><span class='rparen'>)</span>
|
1645
|
+
<span class='id identifier rubyid_address'>address</span> <span class='op'>=</span> <span class='id identifier rubyid_address'>address</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
|
1658
1646
|
|
1659
|
-
<span class='
|
1660
|
-
<span class='
|
1661
|
-
<span class='
|
1662
|
-
</pre>
|
1647
|
+
<span class='id identifier rubyid_mo'>mo</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\Z</span><span class='regexp_end'>/</span></span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_address'>address</span><span class='rparen'>)</span>
|
1648
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_mo'>mo</span> <span class='op'>&&</span> <span class='id identifier rubyid_mo'>mo</span><span class='period'>.</span><span class='id identifier rubyid_captures'>captures</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_i'>i</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'><</span> <span class='int'>256</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='kw'>false</span>
|
1649
|
+
<span class='kw'>end</span></pre>
|
1663
1650
|
</td>
|
1664
1651
|
</tr>
|
1665
1652
|
</table>
|
@@ -1746,23 +1733,22 @@
|
|
1746
1733
|
<td>
|
1747
1734
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 82</span>
|
1748
1735
|
|
1749
|
-
<span class='
|
1750
|
-
<span class='
|
1751
|
-
|
1752
|
-
<span class='
|
1753
|
-
<span class='comment
|
1754
|
-
<span class='
|
1755
|
-
<span class='
|
1756
|
-
<span class='
|
1757
|
-
<span class='comment
|
1758
|
-
<span class='
|
1759
|
-
<span class='
|
1760
|
-
<span class='
|
1761
|
-
|
1762
|
-
<span class='
|
1763
|
-
<span class='
|
1764
|
-
<span class='
|
1765
|
-
</pre>
|
1736
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_is_ipv6?'>is_ipv6?</span><span class='lparen'>(</span><span class='id identifier rubyid_address'>address</span><span class='rparen'>)</span>
|
1737
|
+
<span class='id identifier rubyid_address'>address</span> <span class='op'>=</span> <span class='id identifier rubyid_address'>address</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
|
1738
|
+
|
1739
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_catch'>catch</span><span class='lparen'>(</span><span class='symbol'>:valid</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
1740
|
+
<span class='comment'># IPv6 (normal)
|
1741
|
+
</span> <span class='id identifier rubyid_throw'>throw</span><span class='lparen'>(</span><span class='symbol'>:valid</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A[\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*\Z</span><span class='regexp_end'>/</span></span> <span class='op'>=~</span> <span class='id identifier rubyid_address'>address</span>
|
1742
|
+
<span class='id identifier rubyid_throw'>throw</span><span class='lparen'>(</span><span class='symbol'>:valid</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A[\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*::([\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*)?\Z</span><span class='regexp_end'>/</span></span> <span class='op'>=~</span> <span class='id identifier rubyid_address'>address</span>
|
1743
|
+
<span class='id identifier rubyid_throw'>throw</span><span class='lparen'>(</span><span class='symbol'>:valid</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A::([\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*)?\Z</span><span class='regexp_end'>/</span></span> <span class='op'>=~</span> <span class='id identifier rubyid_address'>address</span>
|
1744
|
+
<span class='comment'># IPv6 (IPv4 compat)
|
1745
|
+
</span> <span class='id identifier rubyid_throw'>throw</span><span class='lparen'>(</span><span class='symbol'>:valid</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A[\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*:</span><span class='regexp_end'>/</span></span> <span class='op'>=~</span> <span class='id identifier rubyid_address'>address</span> <span class='op'>&&</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_ipv4?'>is_ipv4?</span><span class='lparen'>(</span><span class='backref'>$'</span><span class='rparen'>)</span>
|
1746
|
+
<span class='id identifier rubyid_throw'>throw</span><span class='lparen'>(</span><span class='symbol'>:valid</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A[\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*::([\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*:)?</span><span class='regexp_end'>/</span></span> <span class='op'>=~</span> <span class='id identifier rubyid_address'>address</span> <span class='op'>&&</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_ipv4?'>is_ipv4?</span><span class='lparen'>(</span><span class='backref'>$'</span><span class='rparen'>)</span>
|
1747
|
+
<span class='id identifier rubyid_throw'>throw</span><span class='lparen'>(</span><span class='symbol'>:valid</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A::([\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*:)?</span><span class='regexp_end'>/</span></span> <span class='op'>=~</span> <span class='id identifier rubyid_address'>address</span> <span class='op'>&&</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is_ipv4?'>is_ipv4?</span><span class='lparen'>(</span><span class='backref'>$'</span><span class='rparen'>)</span>
|
1748
|
+
|
1749
|
+
<span class='kw'>false</span>
|
1750
|
+
<span class='kw'>end</span>
|
1751
|
+
<span class='kw'>end</span></pre>
|
1766
1752
|
</td>
|
1767
1753
|
</tr>
|
1768
1754
|
</table>
|
@@ -1819,10 +1805,9 @@
|
|
1819
1805
|
<td>
|
1820
1806
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 63</span>
|
1821
1807
|
|
1822
|
-
<span class='
|
1823
|
-
<span class='
|
1824
|
-
<span class='
|
1825
|
-
</pre>
|
1808
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_is_osx?'>is_osx?</span>
|
1809
|
+
<span class='op'>::</span><span class='const'>Config</span><span class='op'>::</span><span class='const'>CONFIG</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>host_os</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^darwin</span><span class='regexp_end'>/</span></span>
|
1810
|
+
<span class='kw'>end</span></pre>
|
1826
1811
|
</td>
|
1827
1812
|
</tr>
|
1828
1813
|
</table>
|
@@ -1898,10 +1883,9 @@
|
|
1898
1883
|
<td>
|
1899
1884
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 120</span>
|
1900
1885
|
|
1901
|
-
<span class='
|
1902
|
-
<span class='
|
1903
|
-
<span class='
|
1904
|
-
</pre>
|
1886
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_launch_agent_path'>launch_agent_path</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>it.cowtech.akaer</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1887
|
+
<span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>HOME</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/Library/LaunchAgents/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>.plist</span><span class='tstring_end'>"</span></span>
|
1888
|
+
<span class='kw'>end</span></pre>
|
1905
1889
|
</td>
|
1906
1890
|
</tr>
|
1907
1891
|
</table>
|
@@ -2013,33 +1997,32 @@
|
|
2013
1997
|
<td>
|
2014
1998
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 168</span>
|
2015
1999
|
|
2016
|
-
<span class='
|
2017
|
-
<span class='
|
2018
|
-
|
2019
|
-
<span class='comment
|
2020
|
-
<span class='
|
2021
|
-
|
2022
|
-
<span class='comment
|
2023
|
-
<span class='
|
2024
|
-
|
2025
|
-
<span class='comment
|
2026
|
-
<span class='
|
2027
|
-
<span class='
|
2028
|
-
<span class='
|
2029
|
-
<span class='
|
2030
|
-
|
2031
|
-
<span class='comment
|
2032
|
-
<span class='
|
2033
|
-
<span class='
|
2034
|
-
<span class='
|
2035
|
-
<span class='
|
2036
|
-
<span class='
|
2037
|
-
<span class='
|
2038
|
-
<span class='
|
2039
|
-
|
2040
|
-
<span class='
|
2041
|
-
<span class='
|
2042
|
-
</pre>
|
2000
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_manage'>manage</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_address'>address</span><span class='rparen'>)</span>
|
2001
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>true</span>
|
2002
|
+
|
2003
|
+
<span class='comment'># Compute the command
|
2004
|
+
</span> <span class='id identifier rubyid_command'>command</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:remove</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_remove_command'>remove_command</span> <span class='op'>:</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_add_command'>add_command</span>
|
2005
|
+
|
2006
|
+
<span class='comment'># Interpolate
|
2007
|
+
</span> <span class='id identifier rubyid_command'>command</span> <span class='op'>=</span> <span class='id identifier rubyid_command'>command</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@INTERFACE@</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_interface'>interface</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@ALIAS@</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_address'>address</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> > /dev/null 2>&1</span><span class='tstring_end'>"</span></span>
|
2008
|
+
|
2009
|
+
<span class='comment'># Compute the prefix
|
2010
|
+
</span> <span class='ivar'>@addresses</span> <span class='op'>||=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_compute_addresses'>compute_addresses</span>
|
2011
|
+
<span class='id identifier rubyid_length'>length</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_pad_number'>pad_number</span><span class='lparen'>(</span><span class='ivar'>@addresses</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='rparen'>)</span>
|
2012
|
+
<span class='id identifier rubyid_index'>index</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='ivar'>@addresses</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='id identifier rubyid_address'>address</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='int'>0</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='int'>1</span>
|
2013
|
+
<span class='id identifier rubyid_prefix'>prefix</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>{mark=blue}[{mark=bright white}</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_pad_number'>pad_number</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='comma'>,</span> <span class='id identifier rubyid_length'>length</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>{mark=reset blue}/{/mark}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_length'>length</span><span class='rbrace'>}</span><span class='tstring_content'>{/mark}]{/mark}</span><span class='tstring_end'>"</span></span>
|
2014
|
+
|
2015
|
+
<span class='comment'># Now execute
|
2016
|
+
</span> <span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_dry_run'>dry_run</span> <span class='kw'>then</span>
|
2017
|
+
<span class='ivar'>@logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='ivar'>@command</span><span class='period'>.</span><span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_console'>console</span><span class='period'>.</span><span class='id identifier rubyid_replace_markers'>replace_markers</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_prefix'>prefix</span><span class='rbrace'>}</span><span class='tstring_content'> {mark=bright}</span><span class='embexpr_beg'>#{</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:remove</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Removing</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Adding</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>{/mark} address {mark=bright}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_address'>address</span><span class='rbrace'>}</span><span class='tstring_content'>{/mark} </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span> <span class='op'>!=</span> <span class='symbol'>:remove</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>from</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='tstring_content'> interface {mark=bright}</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_interface'>interface</span><span class='rbrace'>}</span><span class='tstring_content'>{/mark}...</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_quiet'>quiet</span>
|
2018
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_execute_command'>execute_command</span><span class='lparen'>(</span><span class='id identifier rubyid_command'>command</span><span class='rparen'>)</span>
|
2019
|
+
<span class='ivar'>@logger</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span><span class='lparen'>(</span><span class='ivar'>@command</span><span class='period'>.</span><span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_console'>console</span><span class='period'>.</span><span class='id identifier rubyid_replace_markers'>replace_markers</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Cannot {mark=bright}</span><span class='embexpr_beg'>#{</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:remove</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>remove</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>add</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>{/mark} address {mark=bright}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_address'>address</span><span class='rbrace'>}</span><span class='tstring_content'>{/mark} </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span> <span class='op'>!=</span> <span class='symbol'>:remove</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>from</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='tstring_content'> interface {mark=bright}</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_interface'>interface</span><span class='rbrace'>}</span><span class='tstring_content'>{/mark}.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_rv'>rv</span>
|
2020
|
+
<span class='kw'>else</span>
|
2021
|
+
<span class='ivar'>@logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='ivar'>@command</span><span class='period'>.</span><span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_console'>console</span><span class='period'>.</span><span class='id identifier rubyid_replace_markers'>replace_markers</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_prefix'>prefix</span><span class='rbrace'>}</span><span class='tstring_content'> I will {mark=bright}</span><span class='embexpr_beg'>#{</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:remove</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>remove</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>add</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>{/mark} address {mark=bright}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_address'>address</span><span class='rbrace'>}</span><span class='tstring_content'>{/mark} </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span> <span class='op'>!=</span> <span class='symbol'>:remove</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>from</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='tstring_content'> interface {mark=bright}</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_interface'>interface</span><span class='rbrace'>}</span><span class='tstring_content'>{/mark}.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_quiet'>quiet</span>
|
2022
|
+
<span class='kw'>end</span>
|
2023
|
+
|
2024
|
+
<span class='id identifier rubyid_rv'>rv</span>
|
2025
|
+
<span class='kw'>end</span></pre>
|
2043
2026
|
</td>
|
2044
2027
|
</tr>
|
2045
2028
|
</table>
|
@@ -2130,10 +2113,9 @@
|
|
2130
2113
|
<td>
|
2131
2114
|
<pre class="code"><span class="info file"># File 'lib/akaer/application.rb', line 105</span>
|
2132
2115
|
|
2133
|
-
<span class='
|
2134
|
-
<span class='
|
2135
|
-
<span class='
|
2136
|
-
</pre>
|
2116
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_pad_number'>pad_number</span><span class='lparen'>(</span><span class='id identifier rubyid_num'>num</span><span class='comma'>,</span> <span class='id identifier rubyid_len'>len</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
2117
|
+
<span class='id identifier rubyid_num'>num</span><span class='period'>.</span><span class='id identifier rubyid_to_integer'>to_integer</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_rjust'>rjust</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_len'>len</span><span class='period'>.</span><span class='id identifier rubyid_to_integer'>to_integer</span><span class='comma'>,</span> <span class='int'>2</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
2118
|
+
<span class='kw'>end</span></pre>
|
2137
2119
|
</td>
|
2138
2120
|
</tr>
|
2139
2121
|
</table>
|
@@ -2144,9 +2126,9 @@
|
|
2144
2126
|
</div>
|
2145
2127
|
|
2146
2128
|
<div id="footer">
|
2147
|
-
Generated on
|
2129
|
+
Generated on Fri Oct 19 08:57:43 2012 by
|
2148
2130
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2149
|
-
0.8.2.1 (ruby-1.
|
2131
|
+
0.8.2.1 (ruby-1.9.2).
|
2150
2132
|
</div>
|
2151
2133
|
|
2152
2134
|
</body>
|