Sha256: dd8182f2b50a06f6885407c6274be7c34bd1cba6c9d4292b7b528681a0c83098
Contents?: true
Size: 1.12 KB
Versions: 1
Compression:
Stored size: 1.12 KB
Contents
# frozen_string_literal: true module Roro module Configurators class AdventureChooser include Utilities attr_reader :itinerary, :stack, :manifest def initialize @asker = AdventurePicker.new @itinerary = [] @stack = Roro::CLI.catalog_root end def build_itinerary(stack=nil) @manifest ||= [] stack ||= @stack case stack_type(stack) when :storyfile @manifest << stack when :story @manifest += stack_stories(stack) when :stack @manifest += stack_stories(stack) children(stack).each { |c| build_itinerary(c) } when :inflection child = choose_adventure(stack) @itinerary << child if stack_type(child).eql?(:story) build_itinerary(child) end @manifest.uniq! @itinerary.uniq! end def stack_is_alias?(catalog) stack_is_storyfile?(catalog) && !read_yaml(catalog)[:aliased_to].nil? end def choose_adventure(inflection) @asker.choose_adventure(inflection) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
roro-0.3.30 | lib/roro/configurators/adventure_chooser.rb |