Hi! I don't understand how your current solution works? It doesn't work like that. As soon as you install newer version of Watir then it will be used and it doesn't matter which branch you're with your git since gem will be loaded from the Ruby gems directory and hasn't anything to do with your git branch. So, even if you checkout older branch, then you're still using newest Watir version.
You could specify the exact version of Watir as Dmitriy already suggested like this. Instead of: require 'watir' use: gem "watir", "1.6.2" # to use 1.6.2 Now, if you commit that change into your branch, then you can be sure that correct version is used. Or you could use Bundler to take care of the correct versions of your gems: http://gembundler.com/ Just don't forget to commit Gemfile and Gemfile.lock into your repository :) Jarmo Pertman ----- IT does really matter - http://www.itreallymatters.net On Mar 31, 5:16 am, Darryl Brown <[email protected]> wrote: > Thanks again for everyone's response but what I'm doing is sufficient > for my needs. I was curious to see how (or if) anyone else was doing > this differently. My needs are to be able to switch between Watir > versions easily. Example: I test one of my scripts on v1.7.0 and it > fails. I switch back to v1.6.2 and run it to see if it's still OK or > if something else is going on. I don't want to change my scripts > (unless it is explicitly required - i.e. different watir wait method, > etc.). > > Generally, this is how I set it up. > > Install ruby > git init (in c:\ruby) > git add > git commit > git checkout -b v1.6.2 > gem install watir -v1.6.2 > git add > git commit > git checkout master > git checkout -b v1.6.7 > gem install watir -v1.6.7 > git add > git commit > > run test.rb > > Now - If test.rb fails on v1.6.7, I can go back > and verify that it still runs on v1.6.2 with: > > git checkout v1.6.2 > > run test.rb > > Maybe this methodology can help someone else. > > This is only a temporary requirement until I get all of the scripts > checked out on the latest stable (for my scripts) version of Watir. > > --Darryl > > On Mar 30, 3:02 pm, Adam Reed <[email protected]> wrote: > > > > > > > > > I'll admit my reply was more of a response to the first comment than > > the original issue, but I would agree with the explicit versioning > > comment unless for some reason you wanted to uninstall your gem and > > install a specific version for each test: > > > gem uninstall watir > > gem install watir -v 1.6.5 > > etc. > > > On Mar 30, 1:58 pm, Dmitriy Korobskiy <[email protected]> wrote: > > > > How about using Gem to specify explicit versioning, something along > > > these lines: > > > >http://docs.rubygems.org/read/chapter/4 > > > > Just a thought... > > > > -- > > > DK > > > AIM: DKroot1, Skype: DKroot > > > > On 3/30/11 2:49 PM, Darryl Brown wrote: > > > > > RVM is a Ruby version manager. I'm trying to find out if there is a > > > > better way to manage multiple versions of Watir. Using Git with a > > > > branch for each version is working. Are you guys suggesting that I > > > > should manage multiple instances of Ruby with each one having a unique > > > > version of Watir?? -or- am I missing something? > > > > > Darryl > > > > > On Mar 30, 2:32 pm, Adam Reed<[email protected]> wrote: > > > >> Also see pik for Windows (I believe it's linked from RVM's site as > > > >> well): > > > > >>https://github.com/vertiginous/pik/ > > > > >> Adam > > > > >> On Mar 30, 1:23 pm, Tim Koopmans<[email protected]> wrote: > > > > >>> Rvm ? > > > >>> Regards, > > > >>> Tim > > > >>> Sent from my mobile ... > > > >>> On 31/03/2011, at 12:39 AM, Darryl Brown<[email protected]> > > > >>> wrote: > > > >>>> Hello All, > > > >>>> We are currently using Git branches to manage multiple versions of > > > >>>> Watir. Our base scripts were all created with 1.6.2 and we're > > > >>>> transitioning to the newer versions and testing along the way. Start > > > >>>> out with master branch that does that does not have Watir. Then from > > > >>>> master, checkout -b 1.6.2; then 1.6.7, 1.7.0 etc. and install the > > > >>>> versions. Now we can easily switch versions. My question - is there > > > >>>> a > > > >>>> different / better way to accomplish this? > > > >>>> Thanks, > > > >>>> Darryl > > > >>>> -- > > > >>>> Before posting, please readhttp://watir.com/support. In short: > > > >>>> search before you ask, be nice. > > > >>>> [email protected] > > > >>>>http://groups.google.com/group/watir-general > > > >>>> [email protected] -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
