fig 0.2.3 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Changes +36 -0
- data/lib/fig.rb +1 -1
- data/lib/fig/operating_system.rb +15 -10
- data/lib/fig/package.rb +3 -3
- data/lib/fig/repository.rb +117 -56
- data/lib/fig/repository_package_publisher.rb +18 -11
- data/lib/fig/runtime_environment.rb +4 -3
- data/lib/fig/url.rb +3 -1
- metadata +42 -42
data/Changes
CHANGED
@@ -1,3 +1,39 @@
|
|
1
|
+
v0.2.5
|
2
|
+
|
3
|
+
Backwards incompatibilities:
|
4
|
+
|
5
|
+
- The layout of $FIG_HOME has changed in a backwards-incompatible manner (See
|
6
|
+
"Bug fix" section below).
|
7
|
+
|
8
|
+
When run with a local repository created by an earlier version of Fig, Fig
|
9
|
+
will exit with the message
|
10
|
+
|
11
|
+
Local repository is in version 1 format. This version of fig can only
|
12
|
+
deal with repositories in version 2 format. Either point $FIG_HOME to a
|
13
|
+
different location or rename or delete «existing path». (Be mindful of
|
14
|
+
packages that have been published only locally.)
|
15
|
+
|
16
|
+
If you don't have any packages that were were only locally published (i.e.
|
17
|
+
created using the --publish-local option), it should be safe to simply
|
18
|
+
remove the directory and then use the --update or --update-if-missing
|
19
|
+
option to pull packages from the remote repository.
|
20
|
+
|
21
|
+
Any local repository created by this version of Fig will not be readable by
|
22
|
+
earlier versions. Fig v0.1.64 and later will fail with a "Local repository
|
23
|
+
is in version 2 format. This version of fig can only deal with repositories
|
24
|
+
in version 1 format." message when reading a repository created by this
|
25
|
+
version.
|
26
|
+
|
27
|
+
Bug fix:
|
28
|
+
|
29
|
+
- The contents of packages are no longer intermingled with archives used in
|
30
|
+
the packages, meaning that there's a smaller chance of different assets
|
31
|
+
clobbering each other and of packages getting corrupted.
|
32
|
+
|
33
|
+
v0.2.4.beta.1
|
34
|
+
|
35
|
+
- Test release
|
36
|
+
|
1
37
|
v0.2.3
|
2
38
|
|
3
39
|
Backwards incompatibilities:
|
data/lib/fig.rb
CHANGED
data/lib/fig/operating_system.rb
CHANGED
@@ -321,18 +321,18 @@ class Fig::OperatingSystem
|
|
321
321
|
return basename, path
|
322
322
|
end
|
323
323
|
|
324
|
-
def download_and_unpack_archive(url, download_directory)
|
324
|
+
def download_and_unpack_archive(url, download_directory, unpack_directory)
|
325
325
|
basename, path = download_resource(url, download_directory)
|
326
326
|
|
327
327
|
case path
|
328
328
|
when /\.tar\.gz$/
|
329
|
-
unpack_archive(
|
329
|
+
unpack_archive(unpack_directory, path)
|
330
330
|
when /\.tgz$/
|
331
|
-
unpack_archive(
|
331
|
+
unpack_archive(unpack_directory, path)
|
332
332
|
when /\.tar\.bz2$/
|
333
|
-
unpack_archive(
|
333
|
+
unpack_archive(unpack_directory, path)
|
334
334
|
when /\.zip$/
|
335
|
-
unpack_archive(
|
335
|
+
unpack_archive(unpack_directory, path)
|
336
336
|
else
|
337
337
|
Fig::Logging.fatal "Unknown archive type: #{basename}"
|
338
338
|
raise Fig::NetworkError.new("Unknown archive type: #{basename}")
|
@@ -396,7 +396,7 @@ class Fig::OperatingSystem
|
|
396
396
|
end
|
397
397
|
end
|
398
398
|
else
|
399
|
-
if !File.exist?(target) || File.mtime(source) != File.mtime(target)
|
399
|
+
if ! File.exist?(target) || File.mtime(source) != File.mtime(target)
|
400
400
|
log_info "#{msg} #{target}" if msg
|
401
401
|
FileUtils.mkdir_p(File.dirname(target))
|
402
402
|
FileUtils.cp(source, target)
|
@@ -405,8 +405,8 @@ class Fig::OperatingSystem
|
|
405
405
|
end
|
406
406
|
end
|
407
407
|
|
408
|
-
def move_file(
|
409
|
-
Dir.chdir(
|
408
|
+
def move_file(directory, from, to)
|
409
|
+
Dir.chdir(directory) { FileUtils.mv(from, to, :force => true) }
|
410
410
|
end
|
411
411
|
|
412
412
|
def log_info(msg)
|
@@ -442,8 +442,13 @@ class Fig::OperatingSystem
|
|
442
442
|
# .tar.gz
|
443
443
|
# .tgz
|
444
444
|
# .zip
|
445
|
-
def unpack_archive(
|
446
|
-
|
445
|
+
def unpack_archive(directory, file)
|
446
|
+
FileUtils.mkdir_p directory
|
447
|
+
Dir.chdir(directory) do
|
448
|
+
if ! File.exists? file
|
449
|
+
raise Fig::RepositoryError.new "#{file} does not exist."
|
450
|
+
end
|
451
|
+
|
447
452
|
::Archive.read_open_filename(file) do |reader|
|
448
453
|
while entry = reader.next_header
|
449
454
|
begin
|
data/lib/fig/package.rb
CHANGED
@@ -21,16 +21,16 @@ class Fig::Package
|
|
21
21
|
attr_reader :name
|
22
22
|
attr_reader :version
|
23
23
|
attr_reader :description
|
24
|
-
attr_reader :
|
24
|
+
attr_reader :runtime_directory
|
25
25
|
attr_reader :statements
|
26
26
|
attr_accessor :backtrace
|
27
27
|
attr_accessor :unparsed_text
|
28
28
|
|
29
|
-
def initialize(name, version, description,
|
29
|
+
def initialize(name, version, description, runtime_directory, statements)
|
30
30
|
@name = name
|
31
31
|
@version = version
|
32
32
|
@description = description
|
33
|
-
@
|
33
|
+
@runtime_directory = runtime_directory
|
34
34
|
@statements = statements
|
35
35
|
@applied_config_names = []
|
36
36
|
@backtrace = nil
|
data/lib/fig/repository.rb
CHANGED
@@ -20,11 +20,12 @@ module Fig; end
|
|
20
20
|
# Overall management of a repository. Handles local operations itself;
|
21
21
|
# defers remote operations to others.
|
22
22
|
class Fig::Repository
|
23
|
-
METADATA_SUBDIRECTORY
|
24
|
-
PACKAGE_FILE_IN_REPO
|
25
|
-
RESOURCES_FILE
|
26
|
-
VERSION_FILE_NAME
|
27
|
-
|
23
|
+
METADATA_SUBDIRECTORY = '_meta'
|
24
|
+
PACKAGE_FILE_IN_REPO = '.fig'
|
25
|
+
RESOURCES_FILE = 'resources.tar.gz'
|
26
|
+
VERSION_FILE_NAME = 'repository-format-version'
|
27
|
+
LOCAL_VERSION_SUPPORTED = 2
|
28
|
+
REMOTE_VERSION_SUPPORTED = 1
|
28
29
|
|
29
30
|
def initialize(
|
30
31
|
os,
|
@@ -49,13 +50,18 @@ class Fig::Repository
|
|
49
50
|
end
|
50
51
|
|
51
52
|
def list_packages
|
52
|
-
check_local_repository_format
|
53
|
+
check_local_repository_format
|
53
54
|
|
54
55
|
results = []
|
55
|
-
if File.exist?(local_package_directory
|
56
|
-
@operating_system.list(local_package_directory
|
57
|
-
|
56
|
+
if File.exist?(local_package_directory)
|
57
|
+
@operating_system.list(local_package_directory).each do
|
58
|
+
|name|
|
59
|
+
|
60
|
+
@operating_system.list(
|
61
|
+
File.join local_package_directory(), name
|
62
|
+
).each do
|
58
63
|
|version|
|
64
|
+
|
59
65
|
results << Fig::PackageDescriptor.format(name, version, nil)
|
60
66
|
end
|
61
67
|
end
|
@@ -114,7 +120,7 @@ class Fig::Repository
|
|
114
120
|
|
115
121
|
@package_cache.remove_package(descriptor.name, descriptor.version)
|
116
122
|
|
117
|
-
|
123
|
+
nuke_package descriptor
|
118
124
|
|
119
125
|
return
|
120
126
|
end
|
@@ -128,16 +134,19 @@ class Fig::Repository
|
|
128
134
|
end
|
129
135
|
|
130
136
|
publisher = Fig::RepositoryPackagePublisher.new
|
131
|
-
publisher.operating_system
|
132
|
-
publisher.publish_listeners
|
133
|
-
publisher.package_statements
|
134
|
-
publisher.descriptor
|
135
|
-
publisher.source_package
|
136
|
-
publisher.was_forced
|
137
|
-
publisher.base_temp_dir
|
138
|
-
publisher.
|
139
|
-
publisher.
|
140
|
-
|
137
|
+
publisher.operating_system = @operating_system
|
138
|
+
publisher.publish_listeners = @publish_listeners
|
139
|
+
publisher.package_statements = package_statements
|
140
|
+
publisher.descriptor = descriptor
|
141
|
+
publisher.source_package = source_package
|
142
|
+
publisher.was_forced = was_forced
|
143
|
+
publisher.base_temp_dir = base_temp_dir
|
144
|
+
publisher.runtime_for_package = runtime_for_package(descriptor)
|
145
|
+
publisher.local_directory_for_package =
|
146
|
+
local_directory_for_package(descriptor)
|
147
|
+
publisher.remote_directory_for_package =
|
148
|
+
remote_directory_for_package(descriptor)
|
149
|
+
publisher.local_only = local_only
|
141
150
|
publisher.local_fig_file_for_package =
|
142
151
|
local_fig_file_for_package(descriptor)
|
143
152
|
publisher.remote_fig_file_for_package =
|
@@ -161,28 +170,35 @@ class Fig::Repository
|
|
161
170
|
|
162
171
|
version_file = local_version_file()
|
163
172
|
if not File.exist?(version_file)
|
164
|
-
File.open(version_file, 'w') { |handle| handle.write(
|
173
|
+
File.open(version_file, 'w') { |handle| handle.write(LOCAL_VERSION_SUPPORTED) }
|
165
174
|
end
|
166
175
|
|
167
176
|
return
|
168
177
|
end
|
169
178
|
|
170
179
|
def check_local_repository_format()
|
171
|
-
|
180
|
+
version = local_repository_version
|
181
|
+
|
182
|
+
if version != LOCAL_VERSION_SUPPORTED
|
183
|
+
message =
|
184
|
+
"Local repository is in version #{version} format. This version of fig can only deal with repositories in version #{LOCAL_VERSION_SUPPORTED} format."
|
185
|
+
if version < LOCAL_VERSION_SUPPORTED
|
186
|
+
message +=
|
187
|
+
" Either point $FIG_HOME to a different location or rename or delete #{@local_repository_directory}. (Be mindful of packages that have been published only locally.)"
|
188
|
+
end
|
189
|
+
Fig::Logging.fatal message
|
190
|
+
raise Fig::RepositoryError.new
|
191
|
+
end
|
172
192
|
|
173
193
|
return
|
174
194
|
end
|
175
195
|
|
176
196
|
def check_remote_repository_format()
|
177
|
-
|
178
|
-
|
179
|
-
return
|
180
|
-
end
|
197
|
+
version = remote_repository_version
|
181
198
|
|
182
|
-
|
183
|
-
if version != VERSION_SUPPORTED
|
199
|
+
if version != REMOTE_VERSION_SUPPORTED
|
184
200
|
Fig::Logging.fatal \
|
185
|
-
"
|
201
|
+
"Remote repository is in version #{version} format. This version of fig can only deal with repositories in version #{REMOTE_VERSION_SUPPORTED} format."
|
186
202
|
raise Fig::RepositoryError.new
|
187
203
|
end
|
188
204
|
|
@@ -205,7 +221,11 @@ class Fig::Repository
|
|
205
221
|
end
|
206
222
|
|
207
223
|
def local_package_directory()
|
208
|
-
return File.expand_path(File.join(@local_repository_directory, '
|
224
|
+
return File.expand_path(File.join(@local_repository_directory, 'packages'))
|
225
|
+
end
|
226
|
+
|
227
|
+
def package_runtime_directory()
|
228
|
+
return File.expand_path(File.join(@local_repository_directory, 'runtime'))
|
209
229
|
end
|
210
230
|
|
211
231
|
def remote_repository_version()
|
@@ -259,7 +279,7 @@ class Fig::Repository
|
|
259
279
|
end
|
260
280
|
|
261
281
|
def read_local_package(descriptor)
|
262
|
-
directory =
|
282
|
+
directory = local_directory_for_package(descriptor)
|
263
283
|
return read_package_from_directory(directory, descriptor)
|
264
284
|
end
|
265
285
|
|
@@ -283,10 +303,10 @@ class Fig::Repository
|
|
283
303
|
return
|
284
304
|
end
|
285
305
|
|
286
|
-
def install_package(descriptor,
|
287
|
-
remote_fig_file
|
288
|
-
|
289
|
-
local_fig_file
|
306
|
+
def install_package(descriptor, temporary_directory)
|
307
|
+
remote_fig_file = remote_fig_file_for_package(descriptor)
|
308
|
+
package_directory = local_directory_for_package(descriptor)
|
309
|
+
local_fig_file = fig_file_for_package_download(package_directory)
|
290
310
|
|
291
311
|
if @operating_system.path_up_to_date? remote_fig_file, local_fig_file
|
292
312
|
Fig::Logging.debug \
|
@@ -294,41 +314,66 @@ class Fig::Repository
|
|
294
314
|
return
|
295
315
|
end
|
296
316
|
|
297
|
-
|
317
|
+
temporary_package = File.join temporary_directory, 'packages'
|
318
|
+
temporary_runtime = File.join temporary_directory, 'runtime'
|
319
|
+
temp_fig_file = fig_file_for_package_download(temporary_package)
|
298
320
|
|
299
|
-
FileUtils.rm_rf
|
300
|
-
if File.exist?
|
301
|
-
FileUtils.mkdir_p File.dirname(
|
302
|
-
FileUtils.cp_r
|
321
|
+
FileUtils.rm_rf temporary_directory
|
322
|
+
if File.exist? package_directory
|
323
|
+
FileUtils.mkdir_p File.dirname(temporary_package)
|
324
|
+
FileUtils.cp_r(
|
325
|
+
package_directory, temporary_package, :preserve => true
|
326
|
+
)
|
303
327
|
else
|
304
|
-
FileUtils.mkdir_p
|
328
|
+
FileUtils.mkdir_p temporary_package
|
305
329
|
end
|
306
330
|
|
307
331
|
return if ! @operating_system.download(remote_fig_file, temp_fig_file)
|
308
332
|
|
309
|
-
package = read_package_from_directory(
|
333
|
+
package = read_package_from_directory(temporary_package, descriptor)
|
334
|
+
|
335
|
+
remote_package_directory = remote_directory_for_package(descriptor)
|
336
|
+
package.archive_locations.each do
|
337
|
+
|archive_location|
|
310
338
|
|
311
|
-
remote_package_directory = remote_dir_for_package(descriptor)
|
312
|
-
package.archive_locations.each do |archive_location|
|
313
339
|
if not Fig::URL.is_url?(archive_location)
|
314
340
|
archive_location = Fig::URL.append_path_components(
|
315
341
|
remote_package_directory, [archive_location]
|
316
342
|
)
|
317
343
|
end
|
318
|
-
@operating_system.download_and_unpack_archive(
|
344
|
+
@operating_system.download_and_unpack_archive(
|
345
|
+
archive_location, temporary_package, temporary_runtime
|
346
|
+
)
|
319
347
|
end
|
320
|
-
package.resource_locations.each do
|
348
|
+
package.resource_locations.each do
|
349
|
+
|resource_location|
|
350
|
+
|
321
351
|
if not Fig::URL.is_url?(resource_location)
|
322
352
|
resource_location = Fig::URL.append_path_components(
|
323
353
|
remote_package_directory, [resource_location]
|
324
354
|
)
|
325
355
|
end
|
326
|
-
|
356
|
+
|
357
|
+
basename, path =
|
358
|
+
@operating_system.download_resource(
|
359
|
+
resource_location, temporary_package
|
360
|
+
)
|
361
|
+
|
362
|
+
@operating_system.copy path, File.join(temporary_runtime, basename)
|
327
363
|
end
|
328
364
|
|
329
|
-
|
330
|
-
|
331
|
-
FileUtils.
|
365
|
+
nuke_package descriptor
|
366
|
+
|
367
|
+
FileUtils.mkdir_p File.dirname(package_directory)
|
368
|
+
FileUtils.mv temporary_package, package_directory
|
369
|
+
|
370
|
+
runtime_directory = runtime_for_package(descriptor)
|
371
|
+
if File.exists? temporary_runtime
|
372
|
+
FileUtils.mkdir_p File.dirname(runtime_directory)
|
373
|
+
FileUtils.mv temporary_runtime, runtime_directory
|
374
|
+
else
|
375
|
+
FileUtils.mkdir_p runtime_directory
|
376
|
+
end
|
332
377
|
|
333
378
|
return
|
334
379
|
end
|
@@ -358,7 +403,10 @@ class Fig::Repository
|
|
358
403
|
content = File.read(file_name)
|
359
404
|
|
360
405
|
package = @parser.parse_package(
|
361
|
-
descriptor,
|
406
|
+
descriptor,
|
407
|
+
runtime_for_package(descriptor),
|
408
|
+
descriptor.to_string(),
|
409
|
+
content
|
362
410
|
)
|
363
411
|
|
364
412
|
@package_cache.add_package(package)
|
@@ -368,27 +416,33 @@ class Fig::Repository
|
|
368
416
|
|
369
417
|
def remote_fig_file_for_package(descriptor)
|
370
418
|
return Fig::URL.append_path_components(
|
371
|
-
|
419
|
+
remote_directory_for_package(descriptor), [PACKAGE_FILE_IN_REPO]
|
372
420
|
)
|
373
421
|
end
|
374
422
|
|
375
423
|
def local_fig_file_for_package(descriptor)
|
376
|
-
File.join(
|
424
|
+
File.join(local_directory_for_package(descriptor), PACKAGE_FILE_IN_REPO)
|
377
425
|
end
|
378
426
|
|
379
427
|
def fig_file_for_package_download(package_download_dir)
|
380
428
|
File.join(package_download_dir, PACKAGE_FILE_IN_REPO)
|
381
429
|
end
|
382
430
|
|
383
|
-
def
|
431
|
+
def remote_directory_for_package(descriptor)
|
384
432
|
return Fig::URL.append_path_components(
|
385
433
|
remote_repository_url(), [descriptor.name, descriptor.version]
|
386
434
|
)
|
387
435
|
end
|
388
436
|
|
389
|
-
def
|
437
|
+
def local_directory_for_package(descriptor)
|
390
438
|
return File.join(
|
391
|
-
local_package_directory
|
439
|
+
local_package_directory, descriptor.name, descriptor.version
|
440
|
+
)
|
441
|
+
end
|
442
|
+
|
443
|
+
def runtime_for_package(descriptor)
|
444
|
+
return File.join(
|
445
|
+
package_runtime_directory, descriptor.name, descriptor.version
|
392
446
|
)
|
393
447
|
end
|
394
448
|
|
@@ -408,4 +462,11 @@ class Fig::Repository
|
|
408
462
|
def package_missing?(descriptor)
|
409
463
|
not File.exist?(local_fig_file_for_package(descriptor))
|
410
464
|
end
|
465
|
+
|
466
|
+
def nuke_package(descriptor)
|
467
|
+
FileUtils.rm_rf runtime_for_package(descriptor)
|
468
|
+
FileUtils.rm_rf local_directory_for_package(descriptor)
|
469
|
+
|
470
|
+
return
|
471
|
+
end
|
411
472
|
end
|
@@ -30,8 +30,9 @@ class Fig::RepositoryPackagePublisher
|
|
30
30
|
attr_writer :source_package
|
31
31
|
attr_writer :was_forced
|
32
32
|
attr_writer :base_temp_dir
|
33
|
-
attr_writer :
|
34
|
-
attr_writer :
|
33
|
+
attr_writer :runtime_for_package
|
34
|
+
attr_writer :local_directory_for_package
|
35
|
+
attr_writer :remote_directory_for_package
|
35
36
|
attr_writer :local_fig_file_for_package
|
36
37
|
attr_writer :remote_fig_file_for_package
|
37
38
|
attr_writer :local_only
|
@@ -53,7 +54,7 @@ class Fig::RepositoryPackagePublisher
|
|
53
54
|
|
54
55
|
temp_dir = publish_temp_dir()
|
55
56
|
@operating_system.delete_and_recreate_directory(temp_dir)
|
56
|
-
@operating_system.delete_and_recreate_directory(@
|
57
|
+
@operating_system.delete_and_recreate_directory(@local_directory_for_package)
|
57
58
|
|
58
59
|
fig_file = File.join(temp_dir, Fig::Repository::PACKAGE_FILE_IN_REPO)
|
59
60
|
content, published_package = derive_definition_file
|
@@ -123,7 +124,7 @@ class Fig::RepositoryPackagePublisher
|
|
123
124
|
begin
|
124
125
|
published_package = Fig::Parser.new(nil, false).parse_package(
|
125
126
|
@descriptor,
|
126
|
-
@
|
127
|
+
@runtime_for_package,
|
127
128
|
'<package to be published>',
|
128
129
|
file_content
|
129
130
|
)
|
@@ -215,7 +216,7 @@ class Fig::RepositoryPackagePublisher
|
|
215
216
|
if @resource_paths.size > 0
|
216
217
|
check_asset_paths(@resource_paths)
|
217
218
|
|
218
|
-
file = Fig::Repository::RESOURCES_FILE
|
219
|
+
file = File.join publish_temp_dir, Fig::Repository::RESOURCES_FILE
|
219
220
|
@operating_system.create_archive(file, @resource_paths)
|
220
221
|
Fig::AtExit.add { FileUtils.rm_f(file) }
|
221
222
|
|
@@ -247,7 +248,7 @@ class Fig::RepositoryPackagePublisher
|
|
247
248
|
def publish_asset(asset_statement)
|
248
249
|
asset_name = asset_statement.asset_name()
|
249
250
|
asset_remote =
|
250
|
-
Fig::URL.append_path_components @
|
251
|
+
Fig::URL.append_path_components @remote_directory_for_package, [asset_name]
|
251
252
|
|
252
253
|
if Fig::URL.is_url? asset_statement.location
|
253
254
|
asset_local = File.join(publish_temp_dir(), asset_name)
|
@@ -268,10 +269,16 @@ class Fig::RepositoryPackagePublisher
|
|
268
269
|
end
|
269
270
|
|
270
271
|
@operating_system.copy(
|
271
|
-
asset_local, @
|
272
|
+
asset_local, @local_directory_for_package + '/' + asset_name
|
272
273
|
)
|
273
274
|
if asset_statement.is_a?(Fig::Statement::Archive)
|
274
|
-
@operating_system.unpack_archive(
|
275
|
+
@operating_system.unpack_archive(
|
276
|
+
@runtime_for_package, File.absolute_path(asset_local)
|
277
|
+
)
|
278
|
+
else
|
279
|
+
@operating_system.copy(
|
280
|
+
asset_local, @runtime_for_package + '/' + asset_name
|
281
|
+
)
|
275
282
|
end
|
276
283
|
|
277
284
|
return
|
@@ -302,8 +309,8 @@ class Fig::RepositoryPackagePublisher
|
|
302
309
|
publish_information[:was_forced] = @was_forced ? true : false
|
303
310
|
publish_information[:local_only] = @local_only ? true : false
|
304
311
|
|
305
|
-
publish_information[:local_destination] = @
|
306
|
-
publish_information[:remote_destination] = @
|
312
|
+
publish_information[:local_destination] = @local_directory_for_package
|
313
|
+
publish_information[:remote_destination] = @remote_directory_for_package
|
307
314
|
|
308
315
|
@publish_listeners.each do
|
309
316
|
|listener|
|
@@ -352,7 +359,7 @@ class Fig::RepositoryPackagePublisher
|
|
352
359
|
tokenized_value = statement.tokenized_value
|
353
360
|
expansion_happened = false
|
354
361
|
expanded_value = tokenized_value.to_expanded_string {
|
355
|
-
expansion_happened = true; published_package.
|
362
|
+
expansion_happened = true; published_package.runtime_directory
|
356
363
|
}
|
357
364
|
|
358
365
|
if expansion_happened && ! File.exists?(expanded_value) && ! File.symlink?(expanded_value)
|
@@ -346,7 +346,8 @@ class Fig::RuntimeEnvironment
|
|
346
346
|
return tokenized_value.to_expanded_string { '@' } \
|
347
347
|
unless package && package.name
|
348
348
|
|
349
|
-
variable_value =
|
349
|
+
variable_value =
|
350
|
+
tokenized_value.to_expanded_string { package.runtime_directory }
|
350
351
|
|
351
352
|
return variable_value if not @retrieves.member?(statement.name)
|
352
353
|
|
@@ -424,8 +425,8 @@ class Fig::RuntimeEnvironment
|
|
424
425
|
end
|
425
426
|
end
|
426
427
|
|
427
|
-
if package && package.
|
428
|
-
next package.
|
428
|
+
if package && package.runtime_directory
|
429
|
+
next package.runtime_directory
|
429
430
|
end
|
430
431
|
|
431
432
|
next '@'
|
data/lib/fig/url.rb
CHANGED
@@ -8,7 +8,9 @@ module Fig; end
|
|
8
8
|
module Fig::URL
|
9
9
|
# From https://www.rfc-editor.org/rfc/rfc1738.txt
|
10
10
|
def self.is_url?(url)
|
11
|
-
|
11
|
+
# We don't count single-letter "protocols" to allow for Windows drive
|
12
|
+
# letters in paths.
|
13
|
+
return !! ( url =~ %r< \A [a-z0-9+.-]{2,} : >ix )
|
12
14
|
end
|
13
15
|
|
14
16
|
# Encodes components and joins with slashes.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|
16
|
-
requirement: &
|
16
|
+
requirement: &17770220 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.5.8
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *17770220
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: highline
|
27
|
-
requirement: &
|
27
|
+
requirement: &17769520 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.6.2
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *17769520
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: json
|
38
|
-
requirement: &
|
38
|
+
requirement: &17768840 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.6.5
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *17768840
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: libarchive-static
|
49
|
-
requirement: &
|
49
|
+
requirement: &17768160 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.0.0
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *17768160
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: log4r
|
60
|
-
requirement: &
|
60
|
+
requirement: &17831440 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.1.5
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *17831440
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: net-netrc
|
71
|
-
requirement: &
|
71
|
+
requirement: &17830680 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 0.2.2
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *17830680
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: net-sftp
|
82
|
-
requirement: &
|
82
|
+
requirement: &17829940 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 2.0.4
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *17829940
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: net-ssh
|
93
|
-
requirement: &
|
93
|
+
requirement: &17829240 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: 2.0.15
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *17829240
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: rdoc
|
104
|
-
requirement: &
|
104
|
+
requirement: &17828260 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: '3.12'
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *17828260
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: sys-admin
|
115
|
-
requirement: &
|
115
|
+
requirement: &17826460 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: 1.5.6
|
121
121
|
type: :runtime
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *17826460
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: treetop
|
126
|
-
requirement: &
|
126
|
+
requirement: &17825240 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,10 +131,10 @@ dependencies:
|
|
131
131
|
version: 1.4.2
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *17825240
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: open4
|
137
|
-
requirement: &
|
137
|
+
requirement: &17824080 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - ! '>='
|
@@ -142,10 +142,10 @@ dependencies:
|
|
142
142
|
version: 1.0.1
|
143
143
|
type: :development
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *17824080
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
147
|
name: bundler
|
148
|
-
requirement: &
|
148
|
+
requirement: &17823440 !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|
151
151
|
- - ! '>='
|
@@ -153,10 +153,10 @@ dependencies:
|
|
153
153
|
version: 1.0.15
|
154
154
|
type: :development
|
155
155
|
prerelease: false
|
156
|
-
version_requirements: *
|
156
|
+
version_requirements: *17823440
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
158
|
name: rake
|
159
|
-
requirement: &
|
159
|
+
requirement: &17839540 !ruby/object:Gem::Requirement
|
160
160
|
none: false
|
161
161
|
requirements:
|
162
162
|
- - ! '>='
|
@@ -164,10 +164,10 @@ dependencies:
|
|
164
164
|
version: 0.8.7
|
165
165
|
type: :development
|
166
166
|
prerelease: false
|
167
|
-
version_requirements: *
|
167
|
+
version_requirements: *17839540
|
168
168
|
- !ruby/object:Gem::Dependency
|
169
169
|
name: rspec
|
170
|
-
requirement: &
|
170
|
+
requirement: &17838580 !ruby/object:Gem::Requirement
|
171
171
|
none: false
|
172
172
|
requirements:
|
173
173
|
- - ~>
|
@@ -175,10 +175,10 @@ dependencies:
|
|
175
175
|
version: '2'
|
176
176
|
type: :development
|
177
177
|
prerelease: false
|
178
|
-
version_requirements: *
|
178
|
+
version_requirements: *17838580
|
179
179
|
- !ruby/object:Gem::Dependency
|
180
180
|
name: rspec-core
|
181
|
-
requirement: &
|
181
|
+
requirement: &17835700 !ruby/object:Gem::Requirement
|
182
182
|
none: false
|
183
183
|
requirements:
|
184
184
|
- - ! '>='
|
@@ -186,10 +186,10 @@ dependencies:
|
|
186
186
|
version: 2.7.1
|
187
187
|
type: :development
|
188
188
|
prerelease: false
|
189
|
-
version_requirements: *
|
189
|
+
version_requirements: *17835700
|
190
190
|
- !ruby/object:Gem::Dependency
|
191
191
|
name: rspec-expectations
|
192
|
-
requirement: &
|
192
|
+
requirement: &17833380 !ruby/object:Gem::Requirement
|
193
193
|
none: false
|
194
194
|
requirements:
|
195
195
|
- - ! '>='
|
@@ -197,10 +197,10 @@ dependencies:
|
|
197
197
|
version: 2.7.0
|
198
198
|
type: :development
|
199
199
|
prerelease: false
|
200
|
-
version_requirements: *
|
200
|
+
version_requirements: *17833380
|
201
201
|
- !ruby/object:Gem::Dependency
|
202
202
|
name: rspec-mocks
|
203
|
-
requirement: &
|
203
|
+
requirement: &17852720 !ruby/object:Gem::Requirement
|
204
204
|
none: false
|
205
205
|
requirements:
|
206
206
|
- - ! '>='
|
@@ -208,10 +208,10 @@ dependencies:
|
|
208
208
|
version: 2.7.0
|
209
209
|
type: :development
|
210
210
|
prerelease: false
|
211
|
-
version_requirements: *
|
211
|
+
version_requirements: *17852720
|
212
212
|
- !ruby/object:Gem::Dependency
|
213
213
|
name: simplecov
|
214
|
-
requirement: &
|
214
|
+
requirement: &17851120 !ruby/object:Gem::Requirement
|
215
215
|
none: false
|
216
216
|
requirements:
|
217
217
|
- - ! '>='
|
@@ -219,10 +219,10 @@ dependencies:
|
|
219
219
|
version: 0.6.2
|
220
220
|
type: :development
|
221
221
|
prerelease: false
|
222
|
-
version_requirements: *
|
222
|
+
version_requirements: *17851120
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: simplecov-html
|
225
|
-
requirement: &
|
225
|
+
requirement: &17849340 !ruby/object:Gem::Requirement
|
226
226
|
none: false
|
227
227
|
requirements:
|
228
228
|
- - ! '>='
|
@@ -230,7 +230,7 @@ dependencies:
|
|
230
230
|
version: 0.5.3
|
231
231
|
type: :development
|
232
232
|
prerelease: false
|
233
|
-
version_requirements: *
|
233
|
+
version_requirements: *17849340
|
234
234
|
description: Fig is a utility for configuring environments and managing dependencies
|
235
235
|
across a team of developers. Given a list of packages and a command to run, Fig
|
236
236
|
builds environment variables named in those packages (e.g., CLASSPATH), then executes
|