lib/slackdo.rb in slackdo-0.3.0 vs lib/slackdo.rb in slackdo-0.3.1

- old
+ new

@@ -20,9 +20,27 @@ File.open("#{ENV['HOME']}/.slackdo/config.json",'w') do |f| f.write(hash.to_json) end end end + def enable_trello + file = File.read("#{ENV['HOME']}/.slackdo/config.json") + hash = JSON.parse(file) + hash["allow_trello_pushing"] = "true" + File.open("#{ENV['HOME']}/.slackdo/config.json",'w') do |f| + f.write(hash.to_json) + end + puts 'Trello has been enabled...' + end + def disable_trello + file = File.read("#{ENV['HOME']}/.slackdo/config.json") + hash = JSON.parse(file) + hash["allow_trello_pushing"] = "false" + File.open("#{ENV['HOME']}/.slackdo/config.json",'w') do |f| + f.write(hash.to_json) + end + puts 'Trello has been disabled...' + end def configure_trello_api cli = HighLine.new file = File.read("#{ENV['HOME']}/.slackdo/config.json") hash = JSON.parse(file) public_key = cli.ask 'What is your Trello public key?'.strip