From erace at erace.pl Sat Dec 24 05:09:41 2005 From: erace at erace.pl (Przemyslaw Rudzki) Date: Sat, 24 Dec 2005 11:09:41 +0100 Subject: [Cfruby-general] osmodules question Message-ID: <43AD1E65.4070905@erace.pl> Hello, First things first: im very new to Ruby and my question might be result of that... Im trying to use libcfruby on Red Hat Linux. I have found some sources for Gentoo, Suse and etc. and I wanted to prepare RHEL specific module. However, I was unable to find the place in the code where they are actually being used. The only place where distro type/name matter is in linux-generic.rb but as far as I can see this is only for returning the correct 'distribution' field by OSFactory. Am I correct? I have downloaded nightly snapshot and stable release and the case is the same for both. Am I missing something? I am about to develop an application (client is about to decide) that will use ruby-newt and should work on Red Hat and HP-UX 10.20 and cfruby seems to contain the functionality that I will require. Of course, if it will actually come to writing this app I would like to contribute to cfruby as well. /p From david at grayskies.net Tue Dec 27 13:41:43 2005 From: david at grayskies.net (David Powers) Date: Tue, 27 Dec 2005 13:41:43 -0500 Subject: [Cfruby-general] osmodules question In-Reply-To: <43AD1E65.4070905@erace.pl> References: <43AD1E65.4070905@erace.pl> Message-ID: <43B18AE7.8010103@grayskies.net> OK - some more specifics: Everything OS specific in cfruby derives in some fashion from the OS object defined in os.rb under the libcfruby directory in lib. Specifically, there is an OSFactory that does all the work of determining which OS you are running by running a series of tests. Once the correct OS has been determined a specific OS object is instantiated and given back to the caller - an OS object in this case is any object that has Cfruby::OS::OS as its parent class. It is up to the specific OS class to then hand out the other os specific items - a package manager, a user manager, etc. Which must derive from the proper base classes (Cfruby::Packages::PackageManager, and Cfruby::Users::UserManager respectively). All of this really just means that you need to define 3 new classes to extend things for RedHat - RedHatOS, RedHatPackageManager, and RedHatUserManager. These can either derive from the very basic base implementations, or they can use the linux-generic as a base (whichever is easier). Inside of these three classes just implement any platform specific changes necessary to handle all of the methods the classes are supposed to handle. Again, the best resource may be the FreeBSD or OSX files under osmodules. -David Powers Przemyslaw Rudzki wrote: > Hello, > > First things first: im very new to Ruby and my question might be result > of that... > > Im trying to use libcfruby on Red Hat Linux. I have found some sources > for Gentoo, Suse and etc. and I wanted to prepare RHEL specific module. > However, I was unable to find the place in the code where they are > actually being used. The only place where distro type/name matter is in > linux-generic.rb but as far as I can see this is only for returning the > correct 'distribution' field by OSFactory. Am I correct? I have > downloaded nightly snapshot and stable release and the case is the same > for both. Am I missing something? > > I am about to develop an application (client is about to decide) that > will use ruby-newt and should work on Red Hat and HP-UX 10.20 and cfruby > seems to contain the functionality that I will require. Of course, if it > will actually come to writing this app I would like to contribute to > cfruby as well. > > /p > _______________________________________________ > Cfruby-general mailing list > Cfruby-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/cfruby-general >