<commit_before>class SlackCommandParser
	attr_accessor :slack_user_id,:text, :toggl_account,:api_instance
  def command(params)
  	@text = params[:text]
  	@slack_user_id = params[:user_id]
  	parse
  end

  def parse
  	command = @text.partition(" ").first
  	if command != 'setup'
  		get_toggle_account
  	end
  	case command
  	when 'setup'
  		parse_setup_command
  	when 'projects'
  		projects
  	when 'status'
  		status
  	when 'start'
  		start
  	else
  		"I don't know that command. :("
  	end
  end

  # /slackl setup <TOGGL API TOKEN>
  def parse_setup_command
	if @text.partition(" ").length != 3
		return "Bad command. Format is: `/slackl setup <TOGGL API TOKEN>`"
	end

	token = @text.partition(" ")[2]

	account = TogglAccount.find_or_create_by(slack_user_id: @slack_user_id)
	account.api_token = token
	account.save
	"Done! The Toggl api token #{account.api_token} is now associated with your Slack account. You can change this at any time by using the same 'setup' command. \n\nTry typing `/slackl projects`"
  end

  def projects
  	response = ''
	toggle_request.my_projects.each do |p|
  		response.push p['name'] << " - " << p['id'].to_s << "\n"
  	end
  	response
  end

  # /slackl status
  def status
  	te = toggle_request.get_current_time_entry
  	if !te
  		return "Timer isn't currently active."
  	end

  	return_t = humanize Time.new.to_i + te['duration']
  	project = false
  	if te['pid']
  		project = getProjectById(te['pid'])
  		return_t << ' - ' << project['name']
  	end
  	if te['description']
  		return_t << ' - ' << te['description']
  	end

  	return return_t;
<commit_msg>Can't push on a string<commit_after>class SlackCommandParser
	attr_accessor :slack_user_id,:text, :toggl_account,:api_instance
  def command(params)
  	@text = params[:text]
  	@slack_user_id = params[:user_id]
  	parse
  end

  def parse
  	command = @text.partition(" ").first
  	if command != 'setup'
  		get_toggle_account
  	end
  	case command
  	when 'setup'
  		parse_setup_command
  	when 'projects'
  		projects
  	when 'status'
  		status
  	when 'start'
  		start
  	else
  		"I don't know that command. :("
  	end
  end

  # /slackl setup <TOGGL API TOKEN>
  def parse_setup_command
	if @text.partition(" ").length != 3
		return "Bad command. Format is: `/slackl setup <TOGGL API TOKEN>`"
	end

	token = @text.partition(" ")[2]

	account = TogglAccount.find_or_create_by(slack_user_id: @slack_user_id)
	account.api_token = token
	account.save
	"Done! The Toggl api token #{account.api_token} is now associated with your Slack account. You can change this at any time by using the same 'setup' command. \n\nTry typing `/slackl projects`"
  end

  def projects
  	response = ''
	toggle_request.my_projects.each do |p|
  		response << p['name'] << " - " << p['id'].to_s << "\n"
  	end
  	response
  end

  # /slackl status
  def status
  	te = toggle_request.get_current_time_entry
  	if !te
  		return "Timer isn't currently active."
  	end

  	return_t = humanize Time.new.to_i + te['duration']
  	project = false
  	if te['pid']
  		project = getProjectById(te['pid'])
  		return_t << ' - ' << project['name']
  	end
  	if te['description']
  		return_t << ' - ' << te['description']
  	end

  	return return_t;

{'fraction_non_alphanumeric': 0.1171754548257786, 'fraction_numerical': 0.0012334258402713536, 'mean_word_length': 3.2184655396618984, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4616612', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1216, 'n_words': 312}