Method: CommandMapper::Command.sudo
- Defined in:
- lib/command_mapper/command.rb
.sudo(params = {}, sudo: {}, **kwargs) {|command| ... } ⇒ Boolean?
Initializes and runs the command through sudo.
Parameters:
-
(defaults to: {})
The option and argument values.
-
(defaults to: {})
Additional
sudooptions. -
Additional keyword arguments for #initialize.
Options Hash (sudo:):
-
:askpass
(Boolean)
—
Enables the
--askpasssudooption. -
:background
(Boolean)
—
Enables the
--backgroundsudooption -
:bell
(Boolean)
—
Enables the
--bellsudooption -
:close_from
(Integer)
—
Enables the
--close-from=...sudooption -
:chdir
(String)
—
Enables the
--chdir=...sudooption -
:preserve_env
(String)
—
Enables the
--preseve-env=...sudooption -
:group
(String, Boolean)
—
Enables the
--preseve-env=...sudooption -
:set_home
(Boolean)
—
Enables the
--set-homesudooption -
:host
(String)
—
Enables the
--host=...sudooption -
:login
(Boolean)
—
Enables the
--loginsudooption -
:remove_timestamp
(Boolean)
—
Enables the
--remove-timestampsudooption -
:reset_timestamp
(Boolean)
—
Enables the
--reset-timestampsudooption -
:non_interactive
(Boolean)
—
Enables the
--non-interactivesudooption -
:preserve_groups
(Boolean)
—
Enables the
--preserve-groupssudooption -
:prompt
(String)
—
Enables the
--prompt=...sudooption -
:chroot
(String)
—
Enables the
--chroot=...sudooption -
:role
(String)
—
Enables the
--role=...sudooption -
:stdin
(Boolean)
—
Enables the
--stdinsudooption -
:shell
(Boolean)
—
Enables the
--shellsudooption -
:type
(String)
—
Enables the
--type=...sudooption -
:command_timeout
(Integer)
—
Enables the
--command-timeout=...sudooption -
:other_user
(String)
—
Enables the
--other-user=...sudooption -
:user
(String)
—
Enables the
--user=...sudooption
Yields:
-
(command)
—
The newly initialized command.
Yield Parameters:
- command (Command)
Returns:
API:
-
public
276 277 278 279 |
# File 'lib/command_mapper/command.rb', line 276 def self.sudo(params={}, sudo: {}, **kwargs,&block) command = new(params,**kwargs,&block) command.sudo_command(**sudo) end |