1
2
3
4
5
6
7
8
9
10
11
12
13
  author = "#{`niutil -readprop / "/users/$USER" realname`.chomp} (#{ENV['USER']})"
  ext = File.extname(ENV['TM_FILENAME'].to_s).sub(/\A\./, '')

  print %x{
    curl http://pastie.caboo.se/pastes/create \
      -s -L -o /dev/null -w "%{url_effective}" \
      -H "Expect:" \
      -F "paste[parser]=plaintext" \
      -F "paste[display_name]=#{author}" \
      -F "paste[file_extension]=#{ext}" \
      -F "paste[body]=<#{text_file}" \
      -F "paste[textmate_html]=<#{html_file}"
  }