netlinx-workspace 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af4e507c310d29551131ee3a2e48b104d04d29fb
4
- data.tar.gz: 0efd9ba6c0c2b3f23647bea4c6cb98a15fa8349f
3
+ metadata.gz: 06af066cd47df3d68e59a126be7c0a6218fdaf4f
4
+ data.tar.gz: 9a04b1895ebe1f2ec6145b57324a8ddd9aaed8a7
5
5
  SHA512:
6
- metadata.gz: 4480ec44f77be4b2d8168746aac92aae74dec9783cc0ec52b4c5ba8795903f00a4e99865e1b4d1339618e37217b46645758e433995ea7d9b433121b4e174093e
7
- data.tar.gz: 482ecea5a90c696b07772d49128ffd9498483d3db08e7e6c17fef7e4d7bcd024cb2edc96e7bac4839f99df970e51384a78870e3643c3693ae729c9b2d2b6cf2f
6
+ metadata.gz: 70347a1cb88a1d73594e17a42ca0d0d452b34c8868767760cb1abd72290799eaa687090abf7497a7b230300aa199b6779224bda8575213cbe38617845a73eddc
7
+ data.tar.gz: 8aac8035aa30ee0ba11f04a284fb7469789009999d41e25c9d329e0b73df9948b1345e08c058015cc74408d2dfa426fd7cdeadf7b261eea2ad2ff00647a7f3ca
data/doc/NetLinx.html CHANGED
@@ -121,7 +121,7 @@
121
121
  </div>
122
122
 
123
123
  <div id="footer">
124
- Generated on Tue Feb 24 17:43:02 2015 by
124
+ Generated on Wed Feb 25 15:09:13 2015 by
125
125
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
126
126
  0.8.7.6 (ruby-2.1.3).
127
127
  </div>
@@ -117,7 +117,7 @@
117
117
  </div>
118
118
 
119
119
  <div id="footer">
120
- Generated on Tue Feb 24 17:43:02 2015 by
120
+ Generated on Wed Feb 25 15:09:13 2015 by
121
121
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
122
122
  0.8.7.6 (ruby-2.1.3).
123
123
  </div>
@@ -117,7 +117,7 @@
117
117
  </div>
118
118
 
119
119
  <div id="footer">
120
- Generated on Tue Feb 24 17:43:02 2015 by
120
+ Generated on Wed Feb 25 15:09:13 2015 by
121
121
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
122
122
  0.8.7.6 (ruby-2.1.3).
123
123
  </div>
@@ -210,7 +210,7 @@
210
210
  </div>
211
211
 
212
212
  <div id="footer">
213
- Generated on Tue Feb 24 17:43:03 2015 by
213
+ Generated on Wed Feb 25 15:09:14 2015 by
214
214
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
215
215
  0.8.7.6 (ruby-2.1.3).
216
216
  </div>
@@ -1339,7 +1339,7 @@
1339
1339
  </div>
1340
1340
 
1341
1341
  <div id="footer">
1342
- Generated on Tue Feb 24 17:43:03 2015 by
1342
+ Generated on Wed Feb 25 15:09:14 2015 by
1343
1343
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1344
1344
  0.8.7.6 (ruby-2.1.3).
1345
1345
  </div>
@@ -119,7 +119,7 @@
119
119
  </div>
120
120
 
121
121
  <div id="footer">
122
- Generated on Tue Feb 24 17:43:02 2015 by
122
+ Generated on Wed Feb 25 15:09:13 2015 by
123
123
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
124
124
  0.8.7.6 (ruby-2.1.3).
125
125
  </div>
@@ -119,7 +119,7 @@
119
119
  </div>
120
120
 
121
121
  <div id="footer">
122
- Generated on Tue Feb 24 17:43:02 2015 by
122
+ Generated on Wed Feb 25 15:09:13 2015 by
123
123
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
124
124
  0.8.7.6 (ruby-2.1.3).
125
125
  </div>
@@ -378,7 +378,7 @@ dps: 5001:1:0
378
378
  </div>
379
379
 
380
380
  <div id="footer">
381
- Generated on Tue Feb 24 17:43:03 2015 by
381
+ Generated on Wed Feb 25 15:09:14 2015 by
382
382
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
383
383
  0.8.7.6 (ruby-2.1.3).
