module TweetWatch::Utils

Public Instance Methods

escape_str(str) click to toggle source
# File lib/tweet_watch/utils.rb, line 12
def escape_str(str)
  str2 = str.gsub('"', '\"')
  str2.gsub(/\\(.)/) do |s|
    case $1
    when "n"
      "\n"
    when "t"
      "\t"
    else
      $1
    end
  end      
end
load_config(options) click to toggle source
# File lib/tweet_watch/utils.rb, line 4
def load_config(options)
  if options[:config_file]
    TweetWatch.config.load_from_path(options[:config_file])
  else
    TweetWatch.config.load_from_path("config.yml")
  end
end
print_dm(tw) click to toggle source
print_tweet(tw) click to toggle source