longleaf 0.2.0.pre.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +84 -0
  3. data/.gitignore +4 -2
  4. data/.rubocop.yml +42 -2
  5. data/.rubocop_todo.yml +390 -311
  6. data/.yardopts +1 -0
  7. data/Gemfile +16 -1
  8. data/README.md +67 -13
  9. data/Rakefile +6 -0
  10. data/bin/setup +16 -1
  11. data/docs/aboutlongleaf.md +28 -0
  12. data/docs/extra.css +32 -0
  13. data/docs/img/change-file.png +0 -0
  14. data/docs/img/ll-example-preserved.png +0 -0
  15. data/docs/index.md +19 -0
  16. data/docs/install.md +66 -0
  17. data/docs/ll-example/config-example-relative.yml +33 -0
  18. data/docs/ll-example/files-dir/LLexample-PDF.pdf +0 -0
  19. data/docs/ll-example/files-dir/LLexample-TOCHANGE.txt +15 -0
  20. data/docs/ll-example/files-dir/LLexample-tokeep.txt +10 -0
  21. data/docs/ll-example/metadata-dir/.gitkeep +0 -0
  22. data/docs/ll-example/replica-files/.gitkeep +0 -0
  23. data/docs/ll-example/replica-metadata/.gitkeep +0 -0
  24. data/docs/quickstart.md +270 -0
  25. data/docs/rdocs/Longleaf.html +135 -0
  26. data/docs/rdocs/Longleaf/AppFields.html +178 -0
  27. data/docs/rdocs/Longleaf/ApplicationConfigDeserializer.html +631 -0
  28. data/docs/rdocs/Longleaf/ApplicationConfigManager.html +610 -0
  29. data/docs/rdocs/Longleaf/ApplicationConfigValidator.html +238 -0
  30. data/docs/rdocs/Longleaf/CLI.html +909 -0
  31. data/docs/rdocs/Longleaf/ChecksumMismatchError.html +151 -0
  32. data/docs/rdocs/Longleaf/ConfigBuilder.html +1339 -0
  33. data/docs/rdocs/Longleaf/ConfigurationError.html +143 -0
  34. data/docs/rdocs/Longleaf/ConfigurationValidator.html +227 -0
  35. data/docs/rdocs/Longleaf/DeregisterCommand.html +420 -0
  36. data/docs/rdocs/Longleaf/DeregisterEvent.html +453 -0
  37. data/docs/rdocs/Longleaf/DeregistrationError.html +151 -0
  38. data/docs/rdocs/Longleaf/DigestHelper.html +419 -0
  39. data/docs/rdocs/Longleaf/EventError.html +147 -0
  40. data/docs/rdocs/Longleaf/EventNames.html +163 -0
  41. data/docs/rdocs/Longleaf/EventStatusTracking.html +656 -0
  42. data/docs/rdocs/Longleaf/FileCheckService.html +540 -0
  43. data/docs/rdocs/Longleaf/FileHelpers.html +520 -0
  44. data/docs/rdocs/Longleaf/FileRecord.html +716 -0
  45. data/docs/rdocs/Longleaf/FileSelector.html +901 -0
  46. data/docs/rdocs/Longleaf/FixityCheckService.html +691 -0
  47. data/docs/rdocs/Longleaf/IndexManager.html +1155 -0
  48. data/docs/rdocs/Longleaf/InvalidDigestAlgorithmError.html +143 -0
  49. data/docs/rdocs/Longleaf/InvalidStoragePathError.html +143 -0
  50. data/docs/rdocs/Longleaf/Logging.html +405 -0
  51. data/docs/rdocs/Longleaf/Logging/RedirectingLogger.html +1213 -0
  52. data/docs/rdocs/Longleaf/LongleafError.html +139 -0
  53. data/docs/rdocs/Longleaf/MDFields.html +193 -0
  54. data/docs/rdocs/Longleaf/MetadataBuilder.html +787 -0
  55. data/docs/rdocs/Longleaf/MetadataDeserializer.html +537 -0
  56. data/docs/rdocs/Longleaf/MetadataError.html +143 -0
  57. data/docs/rdocs/Longleaf/MetadataPersistenceManager.html +539 -0
  58. data/docs/rdocs/Longleaf/MetadataRecord.html +1411 -0
  59. data/docs/rdocs/Longleaf/MetadataSerializer.html +786 -0
  60. data/docs/rdocs/Longleaf/PreservationServiceError.html +147 -0
  61. data/docs/rdocs/Longleaf/PreserveCommand.html +410 -0
  62. data/docs/rdocs/Longleaf/PreserveEvent.html +491 -0
  63. data/docs/rdocs/Longleaf/RegisterCommand.html +428 -0
  64. data/docs/rdocs/Longleaf/RegisterEvent.html +628 -0
  65. data/docs/rdocs/Longleaf/RegisteredFileSelector.html +446 -0
  66. data/docs/rdocs/Longleaf/RegistrationError.html +151 -0
  67. data/docs/rdocs/Longleaf/ReindexCommand.html +576 -0
  68. data/docs/rdocs/Longleaf/RsyncReplicationService.html +1180 -0
  69. data/docs/rdocs/Longleaf/SequelIndexDriver.html +1978 -0
  70. data/docs/rdocs/Longleaf/ServiceCandidateFilesystemIterator.html +572 -0
  71. data/docs/rdocs/Longleaf/ServiceCandidateIndexIterator.html +532 -0
  72. data/docs/rdocs/Longleaf/ServiceCandidateLocator.html +333 -0
  73. data/docs/rdocs/Longleaf/ServiceClassCache.html +725 -0
  74. data/docs/rdocs/Longleaf/ServiceDateHelper.html +425 -0
  75. data/docs/rdocs/Longleaf/ServiceDefinition.html +683 -0
  76. data/docs/rdocs/Longleaf/ServiceDefinitionManager.html +371 -0
  77. data/docs/rdocs/Longleaf/ServiceDefinitionValidator.html +269 -0
  78. data/docs/rdocs/Longleaf/ServiceFields.html +173 -0
  79. data/docs/rdocs/Longleaf/ServiceManager.html +1229 -0
  80. data/docs/rdocs/Longleaf/ServiceMappingManager.html +410 -0
  81. data/docs/rdocs/Longleaf/ServiceMappingValidator.html +347 -0
  82. data/docs/rdocs/Longleaf/ServiceRecord.html +821 -0
  83. data/docs/rdocs/Longleaf/StorageLocation.html +985 -0
  84. data/docs/rdocs/Longleaf/StorageLocationManager.html +729 -0
  85. data/docs/rdocs/Longleaf/StorageLocationUnavailableError.html +143 -0
  86. data/docs/rdocs/Longleaf/StorageLocationValidator.html +373 -0
  87. data/docs/rdocs/Longleaf/StoragePathValidator.html +253 -0
  88. data/docs/rdocs/Longleaf/SystemConfigBuilder.html +441 -0
  89. data/docs/rdocs/Longleaf/SystemConfigFields.html +163 -0
  90. data/docs/rdocs/Longleaf/ValidateConfigCommand.html +451 -0
  91. data/docs/rdocs/Longleaf/ValidateMetadataCommand.html +408 -0
  92. data/docs/rdocs/_index.html +660 -0
  93. data/docs/rdocs/class_list.html +51 -0
  94. data/docs/rdocs/css/common.css +1 -0
  95. data/docs/rdocs/css/full_list.css +58 -0
  96. data/docs/rdocs/css/style.css +496 -0
  97. data/docs/rdocs/file.README.html +165 -0
  98. data/docs/rdocs/file_list.html +56 -0
  99. data/docs/rdocs/frames.html +17 -0
  100. data/docs/rdocs/index.html +165 -0
  101. data/docs/rdocs/js/app.js +303 -0
  102. data/docs/rdocs/js/full_list.js +216 -0
  103. data/docs/rdocs/js/jquery.js +4 -0
  104. data/docs/rdocs/method_list.html +2051 -0
  105. data/docs/rdocs/top-level-namespace.html +110 -0
  106. data/lib/longleaf/candidates/file_selector.rb +47 -15
  107. data/lib/longleaf/candidates/registered_file_selector.rb +67 -0
  108. data/lib/longleaf/candidates/service_candidate_filesystem_iterator.rb +29 -35
  109. data/lib/longleaf/candidates/service_candidate_index_iterator.rb +84 -0
  110. data/lib/longleaf/candidates/service_candidate_locator.rb +9 -4
  111. data/lib/longleaf/cli.rb +162 -80
  112. data/lib/longleaf/commands/deregister_command.rb +12 -11
  113. data/lib/longleaf/commands/preserve_command.rb +13 -8
  114. data/lib/longleaf/commands/register_command.rb +9 -6
  115. data/lib/longleaf/commands/reindex_command.rb +92 -0
  116. data/lib/longleaf/commands/validate_config_command.rb +27 -6
  117. data/lib/longleaf/commands/validate_metadata_command.rb +11 -9
  118. data/lib/longleaf/errors.rb +12 -12
  119. data/lib/longleaf/events/deregister_event.rb +13 -15
  120. data/lib/longleaf/events/event_status_tracking.rb +7 -7
  121. data/lib/longleaf/events/preserve_event.rb +24 -14
  122. data/lib/longleaf/events/register_event.rb +21 -35
  123. data/lib/longleaf/helpers/digest_helper.rb +4 -4
  124. data/lib/longleaf/helpers/service_date_helper.rb +5 -6
  125. data/lib/longleaf/indexing/index_manager.rb +101 -0
  126. data/lib/longleaf/indexing/sequel_index_driver.rb +324 -0
  127. data/lib/longleaf/logging.rb +4 -4
  128. data/lib/longleaf/logging/redirecting_logger.rb +20 -20
  129. data/lib/longleaf/models/app_fields.rb +2 -1
  130. data/lib/longleaf/models/file_record.rb +10 -6
  131. data/lib/longleaf/models/md_fields.rb +1 -1
  132. data/lib/longleaf/models/metadata_record.rb +22 -12
  133. data/lib/longleaf/models/service_definition.rb +3 -3
  134. data/lib/longleaf/models/service_fields.rb +1 -1
  135. data/lib/longleaf/models/service_record.rb +6 -5
  136. data/lib/longleaf/models/storage_location.rb +26 -7
  137. data/lib/longleaf/models/system_config_fields.rb +9 -0
  138. data/lib/longleaf/preservation_services/file_check_service.rb +58 -0
  139. data/lib/longleaf/preservation_services/fixity_check_service.rb +16 -14
  140. data/lib/longleaf/preservation_services/rsync_replication_service.rb +32 -31
  141. data/lib/longleaf/services/application_config_deserializer.rb +55 -18
  142. data/lib/longleaf/services/application_config_manager.rb +16 -4
  143. data/lib/longleaf/services/application_config_validator.rb +1 -2
  144. data/lib/longleaf/services/configuration_validator.rb +6 -4
  145. data/lib/longleaf/services/metadata_deserializer.rb +40 -38
  146. data/lib/longleaf/services/metadata_persistence_manager.rb +46 -0
  147. data/lib/longleaf/services/metadata_serializer.rb +23 -22
  148. data/lib/longleaf/services/service_class_cache.rb +15 -15
  149. data/lib/longleaf/services/service_definition_manager.rb +5 -6
  150. data/lib/longleaf/services/service_definition_validator.rb +5 -6
  151. data/lib/longleaf/services/service_manager.rb +37 -17
  152. data/lib/longleaf/services/service_mapping_manager.rb +9 -9
  153. data/lib/longleaf/services/service_mapping_validator.rb +9 -10
  154. data/lib/longleaf/services/storage_location_manager.rb +22 -8
  155. data/lib/longleaf/services/storage_location_validator.rb +11 -8
  156. data/lib/longleaf/services/storage_path_validator.rb +1 -1
  157. data/lib/longleaf/specs/config_builder.rb +30 -17
  158. data/lib/longleaf/specs/custom_matchers.rb +1 -1
  159. data/lib/longleaf/specs/file_helpers.rb +15 -14
  160. data/lib/longleaf/specs/metadata_builder.rb +91 -0
  161. data/lib/longleaf/specs/system_config_builder.rb +27 -0
  162. data/lib/longleaf/version.rb +1 -1
  163. data/longleaf.gemspec +17 -7
  164. data/mkdocs.yml +20 -0
  165. metadata +233 -22
