Sha256: 5e6124484b62974369224797912b72fab0b96431537c1c5031be0c67f8811801

Contents?: true

Size: 869 Bytes

Versions: 132

Compression:

Stored size: 869 Bytes

Contents

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

Version data entries

132 entries across 132 versions & 2 rubygems

Version Path
specinfra-2.82.4 lib/specinfra/backend/powershell/command.rb
specinfra-2.82.3 lib/specinfra/backend/powershell/command.rb
specinfra-2.82.2 lib/specinfra/backend/powershell/command.rb
specinfra-2.82.1 lib/specinfra/backend/powershell/command.rb
specinfra-2.82.0 lib/specinfra/backend/powershell/command.rb
specinfra-2.81.0 lib/specinfra/backend/powershell/command.rb
specinfra-2.80.0 lib/specinfra/backend/powershell/command.rb
specinfra-2.79.0 lib/specinfra/backend/powershell/command.rb
specinfra-2.78.2 lib/specinfra/backend/powershell/command.rb
specinfra-2.78.1 lib/specinfra/backend/powershell/command.rb
specinfra-2.78.0 lib/specinfra/backend/powershell/command.rb
specinfra-2.77.3 lib/specinfra/backend/powershell/command.rb
specinfra-2.77.2 lib/specinfra/backend/powershell/command.rb
specinfra-2.77.1 lib/specinfra/backend/powershell/command.rb
specinfra-2.77.0 lib/specinfra/backend/powershell/command.rb
specinfra-2.76.9 lib/specinfra/backend/powershell/command.rb
specinfra-2.76.8 lib/specinfra/backend/powershell/command.rb
specinfra-2.76.7 lib/specinfra/backend/powershell/command.rb
specinfra-2.76.6 lib/specinfra/backend/powershell/command.rb
specinfra-2.76.5 lib/specinfra/backend/powershell/command.rb