longleaf 0.1.0.pre.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +94 -0
  3. data/.editorconfig +13 -0
  4. data/.gitignore +4 -1
  5. data/.rubocop.yml +44 -0
  6. data/.rubocop_todo.yml +834 -0
  7. data/.yardopts +1 -0
  8. data/Gemfile +16 -1
  9. data/README.md +98 -12
  10. data/Rakefile +6 -0
  11. data/bin/setup +16 -1
  12. data/docs/aboutlongleaf.md +28 -0
  13. data/docs/extra.css +32 -0
  14. data/docs/img/change-file.png +0 -0
  15. data/docs/img/ll-example-preserved.png +0 -0
  16. data/docs/index.md +19 -0
  17. data/docs/install.md +66 -0
  18. data/docs/ll-example/config-example-relative.yml +33 -0
  19. data/docs/ll-example/files-dir/LLexample-PDF.pdf +0 -0
  20. data/docs/ll-example/files-dir/LLexample-TOCHANGE.txt +15 -0
  21. data/docs/ll-example/files-dir/LLexample-tokeep.txt +10 -0
  22. data/docs/ll-example/metadata-dir/.gitkeep +0 -0
  23. data/docs/ll-example/replica-files/.gitkeep +0 -0
  24. data/docs/ll-example/replica-metadata/.gitkeep +0 -0
  25. data/docs/quickstart.md +270 -0
  26. data/docs/rdocs/Longleaf.html +135 -0
  27. data/docs/rdocs/Longleaf/AppFields.html +178 -0
  28. data/docs/rdocs/Longleaf/ApplicationConfigDeserializer.html +631 -0
  29. data/docs/rdocs/Longleaf/ApplicationConfigManager.html +610 -0
  30. data/docs/rdocs/Longleaf/ApplicationConfigValidator.html +238 -0
  31. data/docs/rdocs/Longleaf/CLI.html +909 -0
  32. data/docs/rdocs/Longleaf/ChecksumMismatchError.html +151 -0
  33. data/docs/rdocs/Longleaf/ConfigBuilder.html +1339 -0
  34. data/docs/rdocs/Longleaf/ConfigurationError.html +143 -0
  35. data/docs/rdocs/Longleaf/ConfigurationValidator.html +227 -0
  36. data/docs/rdocs/Longleaf/DeregisterCommand.html +420 -0
  37. data/docs/rdocs/Longleaf/DeregisterEvent.html +453 -0
  38. data/docs/rdocs/Longleaf/DeregistrationError.html +151 -0
  39. data/docs/rdocs/Longleaf/DigestHelper.html +419 -0
  40. data/docs/rdocs/Longleaf/EventError.html +147 -0
  41. data/docs/rdocs/Longleaf/EventNames.html +163 -0
  42. data/docs/rdocs/Longleaf/EventStatusTracking.html +656 -0
  43. data/docs/rdocs/Longleaf/FileCheckService.html +540 -0
  44. data/docs/rdocs/Longleaf/FileHelpers.html +520 -0
  45. data/docs/rdocs/Longleaf/FileRecord.html +716 -0
  46. data/docs/rdocs/Longleaf/FileSelector.html +901 -0
  47. data/docs/rdocs/Longleaf/FixityCheckService.html +691 -0
  48. data/docs/rdocs/Longleaf/IndexManager.html +1155 -0
  49. data/docs/rdocs/Longleaf/InvalidDigestAlgorithmError.html +143 -0
  50. data/docs/rdocs/Longleaf/InvalidStoragePathError.html +143 -0
  51. data/docs/rdocs/Longleaf/Logging.html +405 -0
  52. data/docs/rdocs/Longleaf/Logging/RedirectingLogger.html +1213 -0
  53. data/docs/rdocs/Longleaf/LongleafError.html +139 -0
  54. data/docs/rdocs/Longleaf/MDFields.html +193 -0
  55. data/docs/rdocs/Longleaf/MetadataBuilder.html +787 -0
  56. data/docs/rdocs/Longleaf/MetadataDeserializer.html +537 -0
  57. data/docs/rdocs/Longleaf/MetadataError.html +143 -0
  58. data/docs/rdocs/Longleaf/MetadataPersistenceManager.html +539 -0
  59. data/docs/rdocs/Longleaf/MetadataRecord.html +1411 -0
  60. data/docs/rdocs/Longleaf/MetadataSerializer.html +786 -0
  61. data/docs/rdocs/Longleaf/PreservationServiceError.html +147 -0
  62. data/docs/rdocs/Longleaf/PreserveCommand.html +410 -0
  63. data/docs/rdocs/Longleaf/PreserveEvent.html +491 -0
  64. data/docs/rdocs/Longleaf/RegisterCommand.html +428 -0
  65. data/docs/rdocs/Longleaf/RegisterEvent.html +628 -0
  66. data/docs/rdocs/Longleaf/RegisteredFileSelector.html +446 -0
  67. data/docs/rdocs/Longleaf/RegistrationError.html +151 -0
  68. data/docs/rdocs/Longleaf/ReindexCommand.html +576 -0
  69. data/docs/rdocs/Longleaf/RsyncReplicationService.html +1180 -0
  70. data/docs/rdocs/Longleaf/SequelIndexDriver.html +1978 -0
  71. data/docs/rdocs/Longleaf/ServiceCandidateFilesystemIterator.html +572 -0
  72. data/docs/rdocs/Longleaf/ServiceCandidateIndexIterator.html +532 -0
  73. data/docs/rdocs/Longleaf/ServiceCandidateLocator.html +333 -0
  74. data/docs/rdocs/Longleaf/ServiceClassCache.html +725 -0
  75. data/docs/rdocs/Longleaf/ServiceDateHelper.html +425 -0
  76. data/docs/rdocs/Longleaf/ServiceDefinition.html +683 -0
  77. data/docs/rdocs/Longleaf/ServiceDefinitionManager.html +371 -0
  78. data/docs/rdocs/Longleaf/ServiceDefinitionValidator.html +269 -0
  79. data/docs/rdocs/Longleaf/ServiceFields.html +173 -0
  80. data/docs/rdocs/Longleaf/ServiceManager.html +1229 -0
  81. data/docs/rdocs/Longleaf/ServiceMappingManager.html +410 -0
  82. data/docs/rdocs/Longleaf/ServiceMappingValidator.html +347 -0
  83. data/docs/rdocs/Longleaf/ServiceRecord.html +821 -0
  84. data/docs/rdocs/Longleaf/StorageLocation.html +985 -0
  85. data/docs/rdocs/Longleaf/StorageLocationManager.html +729 -0
  86. data/docs/rdocs/Longleaf/StorageLocationUnavailableError.html +143 -0
  87. data/docs/rdocs/Longleaf/StorageLocationValidator.html +373 -0
  88. data/docs/rdocs/Longleaf/StoragePathValidator.html +253 -0
  89. data/docs/rdocs/Longleaf/SystemConfigBuilder.html +441 -0
  90. data/docs/rdocs/Longleaf/SystemConfigFields.html +163 -0
  91. data/docs/rdocs/Longleaf/ValidateConfigCommand.html +451 -0
  92. data/docs/rdocs/Longleaf/ValidateMetadataCommand.html +408 -0
  93. data/docs/rdocs/_index.html +660 -0
  94. data/docs/rdocs/class_list.html +51 -0
  95. data/docs/rdocs/css/common.css +1 -0
  96. data/docs/rdocs/css/full_list.css +58 -0
  97. data/docs/rdocs/css/style.css +496 -0
  98. data/docs/rdocs/file.README.html +165 -0
  99. data/docs/rdocs/file_list.html +56 -0
  100. data/docs/rdocs/frames.html +17 -0
  101. data/docs/rdocs/index.html +165 -0
  102. data/docs/rdocs/js/app.js +303 -0
  103. data/docs/rdocs/js/full_list.js +216 -0
  104. data/docs/rdocs/js/jquery.js +4 -0
  105. data/docs/rdocs/method_list.html +2051 -0
  106. data/docs/rdocs/top-level-namespace.html +110 -0
  107. data/lib/longleaf/candidates/file_selector.rb +150 -0
  108. data/lib/longleaf/candidates/manifest_digest_provider.rb +17 -0
  109. data/lib/longleaf/candidates/physical_path_provider.rb +17 -0
  110. data/lib/longleaf/candidates/registered_file_selector.rb +67 -0
  111. data/lib/longleaf/candidates/service_candidate_filesystem_iterator.rb +93 -0
  112. data/lib/longleaf/candidates/service_candidate_index_iterator.rb +84 -0
  113. data/lib/longleaf/candidates/service_candidate_locator.rb +23 -0
  114. data/lib/longleaf/candidates/single_digest_provider.rb +13 -0
  115. data/lib/longleaf/cli.rb +249 -44
  116. data/lib/longleaf/commands/deregister_command.rb +51 -0
  117. data/lib/longleaf/commands/preserve_command.rb +50 -0
  118. data/lib/longleaf/commands/register_command.rb +34 -43
  119. data/lib/longleaf/commands/reindex_command.rb +92 -0
  120. data/lib/longleaf/commands/validate_config_command.rb +33 -8
  121. data/lib/longleaf/commands/validate_metadata_command.rb +51 -0
  122. data/lib/longleaf/errors.rb +26 -7
  123. data/lib/longleaf/events/deregister_event.rb +53 -0
  124. data/lib/longleaf/events/event_names.rb +9 -0
  125. data/lib/longleaf/events/event_status_tracking.rb +59 -0
  126. data/lib/longleaf/events/preserve_event.rb +82 -0
  127. data/lib/longleaf/events/register_event.rb +59 -51
  128. data/lib/longleaf/helpers/case_insensitive_hash.rb +38 -0
  129. data/lib/longleaf/helpers/digest_helper.rb +56 -0
  130. data/lib/longleaf/helpers/s3_uri_helper.rb +86 -0
  131. data/lib/longleaf/helpers/selection_options_parser.rb +215 -0
  132. data/lib/longleaf/helpers/service_date_helper.rb +78 -0
  133. data/lib/longleaf/indexing/index_manager.rb +101 -0
  134. data/lib/longleaf/indexing/sequel_index_driver.rb +306 -0
  135. data/lib/longleaf/logging.rb +5 -4
  136. data/lib/longleaf/logging/redirecting_logger.rb +30 -25
  137. data/lib/longleaf/models/app_fields.rb +7 -2
  138. data/lib/longleaf/models/file_record.rb +31 -8
  139. data/lib/longleaf/models/filesystem_metadata_location.rb +56 -0
  140. data/lib/longleaf/models/filesystem_storage_location.rb +52 -0
  141. data/lib/longleaf/models/md_fields.rb +3 -1
  142. data/lib/longleaf/models/metadata_location.rb +47 -0
  143. data/lib/longleaf/models/metadata_record.rb +43 -16
  144. data/lib/longleaf/models/s3_storage_location.rb +138 -0
  145. data/lib/longleaf/models/service_definition.rb +7 -6
  146. data/lib/longleaf/models/service_fields.rb +7 -1
  147. data/lib/longleaf/models/service_record.rb +10 -6
  148. data/lib/longleaf/models/storage_location.rb +24 -21
  149. data/lib/longleaf/models/storage_types.rb +9 -0
  150. data/lib/longleaf/models/system_config_fields.rb +9 -0
  151. data/lib/longleaf/preservation_services/file_check_service.rb +59 -0
  152. data/lib/longleaf/preservation_services/fixity_check_service.rb +124 -0
  153. data/lib/longleaf/preservation_services/rsync_replication_service.rb +198 -0
  154. data/lib/longleaf/preservation_services/s3_replication_service.rb +131 -0
  155. data/lib/longleaf/services/application_config_deserializer.rb +80 -21
  156. data/lib/longleaf/services/application_config_manager.rb +20 -6
  157. data/lib/longleaf/services/application_config_validator.rb +19 -9
  158. data/lib/longleaf/services/configuration_validator.rb +67 -4
  159. data/lib/longleaf/services/filesystem_location_validator.rb +16 -0
  160. data/lib/longleaf/services/metadata_deserializer.rb +115 -42
  161. data/lib/longleaf/services/metadata_persistence_manager.rb +47 -0
  162. data/lib/longleaf/services/metadata_serializer.rb +139 -25
  163. data/lib/longleaf/services/metadata_validator.rb +76 -0
  164. data/lib/longleaf/services/s3_location_validator.rb +19 -0
  165. data/lib/longleaf/services/service_class_cache.rb +112 -0
  166. data/lib/longleaf/services/service_definition_manager.rb +10 -7
  167. data/lib/longleaf/services/service_definition_validator.rb +25 -18
  168. data/lib/longleaf/services/service_manager.rb +86 -11
  169. data/lib/longleaf/services/service_mapping_manager.rb +13 -12
  170. data/lib/longleaf/services/service_mapping_validator.rb +36 -26
  171. data/lib/longleaf/services/storage_location_manager.rb +76 -15
  172. data/lib/longleaf/services/storage_location_validator.rb +49 -35
  173. data/lib/longleaf/specs/config_builder.rb +47 -23
  174. data/lib/longleaf/specs/config_validator_helpers.rb +16 -0
  175. data/lib/longleaf/specs/custom_matchers.rb +9 -0
  176. data/lib/longleaf/specs/file_helpers.rb +61 -0
  177. data/lib/longleaf/specs/metadata_builder.rb +98 -0
  178. data/lib/longleaf/specs/system_config_builder.rb +27 -0
  179. data/lib/longleaf/version.rb +1 -1
  180. data/longleaf.gemspec +20 -7
  181. data/mkdocs.yml +21 -0
  182. metadata +310 -26
  183. data/.travis.yml +0 -4
  184. data/lib/longleaf/commands/abstract_command.rb +0 -37
  185. data/lib/longleaf/services/storage_path_validator.rb +0 -16