384
384
  </div>
@@ -362,7 +362,7 @@
362
362
  </div>
363
363
 
364
364
  <div id="footer">
365
- Generated on Tue Feb 24 17:43:03 2015 by
365
+ Generated on Wed Feb 25 15:09:14 2015 by
366
366
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
367
367
  0.8.7.6 (ruby-2.1.3).
368
368
  </div>
@@ -2320,7 +2320,7 @@ master with a different ID.</p>
2320
2320
  </div>
2321
2321
 
2322
2322
  <div id="footer">
2323
- Generated on Tue Feb 24 17:43:02 2015 by
2323
+ Generated on Wed Feb 25 15:09:14 2015 by
2324
2324
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2325
2325
  0.8.7.6 (ruby-2.1.3).
2326
2326
  </div>
@@ -1041,7 +1041,7 @@
1041
1041
  </div>
1042
1042
 
1043
1043
  <div id="footer">
1044
- Generated on Tue Feb 24 17:43:03 2015 by
1044
+ Generated on Wed Feb 25 15:09:14 2015 by
1045
1045
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1046
1046
  0.8.7.6 (ruby-2.1.3).
1047
1047
  </div>
@@ -169,8 +169,6 @@
169
169
 
170
170
 
171
171
 
172
- <span class="note title readonly">readonly</span>
173
-
174
172
 
175
173
 
176
174
 
@@ -256,7 +254,7 @@
256
254
  <li class="public ">
257
255
  <span class="summary_signature">
258
256
 
259
- <a href="#search-class_method" title="search (class method)">+ (Object) <strong>search</strong>(dir: nil) </a>
257
+ <a href="#search-class_method" title="search (class method)">+ (NetLinx::Workspace) <strong>search</strong>(dir: nil) </a>
260
258
 
261
259
 
262
260
 
@@ -594,17 +592,17 @@ found.</p>
594
592
  <pre class="lines">
595
593
 
596
594
 
597
- 34
598
- 35
599
- 36
600
- 37
601
- 38
602
- 39
603
- 40
604
- 41</pre>
595
+ 45
596
+ 46
597
+ 47
598
+ 48
599
+ 49
600
+ 50
601
+ 51
602
+ 52</pre>
605
603
  </td>
606
604
  <td>
607
- <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 34</span>
605
+ <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 45</span>
608
606
 
609
607
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span>
610
608
  <span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
@@ -668,11 +666,11 @@ found.</p>
668
666
  </div>
669
667
 
670
668
 
671
- <span id=""></span>
669
+ <span id="file=-instance_method"></span>
672
670
  <div class="method_details ">
673
671
  <h3 class="signature " id="file-instance_method">
674
672
 
675
- - (<tt>Object</tt>) <strong>file</strong> <span class="extras">(readonly)</span>
673
+ - (<tt>Object</tt>) <strong>file</strong>
676
674
 
677
675
 
678
676
 
@@ -806,7 +804,7 @@ found.</p>
806
804
  <div class="method_details first">
807
805
  <h3 class="signature first" id="search-class_method">
808
806
 
809
- + (<tt>Object</tt>) <strong>search</strong>(dir: nil)
807
+ + (<tt><span class='object_link'><a href="" title="NetLinx::Workspace (class)">NetLinx::Workspace</a></span></tt>) <strong>search</strong>(dir: nil)
810
808
 
811
809
 
812
810
 
@@ -823,6 +821,19 @@ found.</p>
823
821
  </div>
824
822
  <div class="tags">
825
823
 
824
+ <p class="tag_title">Returns:</p>
825
+ <ul class="return">
826
+
827
+ <li>
828
+
829
+
830
+ <span class='type'>(<tt><span class='object_link'><a href="" title="NetLinx::Workspace (class)">NetLinx::Workspace</a></span></tt>)</span>
831
+
832
+
833
+
834
+ </li>
835
+
836
+ </ul>
826
837
 
827
838
  </div><table class="source_code">
828
839
  <tr>
@@ -830,7 +841,6 @@ found.</p>
830
841
  <pre class="lines">
831
842
 
832
843
 
833
- 19
834
844
  20
835
845
  21