@@ -0,0 +1,446 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Longleaf::RegisteredFileSelector
8
+
9
+ &mdash; Documentation by YARD 0.9.19
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Longleaf::RegisteredFileSelector";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (R)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Longleaf.html" title="Longleaf (module)">Longleaf</a></span></span>
41
+ &raquo;
42
+ <span class="title">RegisteredFileSelector</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Longleaf::RegisteredFileSelector
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="FileSelector.html" title="Longleaf::FileSelector (class)">FileSelector</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next"><span class='object_link'><a href="FileSelector.html" title="Longleaf::FileSelector (class)">FileSelector</a></span></li>
78
+
79
+ <li class="next">Longleaf::RegisteredFileSelector</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+ <dl>
93
+ <dt>Includes:</dt>
94
+ <dd><span class='object_link'><a href="Logging.html" title="Longleaf::Logging (module)">Logging</a></span></dd>
95
+ </dl>
96
+
97
+
98
+
99
+
100
+
101
+
102
+ <dl>
103
+ <dt>Defined in:</dt>
104
+ <dd>lib/longleaf/candidates/registered_file_selector.rb</dd>
105
+ </dl>
106
+
107
+ </div>
108
+
109
+ <h2>Overview</h2><div class="docstring">
110
+ <div class="discussion">
111
+
112
+ <p>Selects and allows for iteration over files which are registered and match a provided set of selection criteria</p>
113
+
114
+
115
+ </div>
116
+ </div>
117
+ <div class="tags">
118
+
119
+
120
+ </div>
121
+
122
+
123
+ <h2>Constant Summary</h2>
124
+
125
+ <h3 class="inherited">Constants inherited
126
+ from <span class='object_link'><a href="FileSelector.html" title="Longleaf::FileSelector (class)">FileSelector</a></span></h3>
127
+ <p class="inherited"><span class='object_link'><a href="FileSelector.html#SPECIFICITY_PATH-constant" title="Longleaf::FileSelector::SPECIFICITY_PATH (constant)">FileSelector::SPECIFICITY_PATH</a></span>, <span class='object_link'><a href="FileSelector.html#SPECIFICITY_STORAGE_LOCATION-constant" title="Longleaf::FileSelector::SPECIFICITY_STORAGE_LOCATION (constant)">FileSelector::SPECIFICITY_STORAGE_LOCATION</a></span></p>
128
+
129
+
130
+
131
+
132
+ <h2>Instance Attribute Summary</h2>
133
+
134
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="FileSelector.html" title="Longleaf::FileSelector (class)">FileSelector</a></span></h3>
135
+ <p class="inherited"><span class='object_link'><a href="FileSelector.html#specificity-instance_method" title="Longleaf::FileSelector#specificity (method)">#specificity</a></span></p>
136
+
137
+
138
+
139
+ <h2>
140
+ Instance Method Summary
141
+ <small><a href="#" class="summary_toggle">collapse</a></small>
142
+ </h2>
143
+
144
+ <ul class="summary">
145
+
146
+ <li class="private ">
147
+ <span class="summary_signature">
148
+
149
+ <a href="#file_path_for_metadata-instance_method" title="#file_path_for_metadata (instance method)">#<strong>file_path_for_metadata</strong>(md_path) &#x21d2; Object </a>
150
+
151
+
152
+
153
+ </span>
154
+
155
+
156
+
157
+ <span class="note title private">private</span>
158
+
159
+
160
+
161
+
162
+
163
+ <span class="summary_desc"><div class='inline'></div></span>
164
+
165
+ </li>
166
+
167
+
168
+ <li class="public ">
169
+ <span class="summary_signature">
170
+
171
+ <a href="#next_path-instance_method" title="#next_path (instance method)">#<strong>next_path</strong> &#x21d2; String </a>
172
+
173
+
174
+
175
+ </span>
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+ <span class="summary_desc"><div class='inline'>
186
+ <p>Get the next file path for this selector.</p>
187
+ </div></span>
188
+
189
+ </li>
190
+
191
+
192
+ </ul>
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Logging.html" title="Longleaf::Logging (module)">Logging</a></span></h3>
205
+ <p class="inherited"><span class='object_link'><a href="Logging.html#initialize_logger-instance_method" title="Longleaf::Logging#initialize_logger (method)">#initialize_logger</a></span>, <span class='object_link'><a href="Logging.html#initialize_logger-class_method" title="Longleaf::Logging.initialize_logger (method)">initialize_logger</a></span>, <span class='object_link'><a href="Logging.html#logger-instance_method" title="Longleaf::Logging#logger (method)">#logger</a></span>, <span class='object_link'><a href="Logging.html#logger-class_method" title="Longleaf::Logging.logger (method)">logger</a></span></p>
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="FileSelector.html" title="Longleaf::FileSelector (class)">FileSelector</a></span></h3>
216
+ <p class="inherited"><span class='object_link'><a href="FileSelector.html#each-instance_method" title="Longleaf::FileSelector#each (method)">#each</a></span>, <span class='object_link'><a href="FileSelector.html#initialize-instance_method" title="Longleaf::FileSelector#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="FileSelector.html#nil_or_empty%3F-instance_method" title="Longleaf::FileSelector#nil_or_empty? (method)">#nil_or_empty?</a></span>, <span class='object_link'><a href="FileSelector.html#storage_locations-instance_method" title="Longleaf::FileSelector#storage_locations (method)">#storage_locations</a></span>, <span class='object_link'><a href="FileSelector.html#target_paths-instance_method" title="Longleaf::FileSelector#target_paths (method)">#target_paths</a></span></p>
217
+ <div id="constructor_details" class="method_details_list">
218
+ <h2>Constructor Details</h2>
219
+
220
+ <p class="notice">This class inherits a constructor from <span class='object_link'><a href="FileSelector.html#initialize-instance_method" title="Longleaf::FileSelector#initialize (method)">Longleaf::FileSelector</a></span></p>
221
+
222
+ </div>
223
+
224
+
225
+ <div id="instance_method_details" class="method_details_list">
226
+ <h2>Instance Method Details</h2>
227
+
228
+
229
+ <div class="method_details first">
230
+ <h3 class="signature first" id="file_path_for_metadata-instance_method">
231
+
232
+ #<strong>file_path_for_metadata</strong>(md_path) &#x21d2; <tt>Object</tt> <span class="extras">(private)</span>
233
+
234
+
235
+
236
+
237
+
238
+ </h3><table class="source_code">
239
+ <tr>
240
+ <td>
241
+ <pre class="lines">
242
+
243
+
244
+ 60
245
+ 61
246
+ 62
247
+ 63
248
+ 64
249
+ 65</pre>
250
+ </td>
251
+ <td>
252
+ <pre class="code"><span class="info file"># File 'lib/longleaf/candidates/registered_file_selector.rb', line 60</span>
253
+
254
+ <span class='kw'>def</span> <span class='id identifier rubyid_file_path_for_metadata'>file_path_for_metadata</span><span class='lparen'>(</span><span class='id identifier rubyid_md_path'>md_path</span><span class='rparen'>)</span>
255
+ <span class='id identifier rubyid_storage_loc'>storage_loc</span> <span class='op'>=</span> <span class='ivar'>@app_config</span><span class='period'>.</span><span class='id identifier rubyid_location_manager'>location_manager</span><span class='period'>.</span><span class='id identifier rubyid_get_location_by_metadata_path'>get_location_by_metadata_path</span><span class='lparen'>(</span><span class='id identifier rubyid_md_path'>md_path</span><span class='rparen'>)</span>
256
+ <span class='id identifier rubyid_file_path'>file_path</span> <span class='op'>=</span> <span class='id identifier rubyid_storage_loc'>storage_loc</span><span class='period'>.</span><span class='id identifier rubyid_get_path_from_metadata_path'>get_path_from_metadata_path</span><span class='lparen'>(</span><span class='id identifier rubyid_md_path'>md_path</span><span class='rparen'>)</span>
257
+ <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Returning next file </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_file_path'>file_path</span><span class='embexpr_end'>}</span><span class='tstring_content'> for metadata path </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_md_path'>md_path</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
258
+ <span class='kw'>return</span> <span class='id identifier rubyid_file_path'>file_path</span>
259
+ <span class='kw'>end</span></pre>
260
+ </td>
261
+ </tr>
262
+ </table>
263
+ </div>
264
+
265
+ <div class="method_details ">
266
+ <h3 class="signature " id="next_path-instance_method">
267
+
268
+ #<strong>next_path</strong> &#x21d2; <tt>String</tt>
269
+
270
+
271
+
272
+
273
+
274
+ </h3><div class="docstring">
275
+ <div class="discussion">
276
+
277
+ <p>Get the next file path for this selector.</p>
278
+
279
+
280
+ </div>
281
+ </div>
282
+ <div class="tags">
283
+
284
+ <p class="tag_title">Returns:</p>
285
+ <ul class="return">
286
+
287
+ <li>
288
+
289
+
290
+ <span class='type'>(<tt>String</tt>)</span>
291
+
292
+
293
+
294
+ &mdash;
295
+ <div class='inline'>
296
+ <p>an absolute path to the next file targeted by this selector, or nil if no more files selected</p>
297
+ </div>
298
+
299
+ </li>
300
+
301
+ </ul>
302
+ <p class="tag_title">Raises:</p>
303
+ <ul class="raise">
304
+
305
+ <li>
306
+
307
+
308
+ <span class='type'>(<tt><span class='object_link'><a href="InvalidStoragePathError.html" title="Longleaf::InvalidStoragePathError (class)">InvalidStoragePathError</a></span></tt>)</span>
309
+
310
+
311
+
312
+ &mdash;
313
+ <div class='inline'>
314
+ <p>if any of the selected files do not exist</p>
315
+ </div>
316
+
317
+ </li>
318
+
319
+ <li>
320
+
321
+
322
+ <span class='type'>(<tt><span class='object_link'><a href="StorageLocationUnavailableError.html" title="Longleaf::StorageLocationUnavailableError (class)">StorageLocationUnavailableError</a></span></tt>)</span>
323
+
324
+
325
+
326
+ &mdash;
327
+ <div class='inline'>
328
+ <p>if any of the selected paths are not in a registered storage location.</p>
329
+ </div>
330
+
331
+ </li>
332
+
333
+ </ul>
334
+
335
+ </div><table class="source_code">
336
+ <tr>
337
+ <td>
338
+ <pre class="lines">
339
+
340
+
341
+ 16
342
+ 17
343
+ 18
344
+ 19
345
+ 20
346
+ 21
347
+ 22
348
+ 23
349
+ 24
350
+ 25
351
+ 26
352
+ 27
353
+ 28
354
+ 29
355
+ 30
356
+ 31
357
+ 32
358
+ 33
359
+ 34
360
+ 35
361
+ 36
362
+ 37
363
+ 38
364
+ 39
365
+ 40
366
+ 41
367
+ 42
368
+ 43
369
+ 44
370
+ 45
371
+ 46
372
+ 47
373
+ 48
374
+ 49
375
+ 50
376
+ 51
377
+ 52
378
+ 53
379
+ 54
380
+ 55
381
+ 56
382
+ 57</pre>
383
+ </td>
384
+ <td>
385
+ <pre class="code"><span class="info file"># File 'lib/longleaf/candidates/registered_file_selector.rb', line 16</span>
386
+
387
+ <span class='kw'>def</span> <span class='id identifier rubyid_next_path'>next_path</span>
388
+ <span class='kw'>if</span> <span class='ivar'>@md_paths</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
389
+ <span class='comment'># Compute the starting paths by looking up the metadata paths for the provided targets,
390
+ </span> <span class='comment'># in reverse order since @md_paths is a LIFO stack structure.
391
+ </span> <span class='ivar'>@md_paths</span> <span class='op'>=</span> <span class='id identifier rubyid_target_paths'>target_paths</span><span class='period'>.</span><span class='id identifier rubyid_reverse_each'>reverse_each</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_file_path'>file_path</span><span class='op'>|</span>
392
+ <span class='id identifier rubyid_storage_loc'>storage_loc</span> <span class='op'>=</span> <span class='ivar'>@app_config</span><span class='period'>.</span><span class='id identifier rubyid_location_manager'>location_manager</span><span class='period'>.</span><span class='id identifier rubyid_verify_path_in_location'>verify_path_in_location</span><span class='lparen'>(</span><span class='id identifier rubyid_file_path'>file_path</span><span class='rparen'>)</span>
393
+ <span class='id identifier rubyid_storage_loc'>storage_loc</span><span class='period'>.</span><span class='id identifier rubyid_get_metadata_path_for'>get_metadata_path_for</span><span class='lparen'>(</span><span class='id identifier rubyid_file_path'>file_path</span><span class='rparen'>)</span>
394
+ <span class='kw'>end</span>
395
+ <span class='kw'>end</span>
396
+
397
+ <span class='comment'># No more paths to return
398
+ </span> <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='ivar'>@md_paths</span><span class='op'>&amp;.</span><span class='id identifier rubyid_empty?'>empty?</span>
399
+
400
+ <span class='comment'># Get the most recently added path for depth first traversal of selected paths
401
+ </span> <span class='id identifier rubyid_md_path'>md_path</span> <span class='op'>=</span> <span class='ivar'>@md_paths</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span>
402
+ <span class='kw'>until</span> <span class='id identifier rubyid_md_path'>md_path</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>do</span>
403
+ <span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_md_path'>md_path</span><span class='rparen'>)</span>
404
+ <span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_directory?'>directory?</span><span class='lparen'>(</span><span class='id identifier rubyid_md_path'>md_path</span><span class='rparen'>)</span>
405
+ <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Expanding metadata directory </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_md_path'>md_path</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
406
+ <span class='comment'># For a directory, add all children to file_paths
407
+ </span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_entries'>entries</span><span class='lparen'>(</span><span class='id identifier rubyid_md_path'>md_path</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span><span class='period'>.</span><span class='id identifier rubyid_reverse_each'>reverse_each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_child'>child</span><span class='op'>|</span>
408
+ <span class='ivar'>@md_paths</span> <span class='op'>&lt;&lt;</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='id identifier rubyid_md_path'>md_path</span><span class='comma'>,</span> <span class='id identifier rubyid_child'>child</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_child'>child</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>or</span> <span class='id identifier rubyid_child'>child</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>..</span><span class='tstring_end'>&#39;</span></span>
409
+ <span class='kw'>end</span>
410
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_md_path'>md_path</span><span class='period'>.</span><span class='id identifier rubyid_end_with?'>end_with?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="MetadataSerializer.html" title="Longleaf::MetadataSerializer (class)">MetadataSerializer</a></span></span><span class='op'>::</span><span class='id identifier rubyid_metadata_suffix'><span class='object_link'><a href="MetadataSerializer.html#metadata_suffix-class_method" title="Longleaf::MetadataSerializer.metadata_suffix (method)">metadata_suffix</a></span></span><span class='rparen'>)</span>
411
+ <span class='comment'># Convert metadata path to file path before returning
412
+ </span> <span class='kw'>return</span> <span class='id identifier rubyid_file_path_for_metadata'>file_path_for_metadata</span><span class='lparen'>(</span><span class='id identifier rubyid_md_path'>md_path</span><span class='rparen'>)</span>
413
+ <span class='kw'>else</span>
414
+ <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Skipping non-metadata file in metadata directory </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_md_path'>md_path</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
415
+ <span class='kw'>end</span>
416
+ <span class='kw'>else</span>
417
+ <span class='id identifier rubyid_file_path'>file_path</span> <span class='op'>=</span> <span class='id identifier rubyid_file_path_for_metadata'>file_path_for_metadata</span><span class='lparen'>(</span><span class='id identifier rubyid_md_path'>md_path</span><span class='rparen'>)</span>
418
+ <span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_file_path'>file_path</span><span class='rparen'>)</span>
419
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="RegistrationError.html" title="Longleaf::RegistrationError (class)">RegistrationError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>File </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_file_path'>file_path</span><span class='embexpr_end'>}</span><span class='tstring_content'> is not registered.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
420
+ <span class='kw'>else</span>
421
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="InvalidStoragePathError.html" title="Longleaf::InvalidStoragePathError (class)">InvalidStoragePathError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>File </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_file_path'>file_path</span><span class='embexpr_end'>}</span><span class='tstring_content'> does not exist.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
422
+ <span class='kw'>end</span>
423
+ <span class='kw'>end</span>
424
+
425
+ <span class='comment'># Returned path was not a suitable file, try the next path
426
+ </span> <span class='id identifier rubyid_md_path'>md_path</span> <span class='op'>=</span> <span class='ivar'>@md_paths</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span>
427
+ <span class='kw'>end</span>
428
+ <span class='kw'>end</span></pre>
429
+ </td>
430
+ </tr>
431
+ </table>
432
+ </div>
433
+
434
+ </div>
435
+
436
+ </div>
437
+
438
+ <div id="footer">
439
+ Generated on Tue May 28 15:48:02 2019 by
440
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
441
+ 0.9.19 (ruby-2.6.3).
442
+ </div>
443
+
444
+ </div>
445
+ </body>
446
+ </html>
@@ -0,0 +1,151 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Exception: Longleaf::RegistrationError
8
+
9
+ &mdash; Documentation by YARD 0.9.19
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Longleaf::RegistrationError";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (R)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Longleaf.html" title="Longleaf (module)">Longleaf</a></span></span>
41
+ &raquo;
42
+ <span class="title">RegistrationError</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Exception: Longleaf::RegistrationError
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="EventError.html" title="Longleaf::EventError (class)">EventError</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">StandardError</li>
78
+
79
+ <li class="next"><span class='object_link'><a href="LongleafError.html" title="Longleaf::LongleafError (class)">LongleafError</a></span></li>
80
+
81
+ <li class="next"><span class='object_link'><a href="EventError.html" title="Longleaf::EventError (class)">EventError</a></span></li>
82
+
83
+ <li class="next">Longleaf::RegistrationError</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+ </dl>
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+ <dl>
102
+ <dt>Defined in:</dt>
103
+ <dd>lib/longleaf/errors.rb</dd>
104
+ </dl>
105
+
106
+ </div>
107
+
108
+ <h2>Overview</h2><div class="docstring">
109
+ <div class="discussion">
110
+
111
+ <p>Error with the registration state of a file or while attempting to perform a registration event</p>
112
+
113
+
114
+ </div>
115
+ </div>
116
+ <div class="tags">
117
+
118
+
119
+ </div>
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+ </div>
142
+
143
+ <div id="footer">
144
+ Generated on Tue May 28 15:48:00 2019 by
145
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
146
+ 0.9.19 (ruby-2.6.3).
147
+ </div>
148
+
149
+ </div>
150
+ </body>
151
+ </html>