Class: VagrantPlugins::RsyncOnlyChanged::Plugin
- Inherits:
-
Object
- Object
- VagrantPlugins::RsyncOnlyChanged::Plugin
- Defined in:
- lib/vagrant-rsync-only-changed/plugin.rb
Class Method Summary collapse
-
.setup_i18n ⇒ Object
This initializes the internationalization strings.
- .usable(raise_error = false) ⇒ Object
Class Method Details
.setup_i18n ⇒ Object
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.("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 |