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,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::ChecksumMismatchError
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::ChecksumMismatchError";
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 (C)</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">ChecksumMismatchError</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::ChecksumMismatchError
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="PreservationServiceError.html" title="Longleaf::PreservationServiceError (class)">PreservationServiceError</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="PreservationServiceError.html" title="Longleaf::PreservationServiceError (class)">PreservationServiceError</a></span></li>
82
+
83
+ <li class="next">Longleaf::ChecksumMismatchError</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>Fixity check failure error</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>
@@ -0,0 +1,1339 @@
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::ConfigBuilder
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::ConfigBuilder";
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 (C)</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">ConfigBuilder</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::ConfigBuilder
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::ConfigBuilder</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/config_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 application configuration hashes</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
118
+ <ul class="summary">
119
+
120
+ <li class="public ">
121
+ <span class="summary_signature">
122
+
123
+ <a href="#config-instance_method" title="#config (instance method)">#<strong>config</strong> &#x21d2; Object </a>
124
+
125
+
126
+
127
+ </span>
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+ <span class="summary_desc"><div class='inline'>
141
+ <p>Returns the value of attribute config.</p>
142
+ </div></span>
143
+
144
+ </li>
145
+
146
+
147
+ </ul>
148
+
149
+
150
+
151
+
152
+
153
+ <h2>
154
+ Instance Method Summary
155
+ <small><a href="#" class="summary_toggle">collapse</a></small>
156
+ </h2>
157
+
158
+ <ul class="summary">
159
+
160
+ <li class="public ">
161
+ <span class="summary_signature">
162
+
163
+ <a href="#get-instance_method" title="#get (instance method)">#<strong>get</strong> &#x21d2; Object </a>
164
+
165
+
166
+
167
+ </span>
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+ <span class="summary_desc"><div class='inline'>
178
+ <p>The constructed configuration.</p>
179
+ </div></span>
180
+
181
+ </li>
182
+
183
+
184
+ <li class="public ">
185
+ <span class="summary_signature">
186
+
187
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> &#x21d2; ConfigBuilder </a>
188
+
189
+
190
+
191
+ </span>
192
+
193
+
194
+ <span class="note title constructor">constructor</span>
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+ <span class="summary_desc"><div class='inline'>
204
+ <p>A new instance of ConfigBuilder.</p>
205
+ </div></span>
206
+
207
+ </li>
208
+
209
+
210
+ <li class="public ">
211
+ <span class="summary_signature">
212
+
213
+ <a href="#map_services-instance_method" title="#map_services (instance method)">#<strong>map_services</strong>(loc_names, service_names) &#x21d2; Object </a>
214
+
215
+
216
+
217
+ </span>
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+ <span class="summary_desc"><div class='inline'>
228
+ <p>Add a mapping from one or more services to one or more location.</p>
229
+ </div></span>
230
+
231
+ </li>
232
+
233
+
234
+ <li class="public ">
235
+ <span class="summary_signature">
236
+
237
+ <a href="#with_location-instance_method" title="#with_location (instance method)">#<strong>with_location</strong>(name:, path: &#39;/file/path/&#39;, md_path: &#39;/metadata/path/&#39;, md_digests: nil) &#x21d2; Object </a>
238
+
239
+
240
+
241
+ </span>
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+ <span class="summary_desc"><div class='inline'>
252
+ <p>Add a &#39;location&#39; to the config.</p>
253
+ </div></span>
254
+
255
+ </li>
256
+
257
+
258
+ <li class="public ">
259
+ <span class="summary_signature">
260
+
261
+ <a href="#with_locations-instance_method" title="#with_locations (instance method)">#<strong>with_locations</strong>(locations = Hash.new) &#x21d2; Object </a>
262
+
263
+
264
+
265
+ </span>
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+ <span class="summary_desc"><div class='inline'>
276
+ <p>Add a root &#39;locations&#39; field to the config.</p>
277
+ </div></span>
278
+
279
+ </li>
280
+
281
+
282
+ <li class="public ">
283
+ <span class="summary_signature">
284
+
285
+ <a href="#with_mappings-instance_method" title="#with_mappings (instance method)">#<strong>with_mappings</strong>(mappings = Hash.new) &#x21d2; Object </a>
286
+
287
+
288
+
289
+ </span>
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+ <span class="summary_desc"><div class='inline'>
300
+ <p>Adds a &#39;service_mappings&#39; section to the config.</p>
301
+ </div></span>
302
+
303
+ </li>
304
+
305
+
306
+ <li class="public ">
307
+ <span class="summary_signature">
308
+
309
+ <a href="#with_service-instance_method" title="#with_service (instance method)">#<strong>with_service</strong>(name:, work_script: &#39;some_pres_service.rb&#39;, work_class: nil, frequency: nil, delay: nil, properties: nil) &#x21d2; Object </a>
310
+
311
+
312
+
313
+ </span>
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+
322
+
323
+ <span class="summary_desc"><div class='inline'>
324
+ <p>Add a &#39;service&#39; to the config.</p>
325
+ </div></span>
326
+
327
+ </li>
328
+
329
+
330
+ <li class="public ">
331
+ <span class="summary_signature">
332
+
333
+ <a href="#with_services-instance_method" title="#with_services (instance method)">#<strong>with_services</strong>(services = Hash.new) &#x21d2; Object </a>
334
+
335
+
336
+
337
+ </span>
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+ <span class="summary_desc"><div class='inline'>
348
+ <p>Add a root &#39;services&#39; field to the config.</p>
349
+ </div></span>
350
+
351
+ </li>
352
+
353
+
354
+ <li class="public ">
355
+ <span class="summary_signature">
356
+
357
+ <a href="#with_system-instance_method" title="#with_system (instance method)">#<strong>with_system</strong>(sys_config) &#x21d2; Object </a>
358
+
359
+
360
+
361
+ </span>
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+ <span class="summary_desc"><div class='inline'>
372
+ <p>Add a system config section to the config.</p>
373
+ </div></span>
374
+
375
+ </li>
376
+
377
+
378
+ <li class="public ">
379
+ <span class="summary_signature">
380
+
381
+ <a href="#write_to_yaml_file-instance_method" title="#write_to_yaml_file (instance method)">#<strong>write_to_yaml_file</strong>(dest_path = nil) &#x21d2; Object </a>
382
+
383
+
384
+
385
+ </span>
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+ <span class="summary_desc"><div class='inline'>
396
+ <p>Writes the configuration from this builder into a temporary file.</p>
397
+ </div></span>
398
+
399
+ </li>
400
+
401
+
402
+ </ul>
403
+
404
+
405
+ <div id="constructor_details" class="method_details_list">
406
+ <h2>Constructor Details</h2>
407
+
408
+ <div class="method_details first">
409
+ <h3 class="signature first" id="initialize-instance_method">
410
+
411
+ #<strong>initialize</strong> &#x21d2; <tt><span class='object_link'><a href="" title="Longleaf::ConfigBuilder (class)">ConfigBuilder</a></span></tt>
412
+
413
+
414
+
415
+
416
+
417
+ </h3><div class="docstring">
418
+ <div class="discussion">
419
+
420
+ <p>Returns a new instance of ConfigBuilder</p>
421
+
422
+
423
+ </div>
424
+ </div>
425
+ <div class="tags">
426
+
427
+
428
+ </div><table class="source_code">
429
+ <tr>
430
+ <td>
431
+ <pre class="lines">
432
+
433
+
434
+ 13
435
+ 14
436
+ 15</pre>
437
+ </td>
438
+ <td>
439
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/config_builder.rb', line 13</span>
440
+
441
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
442
+ <span class='ivar'>@config</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
443
+ <span class='kw'>end</span></pre>
444
+ </td>
445
+ </tr>
446
+ </table>
447
+ </div>
448
+
449
+ </div>
450
+
451
+ <div id="instance_attr_details" class="attr_details">
452
+ <h2>Instance Attribute Details</h2>
453
+
454
+
455
+ <span id="config=-instance_method"></span>
456
+ <div class="method_details first">
457
+ <h3 class="signature first" id="config-instance_method">
458
+
459
+ #<strong>config</strong> &#x21d2; <tt>Object</tt>
460
+
461
+
462
+
463
+
464
+
465
+ </h3><div class="docstring">
466
+ <div class="discussion">
467
+
468
+ <p>Returns the value of attribute config</p>
469
+
470
+
471
+ </div>
472
+ </div>
473
+ <div class="tags">
474
+
475
+
476
+ </div><table class="source_code">
477
+ <tr>
478
+ <td>
479
+ <pre class="lines">
480
+
481
+
482
+ 11
483
+ 12
484
+ 13</pre>
485
+ </td>
486
+ <td>
487
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/config_builder.rb', line 11</span>
488
+
489
+ <span class='kw'>def</span> <span class='id identifier rubyid_config'>config</span>
490
+ <span class='ivar'>@config</span>
491
+ <span class='kw'>end</span></pre>
492
+ </td>
493
+ </tr>
494
+ </table>
495
+ </div>
496
+
497
+ </div>
498
+
499
+
500
+ <div id="instance_method_details" class="method_details_list">
501
+ <h2>Instance Method Details</h2>
502
+
503
+
504
+ <div class="method_details first">
505
+ <h3 class="signature first" id="get-instance_method">
506
+
507
+ #<strong>get</strong> &#x21d2; <tt>Object</tt>
508
+
509
+
510
+
511
+
512
+
513
+ </h3><div class="docstring">
514
+ <div class="discussion">
515
+
516
+ <p>Returns the constructed configuration</p>
517
+
518
+
519
+ </div>
520
+ </div>
521
+ <div class="tags">
522
+
523
+ <p class="tag_title">Returns:</p>
524
+ <ul class="return">
525
+
526
+ <li>
527
+
528
+
529
+ <span class='type'></span>
530
+
531
+
532
+
533
+
534
+ <div class='inline'>
535
+ <p>the constructed configuration</p>
536
+ </div>
537
+
538
+ </li>
539
+
540
+ </ul>
541
+
542
+ </div><table class="source_code">
543
+ <tr>
544
+ <td>
545
+ <pre class="lines">
546
+
547
+
548
+ 99
549
+ 100
550
+ 101</pre>
551
+ </td>
552
+ <td>
553
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/config_builder.rb', line 99</span>
554
+
555
+ <span class='kw'>def</span> <span class='id identifier rubyid_get'>get</span>
556
+ <span class='ivar'>@config</span>
557
+ <span class='kw'>end</span></pre>
558
+ </td>
559
+ </tr>
560
+ </table>
561
+ </div>
562
+
563
+ <div class="method_details ">
564
+ <h3 class="signature " id="map_services-instance_method">
565
+
566
+ #<strong>map_services</strong>(loc_names, service_names) &#x21d2; <tt>Object</tt>
567
+
568
+
569
+
570
+
571
+
572
+ </h3><div class="docstring">
573
+ <div class="discussion">
574
+
575
+ <p>Add a mapping from one or more services to one or more location</p>
576
+
577
+
578
+ </div>
579
+ </div>
580
+ <div class="tags">
581
+ <p class="tag_title">Parameters:</p>
582
+ <ul class="param">
583
+
584
+ <li>
585
+
586
+ <span class='name'>loc_names</span>
587
+
588
+
589
+ <span class='type'>(<tt>Object</tt>)</span>
590
+
591
+
592
+
593
+ &mdash;
594
+ <div class='inline'>
595
+ <p>one or more location names. Can be a string or array.</p>
596
+ </div>
597
+
598
+ </li>
599
+
600
+ <li>
601
+
602
+ <span class='name'>service_names</span>
603
+
604
+
605
+ <span class='type'>(<tt>Object</tt>)</span>
606
+
607
+
608
+
609
+ &mdash;
610
+ <div class='inline'>
611
+ <p>one or more service names. Can be a string or array.</p>
612
+ </div>
613
+
614
+ </li>
615
+
616
+ </ul>
617
+
618
+
619
+ </div><table class="source_code">
620
+ <tr>
621
+ <td>
622
+ <pre class="lines">
623
+
624
+
625
+ 82
626
+ 83
627
+ 84
628
+ 85
629
+ 86
630
+ 87
631
+ 88
632
+ 89
633
+ 90</pre>
634
+ </td>
635
+ <td>
636
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/config_builder.rb', line 82</span>
637
+
638
+ <span class='kw'>def</span> <span class='id identifier rubyid_map_services'>map_services</span><span class='lparen'>(</span><span class='id identifier rubyid_loc_names'>loc_names</span><span class='comma'>,</span> <span class='id identifier rubyid_service_names'>service_names</span><span class='rparen'>)</span>
639
+ <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>SERVICE_MAPPINGS</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>unless</span> <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>SERVICE_MAPPINGS</span><span class='rparen'>)</span>
640
+
641
+ <span class='id identifier rubyid_mapping'>mapping</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
642
+ <span class='id identifier rubyid_mapping'>mapping</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>LOCATIONS</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_loc_names'>loc_names</span> <span class='kw'>unless</span> <span class='id identifier rubyid_loc_names'>loc_names</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
643
+ <span class='id identifier rubyid_mapping'>mapping</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>SERVICES</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_service_names'>service_names</span> <span class='kw'>unless</span> <span class='id identifier rubyid_service_names'>service_names</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
644
+ <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>SERVICE_MAPPINGS</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_mapping'>mapping</span><span class='rparen'>)</span>
645
+ <span class='kw'>self</span>
646
+ <span class='kw'>end</span></pre>
647
+ </td>
648
+ </tr>
649
+ </table>
650
+ </div>
651
+
652
+ <div class="method_details ">
653
+ <h3 class="signature " id="with_location-instance_method">
654
+
655
+ #<strong>with_location</strong>(name:, path: &#39;/file/path/&#39;, md_path: &#39;/metadata/path/&#39;, md_digests: nil) &#x21d2; <tt>Object</tt>
656
+
657
+
658
+
659
+
660
+
661
+ </h3><div class="docstring">
662
+ <div class="discussion">
663
+
664
+ <p>Add a &#39;location&#39; to the config</p>
665
+
666
+
667
+ </div>
668
+ </div>
669
+ <div class="tags">
670
+ <p class="tag_title">Parameters:</p>
671
+ <ul class="param">
672
+
673
+ <li>
674
+
675
+ <span class='name'>name</span>
676
+
677
+
678
+ <span class='type'>(<tt>String</tt>)</span>
679
+
680
+
681
+
682
+ &mdash;
683
+ <div class='inline'>
684
+ <p>name of the location</p>
685
+ </div>
686
+
687
+ </li>
688
+
689
+ <li>
690
+
691
+ <span class='name'>path</span>
692
+
693
+
694
+ <span class='type'>(<tt>String</tt>)</span>
695
+
696
+
697
+
698
+ &mdash;
699
+ <div class='inline'>
700
+ <p>value for the &#39;path&#39; field</p>
701
+ </div>
702
+
703
+ </li>
704
+
705
+ <li>
706
+
707
+ <span class='name'>md_path</span>
708
+
709
+
710
+ <span class='type'>(<tt>String</tt>)</span>
711
+
712
+
713
+
714
+ &mdash;
715
+ <div class='inline'>
716
+ <p>value for the &#39;metadata_path&#39; field</p>
717
+ </div>
718
+
719
+ </li>
720
+
721
+ </ul>
722
+
723
+ <p class="tag_title">Returns:</p>
724
+ <ul class="return">
725
+
726
+ <li>
727
+
728
+
729
+ <span class='type'></span>
730
+
731
+
732
+
733
+
734
+ <div class='inline'>
735
+ <p>this builder</p>
736
+ </div>
737
+
738
+ </li>
739
+
740
+ </ul>
741
+
742
+ </div><table class="source_code">
743
+ <tr>
744
+ <td>
745
+ <pre class="lines">
746
+
747
+
748
+ 30
749
+ 31
750
+ 32
751
+ 33
752
+ 34
753
+ 35
754
+ 36
755
+ 37
756
+ 38
757
+ 39</pre>
758
+ </td>
759
+ <td>
760
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/config_builder.rb', line 30</span>
761
+
762
+ <span class='kw'>def</span> <span class='id identifier rubyid_with_location'>with_location</span><span class='lparen'>(</span><span class='label'>name:</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/file/path/</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>md_path:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/metadata/path/</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>md_digests:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
763
+ <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>LOCATIONS</span><span class='rbracket'>]</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'>@config</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>LOCATIONS</span><span class='rparen'>)</span>
764
+
765
+ <span class='id identifier rubyid_location'>location</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
766
+ <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>LOCATIONS</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_location'>location</span>
767
+ <span class='id identifier rubyid_location'>location</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>LOCATION_PATH</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span> <span class='kw'>unless</span> <span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
768
+ <span class='id identifier rubyid_location'>location</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>METADATA_PATH</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_md_path'>md_path</span> <span class='kw'>unless</span> <span class='id identifier rubyid_md_path'>md_path</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
769
+ <span class='id identifier rubyid_location'>location</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>METADATA_DIGESTS</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_md_digests'>md_digests</span> <span class='kw'>unless</span> <span class='id identifier rubyid_md_digests'>md_digests</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
770
+ <span class='kw'>self</span>
771
+ <span class='kw'>end</span></pre>
772
+ </td>
773
+ </tr>
774
+ </table>
775
+ </div>
776
+
777
+ <div class="method_details ">
778
+ <h3 class="signature " id="with_locations-instance_method">
779
+
780
+ #<strong>with_locations</strong>(locations = Hash.new) &#x21d2; <tt>Object</tt>
781
+
782
+
783
+
784
+
785
+
786
+ </h3><div class="docstring">
787
+ <div class="discussion">
788
+
789
+ <p>Add a root &#39;locations&#39; field to the config</p>
790
+
791
+
792
+ </div>
793
+ </div>
794
+ <div class="tags">
795
+ <p class="tag_title">Parameters:</p>
796
+ <ul class="param">
797
+
798
+ <li>
799
+
800
+ <span class='name'>locations</span>
801
+
802
+
803
+ <span class='type'>(<tt>Hash</tt>)</span>
804
+
805
+
806
+ <em class="default">(defaults to: <tt>Hash.new</tt>)</em>
807
+
808
+
809
+ &mdash;
810
+ <div class='inline'>
811
+ <p>value for the locations fields. Default is {}</p>
812
+ </div>
813
+
814
+ </li>
815
+
816
+ </ul>
817
+
818
+ <p class="tag_title">Returns:</p>
819
+ <ul class="return">
820
+
821
+ <li>
822
+
823
+
824
+ <span class='type'></span>
825
+
826
+
827
+
828
+
829
+ <div class='inline'>
830
+ <p>this builder</p>
831
+ </div>
832
+
833
+ </li>
834
+
835
+ </ul>
836
+
837
+ </div><table class="source_code">
838
+ <tr>
839
+ <td>
840
+ <pre class="lines">
841
+
842
+
843
+ 20
844
+ 21
845
+ 22
846
+ 23</pre>
847
+ </td>
848
+ <td>
849
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/config_builder.rb', line 20</span>
850
+
851
+ <span class='kw'>def</span> <span class='id identifier rubyid_with_locations'>with_locations</span><span class='lparen'>(</span><span class='id identifier rubyid_locations'>locations</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='rparen'>)</span>
852
+ <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>LOCATIONS</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_locations'>locations</span>
853
+ <span class='kw'>self</span>
854
+ <span class='kw'>end</span></pre>
855
+ </td>
856
+ </tr>
857
+ </table>
858
+ </div>
859
+
860
+ <div class="method_details ">
861
+ <h3 class="signature " id="with_mappings-instance_method">
862
+
863
+ #<strong>with_mappings</strong>(mappings = Hash.new) &#x21d2; <tt>Object</tt>
864
+
865
+
866
+
867
+
868
+
869
+ </h3><div class="docstring">
870
+ <div class="discussion">
871
+
872
+ <p>Adds a &#39;service_mappings&#39; section to the config</p>
873
+
874
+
875
+ </div>
876
+ </div>
877
+ <div class="tags">
878
+ <p class="tag_title">Parameters:</p>
879
+ <ul class="param">
880
+
881
+ <li>
882
+
883
+ <span class='name'>mappings</span>
884
+
885
+
886
+ <span class='type'>(<tt>Object</tt>)</span>
887
+
888
+
889
+ <em class="default">(defaults to: <tt>Hash.new</tt>)</em>
890
+
891
+
892
+ &mdash;
893
+ <div class='inline'>
894
+ <p>the mappings config</p>
895
+ </div>
896
+
897
+ </li>
898
+
899
+ </ul>
900
+
901
+ <p class="tag_title">Returns:</p>
902
+ <ul class="return">
903
+
904
+ <li>
905
+
906
+
907
+ <span class='type'></span>
908
+
909
+
910
+
911
+
912
+ <div class='inline'>
913
+ <p>this builder</p>
914
+ </div>
915
+
916
+ </li>
917
+
918
+ </ul>
919
+
920
+ </div><table class="source_code">
921
+ <tr>
922
+ <td>
923
+ <pre class="lines">
924
+
925
+
926
+ 74
927
+ 75
928
+ 76
929
+ 77</pre>
930
+ </td>
931
+ <td>
932
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/config_builder.rb', line 74</span>
933
+
934
+ <span class='kw'>def</span> <span class='id identifier rubyid_with_mappings'>with_mappings</span><span class='lparen'>(</span><span class='id identifier rubyid_mappings'>mappings</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='rparen'>)</span>
935
+ <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>SERVICE_MAPPINGS</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_mappings'>mappings</span>
936
+ <span class='kw'>self</span>
937
+ <span class='kw'>end</span></pre>
938
+ </td>
939
+ </tr>
940
+ </table>
941
+ </div>
942
+
943
+ <div class="method_details ">
944
+ <h3 class="signature " id="with_service-instance_method">
945
+
946
+ #<strong>with_service</strong>(name:, work_script: &#39;some_pres_service.rb&#39;, work_class: nil, frequency: nil, delay: nil, properties: nil) &#x21d2; <tt>Object</tt>
947
+
948
+
949
+
950
+
951
+
952
+ </h3><div class="docstring">
953
+ <div class="discussion">
954
+
955
+ <p>Add a &#39;service&#39; to the config</p>
956
+
957
+
958
+ </div>
959
+ </div>
960
+ <div class="tags">
961
+ <p class="tag_title">Parameters:</p>
962
+ <ul class="param">
963
+
964
+ <li>
965
+
966
+ <span class='name'>name</span>
967
+
968
+
969
+ <span class='type'>(<tt>String</tt>)</span>
970
+
971
+
972
+
973
+ &mdash;
974
+ <div class='inline'>
975
+ <p>name of the service</p>
976
+ </div>
977
+
978
+ </li>
979
+
980
+ <li>
981
+
982
+ <span class='name'>work_script</span>
983
+
984
+
985
+ <span class='type'>(<tt>String</tt>)</span>
986
+
987
+
988
+
989
+ &mdash;
990
+ <div class='inline'>
991
+ <p>value for the &#39;work_script&#39; field</p>
992
+ </div>
993
+
994
+ </li>
995
+
996
+ <li>
997
+
998
+ <span class='name'>work_class</span>
999
+
1000
+
1001
+ <span class='type'>(<tt>String</tt>)</span>
1002
+
1003
+
1004
+
1005
+ &mdash;
1006
+ <div class='inline'>
1007
+ <p>value for the &#39;work_class&#39; field</p>
1008
+ </div>
1009
+
1010
+ </li>
1011
+
1012
+ <li>
1013
+
1014
+ <span class='name'>frequency</span>
1015
+
1016
+
1017
+ <span class='type'>(<tt>String</tt>)</span>
1018
+
1019
+
1020
+
1021
+ &mdash;
1022
+ <div class='inline'>
1023
+ <p>value for the &#39;frequency&#39; field</p>
1024
+ </div>
1025
+
1026
+ </li>
1027
+
1028
+ <li>
1029
+
1030
+ <span class='name'>delay</span>
1031
+
1032
+
1033
+ <span class='type'>(<tt>String</tt>)</span>
1034
+
1035
+
1036
+
1037
+ &mdash;
1038
+ <div class='inline'>
1039
+ <p>value for the &#39;delay&#39; field</p>
1040
+ </div>
1041
+
1042
+ </li>
1043
+
1044
+ <li>
1045
+
1046
+ <span class='name'>properties</span>
1047
+
1048
+
1049
+ <span class='type'>(<tt>Hash</tt>)</span>
1050
+
1051
+
1052
+
1053
+ &mdash;
1054
+ <div class='inline'>
1055
+ <p>hash of additional properties to include in the service</p>
1056
+ </div>
1057
+
1058
+ </li>
1059
+
1060
+ </ul>
1061
+
1062
+ <p class="tag_title">Returns:</p>
1063
+ <ul class="return">
1064
+
1065
+ <li>
1066
+
1067
+
1068
+ <span class='type'></span>
1069
+
1070
+
1071
+
1072
+
1073
+ <div class='inline'>
1074
+ <p>this builder</p>
1075
+ </div>
1076
+
1077
+ </li>
1078
+
1079
+ </ul>
1080
+
1081
+ </div><table class="source_code">
1082
+ <tr>
1083
+ <td>
1084
+ <pre class="lines">
1085
+
1086
+
1087
+ 57
1088
+ 58
1089
+ 59
1090
+ 60
1091
+ 61
1092
+ 62
1093
+ 63
1094
+ 64
1095
+ 65
1096
+ 66
1097
+ 67
1098
+ 68
1099
+ 69</pre>
1100
+ </td>
1101
+ <td>
1102
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/config_builder.rb', line 57</span>
1103
+
1104
+ <span class='kw'>def</span> <span class='id identifier rubyid_with_service'>with_service</span><span class='lparen'>(</span><span class='label'>name:</span><span class='comma'>,</span> <span class='label'>work_script:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>some_pres_service.rb</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>work_class:</span> <span class='kw'>nil</span><span class='comma'>,</span>
1105
+ <span class='label'>frequency:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>delay:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>properties:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
1106
+ <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>SERVICES</span><span class='rbracket'>]</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'>@config</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>SERVICES</span><span class='rparen'>)</span>
1107
+
1108
+ <span class='id identifier rubyid_service'>service</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
1109
+ <span class='id identifier rubyid_service'>service</span><span class='lbracket'>[</span><span class='const'>SF</span><span class='op'>::</span><span class='const'>WORK_SCRIPT</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_work_script'>work_script</span>
1110
+ <span class='id identifier rubyid_service'>service</span><span class='lbracket'>[</span><span class='const'>SF</span><span class='op'>::</span><span class='const'>WORK_CLASS</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_work_class'>work_class</span>
1111
+ <span class='id identifier rubyid_service'>service</span><span class='lbracket'>[</span><span class='const'>SF</span><span class='op'>::</span><span class='const'>FREQUENCY</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_frequency'>frequency</span> <span class='kw'>unless</span> <span class='id identifier rubyid_frequency'>frequency</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1112
+ <span class='id identifier rubyid_service'>service</span><span class='lbracket'>[</span><span class='const'>SF</span><span class='op'>::</span><span class='const'>DELAY</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_delay'>delay</span> <span class='kw'>unless</span> <span class='id identifier rubyid_delay'>delay</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1113
+ <span class='id identifier rubyid_service'>service</span> <span class='op'>=</span> <span class='id identifier rubyid_service'>service</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_properties'>properties</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_properties'>properties</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1114
+ <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>SERVICES</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_service'>service</span>
1115
+ <span class='kw'>self</span>
1116
+ <span class='kw'>end</span></pre>
1117
+ </td>
1118
+ </tr>
1119
+ </table>
1120
+ </div>
1121
+
1122
+ <div class="method_details ">
1123
+ <h3 class="signature " id="with_services-instance_method">
1124
+
1125
+ #<strong>with_services</strong>(services = Hash.new) &#x21d2; <tt>Object</tt>
1126
+
1127
+
1128
+
1129
+
1130
+
1131
+ </h3><div class="docstring">
1132
+ <div class="discussion">
1133
+
1134
+ <p>Add a root &#39;services&#39; field to the config</p>
1135
+
1136
+
1137
+ </div>
1138
+ </div>
1139
+ <div class="tags">
1140
+ <p class="tag_title">Parameters:</p>
1141
+ <ul class="param">
1142
+
1143
+ <li>
1144
+
1145
+ <span class='name'>services</span>
1146
+
1147
+
1148
+ <span class='type'>(<tt>Hash</tt>)</span>
1149
+
1150
+
1151
+ <em class="default">(defaults to: <tt>Hash.new</tt>)</em>
1152
+
1153
+
1154
+ &mdash;
1155
+ <div class='inline'>
1156
+ <p>value for the services field. Default is {}</p>
1157
+ </div>
1158
+
1159
+ </li>
1160
+
1161
+ </ul>
1162
+
1163
+ <p class="tag_title">Returns:</p>
1164
+ <ul class="return">
1165
+
1166
+ <li>
1167
+
1168
+
1169
+ <span class='type'></span>
1170
+
1171
+
1172
+
1173
+
1174
+ <div class='inline'>
1175
+ <p>this builder</p>
1176
+ </div>
1177
+
1178
+ </li>
1179
+
1180
+ </ul>
1181
+
1182
+ </div><table class="source_code">
1183
+ <tr>
1184
+ <td>
1185
+ <pre class="lines">
1186
+
1187
+
1188
+ 44
1189
+ 45
1190
+ 46
1191
+ 47</pre>
1192
+ </td>
1193
+ <td>
1194
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/config_builder.rb', line 44</span>
1195
+
1196
+ <span class='kw'>def</span> <span class='id identifier rubyid_with_services'>with_services</span><span class='lparen'>(</span><span class='id identifier rubyid_services'>services</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='rparen'>)</span>
1197
+ <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>SERVICES</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_services'>services</span>
1198
+ <span class='kw'>self</span>
1199
+ <span class='kw'>end</span></pre>
1200
+ </td>
1201
+ </tr>
1202
+ </table>
1203
+ </div>
1204
+
1205
+ <div class="method_details ">
1206
+ <h3 class="signature " id="with_system-instance_method">
1207
+
1208
+ #<strong>with_system</strong>(sys_config) &#x21d2; <tt>Object</tt>
1209
+
1210
+
1211
+
1212
+
1213
+
1214
+ </h3><div class="docstring">
1215
+ <div class="discussion">
1216
+
1217
+ <p>Add a system config section to the config</p>
1218
+
1219
+
1220
+ </div>
1221
+ </div>
1222
+ <div class="tags">
1223
+
1224
+
1225
+ </div><table class="source_code">
1226
+ <tr>
1227
+ <td>
1228
+ <pre class="lines">
1229
+
1230
+
1231
+ 93
1232
+ 94
1233
+ 95
1234
+ 96</pre>
1235
+ </td>
1236
+ <td>
1237
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/config_builder.rb', line 93</span>
1238
+
1239
+ <span class='kw'>def</span> <span class='id identifier rubyid_with_system'>with_system</span><span class='lparen'>(</span><span class='id identifier rubyid_sys_config'>sys_config</span><span class='rparen'>)</span>
1240
+ <span class='ivar'>@config</span><span class='lbracket'>[</span><span class='const'>AF</span><span class='op'>::</span><span class='const'>SYSTEM</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_sys_config'>sys_config</span>
1241
+ <span class='kw'>self</span>
1242
+ <span class='kw'>end</span></pre>
1243
+ </td>
1244
+ </tr>
1245
+ </table>
1246
+ </div>
1247
+
1248
+ <div class="method_details ">
1249
+ <h3 class="signature " id="write_to_yaml_file-instance_method">
1250
+
1251
+ #<strong>write_to_yaml_file</strong>(dest_path = nil) &#x21d2; <tt>Object</tt>
1252
+
1253
+
1254
+
1255
+
1256
+
1257
+ </h3><div class="docstring">
1258
+ <div class="discussion">
1259
+
1260
+ <p>Writes the configuration from this builder into a temporary file</p>
1261
+
1262
+
1263
+ </div>
1264
+ </div>
1265
+ <div class="tags">
1266
+
1267
+ <p class="tag_title">Returns:</p>
1268
+ <ul class="return">
1269
+
1270
+ <li>
1271
+
1272
+
1273
+ <span class='type'></span>
1274
+
1275
+
1276
+
1277
+
1278
+ <div class='inline'>
1279
+ <p>the file path of the config file</p>
1280
+ </div>
1281
+
1282
+ </li>
1283
+
1284
+ </ul>
1285
+
1286
+ </div><table class="source_code">
1287
+ <tr>
1288
+ <td>
1289
+ <pre class="lines">
1290
+
1291
+
1292
+ 105
1293
+ 106
1294
+ 107
1295
+ 108
1296
+ 109
1297
+ 110
1298
+ 111
1299
+ 112
1300
+ 113
1301
+ 114
1302
+ 115
1303
+ 116
1304
+ 117</pre>
1305
+ </td>
1306
+ <td>
1307
+ <pre class="code"><span class="info file"># File 'lib/longleaf/specs/config_builder.rb', line 105</span>
1308
+
1309
+ <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='id identifier rubyid_dest_path'>dest_path</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
1310
+ <span class='kw'>if</span> <span class='id identifier rubyid_dest_path'>dest_path</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1311
+ <span class='id identifier rubyid_file'>file</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='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>config</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1312
+ <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
1313
+ <span class='id identifier rubyid_dest_path'>dest_path</span> <span class='op'>=</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span>
1314
+ <span class='comment'># deleting temp file but reusing file name. This is to avoid premature garbage collection.
1315
+ </span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_unlink'>unlink</span>
1316
+ <span class='kw'>end</span>
1317
+ <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_dest_path'>dest_path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>w</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span>
1318
+ <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_to_yaml'>to_yaml</span><span class='rparen'>)</span>
1319
+ <span class='kw'>end</span>
1320
+ <span class='id identifier rubyid_dest_path'>dest_path</span>
1321
+ <span class='kw'>end</span></pre>
1322
+ </td>
1323
+ </tr>
1324
+ </table>
1325
+ </div>
1326
+
1327
+ </div>
1328
+
1329
+ </div>
1330
+
1331
+ <div id="footer">
1332
+ Generated on Tue May 28 15:48:01 2019 by
1333
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1334
+ 0.9.19 (ruby-2.6.3).
1335
+ </div>
1336
+
1337
+ </div>
1338
+ </body>
1339
+ </html>