- You want to use the latest version of Watir under development and don't want to wait for the next release.
- You have made changes to Watir and want to distribute your own version as a gem.
Watir's use Git as its source code management tool, leveraging the power of Github. There are many good tutorials for Git on the web. Here are a few for Git on Windows using both a GUI and the command prompt:
Once Git is installed, checkout the source:
- Create or go to a directory to checkout into (e.g. "C:/dev"). Git will create a 'watir' directory there.
- Open a cmd prompt and navigate to that directory and execute
You should now see a watir directory, containing 5 directories: .git, commonwatir, doc, firewatir, and watir
You will need to install several gems used to build Watir.
On Windows, you will need to define your "HOME" environment variable. Go to My Computer > Properties > Advanced > Environment Variables. Under Sytem Variables, look for a variable called HOME. If you don't have one yet, created one with a value something like "C:\Documents and Settings\Administrator" (Substituting whatever Windows login you use for 'Administrator' if needed).
As of Watir 1.6, Watir now consists of 3 gems: watir, commonwatir and firewatir. Users on Windows will need to build all three. Users on other platforms only need to build commonwatir and firewatir.
Inside the watir directory are five directories, including one for each of the three gems (commonwatir, firewatir, and watir). To build each gem: In your watir directory, execute
This will create a watir/gems directory containing .gem files.
You should install them in the following order
To install these gems, open the command shell into the watir/gems directory and execute
See Development Builds for additional notes on installing local gems.
This command will list the gem versions on your local system, you should now have the latest development version listed.
You can also do a gem uninstall on previous versions if you'd like.
and you'll get a list of versions to choose from.
To keep in sync with the latest code you can now
...from your watir directory (e.g. C:\dev\watir) and then follow the gem install process again.