fig 1.21.0 → 1.21.1.beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d6fb010050e5c804acf3af9f5ceae178afb126fd
4
- data.tar.gz: 93efb2bc6db5f828625426a28475d4ef1aae86ab
3
+ metadata.gz: 92694a12f488f9612add81bcd327fc0d20a3d737
4
+ data.tar.gz: 6e63c440c727bf1f5ec5fbe01d17d6b88c65ba7b
5
5
  SHA512:
6
- metadata.gz: 55e4c84950b0e197e39099804d7f5d661b2cb3b69d7f043a31419a34798d53c0fc6741f29bdc7666f8edee4b658a335050333083cab4c0421514c444ff551902
7
- data.tar.gz: 77bad3feeadbfbe9de0faa5dc77efde9d0bf01aa825ec9b6ac68d903b1fc3940306fccb8caf30bfe4dddcd8e5bb04f39c62140507de461560b49e88e2dadc816
6
+ metadata.gz: df1ee56e6af7a3afd428aff6a8d42d1015ddbac0384720ddfa2ad7d67ef26c507672148e0af89d9620bae86afcb90b6132fbe4d967a0464740902e55cf9714f3
7
+ data.tar.gz: c6548fd362610c76c21a8ef5e5b7cea0011aff7a1295f842dbc432f0d8caf18d5c14248ae962e72b6957dd9d451c278c88163672c9867961891cec673291fe7d
data/Changes CHANGED
@@ -1,3 +1,24 @@
1
+ v1.21.1.beta.1 - 2014/11/17
2
+
3
+ Bug fixes:
4
+
5
+ - Republishing a package did not clean out no-longer-extant files from the
6
+ runtime directory.
7
+
8
+ New feature:
9
+
10
+ - New --add synonym for the --append option. A slight fix for the misnomer
11
+ that the latter option is.
12
+
13
+ Miscellaneous:
14
+
15
+ - Include file size in checks for whether a local file is up-to-date for
16
+ copying.
17
+ - Command-line options listing in --options and --help-long output is now
18
+ broken up into sections.
19
+ - Stack trace no longer emitted when releasing repository lock after exec
20
+ error.
21
+
1
22
  v1.21.0 - 2014/10/13
2
23
 
3
24
  Bug fixes:
data/lib/fig.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fig
2
- VERSION = '1.21.0'
2
+ VERSION = '1.21.1.beta.1'
3
3
  end
@@ -165,6 +165,8 @@ class Fig::Command::Options
165
165
  private
166
166
 
167
167
  EXTRA_OPTIONS_DESCRIPTION = <<-'END_DESCRIPTION'
168
+
169
+ Running commands:
168
170
  -- end of Fig options; anything after this is used as a command to run
169
171
  --command-extra-args end of Fig options; anything after this is appended to the end of a
170
172
  "command" statement in a "config" block.
@@ -223,143 +225,110 @@ class Fig::Command::Options
223
225
  set_up_asset_statements()
224
226
  set_up_queries()
225
227
  set_up_program_configuration()
228
+ set_up_help()
226
229
 
227
230
  return
228
231
  end
229
232
 
230
- def set_up_queries()
231
- @parser.on_tail(
232
- '-?', '-h', '--help', 'display short usage summary'
233
- ) do
234
- set_base_action(Fig::Command::Action::Help)
235
- end
236
- @parser.on_tail(
237
- '--help-long', 'display full usage'
238
- ) do
239
- set_base_action(Fig::Command::Action::HelpLong)
240
- end
241
- @parser.on_tail(
242
- '--options', 'just list Fig options'
243
- ) do
244
- set_base_action(Fig::Command::Action::Options)
245
- end
233
+ FILE_OPTION_VALUE_PATTERN =
234
+ %r<
235
+ \A
236
+ (?:
237
+ - # Solely a hyphen, to allow for stdin
238
+ | [^-] .* # or anything not starting with a hyphen.
239
+ )
240
+ \z
241
+ >x
246
242
 
