Sha256: 309b1bfe0706db10664afbec40536be09290257037c08eb86da74be6f6acc904

Contents?: true

Size: 898 Bytes

Versions: 4

Compression:

Stored size: 898 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

4 entries across 4 versions & 1 rubygems

Version Path
thartm-0.0.23 bin/rrtm
thartm-0.0.22 bin/rrtm
thartm-0.0.21 bin/rrtm
thartm-0.0.20 bin/rrtm