-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
folder.rb
38 lines (30 loc) · 820 Bytes
/
folder.rb
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
30
31
32
33
34
35
36
37
38
# frozen_string_literal: true
require 'digest/sha1'
module VagrantBindfs
module Bindfs
class Folder # :nodoc:
attr_reader :source,
:destination,
:options,
:hook
def initialize(hook, source, destination, options = {})
@hook = hook
@source = source
@destination = destination
@options = Bindfs::OptionSet.new(nil, options)
end
def id
@id ||= Digest::SHA1.new.digest(destination)
end
def reverse_merge!(options)
@options = Bindfs::OptionSet.new(nil, options).merge(@options)
end
def merge!(options)
@options = @options.merge(options)
end
def to_version!(version)
@options = @options.to_version(version)
end
end
end
end