Sha256: 4bc502d58f7da8bda9fdd60e6d117d226390c50fb85150907f69c1c10373bdca

Contents?: true

Size: 625 Bytes

Versions: 85

Compression:

Stored size: 625 Bytes

Contents

module PactBroker
  module Config
    class SpaceDelimitedStringList < Array

      def initialize list
        super(list)
      end

      def self.parse(string)
        array = (string || '').split(' ').collect do | word |
          if word[0] == '/' and word[-1] == '/'
            Regexp.new(word[1..-2])
          else
            word
          end
        end
        SpaceDelimitedStringList.new(array)
      end

      def to_s
        collect do | word |
          if word.is_a?(Regexp)
            "/#{word.source}/"
          else
            word
          end
        end.join(' ')
      end
    end
  end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
pact_broker-2.79.1 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.79.0 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.78.1 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.78.0 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.77.0 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.76.2 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.76.1 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.76.0 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.75.0 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.74.1 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.74.0 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.73.0 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.72.0 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.71.0 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.70.0 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.69.0 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.68.1 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.68.0 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.67.0 lib/pact_broker/config/space_delimited_string_list.rb
pact_broker-2.66.0 lib/pact_broker/config/space_delimited_string_list.rb