Module: Envo::Shell::WinCmd

Extended by:
WinCmd
Included in:
WinCmd
Defined in:
lib/envo/shell/win_cmd.rb

Constant Summary collapse

LIST_SEP =
';'

Instance Method Summary collapse

Instance Method Details

#ar_to_list(ar) ⇒ Object



34
35
36
# File 'lib/envo/shell/win_cmd.rb', line 34

def ar_to_list(ar)
  ar.join(LIST_SEP)
end

#cmd_set_env_var(name, value) ⇒ Object



38
39
40
41
# File 'lib/envo/shell/win_cmd.rb', line 38

def cmd_set_env_var(name, value)
  escaped = value # TODO
  "set #{name}=#{escaped}"
end

#cmd_unset_env_var(name) ⇒ Object



42
43
44
# File 'lib/envo/shell/win_cmd.rb', line 42

def cmd_unset_env_var(name)
  "set #{name}="
end

#fix_path(path) ⇒ Object



23
24
25
# File 'lib/envo/shell/win_cmd.rb', line 23

def fix_path(path)
  path.gsub('/', '\\')
end

#home_var_nameObject



13
14
15
# File 'lib/envo/shell/win_cmd.rb', line 13

def home_var_name
  'HOME'
end

#installerObject



6
7
8
# File 'lib/envo/shell/win_cmd.rb', line 6

def installer
  Cli::InstallerWinCmd
end

#likely_abs_path?(val) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/envo/shell/win_cmd.rb', line 17

def likely_abs_path?(val)
  val =~ /^[a-zA-Z]\:\\/
end

#likely_list?(val) ⇒ Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/envo/shell/win_cmd.rb', line 28

def likely_list?(val)
  val.include?(LIST_SEP)
end

#likely_rel_path?(val) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/envo/shell/win_cmd.rb', line 20

def likely_rel_path?(val)
  return !val.empty? && val[0] == '.'
end

#list_to_ar(list) ⇒ Object



31
32
33
# File 'lib/envo/shell/win_cmd.rb', line 31

def list_to_ar(list)
  list.split(LIST_SEP)
end

#path_var_nameObject



10
11
12
# File 'lib/envo/shell/win_cmd.rb', line 10

def path_var_name
  'Path'
end