roro 0.3.27 → 0.3.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fca977ddce6ff695738dee841a235d4f1fe753b10d72cf0680b97448a42a2190
4
- data.tar.gz: 66cb772f603fed68743466db5203a34ddd87584ef3b5bb6602a7a7663a0d57d6
3
+ metadata.gz: 19be35517b076c033f63af8c5ce2663976a44c0985ae01e2b385a1e3185ace88
4
+ data.tar.gz: 363daa801e5edbbb26457cd10dd595a136651354e92a013501d480686e4a372a
5
5
  SHA512:
6
- metadata.gz: 25d819fbd99f1acf538abe9c5c981d19b3d08f392449a9da70ab283b5ea332a194517ee64fdddc20b3168e8587997e86731524b75089e7e8c939feb86ab3de0b
7
- data.tar.gz: d8acf64e6d89fddf3f67b6c31d217ef887c5a24b509ca5aec57aaf4cd3e96097aa40e302e0eb48e716073e5ede91a89f714dcb59e78adf13a751c221ca862235
6
+ metadata.gz: 0a7d48d17152790425c6eb85a18373dca236adb2b9535f41ac32fbb152eb1bcccf6be260bd343a0c52fc8914edf40044bb2e49f5fbd3a7c358a7df8960faf2d5
7
+ data.tar.gz: 3d34abd1258190792277d4e0a3fb8ddef2cf33aecc48d46d766a8aae411713ce232ee666ffef8b2c834cf73b4400f884530503aa6ed69f992d2fd9964623038f
data/lib/roro/cli.rb CHANGED
@@ -38,6 +38,10 @@ module Roro
38
38
  %w[base development production test staging ci]
39
39
  end
40
40
 
41
+ def self.stack_documentation_root
42
+ '<a href="url">link text</a>'
43
+ end
44
+
41
45
  def self.roro_default_containers
42
46
  %w[backend database frontend]
43
47
  end
@@ -10,6 +10,8 @@ module Roro
10
10
  no_commands do
11
11
  def choose_adventure(stack)
12
12
  build_inflection(stack)
13
+ say("Rolling story on from stack: #{@stack}\n\n")
14
+ say(@getsome)
13
15
  choice = ask(@inflection)
14
16
  story_name = story_from(choice.to_s)
15
17
  "#{stack}/#{story_name}"
@@ -20,7 +22,8 @@ module Roro
20
22
  prompt = inflection_prompt
21
23
  options = inflection_options
22
24
  prompt_options = humanize(options)
23
- @inflection = ["#{prompt} #{prompt_options}", limited_to: options.keys]
25
+ @getsome = "#{prompt}\n"
26
+ @inflection = ["#{prompt_options}\n\n", "Choices: [#{set_color(options.keys.map { |k| k.to_i }.join(' '), :blue)}]"]
24
27
  end
25
28
 
26
29
  def inflection_prompt
@@ -45,9 +48,9 @@ module Roro
45
48
  array = []
46
49
  hash.map do |key, value|
47
50
  preface = get_story_preface("#{@stack}/#{value}")
48
- array << "\n(#{key}) #{value}:\n #{preface}"
51
+ array << "#{set_color("(#{key})", :bold)} #{set_color(value, :blue, :bold)}\n\s\s\s\s#{preface}"
49
52
  end
50
- array.join
53
+ array.join("\n\n")
51
54
  end
52
55
 
53
56
  def get_story_preface(story)
@@ -50,8 +50,8 @@ module Roro
50
50
 
51
51
  def override_environment_variables
52
52
  @env.each do |e, v| v.each do |k, v|
53
- answer = @asker.confirm_default(@builder.override(e, k, v))
54
- v[:value] = answer unless answer.eql?('y')
53
+ answer = @asker.confirm_default(@builder.override(e, k, v), v)
54
+ answer.eql?('') ? return : v[:value] = answer
55
55
  end
56
56
  end
57
57
  end
@@ -13,15 +13,21 @@ module Roro
13
13
  answer.size > 1 ? answer : override_default(question)
14
14
  end
15
15
 
16
- def confirm_default(question)
17
- options = { "y": "yes", "n": "no"}
16
+ def confirm_default(question, default)
17
+ options = { "y": "yes", "n": "no", 'a': 'accept all defaults'}
18
18
  humanized_options = options.map {|key, value|
19
19
  "(#{key}) #{value}"
20
20
  }
21
21
  getsome = "Would you like to accept the default value?\n"
22
22
  prompt = [question, getsome, humanized_options, "\n"].join("\n")
23
- answer = ask(prompt, limited_to: options.keys.map(&:to_s))
24
- answer.eql?('n') ? override_default(question) : 'y'
23
+ case ask(prompt)
24
+ when 'y'
25
+ default
26
+ when 'n'
27
+ override_default(question)
28
+ when 'a'
29
+ ''
30
+ end
25
31
  end
26
32
  end
27
33
  end
@@ -7,7 +7,7 @@ describe 'okonomi roll_your_own' do
7
7
 
8
8
  Given(:rollon) {
9
9
  stub_adventure
10
- stub_overrides
10
+ # stub_overrides
11
11
  stub_run_actions
12
12
  cli.rollon
13
13
  }
@@ -19,15 +19,20 @@ describe 'okonomi roll_your_own' do
19
19
  # quiet { rollon }
20
20
  }
21
21
 
22
+ describe 'testing cli ask and say' do
23
+ Given(:adventures) { %w[] }
24
+
25
+ Then { }
26
+ end
22
27
  describe 'must generate' do
23
28
  describe 'templates with stage one' do
24
- # Then { assert_file 'mise/stacks/my_story/templates/stage_one/.keep' }
29
+ Then { assert_file 'mise/stacks/my_story/templates/stage_one/.keep' }
25
30
  end
26
31
 
27
32
  describe 'test' do
28
33
  describe 'with stage one' do
29
34
  describe 'with stage dummy' do
30
- # Then { assert_file 'mise/stacks/my_story/test/stage_one/stage_dummy/.keep' }
35
+ Then { assert_file 'mise/stacks/my_story/test/stage_one/stage_dummy/.keep' }
31
36
  end
32
37
  end
33
38
  end
data/lib/roro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Roro
2
- VERSION = "0.3.27"
2
+ VERSION = "0.3.28"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.27
4
+ version: 0.3.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - schadenfred
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-23 00:00:00.000000000 Z
11
+ date: 2021-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem-release
@@ -358,7 +358,7 @@ files:
358
358
  - lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/test/stage_one/stage_dummy/.keep
359
359
  - lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/test/stage_one/stage_test.rb
360
360
  - lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/wordpress.yml
361
- - lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/fatsufodo.yml
361
+ - lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/sashimi.yml
362
362
  - lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/django.yml
363
363
  - lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/templates/stage_one/Dockerfile.tt
364
364
  - lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/templates/stage_one/docker-compose.yml.tt