Sha256: 68872ed5fc26a0c0eb672ac94f16a0ec8cc60c8a1680a4a0f3e01aaf2931f6b7

Contents?: true

Size: 861 Bytes

Versions: 221

Compression:

Stored size: 861 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

221 entries across 221 versions & 2 rubygems

Version Path
specinfra-2.0.0.beta22 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta21 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta20 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta19 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta18 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta17 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta16 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta15 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta14 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta13 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta12 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta11 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta10 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta9 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta8 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta7 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta6 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta5 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta4 lib/specinfra/backend/powershell/command.rb
specinfra-2.0.0.beta3 lib/specinfra/backend/powershell/command.rb