File: lockfile.rb

package info (click to toggle)
ruby-librarian 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 632 kB
  • sloc: ruby: 6,109; makefile: 11
file content (29 lines) | stat: -rw-r--r-- 507 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'librarian/lockfile/compiler'
require 'librarian/lockfile/parser'

module Librarian
  class Lockfile

    attr_accessor :environment
    private :environment=
    attr_reader :path

    def initialize(environment, path)
      self.environment = environment
      @path = path
    end

    def save(resolution)
      Compiler.new(environment).compile(resolution)
    end

    def load(string)
      Parser.new(environment).parse(string)
    end

    def read
      load(path.read)
    end

  end
end