@@ -0,0 +1,139 @@
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::LongleafError
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::LongleafError";
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 (L)</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">LongleafError</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::LongleafError
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">StandardError</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">StandardError</li>
78
+
79
+ <li class="next">Longleaf::LongleafError</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/longleaf/errors.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>General Longleaf error</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div><div id="subclasses">
116
+ <h2>Direct Known Subclasses</h2>
117
+ <p class="children"><span class='object_link'><a href="ConfigurationError.html" title="Longleaf::ConfigurationError (class)">ConfigurationError</a></span>, <span class='object_link'><a href="EventError.html" title="Longleaf::EventError (class)">EventError</a></span>, <span class='object_link'><a href="InvalidDigestAlgorithmError.html" title="Longleaf::InvalidDigestAlgorithmError (class)">InvalidDigestAlgorithmError</a></span>, <span class='object_link'><a href="InvalidStoragePathError.html" title="Longleaf::InvalidStoragePathError (class)">InvalidStoragePathError</a></span>, <span class='object_link'><a href="MetadataError.html" title="Longleaf::MetadataError (class)">MetadataError</a></span>, <span class='object_link'><a href="PreservationServiceError.html" title="Longleaf::PreservationServiceError (class)">PreservationServiceError</a></span>, <span class='object_link'><a href="StorageLocationUnavailableError.html" title="Longleaf::StorageLocationUnavailableError (class)">StorageLocationUnavailableError</a></span></p>
118
+ </div>
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ </div>
130
+
131
+ <div id="footer">
132
+ Generated on Tue May 28 15:48:00 2019 by
133
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
134
+ 0.9.19 (ruby-2.6.3).
135
+ </div>
136
+
137
+ </div>
138
+ </body>
139
+ </html>
@@ -0,0 +1,193 @@
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::MDFields
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::MDFields";
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 (M)</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">MDFields</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::MDFields
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Longleaf::MDFields</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/longleaf/models/md_fields.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>File metadata fields</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+ <h2>
116
+ Constant Summary
117
+ <small><a href="#" class="constants_summary_toggle">collapse</a></small>
118
+ </h2>
119
+
120
+ <dl class="constants">
121
+
122
+ <dt id="DATA-constant" class="">DATA =
123
+
124
+ </dt>
125
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>data</span><span class='tstring_end'>&#39;</span></span></pre></dd>
126
+
127
+ <dt id="SERVICES-constant" class="">SERVICES =
128
+
129
+ </dt>
130
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>services</span><span class='tstring_end'>&#39;</span></span></pre></dd>
131
+
132
+ <dt id="REGISTERED_TIMESTAMP-constant" class="">REGISTERED_TIMESTAMP =
133
+
134
+ </dt>
135
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>registered</span><span class='tstring_end'>&#39;</span></span></pre></dd>
136
+
137
+ <dt id="DEREGISTERED_TIMESTAMP-constant" class="">DEREGISTERED_TIMESTAMP =
138
+
139
+ </dt>
140
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>deregistered</span><span class='tstring_end'>&#39;</span></span></pre></dd>
141
+
142
+ <dt id="LAST_MODIFIED-constant" class="">LAST_MODIFIED =
143
+
144
+ </dt>
145
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>last-modified</span><span class='tstring_end'>&#39;</span></span></pre></dd>
146
+
147
+ <dt id="FILE_SIZE-constant" class="">FILE_SIZE =
148
+
149
+ </dt>
150
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>size</span><span class='tstring_end'>&#39;</span></span></pre></dd>
151
+
152
+ <dt id="CHECKSUMS-constant" class="">CHECKSUMS =
153
+
154
+ </dt>
155
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>checksums</span><span class='tstring_end'>&#39;</span></span></pre></dd>
156
+
157
+ <dt id="STALE_REPLICAS-constant" class="">STALE_REPLICAS =
158
+
159
+ </dt>
160
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>stale-replicas</span><span class='tstring_end'>&#39;</span></span></pre></dd>
161
+
162
+ <dt id="SERVICE_TIMESTAMP-constant" class="">SERVICE_TIMESTAMP =
163
+
164
+ </dt>
165
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>timestamp</span><span class='tstring_end'>&#39;</span></span></pre></dd>
166
+
167
+ <dt id="RUN_NEEDED-constant" class="">RUN_NEEDED =
168
+
169
+ </dt>
170
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>run-needed</span><span class='tstring_end'>&#39;</span></span></pre></dd>
171
+
172
+ </dl>
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+ </div>
184
+
185
+ <div id="footer">
186
+ Generated on Tue May 28 15:48:00 2019 by
187
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
188
+ 0.9.19 (ruby-2.6.3).
189
+ </div>
190
+
191
+ </div>
192
+ </body>
193
+ </html>
@@ -0,0 +1,787 @@
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::MetadataBuilder
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::MetadataBuilder";
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 (M)</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">MetadataBuilder</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::MetadataBuilder
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Longleaf::MetadataBuilder</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/longleaf/specs/metadata_builder.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Test helper for constructing file metadata records</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+ <h2>
122
+ Instance Method Summary
123
+ <small><a href="#" class="summary_toggle">collapse</a></small>
124
+ </h2>
125
+
126
+ <ul class="summary">
127
+
128
+ <li class="public ">
129
+ <span class="summary_signature">
130
+
131
+ <a href="#deregistered-instance_method" title="#deregistered (instance method)">#<strong>deregistered</strong>(timestamp = ServiceDateHelper::formatted_timestamp) &#x21d2; Object </a>
132
+
133
+
134
+
135
+ </span>
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+ <span class="summary_desc"><div class='inline'></div></span>
146
+
147
+ </li>
148
+
149
+
150
+ <li class="private ">
151
+ <span class="summary_signature">
152
+
153
+ <a href="#format_timestamp-instance_method" title="#format_timestamp (instance method)">#<strong>format_timestamp</strong>(timestamp) &#x21d2; Object </a>
154
+
155
+
156
+
157
+ </span>
158
+
159
+
160
+
161
+ <span class="note title private">private</span>
162
+
163
+
164
+
165
+
166
+
167
+ <span class="summary_desc"><div class='inline'></div></span>
168
+
169
+ </li>
170
+
171
+
172
+ <li class="public ">
173
+ <span class="summary_signature">
174
+
175
+ <a href="#get_metadata_record-instance_method" title="#get_metadata_record (instance method)">#<strong>get_metadata_record</strong> &#x21d2; Object </a>
176
+
177
+
178
+
179
+ </span>
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+ <span class="summary_desc"><div class='inline'>
190
+ <p>The constructed metadata record.</p>
191
+ </div></span>
192
+
193
+ </li>
194
+
195
+
196
+ <li class="public ">
197
+ <span class="summary_signature">
198
+
199
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(file_path: nil, registered: ServiceDateHelper::formatted_timestamp) &#x21d2; MetadataBuilder </a>
200
+
201
+
202
+
203
+ </span>
204
+
205
+
206
+ <span class="note title constructor">constructor</span>
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+ <span class="summary_desc"><div class='inline'>
216
+ <p>A new instance of MetadataBuilder.</p>
217
+ </div></span>
218
+
219
+ </li>
220
+
221
+
222
+ <li class="public ">
223
+ <span class="summary_signature">
224
+
225
+ <a href="#register_to-instance_method" title="#register_to (instance method)">#<strong>register_to</strong>(file_rec) &#x21d2; Object </a>
226
+
227
+
228
+
229
+ </span>
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+ <span class="summary_desc"><div class='inline'>
240
+ <p>Add the generated metadata record to the given file record.</p>
241
+ </div></span>
242
+
243
+ </li>
244
+
245
+
246
+ <li class="public ">
247
+ <span class="summary_signature">
248
+
249
+ <a href="#with_checksum-instance_method" title="#with_checksum (instance method)">#<strong>with_checksum</strong>(alg, value) &#x21d2; Object </a>
250
+
251
+
252
+
253
+ </span>
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+ <span class="summary_desc"><div class='inline'></div></span>
264
+
265
+ </li>
266
+
267
+
268
+ <li class="public ">
269
+ <span class="summary_signature">
270
+
271
+ <a href="#with_properties-instance_method" title="#with_properties (instance method)">#<strong>with_properties</strong>(properties) &#x21d2; Object </a>
272
+
273
+
274
+
275
+ </span>
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+ <span class="summary_desc"><div class='inline'></div></span>
286
+
287
+ </li>
288
+
289
+
290
+ <li class="public ">
291
+ <span class="summary_signature">
292
+
293
+ <a href="#with_service-instance_method" title="#with_service (instance method)">#<strong>with_service</strong>(name, timestamp: ServiceDateHelper::formatted_timestamp, run_needed: false, properties: nil, failure_timestamp: nil) &#x21d2; Object </a>
294
+
295
+
296
+
297
+ </span>
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+ <span class="summary_desc"><div class='inline'></div></span>
308
+
309
+ </li>
310
+
311
+
312
+ <li class="public ">
313
+ <span class="summary_signature">
314
+
315
+ <a href="#write_to_yaml_file-instance_method" title="#write_to_yaml_file (instance method)">#<strong>write_to_yaml_file</strong>(file_rec: nil) &#x21d2; Object </a>
316
+
317
+
318
+
319
+ </span>
320
+
321
+
322
+
323
+
324
+
325
+
326
+
327
+
328
+
329
+ <span class="summary_desc"><div class='inline'>
330
+ <p>Writes the metadata record from this builder into a temporary file, or if a file record is provided, then to the expected metadata path for the record, and assigns the result as the metadata record for the file record.</p>
331
+ </div></span>
332
+
333
+ </li>
334
+
335
+
336
+ </ul>
337
+
338
+
339
+ <div id="constructor_details" class="method_details_list">
340
+ <h2>Constructor Details</h2>
341
+
342
+ <div class="method_details first">
343
+ <h3 class="signature first" id="initialize-instance_method">
344
+
345
+ #<strong>initialize</strong>(file_path: nil, registered: ServiceDateHelper::formatted_timestamp) &#x21d2; <tt><span class='object_link'><a href="" title="Longleaf::MetadataBuilder (class)">MetadataBuilder</a></span></tt>
346
+
347
+
348
+
349
+
350
+
351
+ </h3><div class="docstring">
352
+ <div class="discussion">
353
+
354
+ <p>Returns a new instance of MetadataBuilder</p>
355
+
356
+
357
+ </div>
358
+ </div>
359
+ <div class="tags">
360
+
361
+
362
+ </div><table class="source_code">
363
+ <tr>
364
+ <td>
365
+ <pre class="lines">
366
+
367
+
368
+ 10
369
+ 11
370
+ 12
371
+ 13
372
+ 14
373
+ 15
374
+ 16
375
+ 17
376
+ 18
377
+ 19
378
+ 20</pre>
379
+ </td>
380
+ <td>
381
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/metadata_builder.rb', line 10</span>
382
+
383
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>file_path:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>registered:</span> <span class='const'><span class='object_link'><a href="ServiceDateHelper.html" title="Longleaf::ServiceDateHelper (class)">ServiceDateHelper</a></span></span><span class='op'>::</span><span class='id identifier rubyid_formatted_timestamp'><span class='object_link'><a href="ServiceDateHelper.html#formatted_timestamp-class_method" title="Longleaf::ServiceDateHelper.formatted_timestamp (method)">formatted_timestamp</a></span></span><span class='rparen'>)</span>
384
+ <span class='ivar'>@data</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
385
+ <span class='ivar'>@services</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
386
+
387
+ <span class='kw'>unless</span> <span class='id identifier rubyid_file_path'>file_path</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
388
+ <span class='ivar'>@last_modified</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_mtime'>mtime</span><span class='lparen'>(</span><span class='id identifier rubyid_file_path'>file_path</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span><span class='period'>.</span><span class='id identifier rubyid_iso8601'>iso8601</span><span class='lparen'>(</span><span class='int'>3</span><span class='rparen'>)</span>
389
+ <span class='ivar'>@file_size</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='lparen'>(</span><span class='id identifier rubyid_file_path'>file_path</span><span class='rparen'>)</span>
390
+ <span class='kw'>end</span>
391
+
392
+ <span class='ivar'>@registered</span> <span class='op'>=</span> <span class='id identifier rubyid_registered'>registered</span>
393
+ <span class='kw'>end</span></pre>
394
+ </td>
395
+ </tr>
396
+ </table>
397
+ </div>
398
+
399
+ </div>
400
+
401
+
402
+ <div id="instance_method_details" class="method_details_list">
403
+ <h2>Instance Method Details</h2>
404
+
405
+
406
+ <div class="method_details first">
407
+ <h3 class="signature first" id="deregistered-instance_method">
408
+
409
+ #<strong>deregistered</strong>(timestamp = ServiceDateHelper::formatted_timestamp) &#x21d2; <tt>Object</tt>
410
+
411
+
412
+
413
+
414
+
415
+ </h3><table class="source_code">
416
+ <tr>
417
+ <td>
418
+ <pre class="lines">
419
+
420
+
421
+ 22
422
+ 23
423
+ 24
424
+ 25</pre>
425
+ </td>
426
+ <td>
427
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/metadata_builder.rb', line 22</span>
428
+
429
+ <span class='kw'>def</span> <span class='id identifier rubyid_deregistered'>deregistered</span><span class='lparen'>(</span><span class='id identifier rubyid_timestamp'>timestamp</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ServiceDateHelper.html" title="Longleaf::ServiceDateHelper (class)">ServiceDateHelper</a></span></span><span class='op'>::</span><span class='id identifier rubyid_formatted_timestamp'><span class='object_link'><a href="ServiceDateHelper.html#formatted_timestamp-class_method" title="Longleaf::ServiceDateHelper.formatted_timestamp (method)">formatted_timestamp</a></span></span><span class='rparen'>)</span>
430
+ <span class='ivar'>@deregistered</span> <span class='op'>=</span> <span class='id identifier rubyid_timestamp'>timestamp</span>
431
+ <span class='kw'>self</span>
432
+ <span class='kw'>end</span></pre>
433
+ </td>
434
+ </tr>
435
+ </table>
436
+ </div>
437
+
438
+ <div class="method_details ">
439
+ <h3 class="signature " id="format_timestamp-instance_method">
440
+
441
+ #<strong>format_timestamp</strong>(timestamp) &#x21d2; <tt>Object</tt> <span class="extras">(private)</span>
442
+
443
+
444
+
445
+
446
+
447
+ </h3><table class="source_code">
448
+ <tr>
449
+ <td>
450
+ <pre class="lines">
451
+
452
+
453
+ 87
454
+ 88
455
+ 89</pre>
456
+ </td>
457
+ <td>
458
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/metadata_builder.rb', line 87</span>
459
+
460
+ <span class='kw'>def</span> <span class='id identifier rubyid_format_timestamp'>format_timestamp</span><span class='lparen'>(</span><span class='id identifier rubyid_timestamp'>timestamp</span><span class='rparen'>)</span>
461
+ <span class='id identifier rubyid_timestamp'>timestamp</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Time</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'><span class='object_link'><a href="ServiceDateHelper.html" title="Longleaf::ServiceDateHelper (class)">ServiceDateHelper</a></span></span><span class='op'>::</span><span class='id identifier rubyid_formatted_timestamp'><span class='object_link'><a href="ServiceDateHelper.html#formatted_timestamp-class_method" title="Longleaf::ServiceDateHelper.formatted_timestamp (method)">formatted_timestamp</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_timestamp'>timestamp</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_timestamp'>timestamp</span>
462
+ <span class='kw'>end</span></pre>
463
+ </td>
464
+ </tr>
465
+ </table>
466
+ </div>
467
+
468
+ <div class="method_details ">
469
+ <h3 class="signature " id="get_metadata_record-instance_method">
470
+
471
+ #<strong>get_metadata_record</strong> &#x21d2; <tt>Object</tt>
472
+
473
+
474
+
475
+
476
+
477
+ </h3><div class="docstring">
478
+ <div class="discussion">
479
+
480
+ <p>Returns the constructed metadata record</p>
481
+
482
+
483
+ </div>
484
+ </div>
485
+ <div class="tags">
486
+
487
+ <p class="tag_title">Returns:</p>
488
+ <ul class="return">
489
+
490
+ <li>
491
+
492
+
493
+ <span class='type'></span>
494
+
495
+
496
+
497
+
498
+ <div class='inline'>
499
+ <p>the constructed metadata record</p>
500
+ </div>
501
+
502
+ </li>
503
+
504
+ </ul>
505
+
506
+ </div><table class="source_code">
507
+ <tr>
508
+ <td>
509
+ <pre class="lines">
510
+
511
+
512
+ 51
513
+ 52
514
+ 53
515
+ 54
516
+ 55
517
+ 56
518
+ 57
519
+ 58
520
+ 59</pre>
521
+ </td>
522
+ <td>
523
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/metadata_builder.rb', line 51</span>
524
+
525
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_metadata_record'>get_metadata_record</span>
526
+ <span class='const'><span class='object_link'><a href="MetadataRecord.html" title="Longleaf::MetadataRecord (class)">MetadataRecord</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MetadataRecord.html#initialize-instance_method" title="Longleaf::MetadataRecord#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>properties:</span> <span class='ivar'>@properties</span><span class='comma'>,</span>
527
+ <span class='label'>services:</span> <span class='ivar'>@services</span><span class='comma'>,</span>
528
+ <span class='label'>deregistered:</span> <span class='ivar'>@deregistered</span><span class='comma'>,</span>
529
+ <span class='label'>registered:</span> <span class='ivar'>@registered</span><span class='comma'>,</span>
530
+ <span class='label'>checksums:</span> <span class='ivar'>@checksums</span><span class='comma'>,</span>
531
+ <span class='label'>file_size:</span> <span class='ivar'>@file_size</span><span class='comma'>,</span>
532
+ <span class='label'>last_modified:</span> <span class='ivar'>@last_modified</span><span class='rparen'>)</span>
533
+ <span class='kw'>end</span></pre>
534
+ </td>
535
+ </tr>
536
+ </table>
537
+ </div>
538
+
539
+ <div class="method_details ">
540
+ <h3 class="signature " id="register_to-instance_method">
541
+
542
+ #<strong>register_to</strong>(file_rec) &#x21d2; <tt>Object</tt>
543
+
544
+
545
+
546
+
547
+
548
+ </h3><div class="docstring">
549
+ <div class="discussion">
550
+
551
+ <p>Add the generated metadata record to the given file record</p>
552
+
553
+
554
+ </div>
555
+ </div>
556
+ <div class="tags">
557
+
558
+
559
+ </div><table class="source_code">
560
+ <tr>
561
+ <td>
562
+ <pre class="lines">
563
+
564
+
565
+ 62
566
+ 63
567
+ 64
568
+ 65</pre>
569
+ </td>
570
+ <td>
571
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/metadata_builder.rb', line 62</span>
572
+
573
+ <span class='kw'>def</span> <span class='id identifier rubyid_register_to'>register_to</span><span class='lparen'>(</span><span class='id identifier rubyid_file_rec'>file_rec</span><span class='rparen'>)</span>
574
+ <span class='id identifier rubyid_file_rec'>file_rec</span><span class='period'>.</span><span class='id identifier rubyid_metadata_record'>metadata_record</span> <span class='op'>=</span> <span class='id identifier rubyid_get_metadata_record'>get_metadata_record</span>
575
+ <span class='kw'>self</span>
576
+ <span class='kw'>end</span></pre>
577
+ </td>
578
+ </tr>
579
+ </table>
580
+ </div>
581
+
582
+ <div class="method_details ">
583
+ <h3 class="signature " id="with_checksum-instance_method">
584
+
585
+ #<strong>with_checksum</strong>(alg, value) &#x21d2; <tt>Object</tt>
586
+
587
+
588
+
589
+
590
+
591
+ </h3><table class="source_code">
592
+ <tr>
593
+ <td>
594
+ <pre class="lines">
595
+
596
+
597
+ 27
598
+ 28
599
+ 29
600
+ 30
601
+ 31</pre>
602
+ </td>
603
+ <td>
604
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/metadata_builder.rb', line 27</span>
605
+
606
+ <span class='kw'>def</span> <span class='id identifier rubyid_with_checksum'>with_checksum</span><span class='lparen'>(</span><span class='id identifier rubyid_alg'>alg</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
607
+ <span class='ivar'>@checksums</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>unless</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='const'>MF</span><span class='op'>::</span><span class='const'>CHECKSUMS</span><span class='rparen'>)</span>
608
+ <span class='ivar'>@checksums</span><span class='lbracket'>[</span><span class='id identifier rubyid_alg'>alg</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
609
+ <span class='kw'>self</span>
610
+ <span class='kw'>end</span></pre>
611
+ </td>
612
+ </tr>
613
+ </table>
614
+ </div>
615
+
616
+ <div class="method_details ">
617
+ <h3 class="signature " id="with_properties-instance_method">
618
+
619
+ #<strong>with_properties</strong>(properties) &#x21d2; <tt>Object</tt>
620
+
621
+
622
+
623
+
624
+
625
+ </h3><table class="source_code">
626
+ <tr>
627
+ <td>
628
+ <pre class="lines">
629
+
630
+
631
+ 46
632
+ 47
633
+ 48</pre>
634
+ </td>
635
+ <td>
636
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/metadata_builder.rb', line 46</span>
637
+
638
+ <span class='kw'>def</span> <span class='id identifier rubyid_with_properties'>with_properties</span><span class='lparen'>(</span><span class='id identifier rubyid_properties'>properties</span><span class='rparen'>)</span>
639
+ <span class='ivar'>@properties</span> <span class='op'>=</span> <span class='id identifier rubyid_properties'>properties</span>
640
+ <span class='kw'>end</span></pre>
641
+ </td>
642
+ </tr>
643
+ </table>
644
+ </div>
645
+
646
+ <div class="method_details ">
647
+ <h3 class="signature " id="with_service-instance_method">
648
+
649
+ #<strong>with_service</strong>(name, timestamp: ServiceDateHelper::formatted_timestamp, run_needed: false, properties: nil, failure_timestamp: nil) &#x21d2; <tt>Object</tt>
650
+
651
+
652
+
653
+
654
+
655
+ </h3><table class="source_code">
656
+ <tr>
657
+ <td>
658
+ <pre class="lines">
659
+
660
+
661
+ 33
662
+ 34
663
+ 35
664
+ 36
665
+ 37
666
+ 38
667
+ 39
668
+ 40
669
+ 41
670
+ 42
671
+ 43
672
+ 44</pre>
673
+ </td>
674
+ <td>
675
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/metadata_builder.rb', line 33</span>
676
+
677
+ <span class='kw'>def</span> <span class='id identifier rubyid_with_service'>with_service</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>timestamp:</span> <span class='const'><span class='object_link'><a href="ServiceDateHelper.html" title="Longleaf::ServiceDateHelper (class)">ServiceDateHelper</a></span></span><span class='op'>::</span><span class='id identifier rubyid_formatted_timestamp'><span class='object_link'><a href="ServiceDateHelper.html#formatted_timestamp-class_method" title="Longleaf::ServiceDateHelper.formatted_timestamp (method)">formatted_timestamp</a></span></span><span class='comma'>,</span> <span class='label'>run_needed:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>properties:</span> <span class='kw'>nil</span><span class='comma'>,</span>
678
+ <span class='label'>failure_timestamp:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
679
+ <span class='id identifier rubyid_timestamp'>timestamp</span> <span class='op'>=</span> <span class='id identifier rubyid_format_timestamp'>format_timestamp</span><span class='lparen'>(</span><span class='id identifier rubyid_timestamp'>timestamp</span><span class='rparen'>)</span>
680
+ <span class='id identifier rubyid_failure_timestamp'>failure_timestamp</span> <span class='op'>=</span> <span class='id identifier rubyid_format_timestamp'>format_timestamp</span><span class='lparen'>(</span><span class='id identifier rubyid_failure_timestamp'>failure_timestamp</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_failure_timestamp'>failure_timestamp</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
681
+
682
+ <span class='ivar'>@services</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ServiceRecord.html" title="Longleaf::ServiceRecord (class)">ServiceRecord</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ServiceRecord.html#initialize-instance_method" title="Longleaf::ServiceRecord#initialize (method)">new</a></span></span><span class='lparen'>(</span>
683
+ <span class='label'>properties:</span> <span class='id identifier rubyid_properties'>properties</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='op'>:</span> <span class='kw'>nil</span><span class='comma'>,</span>
684
+ <span class='label'>timestamp:</span> <span class='id identifier rubyid_timestamp'>timestamp</span><span class='comma'>,</span>
685
+ <span class='label'>run_needed:</span> <span class='id identifier rubyid_run_needed'>run_needed</span><span class='rparen'>)</span>
686
+ <span class='ivar'>@services</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_failure_timestamp'>failure_timestamp</span> <span class='op'>=</span> <span class='id identifier rubyid_failure_timestamp'>failure_timestamp</span>
687
+ <span class='kw'>self</span>
688
+ <span class='kw'>end</span></pre>
689
+ </td>
690
+ </tr>
691
+ </table>
692
+ </div>
693
+
694
+ <div class="method_details ">
695
+ <h3 class="signature " id="write_to_yaml_file-instance_method">
696
+
697
+ #<strong>write_to_yaml_file</strong>(file_rec: nil) &#x21d2; <tt>Object</tt>
698
+
699
+
700
+
701
+
702
+
703
+ </h3><div class="docstring">
704
+ <div class="discussion">
705
+
706
+ <p>Writes the metadata record from this builder into a temporary file, or if a file record is provided, then to the expected metadata path for the record, and assigns the result as the metadata record for the file record.</p>
707
+
708
+
709
+ </div>
710
+ </div>
711
+ <div class="tags">
712
+
713
+ <p class="tag_title">Returns:</p>
714
+ <ul class="return">
715
+
716
+ <li>
717
+
718
+
719
+ <span class='type'></span>
720
+
721
+
722
+
723
+
724
+ <div class='inline'>
725
+ <p>the file path of the config file</p>
726
+ </div>
727
+
728
+ </li>
729
+
730
+ </ul>
731
+
732
+ </div><table class="source_code">
733
+ <tr>
734
+ <td>
735
+ <pre class="lines">
736
+
737
+
738
+ 71
739
+ 72
740
+ 73
741
+ 74
742
+ 75
743
+ 76
744
+ 77
745
+ 78
746
+ 79
747
+ 80
748
+ 81
749
+ 82
750
+ 83
751
+ 84</pre>
752
+ </td>
753
+ <td>
754
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/metadata_builder.rb', line 71</span>
755
+
756
+ <span class='kw'>def</span> <span class='id identifier rubyid_write_to_yaml_file'>write_to_yaml_file</span><span class='lparen'>(</span><span class='label'>file_rec:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
757
+ <span class='id identifier rubyid_md_path'>md_path</span> <span class='op'>=</span> <span class='kw'>nil</span>
758
+ <span class='kw'>if</span> <span class='id identifier rubyid_file_rec'>file_rec</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
759
+ <span class='id identifier rubyid_md_path'>md_path</span> <span class='op'>=</span> <span class='const'>TempFile</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>metadata</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>yml</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span>
760
+ <span class='kw'>else</span>
761
+ <span class='id identifier rubyid_md_path'>md_path</span> <span class='op'>=</span> <span class='id identifier rubyid_file_rec'>file_rec</span><span class='period'>.</span><span class='id identifier rubyid_metadata_path'>metadata_path</span>
762
+ <span class='kw'>end</span>
763
+
764
+ <span class='id identifier rubyid_md_rec'>md_rec</span> <span class='op'>=</span> <span class='id identifier rubyid_get_metadata_record'>get_metadata_record</span>
765
+ <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_write'><span class='object_link'><a href="MetadataSerializer.html#write-class_method" title="Longleaf::MetadataSerializer.write (method)">write</a></span></span><span class='lparen'>(</span><span class='label'>metadata:</span> <span class='id identifier rubyid_md_rec'>md_rec</span><span class='comma'>,</span> <span class='label'>file_path:</span> <span class='id identifier rubyid_md_path'>md_path</span><span class='rparen'>)</span>
766
+ <span class='id identifier rubyid_file_rec'>file_rec</span><span class='period'>.</span><span class='id identifier rubyid_metadata_record'>metadata_record</span> <span class='op'>=</span> <span class='id identifier rubyid_md_rec'>md_rec</span>
767
+
768
+ <span class='id identifier rubyid_md_path'>md_path</span>
769
+ <span class='kw'>end</span></pre>
770
+ </td>
771
+ </tr>
772
+ </table>
773
+ </div>
774
+
775
+ </div>
776
+
777
+ </div>
778
+
779
+ <div id="footer">
780
+ Generated on Tue May 28 15:48:01 2019 by
781
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
782
+ 0.9.19 (ruby-2.6.3).
783
+ </div>
784
+
785
+ </div>
786
+ </body>
787
+ </html>