Thursday, November 6, 2014

UN LIBRARY: RUBY PROGRAMMING FOR SERVER:

 

UN LIBRARY: RUBY PROGRAMMING FOR SERVER: (‪#‎isoeh‬) Deploying Ruby programs is always a problem. We mostly need script to copy files, create directories and every operating systems has a different command to do these things. Ruby -run was thus made, where it emerged as a boon. The ruby -run -e httpd . -p 9000 command is extremely useful. It starts a WEBrick HTTP server serving the current directory on port 9000. Some of the additional modules are: ruby -run -e cp -- [OPTION] SOURCE DEST Copy a file from source to destination. ruby -run -e ln -- [OPTION] TARGET LINK_NAME Link target file from link_name. A link is a bit like a second name of a file, creating a second file system entry for the file without actually creating a new copy of the file. ruby -run -e mv -- [OPTION] SOURCE DEST Move a file from source to dest. This can be used to rename files, or copy a file to another directory. ruby -run -e rm -- [OPTION] FILE Delete a file. ruby -run -e mkdir -- [OPTION] DIRS Make a new directory. ruby -run -e rmdir -- [OPTION] DIRS Remove an empty directory. ruby -run -e install -- [OPTION] SOURCE DEST The install command is a lot like the copy command, except it also modifies file ownership and permissions. ruby -run -e chmod -- [OPTION] OCTAL-MODE FILE Change permissions of a file. ruby -run -e touch -- [OPTION] FILE Touch a file, updating its last modified time. Additionally, if the file does not yet exist, create the file. ruby -run -e wait_writable -- [OPTION] FILE Wait until the file is writable. If another program is using the file, it will not be writable until the program is finished. However, be aware that only one program should be waiting for the file to be writable to avoid race conditions. ruby -run -e mkmf -- [OPTION] EXTNAME [OPTION] Make a makefile for building a C extension. ruby -run -e httpd -- [OPTION] DocumentRoot Run an HTTP server to serve the contents of a directory (discussed above).

No comments:

Post a Comment

Search Box