Sha256: b0213cbdc323f7edfd524d328ab769fe184d6b1f4c717fc368751b07018e6c14

Contents?: true

Size: 451 Bytes

Versions: 5

Compression:

Stored size: 451 Bytes

Contents

class Options < Struct.new( \
    :data_dir,
    :input_spec,
    :min_episode_num,
    :max_episode_num,
    :no_op,
    :reverse,
    :sleep_interval
)

  DEFAULT_TAPAS_DIR = '~/ruby-tapas'

  def initialize
    super
    self.data_dir ||= DEFAULT_TAPAS_DIR
  end

  # Convert '~' to $HOME if necessary.
  def data_dir=(dir)
    if dir.is_a?(String) && dir[0,2] == '~/'
      dir = File.join(ENV['HOME'], dir[2..-1])
    end
    super(dir)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
get_tapas-0.9.5 lib/get_tapas/options.rb
get_tapas-0.9.4 lib/get_tapas/options.rb
get_tapas-0.9.2 lib/get_tapas/options.rb
get_tapas-0.9.1 lib/get_tapas/options.rb
get_tapas-0.9.0 lib/get_tapas/options.rb