Higo

Get started

gem install higo

Detailed usage examples can be found in the /examples directory. Documentation can be found here.

Gem Story - TL;DR

Higo creates 'config' objects dynamic using the well understood configure block:

class ConfigureFoo
  configure do |conf|
      conf.greatness = 'pending'
      conf.host      = Hostname.new
  end
end

Except you don't have to define those methods ahead of time.

Higo creates getter (greatness), setter (host=)and predicate methods (host?).

Gem Story -v

Higo enables the developer to create flexible configuration objects. It returns a Higo::Configurable object with getter, setter and predicate methods based on the values passed to the block.

Flexible meant two things (to me, at least). First, knowledge of the configuration values should not depend on static methods definition. Second, I prefer configuration that accepts multiple formats (like text, YAML)that could come from from remote sources.

I settled on the name after finding that fig, figgy were taken. Sure I could've named it figy, but that would be too confusing. So I settled on Higo.

Note-if you already defined method_missing in your class Higo will honor that and that is likely not what you want. Higo might not be right for you at this stage.

To Do List

  • ~~Generate arbitrary configuration values~~
  • Improve support for subclasses that define method_missing
  • ~~Read from an external source~~
  • Improve documentation

Contributing

If you are developing against this gem (yay!), run bundle exec rake -T for list of rake tasks.

  1. Fork it ( https://github.com/rhodee/higo/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request