Sha256: 545e9c0e0fbaf1bee3ada9544ee6e091d3fa48de4f0c70b2b45388ca84355535
Contents?: true
Size: 657 Bytes
Versions: 18
Compression:
Stored size: 657 Bytes
Contents
require 'rush/shell' module Rush # This is a class that can be embedded in other applications # rake tasks, utility scripts, etc # # Delegates unknown method calls to a Rush::Shell instance class EmbeddableShell attr_accessor :shell def initialize(suppress_output = true) self.shell = Rush::Shell.new shell.suppress_output = suppress_output end # evalutes and unkown method call agains the rush shell def method_missing(sym, *args, &block) shell.execute sym.to_s $last_res end # take a whole block and execute it as if it were inside a shell def execute_in_shell(&block) self.instance_eval(&block) end end end
Version data entries
18 entries across 18 versions & 3 rubygems