247
- @parser.on_tail('-v', '--version', 'print Fig version') do
248
- set_base_action(Fig::Command::Action::Version)
249
- end
250
- @parser.on_tail(
251
- '--version-plain', 'print Fig version without embellishment (no newline)'
252
- ) do
253
- set_base_action(Fig::Command::Action::VersionPlain)
254
- end
243
+ def set_up_package_definition()
244
+ @parser.separator 'Package definition:'
255
245
 
256
246
  @parser.on(
257
- '-g',
258
- '--get VARIABLE',
247
+ '-c',
248
+ '--config CONFIG',
259
249
  STARTS_WITH_NON_HYPHEN,
260
- 'print value of environment variable VARIABLE'
261
- ) do |variable_to_get|
262
- set_base_action(Fig::Command::Action::Get)
263
- @variable_to_get = variable_to_get
250
+ %q<apply configuration CONFIG, default is "default">
251
+ ) do |config|
252
+ @config = config
264
253
  end
265
254
 
266
- set_up_listings()
267
-
268
255
  @parser.on(
269
- '--source-package FILE',
270
- STARTS_WITH_NON_HYPHEN,
271
- 'print package FILE was retrieved from'
272
- ) do |file_to_find_package_for|
273
- set_base_action(Fig::Command::Action::SourcePackage)
274
- @file_to_find_package_for = file_to_find_package_for
256
+ '--file FILE',
257
+ FILE_OPTION_VALUE_PATTERN,
258
+ %q<read package definition FILE. Use '-' for stdin. See also --no-file>
259
+ ) do |path|
260
+ set_package_definition_file(path)
275
261
  end
276
262
 
277
263
  @parser.on(
278
- '-T', '--dump-package-definition-text',
279
- 'emit the unparsed definition of the base package, if there is one'
264
+ '--no-file', 'ignore package.fig/application.fig file in current directory'
280
265
  ) do
281
- set_base_action(Fig::Command::Action::DumpPackageDefinitionText)
266
+ set_package_definition_file(:none)
282
267
  end
268
+
283
269
  @parser.on(
284
- '--dump-package-definition-parsed',
285
- 'emit the parsed definition of the base package'
270
+ '--suppress-all-includes', %q<don't process include statements>,
286
271
  ) do
287
- set_base_action(Fig::Command::Action::DumpPackageDefinitionParsed)
272
+ set_suppress_includes(:all)
288
273
  end
274
+
289
275
  @parser.on(
290
- '--dump-package-definition-for-command-line',
291
- 'emit the synthetic package for the other options (--set/--archive/etc.)'
276
+ '--suppress-cross-package-includes',
277
+ %q<don't process includes of configs from other packages>,
292
278
  ) do
293
- set_base_action(Fig::Command::Action::DumpPackageDefinitionForCommandLine)
279
+ set_suppress_includes(:cross_package)
294
280
  end
295
281
 
296
282
  return
297
283
  end
298
284
 
299
- def set_up_listings()
300
- option_mapping = {
301
- :local_packages => [
302
- ['--list-local', '--list', 'list packages in $FIG_HOME'],
303
- Fig::Command::Action::ListLocal
304
- ],
305
-
306
- :configs => [
307
- ['--list-configs', 'list configurations'],
308
- Fig::Command::Action::ListConfigs
309
- ],
310
-
311
- :dependencies => [
312
- ['--list-dependencies', 'list package dependencies, recursively'],
313
- Fig::Command::Action::ListDependencies
314
- ],
315
-
316
- :variables => [
317
- [
318
- '--list-variables',
319
- 'list all variables defined/used by package and its dependencies'
320
- ],
321
- Fig::Command::Action::ListVariables
322
- ],
323
-
324
- :remote_packages => [
325
- ['--list-remote', 'list packages in remote repo'],
326
- Fig::Command::Action::ListRemote
327
- ],
328
- }
285
+ def set_up_remote_repository_access()
286
+ @parser.separator ''
287
+ @parser.separator 'Remote repository access:'
329
288
 
