Module: Envo::Shell::WinCmd
Constant Summary collapse
- LIST_SEP =
';'
Instance Method Summary collapse
- #ar_to_list(ar) ⇒ Object
- #cmd_set_env_var(name, value) ⇒ Object
- #cmd_unset_env_var(name) ⇒ Object
- #fix_path(path) ⇒ Object
- #home_var_name ⇒ Object
- #installer ⇒ Object
- #likely_abs_path?(val) ⇒ Boolean
- #likely_list?(val) ⇒ Boolean
- #likely_rel_path?(val) ⇒ Boolean
- #list_to_ar(list) ⇒ Object
- #path_var_name ⇒ Object
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_name ⇒ Object
13 14 15 |
# File 'lib/envo/shell/win_cmd.rb', line 13 def home_var_name 'HOME' end |
#installer ⇒ Object
6 7 8 |
# File 'lib/envo/shell/win_cmd.rb', line 6 def installer Cli::InstallerWinCmd end |
#likely_abs_path?(val) ⇒ 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
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
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_name ⇒ Object
10 11 12 |
# File 'lib/envo/shell/win_cmd.rb', line 10 def path_var_name 'Path' end |