Module: TwitterBackup

Defined in:
lib/twitter_backup.rb,
lib/twitter_backup/ui.rb,
lib/twitter_backup/error.rb,
lib/twitter_backup/tweet.rb,
lib/twitter_backup/config.rb,
lib/twitter_backup/version.rb

Defined Under Namespace

Modules: Error, UI Classes: TBConfig, Tweet

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.prepare_file(file) ⇒ Object

Raises:



14
15
16
17
18
19
20
# File 'lib/twitter_backup.rb', line 14

def self.prepare_file file
  file = File.expand_path file
  dir = File.dirname file
  FileUtils.mkdir_p dir unless File.exist? dir
  FileUtils.touch file unless File.exist? file
  raise( Error::InvalidPath, "Can't create file: #{file}" ) unless File.exist?( file )
end