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.9.7 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.9.6 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.9.5 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.9.4 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.9.3 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.9.2 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.9.1 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.9.0 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.8.4 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.8.3 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.8.2 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.8.1 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.8.0 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.7.1 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.7.0 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.6.1 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.6.0 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.5.0 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.4.2 lib/goa_model_gen/golang_helper.rb
goa_model_gen-0.4.1 lib/goa_model_gen/golang_helper.rb