Module: VagrantBindfs::Bindfs

Defined in:
lib/vagrant-bindfs/bindfs.rb,
lib/vagrant-bindfs/bindfs/folder.rb,
lib/vagrant-bindfs/bindfs/command.rb,
lib/vagrant-bindfs/bindfs/option_set.rb,
lib/vagrant-bindfs/bindfs/validators.rb,
lib/vagrant-bindfs/bindfs/validators/config.rb,
lib/vagrant-bindfs/bindfs/validators/runtime.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Validators Classes: Command, Folder, OptionSet

Constant Summary collapse

SOURCE_VERSION =
'1.17.7'
SOURCE_URLS =
[
  'https://bindfs.org/downloads/%<basename>s.tar.gz',
  'https://bindfs.dy.fi/downloads/%<basename>s.tar.gz'
].freeze
FULL_VERSION_NUMBER_SINCE =
'1.13.0'

Class Method Summary collapse

Class Method Details

.normalize_version_in_tar_name(version) ⇒ Object



27
28
29
30
31
32
# File 'lib/vagrant-bindfs/bindfs.rb', line 27

def normalize_version_in_tar_name(version)
  v = version.to_s.strip
  parts = (v.split('.').map(&:to_i) + [0, 0, 0]).take(3).compact
  parts.pop if parts.last.zero? && Gem::Version.new(v) < Gem::Version.new(FULL_VERSION_NUMBER_SINCE)
  parts.join('.')
end

.source_tar_basename(version) ⇒ Object



19
20
21
# File 'lib/vagrant-bindfs/bindfs.rb', line 19

def source_tar_basename(version)
  ['bindfs', normalize_version_in_tar_name(version)].join('-')
end

.source_tar_urls(version) ⇒ Object



23
24
25
# File 'lib/vagrant-bindfs/bindfs.rb', line 23

def source_tar_urls(version)
  SOURCE_URLS.map { |url| format(url, basename: source_tar_basename(version)) }
end