class DevOops::Commands::EditScriptSh
Public Class Methods
source_root()
click to toggle source
# File lib/dev_oops/commands/edit_script_sh.rb, line 7 def self.source_root "#{File.dirname(__FILE__)}/../../../" end
Public Instance Methods
edit()
click to toggle source
# File lib/dev_oops/commands/edit_script_sh.rb, line 21 def edit script_dir = if options[:global] ScriptsLoader::GLOBAL_DIR else ScriptsLoader.script_dir(script_name) end path = "#{script_dir}/#{script_name}.sh" create_file(path) unless File.exist?(path) FileUtils.chmod(0o750, path) system("#{ENV['EDITOR'] || 'vim'} #{path}") end