cl-magic 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cl/magic/cl-dk +38 -40
- data/lib/cl/magic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9f83478d5c0be3f555396d8274a2c4ed7e275130f8068236d8bc9a2775bc30e
|
4
|
+
data.tar.gz: d48e33ed2be7ccc8e83c36edf86ef622e0668cc911b9d50cc5e8c5fb6c039614
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7849ce794132e7111a17091b51b27e1b991e74f5ab2666f831152199da79baa8c683d005ceb9018a8fb48d9d7c5530e8e4c603b38272f7df32316dfc744c19b7
|
7
|
+
data.tar.gz: faab04d8e3c91b302d35b5e89f558326eabf1aabd6648d22d08bc9c38d66bba3aab2b01cb7a50b13c7f20a8719cb48b894078147b6b0dd7c09eeab5ac5cb1378
|
data/Gemfile.lock
CHANGED
data/lib/cl/magic/cl-dk
CHANGED
@@ -151,16 +151,11 @@ def print_set_world_help()
|
|
151
151
|
puts ""
|
152
152
|
end
|
153
153
|
|
154
|
-
def
|
154
|
+
def print_set_parts_help()
|
155
155
|
puts ""
|
156
|
-
puts "Usage: dk [DK_PARTS]
|
156
|
+
puts "Usage: dk [DK_PARTS] set-parts"
|
157
157
|
puts ""
|
158
|
-
puts "
|
159
|
-
puts ""
|
160
|
-
puts "Parts:"
|
161
|
-
dk_parts_hash.keys.each do |key|
|
162
|
-
print_dk_help_line(key, dk_parts_hash[key].fetch('help'))
|
163
|
-
end
|
158
|
+
puts "Set parts for a project and apply to every 'dk' command"
|
164
159
|
puts ""
|
165
160
|
end
|
166
161
|
|
@@ -360,23 +355,25 @@ def run_dk_set_context()
|
|
360
355
|
end
|
361
356
|
|
362
357
|
#
|
363
|
-
# Run:
|
358
|
+
# Run: SET PARTS
|
364
359
|
#
|
365
360
|
|
366
|
-
def
|
361
|
+
def run_dk_set_parts()
|
362
|
+
parts = ARGV[1..]
|
367
363
|
filepath = get_save_parts_filepath()
|
368
|
-
if
|
364
|
+
if parts.any?
|
369
365
|
tempfile = File.new(filepath, 'w')
|
370
|
-
tempfile.write(
|
366
|
+
tempfile.write(ARGV[1..].to_yaml) # write it to the tempfile
|
371
367
|
tempfile.close
|
372
368
|
else
|
373
369
|
if File.exist?(filepath)
|
374
370
|
File.delete(filepath)
|
375
371
|
@logger.info "parts cleared"
|
376
372
|
else
|
377
|
-
|
373
|
+
print_set_parts_help()
|
378
374
|
end
|
379
375
|
end
|
376
|
+
exit
|
380
377
|
end
|
381
378
|
|
382
379
|
#
|
@@ -458,37 +455,38 @@ end
|
|
458
455
|
|
459
456
|
@working_dir = ENV['CL_WORKING_DIR'] # passed through cl-magic to here
|
460
457
|
|
461
|
-
#
|
458
|
+
# SET commands first
|
462
459
|
case ARGV.first
|
463
460
|
when "set-world"
|
464
461
|
run_dk_set_world()
|
465
462
|
when "set-context"
|
466
463
|
run_dk_set_context()
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
464
|
+
when "set-parts"
|
465
|
+
run_dk_set_parts()
|
466
|
+
else
|
467
|
+
|
468
|
+
# get compose settings
|
469
|
+
compose_hash = get_base_compose_hash()
|
470
|
+
if compose_hash
|
471
|
+
|
472
|
+
# world
|
473
|
+
compose_hash = merge_world_files(compose_hash, show_help=ARGV.include?("--help"))
|
474
|
+
|
475
|
+
# x-dk fragments
|
476
|
+
dk_parts_hash = compose_hash['x-dk-parts'] ? compose_hash.delete('x-dk-parts') : {}
|
477
|
+
dk_make_hash = compose_hash['x-dk-make'] ? compose_hash.delete('x-dk-make') : {}
|
478
|
+
|
479
|
+
# parts
|
480
|
+
saved_part_keys = get_saved_parts(dk_parts_hash)
|
481
|
+
compose_args, selected_part_keys = merge_parts_save_and_prep_args(compose_hash, dk_parts_hash, dk_make_hash, saved_part_keys)
|
482
|
+
|
483
|
+
# sub-command
|
484
|
+
case compose_args[2]
|
485
|
+
when "make"
|
486
|
+
all_part_keys = selected_part_keys + saved_part_keys
|
487
|
+
run_dk_make(compose_args, dk_make_hash, dk_parts_hash, all_part_keys)
|
488
|
+
else
|
489
|
+
run_dk(compose_args)
|
490
|
+
end
|
493
491
|
end
|
494
492
|
end
|
data/lib/cl/magic/version.rb
CHANGED