330
- option_mapping.each_pair do
331
- | type, specification_action_class |
289
+ @parser.on(
290
+ '-u',
291
+ '--update',
292
+ 'check remote repo for updates, download to $FIG_HOME and process retrieves'
293
+ ) do
294
+ set_update_action(Fig::Command::Action::Update)
295
+ end
332
296
 
333
- specification, action_class = *specification_action_class
334
- @parser.on(*specification) do
335
- set_base_action(action_class)
336
- end
297
+ @parser.on(
298
+ '-m',
299
+ '--update-if-missing',
300
+ 'check remote repo for updates only if package missing from $FIG_HOME'
301
+ ) do
302
+ set_update_action(Fig::Command::Action::UpdateIfMissing)
337
303
  end
338
304
 
339
305
  @parser.on(
340
- '--list-tree', 'for listings, output a tree instead of a list'
306
+ '-R', '--suppress-retrieves',
307
+ %q<don't process retrieves, even if they would otherwise be active>,
341
308
  ) do
342
- @list_tree = true
309
+ @suppress_retrieves = true
343
310
  end
344
311
 
345
312
  @parser.on(
346
- '--graphviz',
347
- 'for listings, output DOT (http://graphviz.org/content/dot-language)'
313
+ '--suppress-cleanup-of-retrieves',
314
+ %q<don't delete files from unreferenced retrieves>,
348
315
  ) do
349
- @graphviz = true
316
+ @suppress_cleanup_of_retrieves = true
350
317
  end
351
318
 
352
319
  @parser.on(
353
- '--list-all-configs',
354
- 'for listings, follow all configurations of the base package'
320
+ '-l', '--login', 'login to FTP repo as a non-anonymous user'
355
321
  ) do
356
- @list_all_configs = true
322
+ @login = true
357
323
  end
358
324
 
359
325
  return
360
326
  end
361
327
 
362
328
  def set_up_commands()
329
+ @parser.separator ''
330
+ @parser.separator 'Commands:'
331
+
363
332
  @parser.on(
364
333
  '--publish', 'install package in $FIG_HOME and in remote repo'
365
334
  ) do |publish|
@@ -409,57 +378,10 @@ class Fig::Command::Options
409
378
  return
410
379
  end
411
380
 
412
- FILE_OPTION_VALUE_PATTERN =
413
- %r<
414
- \A
415
- (?:
416
- - # Solely a hyphen, to allow for stdin
417
- | [^-] .* # or anything not starting with a hyphen.
418
- )
419
- \z
420
- >x
421
-
422
- def set_up_package_definition()
423
- @parser.on(
424
- '-c',
425
- '--config CONFIG',
426
- STARTS_WITH_NON_HYPHEN,
427
- %q<apply configuration CONFIG, default is "default">
428
- ) do |config|
429
- @config = config
430
- end
431
-
432
- @parser.on(
433
- '--file FILE',
434
- FILE_OPTION_VALUE_PATTERN,
435
- %q<read package definition FILE. Use '-' for stdin. See also --no-file>
436
- ) do |path|
437
- set_package_definition_file(path)
438
- end
439
-
440
- @parser.on(
441
- '--no-file', 'ignore package.fig/application.fig file in current directory'
442
- ) do
443
- set_package_definition_file(:none)
444
- end
445
-
446
- @parser.on(
447
- '--suppress-all-includes', %q<don't process include statements>,
448
- ) do
449
- set_suppress_includes(:all)
450
- end
451
-
452
- @parser.on(
453
- '--suppress-cross-package-includes',
454
- %q<don't process includes of configs from other packages>,
455
- ) do
456
- set_suppress_includes(:cross_package)
457
- end
458
-
459
- return
460
- end
461
-
462
381
  def set_up_environment_statements()
