Thanks Mitchell. This code seems to work (at least in 1.5.4 and 1.6.1, 
which I tested):

      if Vagrant::VERSION =~ /^1.[0-5]/
        puts "foo"
      else
        config.vm.post_up_message="foo"
      end

--Diego

On Friday, May 9, 2014 12:14:54 PM UTC-5, Mitchell Hashimoto wrote:
>
> Diego, 
>
> Vagrant::VERSION 
>
> On Fri, May 9, 2014 at 10:03 AM, Diego Zamboni 
> <[email protected]<javascript:>> 
> wrote: 
> > Hi, 
> > 
> > I'd like to use the new 1.6 post_up_message option to display some 
> messages 
> > about my VM's configuration, but while retaining Vagrantfile 
> compatibility 
> > with pre-1.6 Vagrant (I was printing out the information using puts 
> before). 
> > Is there a way to check the exact Vagrant version from within the 
> > Vagrantfile? I'd like to do something like this: 
> > 
> > if vagrant.version < 1.6 
> >   puts "foo" 
> > else 
> >   config.vm.post_up_message "foo" 
> > end 
> > 
> > Is this possible? 
> > 
> > Thanks, 
> > --Diego 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Vagrant" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to [email protected] <javascript:>. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to