Sha256: e369aa4bea34809df3a9e44b396481153ef18116920ebc854b63b03b0a0fbcb2

Contents?: true

Size: 434 Bytes

Versions: 21

Compression:

Stored size: 434 Bytes

Contents

module GoaModelGen
  class GolangHelper

    PARTITION_PATTERNS = [
      /\A[^\.\/]+(?:\/.+)?\z/,
      /\Agopkg\.in\//,
      /\Agolang\.org\//,
      /\Agoogle\.golang\.org\//,
      /\Agithub\.com\//,
    ]

    def partition(paths)
      groups = paths.group_by do |path|
        PARTITION_PATTERNS.index{|ptn| ptn =~ path} || PARTITION_PATTERNS.length
      end
      groups.keys.sort.map{|k| groups[k].sort }
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
goa_model_gen-0.4.0 lib/goa_model_gen/golang_helper.rb