README in rscm-0.1.0.1338 vs README in rscm-0.2.0

- old
+ new

@@ -1,8 +1,8 @@ -= RSCM - Ruby Source Control Management += RSCM - Ruby Source Control Management (0.2.0) -RSCM is to SCM what ODBC/JDBC is to databases - a common API to access a wide variety of SCMs. The features are roughly: +RSCM is to SCM what DBI/JDBC/ODBC are to databases - an SCM-independent API for accessing a wide variety of SCMs. The features are roughly: * Check out a working copy (with possibility to specify branch/date/label) * Get changesets (changesets are emulated for non-transactional SCMs like CVS and StarTeam) * Get diffs * Add and commit files @@ -25,13 +25,14 @@ * StarTeam - http://www.borland.com/starteam (not thoroughly tested) * Subversion - http://subversion.tigris.org (stable) In progress: +* ClearCase -http://www-306.ibm.com/software/awdtools/clearcase (half way there) * Darcs - http://www.abridgegame.org/darcs (very incomplete) * Monotone - http://www.venge.net/monotone (half way there) - + Planned: Loads! All of them! How to add support for a new one is described further down in this file. == Related projects @@ -42,11 +43,11 @@ Here is an example of how to use RSCM to get a list of changesets from a CVS repository: require 'rscm' - scm = RSCM::SVN.new("svn://some.server/some/path/trunk", "trunk") + scm = RSCM::Subversion.new("svn://some.server/some/path/trunk", "trunk") scm.checkout("mycheckout") changesets = scm.changesets("mycheckout", Time.utc(2004, 11, 10, 12, 34, 22)) changesets.each do |changeset| puts changeset @@ -102,12 +103,12 @@ By including GenericSCMTests your test will automatically include the acceptance test suite for RSCM. By doing this you'll actually follow a TDD approach for your new Mooky class - except that the tests are already written for you! -IMPORTANT NOTE: If your SCM doesn't provide an easy way to create new local repositories -- such as with StarTeam - you're probably better off writing the tests from scratch and not +IMPORTANT NOTE: If your SCM doesn't provide an easy way to create new local repositories +(such as with StarTeam) you're probably better off writing the tests from scratch and not include GenericSCMTests. Instead, just make sure you have an SCM repository set up somewhere and write tests to work against that repository. This way you won't be able to pass the generic acceptance test suite, and other people (like the RSCM dev team) will probably not be able to run the tests for it. -But it's better than nothing. We'll happily accept contributions that don't use the generic tests, although it would be best if they did. @@ -118,15 +119,15 @@ to the RSCM API. (The sample files consist of some java sources, but you don't need Java installed. They're just files). Let's implement the Mooky class. Take a look at. - lib/rscm/mooky/mooky.rb + lib/rscm/scm/mooky.rb Try running Mooky's test: - rake test TEST=test/rscm/mooky/mooky_test.rb + rake test TEST=test/rscm/scm/mooky_test.rb Whoops - we got some failures! It failed because our checkout method returned nothing (nil). Let'see if we can get the a little further by implementing this method. @@ -149,37 +150,21 @@ should also yield each file name as the execution proceeds). Once your checkout command works okay, the test will get you a little further. Just keep on going until all tests pass. -NOTE: If the SCM doesn't have a command line utility or a 3rd party Ruby API, but instead +NOTE: If the SCM doesn't have a command line utility (unlikely) or a 3rd party Ruby API, but instead provides libraries (perhaps in C), then you should consider writing a Ruby C extension instead. If the SCM has a Java interface, you can take the same approach as for StarTeam. There are Java classes for ChangeSets that allow easy interaction between Ruby and Java over YAML. You can reuse these classes for other Java based SCMs (if there are any, I don't know). -== Writing the web interface (DamageControl only) +== Web interface (DamageControl only) -If you're contributing a new SCM it would be nice if you took the time to implement a web interface -that can be used to embed it into DamageControl. - -In trunk/damagecontrol, start by creating +app/views/project/_mooky.rhtml+. - -Create a table with 2 columns and a row for each +attr_accessor+ in the Mooky class, preferrably -with some explanatory text for the users so they know how to fill it in. See how the tooltips -are used in some of the existing implementations. - -You also need a javascript section at the top -with a function called +mooky_init()+. This will be called when the page is loaded. If you don't -have plans to do anything fancy here, just leave it blank. - -=== Wiring it all up - -Just edit +lib/rscm.rb+ and +require+ your new scm class. Now you should see it coming up -on the Source Control tab in the web interface. - +DamageControl automatically detects new SCM classes in RSCM and generates a default web interface. + = Building RSCM This section is for developers who are new to ruby development and do not already know how to build and install Ruby gems. You need to install rubygems from http://rubyforge.org/projects/rubygems Afterwards you need to install rake and rails