Tags

redhat
employment
ripple
interfaces
ncurses
ruby
refs
filesystems
retro gaming
raspberry pi
sinatra
3d printing
nethack
gcc
compiler
fedora
virtfs
project
gaming
vim
grep
sed
aikido
philosophy
splix
android
lvm
storage
bitcoin
projects
sig315
miq
db
polisher
meditation
hopex
conferences
omega
simulator
bundler_ext
rubygems
book review
google code in
isitfedoraruby
svn
gsoc
design patters
jsonrpc
rjr
aeolus
ohiolinuxfest
rome
europe
travel
brno
gtk
python
puppet
conference
fudcon
snap
html5
tips
ssh
linux
hardware
libvirt
virtualization
engineering expo
cloud
rpm
yum
rake
redmine
plugins
screencasting
jruby
fosscon
pidgin
gnome-shell
distros
notacon
presentation
rails
deltacloud
apache
qmf
passenger
syrlug
hackerspace
music
massive attack
crypto
backups
vnc
xsd
rxsd
x3d
mercurial
ovirt
qpid
webdev
haikus
poetry
legaleese
jquery
selenium
testing
xpath
git
sshfs
svg
ldap
autotools
pygtk
xmlrpc
slackware

Sep 8 2013 ruby polisher

Ruby Platform Utilities

Application x ruby

Greetings, it's been a while! Today I'm sharing a few utilities that we've been working on during the ongoing process to shore up our platform for Ruby development/deployment

Jumping right into it, the first of these is a set of tools aimed geared at evaluating a Bundler Gemfile against Fedora and Red Hat resources. Dubbed the gem dependency checker the title script processes the specified gemfile, comparing dependencies against a slew of targets including the Fedora API, Koji, Bodhi, Bugzilla, and more. Dependencies are retrieved from rubygems.org recursively and versions are matched so that the end user can fully visualize how much of their application is currently supported. It is fully extensible as additonal targets to check can be easily added to incorporate support for more platforms.

A small asciicast of the tool in action can be seen here (note it's an earlier version when it was known as 'rhgc.rb')

Additional utilities which we are developing in this suite include a binary dependency analyzer which looks up missing dependencies needed to build a binary gem package (for example libmysql is required to build the ruby mysql binding and libcurl is required to build the ruby curb library) using the native package system. Also in flight is a small utility aimed at mass updating gem packages along with new dependencies against a distribution repository, so as to continue to optimize the workflow of getting Ruby software into production.

Geared towards more general linux system administration is the Linux Admin gem which a few of us have been developing as part of the new CloudForms release. The overall goal is to provide a simple / high level Ruby based management interface and dsl to perform common Linux system administration tasks. For example, you could use LinuxAdmin to read local disks, partitions, and create and format a new partition like so:

require 'pp'
require 'linux_admin'
LinuxAdmin::Disk.local.each do |disk|
  pp disk.path
  pp disk.size
  disk.partitions.each { |p| 
    pp " #{p.id} #{p.fs_type} #{p.size} #{p.mount_point}"
  }
end

disk = LinuxAdmin::Disk.local.last
disk.create_partition 'primary', :start => '0%', :end => '50%'
disk.partitions.first.format_to 'ext3'

LinuxAdmin has growing support for many various subsystems including LVM, RHN, yum, sysvinit and many more and provides a solid platform for further automation of many Linux administration tasks from Ruby. LinuxAdmin will take care of the necessary console and other backend calls to perform the intended functionality, wrapping any errors or output in nicely consumable Ruby objects for further processing.

That's it until next time!