Sha256: 7576002c1e87ad9bd0ce1ca865eea9e2774bfab03ad58458d1538beee43b14ec

Contents?: true

Size: 809 Bytes

Versions: 6

Compression:

Stored size: 809 Bytes

Contents

module MelissaData::VagrantPlugin::Actions

  class Update < Base
    def call(env)
      @vm = env['vm']
      if @vm.created? && @vm.vm.running?
        target_root = env['config'].melissadata.target_path
        env.ui.info I18n.t("vagrant.plugins.melissadata.updating"), :prefix => false

        sudo "gem uninstall melissadata" if test? "ruby -r md -e 'puts MD::VERSION'" #%Q!ruby -e 'require "rubygems"; require "melissadata"'!
        gem_filename = "melissadata-#{MelissaData::VERSION}.gem"
        copy_file "#{File.expand_path("pkg/#{gem_filename}", MelissaData.gem_root)}"
        sudo "gem install #{target_root}/#{gem_filename} && rm #{target_root}/#{gem_filename}"
      else
        env.ui.error "Vagrant VM is not running", :prefix => false
      end

      @app.call(env)
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
melissadata-0.1.5 lib/melissadata/vagrant_plugin/actions/update.rb
melissadata-0.1.4 lib/melissadata/vagrant_plugin/actions/update.rb
melissadata-0.1.3 lib/melissadata/vagrant_plugin/actions/update.rb
melissadata-0.1.2 lib/melissadata/vagrant_plugin/actions/update.rb
melissadata-0.1.1 lib/melissadata/vagrant_plugin/actions/update.rb
melissadata-0.1.0 lib/melissadata/vagrant_plugin/actions/update.rb