Module: Meer::Datameer::Session

Defined in:
lib/meer/datameer.rb

Constant Summary collapse

SESSION_FILE =
File.expand_path('~/.dmsession')

Class Method Summary collapse

Class Method Details

.loadObject



84
85
86
# File 'lib/meer/datameer.rb', line 84

def self.load
  File.read(SESSION_FILE) if File.exist?(SESSION_FILE)
end

.set(cookie) ⇒ Object



78
79
80
81
82
# File 'lib/meer/datameer.rb', line 78

def self.set(cookie)
  FileUtils.rm_f SESSION_FILE
  File.open(SESSION_FILE, 'w') { |f| f.puts cookie }
  File.chmod(0400, SESSION_FILE)
end