Sha256: 6f4c029973c13ef3d8e0807e8953e5c947da4867d715d076d09c71563e197496

Contents?: true

Size: 739 Bytes

Versions: 5

Compression:

Stored size: 739 Bytes

Contents

# frozen_string_literal: true

module Roro
  module Configurators
    class AdventureWriter < Thor
      include Thor::Actions
      include Utilities

      attr_reader :itinerary, :stack, :manifest

      no_commands do

        def write(buildenv, storyfile)
          @env = buildenv
          actions = read_yaml(storyfile)[:actions]
          unless actions.nil?
            self.source_paths << "#{stack_parent_path(storyfile)}/templates"
            actions.each do |a|
              eval a
            end
          end
        end

        def interpolated_stack_path
          "#{@env[:stack]}/#{@env[:story]}"
        end

        def interpolated_story_name
          "#{@env[:story]}"
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
roro-0.3.28 lib/roro/configurators/adventure_writer.rb
roro-0.3.27 lib/roro/configurators/adventure_writer.rb
roro-0.3.25 lib/roro/configurators/adventure_writer.rb
roro-0.3.24 lib/roro/configurators/adventure_writer.rb
roro-0.3.23 lib/roro/configurators/adventure_writer.rb