Sha256: 128eb5c8a730f0299174482019e71c03b437f3b4feb4abf3cf85cb5f6a21d4cd
Contents?: true
Size: 801 Bytes
Versions: 3
Compression:
Stored size: 801 Bytes
Contents
require 'open3' module LearnOpen module Adapters class SystemAdapter def self.open_editor(editor, path:) system("#{editor} .") end def self.open_login_shell(shell) exec("#{shell} -l") end def self.watch_dir(dir, action) spawn("while inotifywait -qre create,delete,move,close_write #{dir}; do #{action}; done") end def self.spawn(command, block: false) pid = Process.spawn(command, [:out, :err] => File::NULL) Process.waitpid(pid) if block end def self.run_command(command) system(command) end def self.run_command_with_capture(command) Open3.capture3(command) end def self.change_context_directory(dir) Dir.chdir(dir) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
learn-open-1.2.24 | lib/learn_open/adapters/system_adapter.rb |
learn-open-1.2.23 | lib/learn_open/adapters/system_adapter.rb |
learn-open-1.2.22 | lib/learn_open/adapters/system_adapter.rb |