class Settings

Attributes

conf_file[RW]
library[RW]

Public Class Methods

library=(value) click to toggle source
# File lib/popcorn/settings.rb, line 31
def library= (value)
  @library = value
  write_settings(:library => value)
end
write_settings(options={}) click to toggle source
# File lib/popcorn/settings.rb, line 13
def write_settings(options={})
  defaults = { :library => @default_library.to_s }
  options = defaults.merge(options)
  puts "Writing file."
  @conf_file.open("w") do |f|
    config = { :popcorn => options }
    f.write(config.to_yaml)
  end
  FileUtils.mkdir_p(Pathname(options[:library]).expand_path.to_s)
end