class SimpleSlack::CLI

Public Instance Methods

post(channel, text) click to toggle source
# File lib/simple_slack/cli.rb, line 7
def post(channel, text)
  client = SimpleSlack::Client.new
  client.post.channel(to: channel, text: text)
end
rspec(file_name = 'spec/', channel = nil, bundle = true) click to toggle source
# File lib/simple_slack/cli.rb, line 13
def rspec(file_name = 'spec/', channel = nil, bundle = true)
  return 'channel name blank' if channel.nil?
  client = SimpleSlack::Client.new
  if bundle
    text = `bundle exec rspec #{file_name}`
  else
    text = `rspec #{file_name}`
  end
  puts text
  client.post.channel(to: channel, text: text)
end