Ruby gem that allows us to handle local system's windows - ruby

I want to automate the browse and upload file in my application.Ruby(2.0) that I am using does not let me handle the local system's windows. Is there any ruby gem that allows us to handle local system's windows?

Watir is for automating Browsers, not Operating Systems. Each OS is going to be different, so anything that might help you automate them will also be unique.
For Windows you might see if something like this will do what you need. (Note I've not used this project and recommend avoiding doing OS level automation if possible).

Related

What programming languages come with windows 10 by default (no install required)?

Similar to this question What programming languages are installed by default on Windows 7?. Is the environment any differnt for Windows 10?
For some programs like MS OFfice you get the VBA, Chrome you would get Javascript, if you activate the Bash for Ubuntu on Windows then you can get bash. Not sure if that is default.
In particular, if you didn't have administration rights over a Windows 10 laptop but needed a programming language... what could you use or do about it?
ie I wanted Ruby installed but I needed our tech team to help me. I want to avoid someone else with higher access but also not breach policy.
Out of the box no install solutions include:
(To be written using text file editing software like the preinstalled notepad)
Batch (.bat)
Visual basic script (.vbs)
HTML (.html)
CSS (^Use a style tag for the HTML doc)
JavaScript (.js)
Some quick gets include:
Bash (Ubuntu from Windows Store)
AutoHotKey (from autohotkey.com)
#Code (Windows Store. Apparently supports 12 different languages)
Hope this helps!
Edit: If you really wanna try, you can edit .exe files directly but yeesh.
Edit 2: repl.it is a website that lets you code in tons of different languages, possibly Ruby. With repl.it you can do all the things I've listed and more! (As long as you have alright internet.)
what could you use
You could use pretty much any languages. Any compiled executables looks the same to the OS as any other.
The only catch is that some languages' runtime libraries are quite big, so it's common for smaller programs not to include the entire language runtime and instead expects it to be preinstalled on the machine to keep its own download size small.
However, even high level scripting languages that requires huge runtime support libraries can often be packaged into standalone executable, so that you don't need to install the runtime yourself.
Ultimately it depends on what you wanted to do. If you wanted to just make simple scripts, probably .bat scripts will do just fine. If you wanted something simple and fast, then you can write native executable in C, otherwise if you want to do something a bit more complex and you're fine with the larger download size if you can keep your own program simple, or if you can later get admin to preinstall your preferred runtime on your target machines, then high level languages like Python or Ruby would be great options.

Is it possible to automate installion using Ruby or Watir?

Currently we are installing our setup(.exe file) on daily basis for testing purpose.I want to automate my installation using Ruby or Watir.Is it possible to automate? Please help me how to perform and give your suggestions.
There are many libraries available for Ruby. Watir itself is constrained to the web browser. Although it does have some technology it's built on top of that should allow Windows environment control. Some of the libraries you can try are Win32-autogui, RAutomation, and windows-pr to name a few.
If you are installing for testing purposes, you can use autoit. It will run your installer, and you can handle some unexpected (though anticipated) errors. I wouldn't use autoit for testing, just for setting up to test.

Invoke different ruby interpreter

I am running within a Ruby script (a Vagrantfile, specifically) and I want to invoke another ruby executable (berks installed against system ruby, specifically). I know I can do something like
PATH=/usr/bin GEM_PATH=/var/lib/ruby/1.9.1 berks ...
But, that's not very portable. (Different machines will need different GEM_PATH, for instance). So, how can I invoke a script installed against a different Ruby environment from within a Ruby script?
Well, the task at hand sounds not-very-portable, since its entire reason for being is a system-specific quirk of different Rubies being installed in different places. Not all systems will even have those specific Ruby versions.
It sounds to me like your best bet would probably be to allow the user to set certain environment variables (I dunno, $BERKS_SUBRUBY_PATH or something) and use those if they are set. That way anyone who needs to use the workaround has an easy way to do so, but you're not forcing everybody to have the same system config.

What do we need installations for?

This is a conceptual question and I hope it fits into Stackoverflow's question and answer style. I wonder what the concept of installing applications is good for. In my naive understanding of operating systems we do not need a registry and to use an application it should be enough to just copy the executable and files onto your drive and launch that.
Am a Windows user but also worked with Linux a bit and noticed that there are package managers instead of installers. But even those do more than just a copy instruction, I guess.
I do not think that all the installers exist only because the common user expects them out of steady habit. So what is the advantage of installers in contrast to developing applications which are designed to run out of a single folder and copy that over?
I would really like if someone could explain that concept.
Installing applications is a way to embed them in the OS. It's a kind of standard, you offer procedures like installing and uninstalling that should have the same functionalities for all applications (even "change" under Windows).
Countless times I've "installed" applications with a single shell script that came with them, and then had troubles removing such programs, having to look for single files. If the programmer uses the standard of the OS to make an executable that can be installed, that won't happen.
You can also easily view a list of the installed programs at any time.
Under Linux, additionally, if we're talking about a package manager, it is convenient for the user to have an easy way to download and install a program by just typing its name.
Last but not least, some applications are required to be installed and recognized by the OS (for example services in Windows).

Installing a program without installation file

I've heard that you can take a program that is already installed in a PC and go home to you r own pc and write a program in any programming language to make it work without having to install the program. I wanted to know how does one go about in achieving that.
The class of applications you are describing are called Standalone or Portable Applications.
In such applications all files that are required to run the application are stored in the same directory as the application file itself. Which is not the way with most applications work, so, you cannot make all applications run in that fashion. There are various guides on Google when you search for 'creating portable applications'.
You might want to look at a good directory of portable applications here

Resources