Sha256: 27840b310861e4e018eb5ca7e56cc83d9947c1afeb6913841b0c3fc42f2fe136

Contents?: true

Size: 550 Bytes

Versions: 1

Compression:

Stored size: 550 Bytes

Contents

require "hategra/version"
require "erb"

module Hategra
  unless ARGV[0]
    puts "Please give as arguments Hatena-Notation"
    puts "Ex. [http://instagram.com/p/Y-Q9qvNBbh/:image=http://distilleryimage5.s3.amazonaws.com/781e7932b65511e29a5822000a9f15d4_7.jpg]"
    exit
  end

  root = File.expand_path '../..', __FILE__
  template_path = File.join root, "lib/template.erb"

  template = ERB.new(File.read(template_path))

  urls = ARGV[0].delete("[]").split(":image=")

  system("echo '#{template.result(binding)}' | pbcopy")
  puts "Copied!"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hategra-0.0.3 lib/hategra.rb