836
846
  22
@@ -841,19 +851,40 @@ found.</p>
841
851
  27
842
852
  28
843
853
  29
844
- 30</pre>
854
+ 30
855
+ 31
856
+ 32
857
+ 33
858
+ 34
859
+ 35
860
+ 36
861
+ 37
862
+ 38
863
+ 39
864
+ 40
865
+ 41</pre>
845
866
  </td>
846
867
  <td>
847
- <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 19</span>
868
+ <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 20</span>
848
869
 
849
870
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span> <span class='label'>dir:</span> <span class='kw'>nil</span>
871
+ <span class='id identifier rubyid_yaml_config_file_name'>yaml_config_file_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>workspace.config.yaml</span><span class='tstring_end'>&#39;</span></span>
872
+
850
873
  <span class='id identifier rubyid_dir'>dir</span> <span class='op'>||=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.</span><span class='tstring_end'>&#39;</span></span>
851
874
  <span class='kw'>while</span> <span class='id identifier rubyid_dir'>dir</span> <span class='op'>!=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>..</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_dir'>dir</span><span class='rparen'>)</span>
852
- <span class='id identifier rubyid_workspaces'>workspaces</span> <span class='op'>=</span> <span class='const'>Dir</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dir'>dir</span><span class='embexpr_end'>}</span><span class='tstring_content'>/*.apw</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
875
+ <span class='id identifier rubyid_workspace_files'>workspace_files</span> <span class='op'>=</span> <span class='const'>Dir</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dir'>dir</span><span class='embexpr_end'>}</span><span class='tstring_content'>/{</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_yaml_config_file_name'>yaml_config_file_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>,*.apw}</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
853
876
  <span class='id identifier rubyid_dir'>dir</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>..</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_dir'>dir</span><span class='rparen'>)</span>
854
- <span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_workspaces'>workspaces</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
877
+ <span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_workspace_files'>workspace_files</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
855
878
 
856
- <span class='kw'>return</span> <span class='id identifier rubyid_new'>new</span> <span class='label'>file:</span> <span class='id identifier rubyid_workspaces'>workspaces</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
879
+ <span class='id identifier rubyid_workspace_files'>workspace_files</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_workspace_file'>workspace_file</span><span class='op'>|</span>
880
+ <span class='kw'>if</span> <span class='id identifier rubyid_workspace_file'>workspace_file</span><span class='period'>.</span><span class='id identifier rubyid_end_with?'>end_with?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_yaml_config_file_name'>yaml_config_file_name</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
881
+ <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_chdir'>chdir</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='lparen'>(</span><span class='id identifier rubyid_workspace_file'>workspace_file</span><span class='rparen'>)</span> <span class='kw'>do</span>
882
+ <span class='kw'>return</span> <span class='const'>NetLinx</span><span class='op'>::</span><span class='const'>Workspace</span><span class='op'>::</span><span class='const'>YAML</span><span class='period'>.</span><span class='id identifier rubyid_parse_file'>parse_file</span> <span class='id identifier rubyid_yaml_config_file_name'>yaml_config_file_name</span>
883
+ <span class='kw'>end</span>
884
+ <span class='kw'>else</span>
885
+ <span class='kw'>return</span> <span class='id identifier rubyid_new'>new</span> <span class='label'>file:</span> <span class='id identifier rubyid_workspace_files'>workspace_files</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
886
+ <span class='kw'>end</span>
887
+ <span class='kw'>end</span>
857
888
  <span class='kw'>end</span>
858
889
 
859
890
  <span class='kw'>nil</span>
@@ -895,13 +926,13 @@ found.</p>
895
926
  <pre class="lines">
896
927
 
897
928
 
898
- 44
899
- 45
900
- 46
901
- 47</pre>
929
+ 55
930
+ 56
931
+ 57
932
+ 58</pre>
902
933
  </td>
903
934
  <td>
904
- <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 44</span>
935
+ <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 55</span>
905
936
 
906
937
  <span class='kw'>def</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_project'>project</span>
907
938
  <span class='ivar'>@projects</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_project'>project</span>
@@ -938,18 +969,18 @@ found.</p>
938
969
  <pre class="lines">
939
970
 
940
971
 
