Sha256: bbff3c49a11a48a9d447e6dcbdec89ae4e66a8899271d753944b5d1c0d55a2cb

Contents?: true

Size: 860 Bytes

Versions: 1

Compression:

Stored size: 860 Bytes

Contents

module Specinfra
  class 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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
specinfra-2.0.0.beta24 lib/specinfra/backend/powershell/command.rb