Sha256: 2d4186126f88922f855c71f7085fbc22ee46881dcdd1384df467cabfd849d938

Contents?: true

Size: 861 Bytes

Versions: 100

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

100 entries across 100 versions & 1 rubygems

Version Path
specinfra-1.27.5 lib/specinfra/backend/powershell/command.rb
specinfra-1.27.4 lib/specinfra/backend/powershell/command.rb
specinfra-1.27.3 lib/specinfra/backend/powershell/command.rb
specinfra-1.27.2 lib/specinfra/backend/powershell/command.rb
specinfra-1.27.1 lib/specinfra/backend/powershell/command.rb
specinfra-1.27.0 lib/specinfra/backend/powershell/command.rb
specinfra-1.26.0 lib/specinfra/backend/powershell/command.rb
specinfra-1.25.8 lib/specinfra/backend/powershell/command.rb
specinfra-1.25.7 lib/specinfra/backend/powershell/command.rb
specinfra-1.25.6 lib/specinfra/backend/powershell/command.rb
specinfra-1.25.5 lib/specinfra/backend/powershell/command.rb
specinfra-1.25.4 lib/specinfra/backend/powershell/command.rb
specinfra-1.25.3 lib/specinfra/backend/powershell/command.rb
specinfra-1.25.2 lib/specinfra/backend/powershell/command.rb
specinfra-1.25.1 lib/specinfra/backend/powershell/command.rb
specinfra-1.25.0 lib/specinfra/backend/powershell/command.rb
specinfra-1.24.0 lib/specinfra/backend/powershell/command.rb
specinfra-1.23.1 lib/specinfra/backend/powershell/command.rb
specinfra-1.23.0 lib/specinfra/backend/powershell/command.rb
specinfra-1.22.1 lib/specinfra/backend/powershell/command.rb