382
+ @parser.separator ''
383
+ @parser.separator 'Environment variable statement equivalents:'
384
+
463
385
  @environment_statements = []
464
386
  @parser.on(
465
387
  '-p',
@@ -473,6 +395,17 @@ class Fig::Command::Options
473
395
  @parser.add_argument_description(
474
396
  %w<-p --append>, %q<The value of this option must look like "NAME=VALUE".>
475
397
  )
398
+ @parser.on(
399
+ '--add VARIABLE=VALUE',
400
+ STARTS_WITH_NON_HYPHEN,
401
+ 'prepend VALUE to PATH-like environment variable VARIABLE (synonym for --append)'
402
+ ) do |name_value|
403
+ @environment_statements <<
404
+ new_variable_statement('--add', name_value, Fig::Statement::Path)
405
+ end
406
+ @parser.add_argument_description(
407
+ %w<--add>, %q<The value of this option must look like "NAME=VALUE".>
408
+ )
476
409
 
477
410
  @parser.on(
478
411
  '-s',
@@ -487,6 +420,9 @@ class Fig::Command::Options
487
420
  %w<-s --set>, %q<The value of this option must look like "NAME=VALUE".>
488
421
  )
489
422
 
423
+ @parser.separator ''
424
+ @parser.separator 'Package includes and overrides:'
425
+
490
426
  @parser.on(
491
427
  '-i',
492
428
  '--include DESCRIPTOR',
@@ -551,6 +487,9 @@ class Fig::Command::Options
551
487
  end
552
488
 
553
489
  def set_up_asset_statements()
490
+ @parser.separator ''
491
+ @parser.separator 'Asset statement equivalents:'
492
+
554
493
  @asset_statements = []
555
494
  @parser.on(
556
495
  '--archive PATH',
@@ -573,41 +512,114 @@ class Fig::Command::Options
573
512
  return
574
513
  end
575
514
 
576
- def set_up_remote_repository_access()
515
+ def set_up_queries()
516
+ @parser.separator ''
517
+ @parser.separator 'Querying:'
518
+
577
519
  @parser.on(
578
- '-u',
579
- '--update',
580
- 'check remote repo for updates, download to $FIG_HOME and process retrieves'
581
- ) do
582
- set_update_action(Fig::Command::Action::Update)
520
+ '-g',
521
+ '--get VARIABLE',
522
+ STARTS_WITH_NON_HYPHEN,
523
+ 'print value of environment variable VARIABLE'
524
+ ) do |variable_to_get|
525
+ set_base_action(Fig::Command::Action::Get)
526
+ @variable_to_get = variable_to_get
583
527
  end
584
528
 
585
529
  @parser.on(
586
- '-m',
587
- '--update-if-missing',
588
- 'check remote repo for updates only if package missing from $FIG_HOME'
530
+ '--source-package FILE',
531
+ STARTS_WITH_NON_HYPHEN,
532
+ 'print package FILE was retrieved from'
533
+ ) do |file_to_find_package_for|
534
+ set_base_action(Fig::Command::Action::SourcePackage)
535
+ @file_to_find_package_for = file_to_find_package_for
536
+ end
537
+
538
+ @parser.on(
539
+ '-T', '--dump-package-definition-text',
540
+ 'emit the unparsed definition of the base package, if there is one'
589
541
  ) do
590
- set_update_action(Fig::Command::Action::UpdateIfMissing)
542
+ set_base_action(Fig::Command::Action::DumpPackageDefinitionText)
543
+ end
544
+ @parser.on(
545
+ '--dump-package-definition-parsed',
546
+ 'emit the parsed definition of the base package'
547
+ ) do
548
+ set_base_action(Fig::Command::Action::DumpPackageDefinitionParsed)
549
+ end
550
+ @parser.on(
551
+ '--dump-package-definition-for-command-line',
552
+ 'emit the synthetic package for the other options (--set/--archive/etc.)'
553
+ ) do
554
+ set_base_action(Fig::Command::Action::DumpPackageDefinitionForCommandLine)
555
+ end
556
+
557
+ set_up_listings()
558
+
559
+ return
560
+ end
561
+
562
+ def set_up_listings()
563
+ @parser.separator ''
564
+ @parser.separator 'Listings:'
565
+
566
+ option_mapping = {
567
+ :local_packages => [
568
+ ['--list-local', '--list', 'list packages in $FIG_HOME'],
569
+ Fig::Command::Action::ListLocal
570
+ ],
571
+
572
+ :configs => [
573
+ ['--list-configs', 'list configurations'],
574
+ Fig::Command::Action::ListConfigs
575
+ ],
576
+
577
+ :dependencies => [
578
+ ['--list-dependencies', 'list package dependencies, recursively'],
579
+ Fig::Command::Action::ListDependencies
580
+ ],
581
+
582
+ :variables => [
583
+ [
584
+ '--list-variables',
585
+ 'list all variables defined/used by package and its dependencies'
586
+ ],
587
+ Fig::Command::Action::ListVariables
588
+ ],
589
+
590
+ :remote_packages => [
591
+ ['--list-remote', 'list packages in remote repo'],
592
+ Fig::Command::Action::ListRemote
593
+ ],
594
+ }
595
+
596
+ option_mapping.each_pair do
597
+ | type, specification_action_class |
598
+
599
+ specification, action_class = *specification_action_class
600
+ @parser.on(*specification) do
601
+ set_base_action(action_class)
602
+ end
591
603
  end
592
604
 
593
605
  @parser.on(
594
- '-R', '--suppress-retrieves',
595
- %q<don't process retrieves, even if they would otherwise be active>,
606
+ '--list-tree', 'for listings, output a tree instead of a list'
596
607
  ) do
597
- @suppress_retrieves = true
608
+ @list_tree = true
598
609
  end
599
610
 
600
611
  @parser.on(
601
- '--suppress-cleanup-of-retrieves',
602
- %q<don't delete files from unreferenced retrieves>,
612
+ '--graphviz',
613
+ 'for listings, output DOT (http://graphviz.org/content/dot-language)'
603
614
  ) do
604
- @suppress_cleanup_of_retrieves = true
615
+ @graphviz = true
605
616
  end
606
617
 
607
618
  @parser.on(
608
- '-l', '--login', 'login to FTP repo as a non-anonymous user'
619
+ '--list-all-configs',
620
+ 'for listings, follow all configurations of the base package'
609
621
  ) do
610
- @login = true
622
+ @list_all_configs = true
611
623
  end
612
624
 
613
625
  return
@@ -617,6 +629,9 @@ class Fig::Command::Options
617
629
  LOG_ALIASES = { 'warning' => 'warn' }
618
630
 
619
631
  def set_up_program_configuration()
632
+ @parser.separator ''
633
+ @parser.separator 'Fig configuration:'
634
+
620
635
  @parser.on(
621
636
  '--figrc PATH',
622
637
  STARTS_WITH_NON_HYPHEN,
@@ -684,6 +699,36 @@ class Fig::Command::Options
684
699
  return
685
700
  end
686
701
 
702
+ def set_up_help()
703
+ @parser.separator ''
704
+ @parser.separator 'Help:'
705
+
706
+ @parser.on(
707
+ '-?', '-h', '--help', 'display short usage summary'
708
+ ) do
709
+ set_base_action(Fig::Command::Action::Help)
710
+ end
711
+ @parser.on(
712
+ '--help-long', 'display full usage'
713
+ ) do
714
+ set_base_action(Fig::Command::Action::HelpLong)
715
+ end
716
+ @parser.on(
717
+ '--options', 'just list Fig options'
718
+ ) do
719
+ set_base_action(Fig::Command::Action::Options)
720
+ end
721
+
722
+ @parser.on('-v', '--version', 'print Fig version') do
723
+ set_base_action(Fig::Command::Action::Version)
724
+ end
725
+ @parser.on(
726
+ '--version-plain', 'print Fig version without embellishment (no newline)'
727
+ ) do
728
+ set_base_action(Fig::Command::Action::VersionPlain)
729
+ end
730
+ end
731
+
687
732
  def set_base_action(action_class)
688
733
  action = action_class.new
689
734
  # Help overrides anything.
@@ -28,8 +28,7 @@ Querying:
28
28
 
29
29
  Standard options (represented as "[...]" above):
30
30
  [--update | --update-if-missing]
31
- [--set VARIABLE=VALUE]
32
- [--append VARIABLE=VALUE]
31
+ [--set VARIABLE=VALUE] [--add VARIABLE=VALUE]
33
32
  [--resource PATH] [--archive PATH]
34
33
  [--include DESCRIPTOR] [--include-file PATH:CONFIG]
35
34
  [--override DESCRIPTOR]
@@ -75,8 +74,8 @@ Standard options (represented as "[...]" above):
75
74
  [-u | --update | -m | --update-if-missing]
76
75
  --update-lock-response {wait | fail | ignore}
77
76
 
78
- [{-s | --set} VARIABLE=VALUE]
79
- [{-p | --append} VARIABLE=VALUE]
77
+ [{-s | --set} VARIABLE=VALUE]
78
+ [{-p | --add | --append} VARIABLE=VALUE]
80
79
 
81
80
  [--resource PATH]
82
81
  [--archive PATH]
@@ -164,6 +163,12 @@ Environment variables:
164
163
  return
165
164
  end
166
165
 
166
+ def separator(string)
167
+ @parser.separator string
168
+
169
+ return
170
+ end
171
+
167
172
  def on_tail(*arguments, &block)
168
173
  switch_array = make_switch_array(arguments, block)
169
174
 
@@ -165,7 +165,11 @@ class Fig::OperatingSystem
165
165
  end
166
166
  end
167
167
  else
168
- if ! File.exist?(target) || File.mtime(source) != File.mtime(target)
168
+ if (
169
+ ! File.exist?(target) \
170
+ || File.mtime(source) != File.mtime(target) \
171
+ || File.size(source) != File.size(target)
172
+ )
169
173
  Fig::Logging.info "#{msg} #{target}" if msg
170
174
  FileUtils.mkdir_p(File.dirname(target))
171
175
  FileUtils.cp(source, target)
@@ -62,6 +62,7 @@ class Fig::RepositoryPackagePublisher
62
62
  @operating_system.delete_and_recreate_directory(
63
63
  @local_directory_for_package
64
64
  )
65
+ @operating_system.delete_and_recreate_directory(@runtime_for_package)
65
66
 
66
67
  fig_file = File.join(temp_dir, Fig::Repository::PACKAGE_FILE_IN_REPO)
67
68
  content, published_package =
@@ -12,7 +12,11 @@ class Fig::UpdateLock
12
12
  end
13
13
 
14
14
  def close()
15
- @lock.close
15
+ begin
16
+ @lock.close
17
+ rescue IOError => error
18
+ # Don't care if it's already closed.
19
+ end
16
20
 
17
21
  return
18
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fig
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.21.0
4
+ version: 1.21.1.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Foemmel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-13 00:00:00.000000000 Z
11
+ date: 2014-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -404,9 +404,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
404
404
  version: 1.9.2
405
405
  required_rubygems_version: !ruby/object:Gem::Requirement
406
406
  requirements:
407
- - - ">="
407
+ - - ">"
408
408
  - !ruby/object:Gem::Version
409
- version: '0'
409
+ version: 1.3.1
410
410
  requirements: []
411
411
  rubyforge_project:
412
412
  rubygems_version: 2.2.2