Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

higo

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

higo

  • 0.0.8
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Higo

Get started

Rubygems:

gem install higo

Gemfile:

gem 'higo'

Detailed usage examples can be found in the /examples directory. Supports reading from ruby objects and text files, JSON support coming soon.

Documentation can be found here.

Gem Story - TL;DR

Higo creates configuration objects dynamically. It also plays nice with methods you define. It can be subclassed or included as a module. Define settings in the block, pass values from a relative, dynamic file or URL path. All the same.

require 'higo'

class Configurable < Higo::Configurable
  configure do |conf|
      conf.greatness = 'pending'
      conf.host      = Hostname.new
  end
end

The configure block returns an instance of Higo::Configurable. The values themselves held instance variables. No need to define accessors ahead of time. Higo creates getter greatness(), setter host=(val)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
  • Add support for JSON files
  • 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

FAQs

Package last updated on 30 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc