Sha256: 9c9f5c120ac42d7bae3c74f7e51a28e7a0eacfcf095c15b4e544af18d8296f70

Contents?: true

Size: 556 Bytes

Versions: 1

Compression:

Stored size: 556 Bytes

Contents

# frozen_string_literal: true

Ego.plugin do |robot|
  robot.can 'execute system commands'

  robot.provide :system do |*args|
    debug 'Running system with arguments %s.', args

    unless Kernel.system(*args) # rubocop:disable Style/IfUnlessModifier
      alert 'Sorry, there was a problem running %s.', args.first
    end
  end

  robot.can 'tell you your login name'

  robot.on(
    /^what(?:'?s| is) my (?:user|login)? ?name/i => 5,
    /^who am I(?: logged in as)?/i => 5
  ) do
    say 'You are currently logged in as:'
    system 'who'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ego-0.6.0 lib/ego/plugins/system.rb