941
- 72
942
- 73
943
- 74
944
- 75
945
- 76
946
- 77
947
- 78
948
- 79
949
- 80</pre>
972
+ 83
973
+ 84
974
+ 85
975
+ 86
976
+ 87
977
+ 88
978
+ 89
979
+ 90
980
+ 91</pre>
950
981
  </td>
951
982
  <td>
952
- <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 72</span>
983
+ <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 83</span>
953
984
 
954
985
  <span class='kw'>def</span> <span class='id identifier rubyid_compile'>compile</span>
955
986
  <span class='id identifier rubyid_compiler_results'>compiler_results</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
@@ -1009,19 +1040,19 @@ found.</p>
1009
1040
  <pre class="lines">
1010
1041
 
1011
1042
 
1012
- 60
1013
- 61
1014
- 62
1015
- 63
1016
- 64
1017
- 65
1018
- 66
1019
- 67
1020
- 68
1021
- 69</pre>
1043
+ 71
1044
+ 72
1045
+ 73
1046
+ 74
1047
+ 75
1048
+ 76
1049
+ 77
1050
+ 78
1051
+ 79
1052
+ 80</pre>
1022
1053
  </td>
1023
1054
  <td>
1024
- <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 60</span>
1055
+ <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 71</span>
1025
1056
 
1026
1057
  <span class='kw'>def</span> <span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_file'>file</span>
1027
1058
  <span class='id identifier rubyid_included'>included</span> <span class='op'>=</span> <span class='kw'>false</span>
@@ -1082,13 +1113,13 @@ found.</p>
1082
1113
  <pre class="lines">
1083
1114
 
1084
1115
 
1085
- 112
1086
- 113
1087
- 114
1088
- 115</pre>
1116
+ 123
1117
+ 124
1118
+ 125
1119
+ 126</pre>
1089
1120
  </td>
1090
1121
  <td>
1091
- <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 112</span>
1122
+ <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 123</span>
1092
1123
 
1093
1124
  <span class='kw'>def</span> <span class='id identifier rubyid_parse_xml'>parse_xml</span> <span class='id identifier rubyid_string'>string</span>
1094
1125
  <span class='id identifier rubyid_parse_xml_element'>parse_xml_element</span> <span class='const'>REXML</span><span class='op'>::</span><span class='const'>Document</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_string'>string</span><span class='rparen'>)</span>
@@ -1125,12 +1156,12 @@ found.</p>
1125
1156
  <pre class="lines">
1126
1157
 
1127
1158
 
1128
- 55
1129
- 56
1130
- 57</pre>
1159
+ 66
1160
+ 67
1161
+ 68</pre>
1131
1162
  </td>
1132
1163
  <td>
1133
- <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 55</span>
1164
+ <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 66</span>
1134
1165
 
1135
1166
  <span class='kw'>def</span> <span class='id identifier rubyid_path'>path</span>
1136
1167
  <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span> <span class='ivar'>@file</span> <span class='kw'>if</span> <span class='ivar'>@file</span>
@@ -1166,12 +1197,12 @@ found.</p>
1166
1197
  <pre class="lines">
1167
1198
 
1168
1199
 
1169
- 50
1170
- 51
1171
- 52</pre>
1200
+ 61
1201
+ 62
1202
+ 63</pre>
1172
1203
  </td>
1173
1204
  <td>
1174
- <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 50</span>
1205
+ <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 61</span>
1175
1206
 
1176
1207
  <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
1177
1208
  <span class='ivar'>@name</span>
@@ -1235,19 +1266,19 @@ href="https://bugs.ruby-lang.org/issues/10864">bugs.ruby-lang.org/issues/10864</
1235
1266
  <pre class="lines">
1236
1267
 
1237
1268
 
1238
- 99
1239
- 100
1240
- 101
1241
- 102
1242
- 103
1243
- 104
1244
- 105
1245
- 106
1246
- 107
1247
- 108</pre>
1269
+ 110
1270
+ 111
1271
+ 112
1272
+ 113
1273
+ 114
1274
+ 115
1275
+ 116
1276
+ 117
1277
+ 118
1278
+ 119</pre>
1248
1279
  </td>
1249
1280
  <td>
