Sha256: bee7fef87fdd931abce2854987f59b4efb3185ef8ea72f9976b18dab5b513543

Contents?: true

Size: 710 Bytes

Versions: 10

Compression:

Stored size: 710 Bytes

Contents

require 'yaml'

module Gamefic::Sdk
  
  class PlotConfig
    attr_reader :author, :title, :script_paths, :media_paths
    def initialize filename = nil
      @script_paths = []
      @media_paths = []
      if !filename.nil?
	      config = YAML.load_file filename
	      base_dir = File.dirname(filename)
	      @author = config['author']
	      @title = config['title']
	      config['script_paths'].each { |p|
	        @script_paths.push File.absolute_path(p, base_dir)
	      } if !config['script_paths'].nil?
	      config['media_paths'].map! { |p|
	        @media_paths.push File.absolute_path(p, base_dir)
	      } if !config['media_paths'].nil?
      end
    end
  end
  
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gamefic-sdk-1.6.0 lib/gamefic-sdk/plot_config.rb
gamefic-sdk-1.5.0 lib/gamefic-sdk/plot_config.rb
gamefic-sdk-1.4.1 lib/gamefic-sdk/plot_config.rb
gamefic-sdk-1.4.0 lib/gamefic-sdk/plot_config.rb
gamefic-sdk-1.3.1 lib/gamefic-sdk/plot_config.rb
gamefic-sdk-1.3.0 lib/gamefic-sdk/plot_config.rb
gamefic-sdk-1.2.0 lib/gamefic-sdk/plot_config.rb
gamefic-sdk-1.1.0 lib/gamefic-sdk/plot_config.rb
gamefic-sdk-1.0.1 lib/gamefic-sdk/plot_config.rb
gamefic-sdk-1.0.0 lib/gamefic-sdk/plot_config.rb