Created
July 21, 2011 09:35
-
-
Save ThorstenHans/1096854 to your computer and use it in GitHub Desktop.
Ruby is sexy :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CommandLineExecuter | |
def self.execute(cli,props = {},nameless_param) | |
parameters = props.collect { |key,value| "/#{key}=#{value}" }.join " " | |
exec("#{cli} #{nameless_param} #{parameters}") | |
end | |
end | |
#Sample usage | |
CommandLineExecuter.execute "notepad" | |
CommandLineExecuter.execute "cmd", {:T=> "0A"} | |
CommandLineExecuter.execute "msbuild", {:Configuration => "Relese", :Platform => "AnyCPU"}, "myproject.csproj" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment