Sha256: e4121d666ea991f99ef4b520d7652d0bec1504e428a573a87e476064a862acec

Contents?: true

Size: 929 Bytes

Versions: 56

Compression:

Stored size: 929 Bytes

Contents

module Bibliothecary
  module Parsers
    class Julia
      include Bibliothecary::Analyser

      def self.mapping
        {
          match_filename("REQUIRE", case_insensitive: true) => {
            kind: "manifest",
            parser: :parse_require
          }
        }
      end

      def self.parse_require(manifest)
        deps = []
        manifest.split("\n").each do |line|
          next if line.match(/^#/) || line.empty?
          split = line.split(/\s/)
          if line.match(/^@/)
            name = split[1]
            reqs = split[2, split.length].join(" ")
          else
            name = split[0]
            reqs = split[1, split.length].join(" ")
          end
          reqs = "*" if reqs.empty?
          next if name.empty?

          deps << {
            name: name,
            requirement: reqs,
            type: "runtime"
          }
        end
        deps
      end
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
bibliothecary-7.3.6 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.3.5 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.3.4 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.3.3 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.3.2 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.3.1 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.3.0 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.2.1 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.2.0 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.1.5 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.1.4 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.1.3 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.1.2 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.1.1 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.1.0 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.0.2 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.0.1 lib/bibliothecary/parsers/julia.rb
bibliothecary-7.0.0 lib/bibliothecary/parsers/julia.rb
bibliothecary-6.12.3 lib/bibliothecary/parsers/julia.rb
bibliothecary-6.12.2 lib/bibliothecary/parsers/julia.rb