Sha256: 4afc618085ba954bf37c76616892bad152ae34687627940789f36102786c48df

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

#!/usr/bin/env ruby

$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])

require 'twog'
require 'optparse'

help = <<HELP
Twog is a tool to tweet blog posts.

  Configuration is read from your home directory in the file '.twog.yaml'
  
  SAMPLE cong.yaml:
  rss_feed: 'http://url.com/feed.rss'
  consumer_key: 'consumer key'
  consumer_secret: 'consumer secret'
  access_token: 'access token'
  access_secret: 'access secret'
  bitly_username: 'username'
  bitly_api_key: 'api key'
  last_blog_post_tweeted:

HELP

options = {}
opts = OptionParser.new do |opts|
  opts.banner = help

  opts.on("--version", "Display current version") do
    puts "Jekyll " + Twog.version
    exit 0
  end
end

# Read command line options into `options` hash
opts.parse!

# Get args from the command line
case ARGV.size
  when > 0
    puts "Invalid options. Run `twog --help` for assistance."
    exit(1)
end

raise "please run 'rake twog:conf_create' to create the ~/.twog.yaml file" unless File.exists?("#{ENV['HOME']}/.twog.yaml")
conf = YAML.load_file("#{ENV['HOME']}/.twog.yaml")

Twog.run(conf)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twog-0.2.0 bin/twog