Sha256: 1a9cf4178f9f9ae455bfad551c4f6658fcfb35b560bc9006cda84d8be553a491

Contents?: true

Size: 364 Bytes

Versions: 7

Compression:

Stored size: 364 Bytes

Contents

class String
  def strip_text
    split("\n")
    .map{|l| l.strip}
    .join("\n")
  end
end

class Exception
  def desc
    "#{ message } #{ backtrace&.join "\n" }"
  end
end

def log_ex e
  STDERR.puts e.desc
end

def match_root_or_current_user stat
  (stat.uid == 0           and stat.gid == 0) ||
  (stat.uid == Process.uid and stat.gid == Process.gid)
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
con_ssh-0.2.0 lib/con_ssh/core_extensions.rb
con_ssh-0.1.0 lib/con_ssh/core_extensions.rb
con_ssh-0.0.8 lib/con_ssh/core_extensions.rb
con_ssh-0.0.7 lib/con_ssh/core_extensions.rb
con_ssh-0.0.6 lib/con_ssh/core_extensions.rb
con_ssh-0.0.5 lib/con_ssh/core_extensions.rb
con_ssh-0.0.4 lib/con_ssh/core_extensions.rb