class Object

Public Instance Methods

show_ids_sorted_by_followers(ids) click to toggle source
# File bin/twitter-vanity, line 5
def show_ids_sorted_by_followers(ids)
  users = $client.users(ids)

  users.sort_by { |user|
    -user.followers_count
  }.each do |user|
    printf "%20s %7d followers\n", user.screen_name, user.followers_count
  end
end
usage() click to toggle source
# File lib-internal/common.rb, line 1
def usage
  caller_file = caller_locations.map(&:absolute_path).find { |path| path != __FILE__ }
  lines = File.readlines(caller_file).take_while { |line| line[0] == "#" }
  lines.shift # get rid of the shebang
  lines.map! { |line| line[2..-1] }
  puts lines
end
usage!() click to toggle source
# File lib-internal/common.rb, line 9
def usage!
  usage
  exit false
end