laserlemon/figaro — pull request #12 by ptyagi16 (2012-10-04 21:18:22+00:00)
Title: Added rake tasks for cloudbees and support for jRuby and Java system properties with fallback to ENV via FigaroSettings

## Summary
Added support for
* Cloudbees config update
* JRuby java system properties with fall back to ENV

## CloudBees Support
I added support for cloudbees config rake task. Now you can deploy settings to cloudbees
```
~/my_project> rake figaro:cloudbees
```
or
```
~/my_project> rake figaro:cloudbees my-app
```

## Support for Java System properties with ENV fallback
Added FigaroSettings class (thanks Srushti). FigaroSettings.xxx first looks for xxx in Java System properties. If not defined it looks for it (upcased) in the ENV or else throws an exception. In ruby it just looks at the ENV.
```
jruby> ENV["TEST_PROP"]="TEST_VAL"
jruby> FigaroSettings.test_prop
=> "TEST_VAL"
jruby> FigaroSettings.TEST_PROP
=> "TEST_VAL"
jruby> java.lang.System.set_property "TEST_PROP", "TEST_VAL2"
jruby> FigaroSettings.test_prop
=> "TEST_VAL2"
jruby> FigaroSettings.some_undefined_prop
=> raises SettingNotFoundError
```