Class: RunShell::Shell
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- RunShell::Shell
- Defined in:
- lib/run_shell/shell.rb
Class Method Summary collapse
-
.run ⇒ Object
attr_accessible :whodunnit, :file_path, :content, :result.
Class Method Details
.run ⇒ Object
attr_accessible :whodunnit, :file_path, :content, :result
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/run_shell/shell.rb', line 5 def self.run if File.exists?(RunShell.config.shell_path) content = File.read(RunShell.config.shell_path) result = system content shell = Shell.new(file_path:RunShell.config.shell_path, content:content, result:result, whodunnit:RunShell.whodunnit) shell.save end if !RunShell.config.shell_command.blank? content = RunShell.config.shell_command result = system content shell = Shell.new(content:content, result:result, whodunnit:RunShell.whodunnit) shell.save end end |