Sha256: 748b0b6db9020b5e8c2cc69d7db0fd7f32913989bfd2f1ac3f9cca12856301f4

Contents?: true

Size: 1.36 KB

Versions: 1

Compression:

Stored size: 1.36 KB

Contents

#!/usr/bin/env ruby

require 'slackdo'

config = Slackdo::Config.new
config.configure_init

banner = <<-EOS
Usage: slackdo [options] 
Where [options] are: 
   - configure <subcommand> \t| slack, trello
   - category <subcommand> \t| add, remove
   - label <subcommand> \t| add, remove
   - disable <subcommand> \t| trello
   - enable <subcommand> \t| trello
   - task
   - reminder
EOS

case ARGV[0]
	when 'help', '-h', '--help'
	  puts banner
	when 'configure'
	  config.configure_slack_webhook if ARGV[1] == 'slack'
	  config.configure_trello_api if ARGV[1] == 'trello' && ARGV[2].nil?
	when 'category'
	  config.add_category if ARGV[1] == 'add'
	  config.remove_category if ARGV[1] == 'remove'
	when 'label'
	  config.add_label if ARGV[1] == 'add'
	  config.remove_label if ARGV[1] == 'remove'
	when 'disable'
	  config.disable_trello if ARGV[1] == 'trello'
	when 'enable'
      config.enable_trello if ARGV[1] == 'trello'
	when 'task'
	  slack = Slackdo::Task.new
      slack.add_task
	  file = File.read("#{ENV['HOME']}/.slackdo/config.json")
      hash = JSON.parse(file)
	  if hash['allow_trello_pushing'] == 'true'
		card_name = slack.get_message
		card_desc = slack.get_notes
		card_category = slack.get_category
		trello = Slackdo::Card.new
	    trello.add_card(card_category, card_name, card_desc)
	  end
	when 'reminder'
	  slack = Slackdo::Reminder.new
	  slack.add_reminder
    end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slackdo-0.4.1 bin/slackdo