diff --git a/lib/rscons/basic_environment.rb b/lib/rscons/basic_environment.rb index 2e18134..65705ae 100644 --- a/lib/rscons/basic_environment.rb +++ b/lib/rscons/basic_environment.rb @@ -247,5 +247,28 @@ module Rscons end end + # Execute a command using the system shell. + # + # The shell is automatically determined but can be overridden by the SHELL + # construction variable. If the SHELL construction variable is specified, + # the flag to pass to the shell is automatically dtermined but can be + # overridden by the SHELLFLAG construction variable. + # + # @param command [String] Command to execute. + # + # @return [String] The command's standard output. + def shell(command) + shell_cmd = + if shell = get_var("SHELL") + flag = get_var("SHELLFLAG") || (shell == "cmd" ? "/c" : "-c") + [shell, flag] + else + Rscons.get_system_shell + end + IO.popen([*shell_cmd, command]) do |io| + io.read + end + end + end end diff --git a/lib/rscons/configure_op.rb b/lib/rscons/configure_op.rb index a996534..2bdbc50 100644 --- a/lib/rscons/configure_op.rb +++ b/lib/rscons/configure_op.rb @@ -12,11 +12,11 @@ module Rscons # # @param options [Hash] # Optional parameters. - # @param build_dir [String] + # @option options [String] :build_dir # Build directory. - # @param prefix [String] + # @option options [String] :prefix # Install prefix. - # @param project_name [String] + # @option options [String] :project_name # Project name. def initialize(options) # Default options. diff --git a/lib/rscons/environment.rb b/lib/rscons/environment.rb index fa533e0..3d2c9cd 100644 --- a/lib/rscons/environment.rb +++ b/lib/rscons/environment.rb @@ -487,29 +487,6 @@ module Rscons end end - # Execute a command using the system shell. - # - # The shell is automatically determined but can be overridden by the SHELL - # construction variable. If the SHELL construction variable is specified, - # the flag to pass to the shell is automatically dtermined but can be - # overridden by the SHELLFLAG construction variable. - # - # @param command [String] Command to execute. - # - # @return [String] The command's standard output. - def shell(command) - shell_cmd = - if shell = get_var("SHELL") - flag = get_var("SHELLFLAG") || (shell == "cmd" ? "/c" : "-c") - [shell, flag] - else - Rscons.get_system_shell - end - IO.popen([*shell_cmd, command]) do |io| - io.read - end - end - # Print the builder run message, depending on the Environment's echo mode. # # @param builder [Builder]