sanctuary 0.1.9 → 0.1.10

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
  SHA256:
3
- metadata.gz: d0c5f2e7bf276632aea9ba2716f7cfb904ecfc037f2372fc293bdccb16417381
4
- data.tar.gz: d3b02c6acd164a6cf0c89d7e7c566fbebf1fa2f170872daae7923297b6f83664
3
+ metadata.gz: 90ba10ddc4f20c59327de5281997944aad091dda73e207b63fbf0833a10e99df
4
+ data.tar.gz: 2b36c0b8ac9e525e750b2d99e54442a8ee3e006434548ceca9cfaa2209bd02cd
5
5
  SHA512:
6
- metadata.gz: 8d5432a7341870e4f70103095f51fceab8af50d91457977b24a63aea04d6243bcbc087fda8acde462318dfdc4f191db9d4e9d71cad76d4e988ff53a268d628f0
7
- data.tar.gz: 57260d85aba0a7778057822490242a9719981ab2a0a55d3e36186ba781db8f22320a1236d18161607456149f3a9ff9cd783b599a429bb4043d934609cc473e14
6
+ metadata.gz: 6fffe3aab3ae82db3ebe1eee3ce68066889bbbe87b0e241885e6c9e5731d908a4fea322bd52294135682ae67c3202125afaabb19f42e0ef1ac68461c817b6fb1
7
+ data.tar.gz: ab6e426fc0aa1820de3f9c6ed916cb329dfecf254a74c2838d6ba24ee9f258538b368011fcb010c70692e3db11aeef8a7aeb8bd28e0b2726b78e65f50f134cef
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sanctuary (0.1.8)
4
+ sanctuary (0.1.9)
5
5
  thor (~> 0.2)
6
6
  tty-prompt (~> 0.0)
7
7
 
data/lib/sanctuary/cli.rb CHANGED
@@ -5,11 +5,18 @@ require_relative "reader"
5
5
  module Sanctuary
6
6
  class CLI
7
7
  def self.start
8
- result = present_choices
9
- if ARGV.include?("-p")
10
- Generator.start([result[1..-1], ARGV.last])
8
+ if ARGV.include?("-m")
9
+ results = multi_select
10
+ results.each do |result|
11
+ Generator.start([result[1..-1], ''])
12
+ end
11
13
  else
12
- Generator.start([result[1..-1], ''])
14
+ result = present_choices
15
+ if ARGV.include?("-p")
16
+ Generator.start([result[1..-1], ARGV.last])
17
+ else
18
+ Generator.start([result[1..-1], ''])
19
+ end
13
20
  end
14
21
  end
15
22
 
@@ -24,5 +31,18 @@ module Sanctuary
24
31
  end
25
32
  return path + "/" + prompt_choice
26
33
  end
34
+
35
+ def self.multi_select(path = "")
36
+ choices = Reader.read_templates(path)[2..-1].sort
37
+ prompt = TTY::Prompt.new
38
+ prompt_choices = prompt.multi_select("Select a templates", choices)
39
+ if Reader.directory?(prompt_choices[0])
40
+ return multi_select(path + "/" + prompt_choices[0])
41
+ end
42
+
43
+ prompt_choices.map do |choice|
44
+ path + "/" + choice
45
+ end
46
+ end
27
47
  end
28
48
  end
@@ -1,3 +1,3 @@
1
1
  module Sanctuary
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sanctuary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin-Kawai