1250
- <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 99</span>
1281
+ <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 110</span>
1251
1282
 
1252
1283
  <span class='kw'>def</span> <span class='id identifier rubyid_to_xml'>to_xml</span> <span class='label'>indent:</span> <span class='op'>-</span><span class='int'>1</span>
1253
1284
  <span class='id identifier rubyid_str'>str</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span><span class='tstring_end'>&#39;</span></span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span>
@@ -1308,20 +1339,20 @@ href="https://bugs.ruby-lang.org/issues/10864">bugs.ruby-lang.org/issues/10864</
1308
1339
  <pre class="lines">
1309
1340
 
1310
1341
 
1311
- 83
1312
- 84
1313
- 85
1314
- 86
1315
- 87
1316
- 88
1317
- 89
1318
- 90
1319
- 91
1320
- 92
1321
- 93</pre>
1342
+ 94
1343
+ 95
1344
+ 96
1345
+ 97
1346
+ 98
1347
+ 99
1348
+ 100
1349
+ 101
1350
+ 102
1351
+ 103
1352
+ 104</pre>
1322
1353
  </td>
1323
1354
  <td>
1324
- <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 83</span>
1355
+ <pre class="code"><span class="info file"># File 'lib/netlinx/workspace.rb', line 94</span>
1325
1356
 
1326
1357
  <span class='kw'>def</span> <span class='id identifier rubyid_to_xml_element'>to_xml_element</span>
1327
1358
  <span class='const'>REXML</span><span class='op'>::</span><span class='const'>Element</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Workspace</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_workspace'>workspace</span><span class='op'>|</span>
@@ -1344,7 +1375,7 @@ href="https://bugs.ruby-lang.org/issues/10864">bugs.ruby-lang.org/issues/10864</
1344
1375
  </div>
1345
1376
 
1346
1377
  <div id="footer">
1347
- Generated on Tue Feb 24 17:43:02 2015 by
1378
+ Generated on Wed Feb 25 15:09:13 2015 by
1348
1379
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1349
1380
  0.8.7.6 (ruby-2.1.3).
1350
1381
  </div>
@@ -268,7 +268,9 @@
268
268
  59
269
269
  60
270
270
  61
271
- 62</pre>
271
+ 62
272
+ 63
273
+ 64</pre>
272
274
  </td>
273
275
  <td>
274
276
  <pre class="code"><span class="info file"># File 'lib/netlinx/workspace/yaml.rb', line 9</span>
@@ -306,6 +308,8 @@
306
308
  <span class='kw'>end</span>
307
309
  <span class='kw'>end</span>
308
310
 
311
+ <span class='id identifier rubyid_workspace'>workspace</span><span class='period'>.</span><span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_workspace'>workspace</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>.apw</span><span class='tstring_end'>&quot;</span></span>
312
+
309
313
  <span class='comment'># Ensure exactly one system in the workspace is set active.
310
314
  </span> <span class='id identifier rubyid_a_system_is_active'>a_system_is_active</span> <span class='op'>=</span> <span class='kw'>false</span>
311
315
  <span class='id identifier rubyid_workspace'>workspace</span><span class='period'>.</span><span class='id identifier rubyid_projects'>projects</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_project'>project</span><span class='op'>|</span>
@@ -369,12 +373,12 @@
369
373
  <pre class="lines">
370
374
 
371
375
 
372
- 65
373
- 66
374
- 67</pre>
376
+ 67
377
+ 68
378
+ 69</pre>
375
379
  </td>
376
380
  <td>
377
- <pre class="code"><span class="info file"># File 'lib/netlinx/workspace/yaml.rb', line 65</span>
381
+ <pre class="code"><span class="info file"># File 'lib/netlinx/workspace/yaml.rb', line 67</span>
378
382
 
379
383
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_file'>parse_file</span> <span class='id identifier rubyid_file'>file</span>
380
384
  <span class='id identifier rubyid_parse'>parse</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_file'>file</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>r</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span>
@@ -389,7 +393,7 @@
389
393
  </div>
390
394
 
391
395
  <div id="footer">
392
- Generated on Tue Feb 24 17:43:02 2015 by
396
+ Generated on Wed Feb 25 15:09:13 2015 by
393
397
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
394
398
  0.8.7.6 (ruby-2.1.3).
