Sha256: c2a754d2f7cdd94a059c79e01c07c4ebab5f39720595841dd2e0d6a6dc116dfe

Contents?: true

Size: 450 Bytes

Versions: 8

Compression:

Stored size: 450 Bytes

Contents

module VagrantWindows
  module Helper
    extend self
    
    def win_friendly_path(path)
      if path
        new_path = path.gsub('/', '\\')
        new_path = "c:#{new_path}" if new_path =~ /^\\/
      end
      new_path
    end

    # turns '/vagrant' into 'vagrant' or turns ''/a/b/c/d/e' into 'a_b_c_d_e'
    def win_friendly_share_id(shared_folder_name)
      return shared_folder_name.gsub(/[\/\/]/,'_').sub(/^_/, '')
    end
    
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
vagrant-plugin-dummy-0.0.7 windows/helper.rb
vagrant-plugin-dummy-0.0.6 windows/helper.rb
vagrant-plugin-dummy-0.0.5 windows/helper.rb
vagrant-plugin-dummy-0.0.4 windows/helper.rb
vagrant-plugin-dummy-0.0.3 windows/helper.rb
vagrant-plugin-dummy-0.0.1 windows/helper.rb
vagrant-plugin-dummy-0.0.2 windows/helper.rb
vagrant-windows-1.2.0 lib/vagrant-windows/helper.rb