As 2011 approaches, I decided to look back on a few of the great organisations we have worked with in the last 12 months. We’ve always had a soft spot for building web sites and web applications that make a difference to real people, as opposed to just solving a business need.
Here’s an overview of some of these projects from 2010.
WA Special Needs Children’s Christmas party – Cash donation
Partnerships / Organisations helped
Independent Living Centre of WA – Built and maintained web systems to help them book more appointments and serve more people in the community. Also rebuilt their website to be accessible, more useful to their audience and added an equipment supplier search feature.
Independent Living Centres Australia – Current development of the new website and the national supplier database, integrating seven state-based databases into one.
At The Frontier Group we like to help out deserving charities as often as we can either through partnering, work, or sponsorship.
Drop in the Bucket is an organisation that has found its way to us and we are encouraging all our clients and friends to donate through the widget on our special Donate to Drop in the Bucket donation page.
You can read up on Drop in the Bucket below, or at their website: Drop in the Bucket. Our aim (along with Resonate Social Media) is to raise $10,000 to build two wells by March 31 2011.
Drop in the Bucket
MISSION
Drop In The Bucket is dedicated to improving the health and safety of children in Africa by providing clean water wells and sanitation systems to African schools, particularly those in post-conflict settings. We align ourselves with experienced engineers, innovators and economists who have a vast knowledge of African culture and water solutions so that we can meet the unique challenges associated with the developing world’s water crisis.
The cornerstone of our approach is low overhead and minimal operating costs. We participate directly in every aspect of the process, from targeting each well location and personally working with and training community leaders, to actively helping set up and approve budgets, to diligently monitoring maintenance schedules and carefully tracking success rates. We place a very high value on sustainability and take proactive measures so the water wells and sanitation systems we install will provide benefits far into the future. Our hands-on involvement extends from the time water or sanitation needs are identified, through construction, and long after completion.
Drop In The Bucket provides everything from hand-dug shallow water wells, drilled boreholes, pumps and rainwater harvesting tanks, to an advanced sanitation system that includes the most environmentally responsible, permanent septic system available in rural Sub-Saharan Africa.
Our outreach teams are constantly working to find new ways to incorporate the beneficiaries into the process while our staff and consultants strive to continually develop innovations and improvements that will increase the scope and effectiveness of our efforts to provide clean water wells and sanitation systems to the children and their communities.
VISION
Drop In The Bucket believes we can help create a world in which children are safe, healthy, educated and free from fear. And we believe that the key to achieving those ends is clean water and sanitation.
In its 2000 Millennium Declaration, the United Nations created eight Millennium Development Goals to improve the human condition by 2015. One of the most important objectives in reaching these goals was to reduce, by half, the proportion of people without sustainable access to safe drinking water. The World Health Organization and UNICEF report that of the people still not using an improved source of drinking water in 2010, 37% live in one region of the globe: Sub-Saharan Africa (www.wssinfo.org).
Drop In The Bucket understands how central clean water and sanitation is to survival. We want to see an end to the 1.5 million preventable deaths that occur each year as a result of poor sanitation (www.unwater.org). We want to see the children of Sub-Saharan Africa have the same basic opportunities to live safe, healthy and happy lives as children in places where access to clean water and sanitation are available.
According to the World Water Assessment Programme (www.unesco.org) access to safe drinking water can make a significant contribution to:
(a) eradication of poverty;
(b) increased school attendance;
(c) reduction in diarrheal infections and malaria;
(d) decrease in maternal and child-mortality rates.
Drop In The Bucket wants to make a difference in the quality of life for children in the countries of Sub-Saharan Africa so they can reach their full potential and become healthy adults with the capacity to accomplish their goals and the opportunity to realize their dreams.
As part of the work done on RVM during the Ruby Summer of Code, One of the things I worked to add was a fairly comprehensive Ruby version of the bash API.
Since then, the Ruby API has been used to build a couple of small projects and tools but it still maintains relatively undocumented.
Today, I’m going to introduce the basics of working with the Ruby API, starting by introducing the fundamental concepts you need to know and then going on to cover how the most common example of it’s use (rvm gemset support in passenger) works under the hood.
Getting started
First off, you’re going to want to make sure you actually have the Ruby API installed. If you have a remotely recent (e.g. newer than 6 or so months) copy of rvm, you’ll already have a copy – Otherwise, you’re going to need to update your rvm install using rvm update.
To load the API, open up irb and type the following:
# First, find where rvm is installed
rvm_path = File.expand_path(ENV['rvm_path'] || '~/.rvm')
# Secondly, add the ruby library to the load path
$LOAD_PATH.unshift File.join(rvm_path, 'lib')
# Finally, actually load rvm
require 'rvm'
Once said code has been executed, you should have access to RVM constant in your irb session. The method we use to require it means that it is loaded from the currently installed version of rvm so you don’t have to deal with issues related to different versions between rvm itself and the Ruby API.
The bare basics
The ruby api works on the concept of a rvm ‘environment’ – Essentially, you can think of them as the equivalent of a shell instance – They keep track of instance variables, have their own ruby / gemset selection and are sandboxed (for the most part) from other environments. Creating a new environment is as simple as doing the following in your ruby code:
env = RVM.environment 'ree'
Or, alternatively, you can pass a block and it will be called with the environment as an argument. Along side this, you have RVM.environments, which accepts multiple ruby names and calls the block with each environment.
For convenience sake, RVM exposes RVM.current, an environment that defaults to the currently loaded gemset (e.g. if you open irb in rbx@rails3, it will be an environment using rbx@rails3).
As an added bonus, when you call an undefined method on RVM, we automatically use method missing to call it on RVM.current – Hence, If RVM::Environment#some_instance_method exists, you can use RVM.some_instance_method to call it in the current environment object.
Working with environments
So, now that you know how to get environment object, you need to know how to use it. In the simplest form, the Ruby API mirrors the command line program by translating:
rvm command action arg1 arg2
Into:
env.command_action arg1, arg2
With the library automatically taking care of converting arguments (e.g. a hash as the last value will be converted to arguments to the program).
As an example, to call rvm list strings, One would use env.list_strings. Likewise, rvm use becomes env.use and so on and so forth. In these cases, use switches the environments ruby – not the running ruby itself.
One of the added features in the Ruby API is that use and gemset_use have alternatives with a bang (use! and gemset_use!) that will switch the currently loaded ruby’s gemset (by changing GEM_PATH and GEM_HOME and then telling rubygems about the change) - raising an exception if it’s for a different ruby installation. This switch makes it possibly to dynamically switch your ruby applications gemset whilst running.
Of course, dealing with a direct port of the API isn’t always nice when you’re writing a lot of code env.alias_list feels clunky compared to most ruby code and some of the tools are rough around the edges. With this in mind, the ruby api offers wrappers for situations where this becomes noticeable, e.g env.aliases will return a more ruby-like wrapper for the alias command that lets you do things such as env.alias.all, env.aliases.create and so on. In some cases (e.g. env.list_*), the wrappers add features (such as expanding strings) that aren’t found in the bash API via the wrapper.
A real world example
With that said and done, it’s time to look at a real world example. In this case, the most commonly-used example of the rvm ruby API – A use of passengers support for a config/setup_load_paths.rb file which lets passenger automatically load .rvmrc files. When a compatible ruby is detected, the file will automatically switch the gemset on the fly – In essence, letting passenger work with the one-gemset-per-application philosophy we advocate when dealing with rvm.
For references sake, the rvm portion of the code is:
if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
begin
rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
rvm_lib_path = File.join(rvm_path, 'lib')
$LOAD_PATH.unshift rvm_lib_path
require 'rvm'
RVM.use_from_path! File.dirname(File.dirname(__FILE__))
rescue LoadError
# RVM is unavailable at this point.
raise "RVM ruby lib is currently unavailable."
end
end
Line by line, this code essentially:
Checks that we’re loading it in an RVM ruby – rvm always sets the MY_RUBY_HOME environment variable when using wrappers and we ensure that “rvm” is part of said variables value.
It begins a begin-rescue-end section of code to load rvm – Giving us a nice error message if rvm isn’t available.
Based on my ruby home, We find the location of your rvm install (as rvm_path may or may not be set at this point).
We add the rvm ruby lib directory to the load path
We require the API
Up until this point, it is almost exactly like our original example. Where it differs is the next line:
Expanding this again using what we learnt earlier, we know that RVM.current.use! will take a given ruby string (e.g. ree@rails3) and attempt to switch out the gemset when the ruby versions match. Continuing on, we know RVM.current.tools.path_identifier is roughly the same as RVM.current.tools_path_identifier – a line which takes a path and, taking into account .rvmrc files, returns the identifier (e.g. ree@rails3) we’d get if we had changed into the given directory from the command line.
Putting it all together, the ruby api essentially just finds out which identifier the given path should use (by loading a projects .rvmrc in the given environment), checks they’re for the same ruby install (to avoid issues with binary gems) and finally switches out the GEM_HOME and GEM_PATH variables for the current process, letting your application use a different gemset.
In short, under the hood it simple finds out the gemset details and updates your application to switch them out similar to how rvm would from the command line.
More examples
We’ve only covered the basics of of the ruby api – For the most part, everything implemented in the bash API is supposed to be (except where it lags behind in terms of updates) exposed via the Ruby API in a simple, consistent manner. In practice, this has primarily been used for things like infinity_test and various CI-related work which make working with multiple rubies easier from ruby applications.
I’d ultimately love to see it used more for tools built around rvm – e.g. a web interface for managing a servers system wide install and exposing it over HTTP. Lastly, because it’s written in Ruby, if you’ve ever wanted to contribute to rvm but have felt apprehensive due to the fact it’s written in shell script, the rvm ruby API is a good place to start.
The Frontier Group is pleased to announce it has partnered with The Green Network. We’re their official Web partner and are now putting together their new website. Looking forward to being a part of this organisation, and helping them help others.
—
The Green Network gives Corporate Professionals an opportunity to explore the latest eco-friendly products and services available to ensure their organisation is engaging in environmentally sustainable practices. There is an overwhelming emergence of new products and technologies that are environmentally friendly and this forum gives Perth professionals an exclusive opportunity to access these new technologies and gain that green competitive edge.
Whether you’re in finance, communications, IT or resources there are small changes to everyday business practice that can make a significant difference to the future sustainability of our planet.
The Green Network supports research and development into new technologies that will see industry and business become more environmentally sustainable. By attending The Green Network you are supporting the companies that are supporting the environment.
Brian Gillett from Bloo just advertised our latest workshop coming up on 7th December. Great coverage!
If you’re a small business with (or without) an online presence and want in, there’s still time :)
—
Last week you would have received an email from me about an amazing one day event I had the pleasure of attending recently and have since decided to be part of as a project sponsor.
The Achieve More Online project is a one day Internet marketing workshop that is simply a must-attend for business owners and managers across Perth. There are still limited places left at the workshop on the Tuesday 7 December, so make sure you register your place today by visiting www.businessbalance.com.au/bloo. However places are filling fast and the event looks like it will be a sell-out by Friday, so don’t delay!
Presented by 7 small business and online marketing specialists, you will learn:
Which powerful tools can deliver substantially more foot traffic to your retail store or office in less than 7 days even if you don’t yet have a website
What to look for when selecting a web designer & how to get the site you can update yourself without having to pay every time you want to do an update
Learn how to immediately get more hits to your website without a costly redesign – we’ll show you the simple-to-implement search engine optimisation techniques the experts use
Understand how to take advantage of Google Adwords, one of the cheapest & most powerful forms of advertising available to small business owners today
How to use Facebook to build a follower base of thousands of fans that want a closer relationship with you & your business
PLUS MUCH MORE
Who should attend?
Business owners who want to leverage the marketing power of the internet but have no idea where to start
Business owners & managers who are seeing diminishing returns from Yellowpages and other traditional advertising mediums
Web & graphic designers who want to learn more about SEO, Adwords & Social Media
Anyone considering a website redesign or who are in the process of redesigning their site
Entrepreneurs and business owners who already have a successful website and want to further optimise their website presence
What we find is the workshops really do have something to offer for attendees at every stage of their website lifecycle. Almost everyone walks away with at least 5 quick wins they can action to immediately improve their online presence (yes even without a website!).
You’ll also be provided with a detailed action plan & strategy document that’s over 80 pages long detailing the specific strategies and a step by step action plan for you to follow to build a more effective & profitable online presence.
This is a Federal Government Initiative funded by the Small Business Online Program