Module: Albacore::Paket

Defined in:
lib/albacore/paket.rb

Instance Method Summary collapse

Instance Method Details

#parse_line(line) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/albacore/paket.rb', line 6

def parse_line line
  if (m = line.match /^\s*(?<id>[\w\-\.]+) \((?<ver>[\.\d\w\-]+)\)$/i)
    ver = Albacore::SemVer.parse(m[:ver], '%M.%m.%p', false)
    OpenStruct.new(:id               => m[:id],
                   :version          => m[:ver],
                   :target_framework => 'net40',
                   :semver           => ver)
  end
end

#parse_paket_lock(data) ⇒ Object



16
17
18
19
20
# File 'lib/albacore/paket.rb', line 16

def parse_paket_lock data
  data.map { |line| parse_line line }.
       compact.
       map { |package| [package.id, package] }
end