Sha256: 47911fdfa0b53f17d4d2aa5cd90df17697306cae03d49bedf4ce5727d5aa2648
Contents?: true
Size: 950 Bytes
Versions: 2
Compression:
Stored size: 950 Bytes
Contents
require 'pathname' require_relative 'freighthop/version' unless defined? Vagrant raise "i expect to be required from a Vagrantfile" end module Freighthop class << self def vmware? !!(defined? HashiCorp) end def host_rails_root @rails_root ||= begin Pathname.pwd.tap do |pwd| unless pwd.join('config', 'boot.rb').file? raise 'run me with a rails app as PWD, using VAGRANT_CWD to refer to my directory' end end end end def guest_rails_root "/srv/#{app_name}" end def app_name @app_name ||= host_rails_root.basename.to_s end def hostname "#{app_name}.vagrant.dev" end def ip_address "10.20.1.#{app_name.getbyte(0)}" end def box_url if vmware? 'http://files.vagrantup.com/precise64_vmware.box' else 'http://files.vagrantup.com/precise64.box' end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
freighthop-0.0.2 | lib/freighthop.rb |
freighthop-0.0.1 | lib/freighthop.rb |