Class: VagrantPlugins::RsyncOnlyChanged::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-rsync-only-changed/plugin.rb

Class Method Summary collapse

Class Method Details

.setup_i18nObject

This initializes the internationalization strings.



16
17
18
19
# File 'lib/vagrant-rsync-only-changed/plugin.rb', line 16

def self.setup_i18n
	    I18n.load_path << File.expand_path("locales/en.yml", RsyncOnlyChanged.source_root)
  I18n.reload!
end

.usable(raise_error = false) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/vagrant-rsync-only-changed/plugin.rb', line 21

def self.usable(raise_error=false)
  
 # Build up the actual command to execute
  command = [
    "rsync",
    "--version"
  ].flatten

  r = Vagrant::Util::Subprocess.execute(*(command))

		version_re = /version (\d.\d.\d)/  
		m = version_re.match( r.stdout )  

  return true if Gem::Version.new(m[1]) >= Gem::Version.new('3.1.0')
  return false if !raise_error
  require_relative "errors"
  raise Errors::Rsync310RequiredError
end