Sha256: 2507980cce52ad811c8fad19bbba0ed4e94dda2d1926328f577443d02d2bb565

Contents?: true

Size: 897 Bytes

Versions: 3

Compression:

Stored size: 897 Bytes

Contents

#!/usr/bin/ruby
require File.dirname(__FILE__) + '/../lib/thartm.rb'

CONFIGFILE = File.join(File.expand_path(ENV['HOME']), '.rtm')
begin
	@@config = YAML.load_file(CONFIGFILE)
rescue
	raise "please create a .rtm file in your $HOME"
end


ENV['TZ'] = @@config['tz']

# validating token
unless @@config['token']
		@rtm = ThaRememberTheMilk.new(@@config['key'],@@config['secret'])
		puts "please authorize this program: open the following url and puts the frob value back here."
		puts @rtm.auth_url
		frob = gets

		auth = @rtm.auth.getToken('frob' => frob.chomp)
		token_file = File.open(CONFIGFILE,"+w")
		token_file << "token: " + auth.token

		puts "restart the program now"
		exit
end


cli = CommandLineInterface.new(@@config['key'],@@config['secret'],@@config['token'])
if ARGV[0]
begin
	cli.send ARGV[0] 
rescue
	puts "command #{ARGV[0]} is not available"
	cli.help
end
else
	cli.tasks
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
thartm-0.0.18 bin/rrtm
thartm-0.0.16 bin/rrtm
thartm-0.0.15 bin/rrtm