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.
- checksums.yaml +4 -4
- data/.circleci/config.yml +94 -0
- data/.editorconfig +13 -0
- data/.gitignore +4 -1
- data/.rubocop.yml +44 -0
- data/.rubocop_todo.yml +834 -0
- data/.yardopts +1 -0
- data/Gemfile +16 -1
- data/README.md +98 -12
- data/Rakefile +6 -0
- data/bin/setup +16 -1
- data/docs/aboutlongleaf.md +28 -0
- data/docs/extra.css +32 -0
- data/docs/img/change-file.png +0 -0
- data/docs/img/ll-example-preserved.png +0 -0
- data/docs/index.md +19 -0
- data/docs/install.md +66 -0
- data/docs/ll-example/config-example-relative.yml +33 -0
- data/docs/ll-example/files-dir/LLexample-PDF.pdf +0 -0
- data/docs/ll-example/files-dir/LLexample-TOCHANGE.txt +15 -0
- data/docs/ll-example/files-dir/LLexample-tokeep.txt +10 -0
- data/docs/ll-example/metadata-dir/.gitkeep +0 -0
- data/docs/ll-example/replica-files/.gitkeep +0 -0
- data/docs/ll-example/replica-metadata/.gitkeep +0 -0
- data/docs/quickstart.md +270 -0
- data/docs/rdocs/Longleaf.html +135 -0
- data/docs/rdocs/Longleaf/AppFields.html +178 -0
- data/docs/rdocs/Longleaf/ApplicationConfigDeserializer.html +631 -0
- data/docs/rdocs/Longleaf/ApplicationConfigManager.html +610 -0
- data/docs/rdocs/Longleaf/ApplicationConfigValidator.html +238 -0
- data/docs/rdocs/Longleaf/CLI.html +909 -0
- data/docs/rdocs/Longleaf/ChecksumMismatchError.html +151 -0
- data/docs/rdocs/Longleaf/ConfigBuilder.html +1339 -0
- data/docs/rdocs/Longleaf/ConfigurationError.html +143 -0
- data/docs/rdocs/Longleaf/ConfigurationValidator.html +227 -0
- data/docs/rdocs/Longleaf/DeregisterCommand.html +420 -0
- data/docs/rdocs/Longleaf/DeregisterEvent.html +453 -0
- data/docs/rdocs/Longleaf/DeregistrationError.html +151 -0
- data/docs/rdocs/Longleaf/DigestHelper.html +419 -0
- data/docs/rdocs/Longleaf/EventError.html +147 -0
- data/docs/rdocs/Longleaf/EventNames.html +163 -0
- data/docs/rdocs/Longleaf/EventStatusTracking.html +656 -0
- data/docs/rdocs/Longleaf/FileCheckService.html +540 -0
- data/docs/rdocs/Longleaf/FileHelpers.html +520 -0
- data/docs/rdocs/Longleaf/FileRecord.html +716 -0
- data/docs/rdocs/Longleaf/FileSelector.html +901 -0
- data/docs/rdocs/Longleaf/FixityCheckService.html +691 -0
- data/docs/rdocs/Longleaf/IndexManager.html +1155 -0
- data/docs/rdocs/Longleaf/InvalidDigestAlgorithmError.html +143 -0
- data/docs/rdocs/Longleaf/InvalidStoragePathError.html +143 -0
- data/docs/rdocs/Longleaf/Logging.html +405 -0
- data/docs/rdocs/Longleaf/Logging/RedirectingLogger.html +1213 -0
- data/docs/rdocs/Longleaf/LongleafError.html +139 -0
- data/docs/rdocs/Longleaf/MDFields.html +193 -0
- data/docs/rdocs/Longleaf/MetadataBuilder.html +787 -0
- data/docs/rdocs/Longleaf/MetadataDeserializer.html +537 -0
- data/docs/rdocs/Longleaf/MetadataError.html +143 -0
- data/docs/rdocs/Longleaf/MetadataPersistenceManager.html +539 -0
- data/docs/rdocs/Longleaf/MetadataRecord.html +1411 -0
- data/docs/rdocs/Longleaf/MetadataSerializer.html +786 -0
- data/docs/rdocs/Longleaf/PreservationServiceError.html +147 -0
- data/docs/rdocs/Longleaf/PreserveCommand.html +410 -0
- data/docs/rdocs/Longleaf/PreserveEvent.html +491 -0
- data/docs/rdocs/Longleaf/RegisterCommand.html +428 -0
- data/docs/rdocs/Longleaf/RegisterEvent.html +628 -0
- data/docs/rdocs/Longleaf/RegisteredFileSelector.html +446 -0
- data/docs/rdocs/Longleaf/RegistrationError.html +151 -0
- data/docs/rdocs/Longleaf/ReindexCommand.html +576 -0
- data/docs/rdocs/Longleaf/RsyncReplicationService.html +1180 -0
- data/docs/rdocs/Longleaf/SequelIndexDriver.html +1978 -0
- data/docs/rdocs/Longleaf/ServiceCandidateFilesystemIterator.html +572 -0
- data/docs/rdocs/Longleaf/ServiceCandidateIndexIterator.html +532 -0
- data/docs/rdocs/Longleaf/ServiceCandidateLocator.html +333 -0
- data/docs/rdocs/Longleaf/ServiceClassCache.html +725 -0
- data/docs/rdocs/Longleaf/ServiceDateHelper.html +425 -0
- data/docs/rdocs/Longleaf/ServiceDefinition.html +683 -0
- data/docs/rdocs/Longleaf/ServiceDefinitionManager.html +371 -0
- data/docs/rdocs/Longleaf/ServiceDefinitionValidator.html +269 -0
- data/docs/rdocs/Longleaf/ServiceFields.html +173 -0
- data/docs/rdocs/Longleaf/ServiceManager.html +1229 -0
- data/docs/rdocs/Longleaf/ServiceMappingManager.html +410 -0
- data/docs/rdocs/Longleaf/ServiceMappingValidator.html +347 -0
- data/docs/rdocs/Longleaf/ServiceRecord.html +821 -0
- data/docs/rdocs/Longleaf/StorageLocation.html +985 -0
- data/docs/rdocs/Longleaf/StorageLocationManager.html +729 -0
- data/docs/rdocs/Longleaf/StorageLocationUnavailableError.html +143 -0
- data/docs/rdocs/Longleaf/StorageLocationValidator.html +373 -0
- data/docs/rdocs/Longleaf/StoragePathValidator.html +253 -0
- data/docs/rdocs/Longleaf/SystemConfigBuilder.html +441 -0
- data/docs/rdocs/Longleaf/SystemConfigFields.html +163 -0
- data/docs/rdocs/Longleaf/ValidateConfigCommand.html +451 -0
- data/docs/rdocs/Longleaf/ValidateMetadataCommand.html +408 -0
- data/docs/rdocs/_index.html +660 -0
- data/docs/rdocs/class_list.html +51 -0
- data/docs/rdocs/css/common.css +1 -0
- data/docs/rdocs/css/full_list.css +58 -0
- data/docs/rdocs/css/style.css +496 -0
- data/docs/rdocs/file.README.html +165 -0
- data/docs/rdocs/file_list.html +56 -0
- data/docs/rdocs/frames.html +17 -0
- data/docs/rdocs/index.html +165 -0
- data/docs/rdocs/js/app.js +303 -0
- data/docs/rdocs/js/full_list.js +216 -0
- data/docs/rdocs/js/jquery.js +4 -0
- data/docs/rdocs/method_list.html +2051 -0
- data/docs/rdocs/top-level-namespace.html +110 -0
- data/lib/longleaf/candidates/file_selector.rb +150 -0
- data/lib/longleaf/candidates/manifest_digest_provider.rb +17 -0
- data/lib/longleaf/candidates/physical_path_provider.rb +17 -0
- data/lib/longleaf/candidates/registered_file_selector.rb +67 -0
- data/lib/longleaf/candidates/service_candidate_filesystem_iterator.rb +93 -0
- data/lib/longleaf/candidates/service_candidate_index_iterator.rb +84 -0
- data/lib/longleaf/candidates/service_candidate_locator.rb +23 -0
- data/lib/longleaf/candidates/single_digest_provider.rb +13 -0
- data/lib/longleaf/cli.rb +249 -44
- data/lib/longleaf/commands/deregister_command.rb +51 -0
- data/lib/longleaf/commands/preserve_command.rb +50 -0
- data/lib/longleaf/commands/register_command.rb +34 -43
- data/lib/longleaf/commands/reindex_command.rb +92 -0
- data/lib/longleaf/commands/validate_config_command.rb +33 -8
- data/lib/longleaf/commands/validate_metadata_command.rb +51 -0
- data/lib/longleaf/errors.rb +26 -7
- data/lib/longleaf/events/deregister_event.rb +53 -0
- data/lib/longleaf/events/event_names.rb +9 -0
- data/lib/longleaf/events/event_status_tracking.rb +59 -0
- data/lib/longleaf/events/preserve_event.rb +82 -0
- data/lib/longleaf/events/register_event.rb +59 -51
- data/lib/longleaf/helpers/case_insensitive_hash.rb +38 -0
- data/lib/longleaf/helpers/digest_helper.rb +56 -0
- data/lib/longleaf/helpers/s3_uri_helper.rb +86 -0
- data/lib/longleaf/helpers/selection_options_parser.rb +215 -0
- data/lib/longleaf/helpers/service_date_helper.rb +78 -0
- data/lib/longleaf/indexing/index_manager.rb +101 -0
- data/lib/longleaf/indexing/sequel_index_driver.rb +306 -0
- data/lib/longleaf/logging.rb +5 -4
- data/lib/longleaf/logging/redirecting_logger.rb +30 -25
- data/lib/longleaf/models/app_fields.rb +7 -2
- data/lib/longleaf/models/file_record.rb +31 -8
- data/lib/longleaf/models/filesystem_metadata_location.rb +56 -0
- data/lib/longleaf/models/filesystem_storage_location.rb +52 -0
- data/lib/longleaf/models/md_fields.rb +3 -1
- data/lib/longleaf/models/metadata_location.rb +47 -0
- data/lib/longleaf/models/metadata_record.rb +43 -16
- data/lib/longleaf/models/s3_storage_location.rb +138 -0
- data/lib/longleaf/models/service_definition.rb +7 -6
- data/lib/longleaf/models/service_fields.rb +7 -1
- data/lib/longleaf/models/service_record.rb +10 -6
- data/lib/longleaf/models/storage_location.rb +24 -21
- data/lib/longleaf/models/storage_types.rb +9 -0
- data/lib/longleaf/models/system_config_fields.rb +9 -0
- data/lib/longleaf/preservation_services/file_check_service.rb +59 -0
- data/lib/longleaf/preservation_services/fixity_check_service.rb +124 -0
- data/lib/longleaf/preservation_services/rsync_replication_service.rb +198 -0
- data/lib/longleaf/preservation_services/s3_replication_service.rb +131 -0
- data/lib/longleaf/services/application_config_deserializer.rb +80 -21
- data/lib/longleaf/services/application_config_manager.rb +20 -6
- data/lib/longleaf/services/application_config_validator.rb +19 -9
- data/lib/longleaf/services/configuration_validator.rb +67 -4
- data/lib/longleaf/services/filesystem_location_validator.rb +16 -0
- data/lib/longleaf/services/metadata_deserializer.rb +115 -42
- data/lib/longleaf/services/metadata_persistence_manager.rb +47 -0
- data/lib/longleaf/services/metadata_serializer.rb +139 -25
- data/lib/longleaf/services/metadata_validator.rb +76 -0
- data/lib/longleaf/services/s3_location_validator.rb +19 -0
- data/lib/longleaf/services/service_class_cache.rb +112 -0
- data/lib/longleaf/services/service_definition_manager.rb +10 -7
- data/lib/longleaf/services/service_definition_validator.rb +25 -18
- data/lib/longleaf/services/service_manager.rb +86 -11
- data/lib/longleaf/services/service_mapping_manager.rb +13 -12
- data/lib/longleaf/services/service_mapping_validator.rb +36 -26
- data/lib/longleaf/services/storage_location_manager.rb +76 -15
- data/lib/longleaf/services/storage_location_validator.rb +49 -35
- data/lib/longleaf/specs/config_builder.rb +47 -23
- data/lib/longleaf/specs/config_validator_helpers.rb +16 -0
- data/lib/longleaf/specs/custom_matchers.rb +9 -0
- data/lib/longleaf/specs/file_helpers.rb +61 -0
- data/lib/longleaf/specs/metadata_builder.rb +98 -0
- data/lib/longleaf/specs/system_config_builder.rb +27 -0
- data/lib/longleaf/version.rb +1 -1
- data/longleaf.gemspec +20 -7
- data/mkdocs.yml +21 -0
- metadata +310 -26
- data/.travis.yml +0 -4
- data/lib/longleaf/commands/abstract_command.rb +0 -37
- data/lib/longleaf/services/storage_path_validator.rb +0 -16
@@ -0,0 +1,520 @@
|
|
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
|
+
Module: Longleaf::FileHelpers
|
8
|
+
|
9
|
+
— 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::FileHelpers";
|
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 (F)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Longleaf.html" title="Longleaf (module)">Longleaf</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">FileHelpers</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>Module: Longleaf::FileHelpers
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<dl>
|
80
|
+
<dt>Defined in:</dt>
|
81
|
+
<dd>lib/longleaf/specs/file_helpers.rb</dd>
|
82
|
+
</dl>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<h2>Overview</h2><div class="docstring">
|
87
|
+
<div class="discussion">
|
88
|
+
|
89
|
+
<p>Test helper methods for creating test files</p>
|
90
|
+
|
91
|
+
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
<div class="tags">
|
95
|
+
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<h2>
|
106
|
+
Class Method Summary
|
107
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
108
|
+
</h2>
|
109
|
+
|
110
|
+
<ul class="summary">
|
111
|
+
|
112
|
+
<li class="public ">
|
113
|
+
<span class="summary_signature">
|
114
|
+
|
115
|
+
<a href="#create_test_file-class_method" title="create_test_file (class method)">.<strong>create_test_file</strong>(dir: nil, name: nil, content: 'content') ⇒ Object </a>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
</span>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
130
|
+
|
131
|
+
</li>
|
132
|
+
|
133
|
+
|
134
|
+
<li class="public ">
|
135
|
+
<span class="summary_signature">
|
136
|
+
|
137
|
+
<a href="#create_work_class-class_method" title="create_work_class (class method)">.<strong>create_work_class</strong>(lib_dir, class_name, file_name, module_name, is_applicable, init_body, perform) ⇒ Object </a>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
</span>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
152
|
+
|
153
|
+
</li>
|
154
|
+
|
155
|
+
|
156
|
+
<li class="public ">
|
157
|
+
<span class="summary_signature">
|
158
|
+
|
159
|
+
<a href="#make_test_dir-class_method" title="make_test_dir (class method)">.<strong>make_test_dir</strong>(parent: nil, name: 'dir') ⇒ Object </a>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
</span>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
174
|
+
|
175
|
+
</li>
|
176
|
+
|
177
|
+
|
178
|
+
</ul>
|
179
|
+
|
180
|
+
<h2>
|
181
|
+
Instance Method Summary
|
182
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
183
|
+
</h2>
|
184
|
+
|
185
|
+
<ul class="summary">
|
186
|
+
|
187
|
+
<li class="public ">
|
188
|
+
<span class="summary_signature">
|
189
|
+
|
190
|
+
<a href="#create_test_file-instance_method" title="#create_test_file (instance method)">#<strong>create_test_file</strong>(dir: nil, name: nil, content: 'content') ⇒ Object </a>
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
</span>
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
205
|
+
|
206
|
+
</li>
|
207
|
+
|
208
|
+
|
209
|
+
<li class="public ">
|
210
|
+
<span class="summary_signature">
|
211
|
+
|
212
|
+
<a href="#create_work_class-instance_method" title="#create_work_class (instance method)">#<strong>create_work_class</strong>(lib_dir, class_name, file_name, module_name = nil, is_applicable: true, init_body: "", perform: "") ⇒ Object </a>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
</span>
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
227
|
+
|
228
|
+
</li>
|
229
|
+
|
230
|
+
|
231
|
+
<li class="public ">
|
232
|
+
<span class="summary_signature">
|
233
|
+
|
234
|
+
<a href="#make_test_dir-instance_method" title="#make_test_dir (instance method)">#<strong>make_test_dir</strong>(parent: nil, name: 'dir') ⇒ Object </a>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
</span>
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
249
|
+
|
250
|
+
</li>
|
251
|
+
|
252
|
+
|
253
|
+
</ul>
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
<div id="class_method_details" class="method_details_list">
|
259
|
+
<h2>Class Method Details</h2>
|
260
|
+
|
261
|
+
|
262
|
+
<div class="method_details first">
|
263
|
+
<h3 class="signature first" id="create_test_file-class_method">
|
264
|
+
|
265
|
+
.<strong>create_test_file</strong>(dir: nil, name: nil, content: 'content') ⇒ <tt>Object</tt>
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
</h3><table class="source_code">
|
272
|
+
<tr>
|
273
|
+
<td>
|
274
|
+
<pre class="lines">
|
275
|
+
|
276
|
+
|
277
|
+
25
|
278
|
+
26
|
279
|
+
27
|
280
|
+
28
|
281
|
+
29
|
282
|
+
30
|
283
|
+
31
|
284
|
+
32
|
285
|
+
33
|
286
|
+
34
|
287
|
+
35
|
288
|
+
36
|
289
|
+
37</pre>
|
290
|
+
</td>
|
291
|
+
<td>
|
292
|
+
<pre class="code"><span class="info file"># File 'lib/longleaf/specs/file_helpers.rb', line 25</span>
|
293
|
+
|
294
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create_test_file'>create_test_file</span><span class='lparen'>(</span><span class='label'>dir:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>content:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>content</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
295
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_dir'>dir</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
296
|
+
<span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>test_file</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
297
|
+
<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_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_dir'>dir</span><span class='rparen'>)</span>
|
298
|
+
<span class='id identifier rubyid_file'>file</span> <span class='op'><<</span> <span class='id identifier rubyid_content'>content</span>
|
299
|
+
<span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
|
300
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span>
|
301
|
+
<span class='kw'>else</span>
|
302
|
+
<span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='id identifier rubyid_dir'>dir</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
303
|
+
<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_path'>path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>w</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span> <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
304
|
+
<span class='id identifier rubyid_path'>path</span>
|
305
|
+
<span class='kw'>end</span>
|
306
|
+
<span class='kw'>end</span></pre>
|
307
|
+
</td>
|
308
|
+
</tr>
|
309
|
+
</table>
|
310
|
+
</div>
|
311
|
+
|
312
|
+
<div class="method_details ">
|
313
|
+
<h3 class="signature " id="create_work_class-class_method">
|
314
|
+
|
315
|
+
.<strong>create_work_class</strong>(lib_dir, class_name, file_name, module_name, is_applicable, init_body, perform) ⇒ <tt>Object</tt>
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
</h3><table class="source_code">
|
322
|
+
<tr>
|
323
|
+
<td>
|
324
|
+
<pre class="lines">
|
325
|
+
|
326
|
+
|
327
|
+
43
|
328
|
+
44
|
329
|
+
45
|
330
|
+
46
|
331
|
+
47
|
332
|
+
48
|
333
|
+
49
|
334
|
+
50
|
335
|
+
51
|
336
|
+
52
|
337
|
+
53
|
338
|
+
54
|
339
|
+
55
|
340
|
+
56
|
341
|
+
57
|
342
|
+
58
|
343
|
+
59</pre>
|
344
|
+
</td>
|
345
|
+
<td>
|
346
|
+
<pre class="code"><span class="info file"># File 'lib/longleaf/specs/file_helpers.rb', line 43</span>
|
347
|
+
|
348
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create_work_class'>create_work_class</span><span class='lparen'>(</span><span class='id identifier rubyid_lib_dir'>lib_dir</span><span class='comma'>,</span> <span class='id identifier rubyid_class_name'>class_name</span><span class='comma'>,</span> <span class='id identifier rubyid_file_name'>file_name</span><span class='comma'>,</span> <span class='id identifier rubyid_module_name'>module_name</span><span class='comma'>,</span> <span class='id identifier rubyid_is_applicable'>is_applicable</span><span class='comma'>,</span> <span class='id identifier rubyid_init_body'>init_body</span><span class='comma'>,</span> <span class='id identifier rubyid_perform'>perform</span><span class='rparen'>)</span>
|
349
|
+
<span class='id identifier rubyid_class_contents'>class_contents</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>%Q(</span><span class='tstring_content'>
|
350
|
+
class </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_class_name'>class_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>
|
351
|
+
def initialize(service_def, app_manager)
|
352
|
+
</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_init_body'>init_body</span><span class='embexpr_end'>}</span><span class='tstring_content'>
|
353
|
+
end
|
354
|
+
def perform(file_rec, event)
|
355
|
+
</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_perform'>perform</span><span class='embexpr_end'>}</span><span class='tstring_content'>
|
356
|
+
end
|
357
|
+
def is_applicable?(event)
|
358
|
+
</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_is_applicable'>is_applicable</span><span class='embexpr_end'>}</span><span class='tstring_content'>
|
359
|
+
end
|
360
|
+
end
|
361
|
+
</span><span class='tstring_end'>)</span></span>
|
362
|
+
<span class='id identifier rubyid_class_contents'>class_contents</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>module </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_module_name'>module_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_class_contents'>class_contents</span><span class='embexpr_end'>}</span><span class='tstring_content'>\nend</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_module_name'>module_name</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
363
|
+
<span class='id identifier rubyid_create_test_file'>create_test_file</span><span class='lparen'>(</span><span class='label'>dir:</span> <span class='id identifier rubyid_lib_dir'>lib_dir</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='id identifier rubyid_file_name'>file_name</span><span class='comma'>,</span> <span class='label'>content:</span> <span class='id identifier rubyid_class_contents'>class_contents</span><span class='rparen'>)</span>
|
364
|
+
<span class='kw'>end</span></pre>
|
365
|
+
</td>
|
366
|
+
</tr>
|
367
|
+
</table>
|
368
|
+
</div>
|
369
|
+
|
370
|
+
<div class="method_details ">
|
371
|
+
<h3 class="signature " id="make_test_dir-class_method">
|
372
|
+
|
373
|
+
.<strong>make_test_dir</strong>(parent: nil, name: 'dir') ⇒ <tt>Object</tt>
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
</h3><table class="source_code">
|
380
|
+
<tr>
|
381
|
+
<td>
|
382
|
+
<pre class="lines">
|
383
|
+
|
384
|
+
|
385
|
+
11
|
386
|
+
12
|
387
|
+
13
|
388
|
+
14
|
389
|
+
15
|
390
|
+
16
|
391
|
+
17
|
392
|
+
18
|
393
|
+
19</pre>
|
394
|
+
</td>
|
395
|
+
<td>
|
396
|
+
<pre class="code"><span class="info file"># File 'lib/longleaf/specs/file_helpers.rb', line 11</span>
|
397
|
+
|
398
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_make_test_dir'>make_test_dir</span><span class='lparen'>(</span><span class='label'>parent:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dir</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
399
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_parent'>parent</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
400
|
+
<span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_mktmpdir'>mktmpdir</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
401
|
+
<span class='kw'>else</span>
|
402
|
+
<span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
403
|
+
<span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_mkdir'>mkdir</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
404
|
+
<span class='id identifier rubyid_path'>path</span>
|
405
|
+
<span class='kw'>end</span>
|
406
|
+
<span class='kw'>end</span></pre>
|
407
|
+
</td>
|
408
|
+
</tr>
|
409
|
+
</table>
|
410
|
+
</div>
|
411
|
+
|
412
|
+
</div>
|
413
|
+
|
414
|
+
<div id="instance_method_details" class="method_details_list">
|
415
|
+
<h2>Instance Method Details</h2>
|
416
|
+
|
417
|
+
|
418
|
+
<div class="method_details first">
|
419
|
+
<h3 class="signature first" id="create_test_file-instance_method">
|
420
|
+
|
421
|
+
#<strong>create_test_file</strong>(dir: nil, name: nil, content: 'content') ⇒ <tt>Object</tt>
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
</h3><table class="source_code">
|
428
|
+
<tr>
|
429
|
+
<td>
|
430
|
+
<pre class="lines">
|
431
|
+
|
432
|
+
|
433
|
+
21
|
434
|
+
22
|
435
|
+
23</pre>
|
436
|
+
</td>
|
437
|
+
<td>
|
438
|
+
<pre class="code"><span class="info file"># File 'lib/longleaf/specs/file_helpers.rb', line 21</span>
|
439
|
+
|
440
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_create_test_file'>create_test_file</span><span class='lparen'>(</span><span class='label'>dir:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>content:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>content</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
441
|
+
<span class='const'><span class='object_link'><a href="" title="Longleaf::FileHelpers (module)">FileHelpers</a></span></span><span class='period'>.</span><span class='id identifier rubyid_create_test_file'><span class='object_link'><a href="#create_test_file-class_method" title="Longleaf::FileHelpers.create_test_file (method)">create_test_file</a></span></span><span class='lparen'>(</span><span class='label'>dir:</span> <span class='id identifier rubyid_dir'>dir</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>content:</span> <span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span>
|
442
|
+
<span class='kw'>end</span></pre>
|
443
|
+
</td>
|
444
|
+
</tr>
|
445
|
+
</table>
|
446
|
+
</div>
|
447
|
+
|
448
|
+
<div class="method_details ">
|
449
|
+
<h3 class="signature " id="create_work_class-instance_method">
|
450
|
+
|
451
|
+
#<strong>create_work_class</strong>(lib_dir, class_name, file_name, module_name = nil, is_applicable: true, init_body: "", perform: "") ⇒ <tt>Object</tt>
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
</h3><table class="source_code">
|
458
|
+
<tr>
|
459
|
+
<td>
|
460
|
+
<pre class="lines">
|
461
|
+
|
462
|
+
|
463
|
+
39
|
464
|
+
40
|
465
|
+
41</pre>
|
466
|
+
</td>
|
467
|
+
<td>
|
468
|
+
<pre class="code"><span class="info file"># File 'lib/longleaf/specs/file_helpers.rb', line 39</span>
|
469
|
+
|
470
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_create_work_class'>create_work_class</span><span class='lparen'>(</span><span class='id identifier rubyid_lib_dir'>lib_dir</span><span class='comma'>,</span> <span class='id identifier rubyid_class_name'>class_name</span><span class='comma'>,</span> <span class='id identifier rubyid_file_name'>file_name</span><span class='comma'>,</span> <span class='id identifier rubyid_module_name'>module_name</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>is_applicable:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>init_body:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>perform:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
471
|
+
<span class='const'><span class='object_link'><a href="" title="Longleaf::FileHelpers (module)">FileHelpers</a></span></span><span class='period'>.</span><span class='id identifier rubyid_create_work_class'><span class='object_link'><a href="#create_work_class-class_method" title="Longleaf::FileHelpers.create_work_class (method)">create_work_class</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_lib_dir'>lib_dir</span><span class='comma'>,</span> <span class='id identifier rubyid_class_name'>class_name</span><span class='comma'>,</span> <span class='id identifier rubyid_file_name'>file_name</span><span class='comma'>,</span> <span class='id identifier rubyid_module_name'>module_name</span><span class='comma'>,</span> <span class='id identifier rubyid_is_applicable'>is_applicable</span><span class='comma'>,</span> <span class='id identifier rubyid_init_body'>init_body</span><span class='comma'>,</span> <span class='id identifier rubyid_perform'>perform</span><span class='rparen'>)</span>
|
472
|
+
<span class='kw'>end</span></pre>
|
473
|
+
</td>
|
474
|
+
</tr>
|
475
|
+
</table>
|
476
|
+
</div>
|
477
|
+
|
478
|
+
<div class="method_details ">
|
479
|
+
<h3 class="signature " id="make_test_dir-instance_method">
|
480
|
+
|
481
|
+
#<strong>make_test_dir</strong>(parent: nil, name: 'dir') ⇒ <tt>Object</tt>
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
</h3><table class="source_code">
|
488
|
+
<tr>
|
489
|
+
<td>
|
490
|
+
<pre class="lines">
|
491
|
+
|
492
|
+
|
493
|
+
7
|
494
|
+
8
|
495
|
+
9</pre>
|
496
|
+
</td>
|
497
|
+
<td>
|
498
|
+
<pre class="code"><span class="info file"># File 'lib/longleaf/specs/file_helpers.rb', line 7</span>
|
499
|
+
|
500
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_make_test_dir'>make_test_dir</span><span class='lparen'>(</span><span class='label'>parent:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dir</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
501
|
+
<span class='const'><span class='object_link'><a href="" title="Longleaf::FileHelpers (module)">FileHelpers</a></span></span><span class='period'>.</span><span class='id identifier rubyid_make_test_dir'><span class='object_link'><a href="#make_test_dir-class_method" title="Longleaf::FileHelpers.make_test_dir (method)">make_test_dir</a></span></span><span class='lparen'>(</span><span class='label'>parent:</span> <span class='id identifier rubyid_parent'>parent</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
502
|
+
<span class='kw'>end</span></pre>
|
503
|
+
</td>
|
504
|
+
</tr>
|
505
|
+
</table>
|
506
|
+
</div>
|
507
|
+
|
508
|
+
</div>
|
509
|
+
|
510
|
+
</div>
|
511
|
+
|
512
|
+
<div id="footer">
|
513
|
+
Generated on Tue May 28 15:48:00 2019 by
|
514
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
515
|
+
0.9.19 (ruby-2.6.3).
|
516
|
+
</div>
|
517
|
+
|
518
|
+
</div>
|
519
|
+
</body>
|
520
|
+
</html>
|