Class: AIA::ExecutionDirectives
- Inherits:
-
Directive
- Object
- PM::Directive
- Directive
- AIA::ExecutionDirectives
show all
- Defined in:
- lib/aia/directives/execution_directives.rb
Constant Summary
Constants inherited
from Directive
Directive::DIRECTIVE_PREFIX
Instance Method Summary
collapse
Methods inherited from Directive
build_dispatch_block, help
Instance Method Details
#ruby(args, context_manager = nil) ⇒ Object
Also known as:
rb
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/aia/directives/execution_directives.rb', line 8
def ruby(args, context_manager = nil)
ruby_code = args.join(' ')
begin
String(eval(ruby_code))
rescue StandardError => e
<<~ERROR
This ruby code failed: #{ruby_code}
#{e.message}
ERROR
end
end
|
#say(args, context_manager = nil) ⇒ Object
23
24
25
26
|
# File 'lib/aia/directives/execution_directives.rb', line 23
def say(args, context_manager = nil)
system('say', *args)
""
end
|