395
399
  </div>
data/doc/_index.html CHANGED
@@ -263,7 +263,7 @@
263
263
  </div>
264
264
 
265
265
  <div id="footer">
266
- Generated on Tue Feb 24 17:43:00 2015 by
266
+ Generated on Wed Feb 25 15:09:11 2015 by
267
267
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
268
268
  0.8.7.6 (ruby-2.1.3).
269
269
  </div>
data/doc/file.README.html CHANGED
@@ -285,7 +285,7 @@ available.</p>
285
285
  </div></div>
286
286
 
287
287
  <div id="footer">
288
- Generated on Tue Feb 24 17:43:02 2015 by
288
+ Generated on Wed Feb 25 15:09:13 2015 by
289
289
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
290
290
  0.8.7.6 (ruby-2.1.3).
291
291
  </div>
@@ -64,7 +64,7 @@
64
64
  <div id="content"><div id='filecontents'>Copyright 2013-2015 Alex McLain<br/><br/>Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);<br/>you may not use this file except in compliance with the License.<br/>You may obtain a copy of the License at<br/><br/> http://www.apache.org/licenses/LICENSE-2.0<br/><br/>Unless required by applicable law or agreed to in writing, software<br/>distributed under the License is distributed on an &quot;AS IS&quot; BASIS,<br/>WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br/>See the License for the specific language governing permissions and<br/>limitations under the License.</div></div>
65
65
 
66
66
  <div id="footer">
67
- Generated on Tue Feb 24 17:43:02 2015 by
67
+ Generated on Wed Feb 25 15:09:13 2015 by
68
68
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
69
69
  0.8.7.6 (ruby-2.1.3).
70
70
  </div>
data/doc/index.html CHANGED
@@ -285,7 +285,7 @@ available.</p>
285
285
  </div></div>
286
286
 
287
287
  <div id="footer">
288
- Generated on Tue Feb 24 17:43:01 2015 by
288
+ Generated on Wed Feb 25 15:09:12 2015 by
289
289
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
290
290
  0.8.7.6 (ruby-2.1.3).
291
291
  </div>
@@ -103,7 +103,7 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Tue Feb 24 17:43:02 2015 by
106
+ Generated on Wed Feb 25 15:09:13 2015 by
107
107
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108
108
  0.8.7.6 (ruby-2.1.3).
109
109
  </div>
@@ -13,17 +13,28 @@ module NetLinx
13
13
  attr_accessor :name
14
14
  attr_accessor :description
15
15
  attr_accessor :projects
16
- attr_reader :file
16
+ attr_accessor :file
17
17
 
18
18
  # Search backwards through directory tree and return the first workspace found.
19
+ # @return [NetLinx::Workspace]
19
20
  def self.search dir: nil
21
+ yaml_config_file_name = 'workspace.config.yaml'
22
+
20
23
  dir ||= File.expand_path '.'
21
24
  while dir != File.expand_path('..', dir)
22
- workspaces = Dir["#{dir}/*.apw"]
25
+ workspace_files = Dir["#{dir}/{#{yaml_config_file_name},*.apw}"]
23
26
  dir = File.expand_path('..', dir)
24
- next if workspaces.empty?
27
+ next if workspace_files.empty?
25
28
 
26
- return new file: workspaces.first
29
+ workspace_files.first.tap do |workspace_file|
30
+ if workspace_file.end_with? "/#{yaml_config_file_name}"
31
+ Dir.chdir File.dirname(workspace_file) do
32
+ return NetLinx::Workspace::YAML.parse_file yaml_config_file_name
33
+ end
34
+ else
35
+ return new file: workspace_files.first
36
+ end
37
+ end
27
38
  end
28
39
 
29
40
  nil
@@ -39,6 +39,8 @@ module NetLinx
39
39
  end
40
40
  end
41
41
 
42
+ workspace.file = "#{workspace.name}.apw"
43
+
42
44
  # Ensure exactly one system in the workspace is set active.
43
45
  a_system_is_active = false
44
46
  workspace.projects.each do |project|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netlinx-workspace
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex McLain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-24 00:00:00.000000000 Z
11
+ date: 2015-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: netlinx-compile