/usr/lib/ruby/vendor_ruby/specinfra/backend/powershell/command.rb is in ruby-specinfra 2.66.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | module Specinfra
module Backend
module PowerShell
class Command
attr_reader :import_functions, :script
def initialize &block
@import_functions = []
@script = ""
instance_eval &block if block_given?
end
def using *functions
functions.each { |f| import_functions << f }
end
def exec code
@script = code
end
def convert_regexp(target)
case target
when Regexp
target.source
else
target.to_s.gsub '(^\/|\/$)', ''
end
end
def get_identity id
raise "You must provide a specific Windows user/group" if id =~ /(owner|group|others)/
identity = id || 'Everyone'
end
def to_s
@script
end
end
end
end
end
|