0.0
No commit activity in last 3 years
No release in over 3 years
Lib for managing config files based on OpenStruct, includes file saving and prompt at creation.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0
~> 3.0
 Project Readme

Configstruct

Gem Version Downloads Build Status Coverage Status Dependency Status Code Climate Inch


This gem is a lib for managing configfile for cli applications, including

  • call a setup of the config file if it does not exist
  • edit configuration and update the config file

It's for now totally experimental, please do not use yet.

Installation

Add this line to your application's Gemfile:

gem 'configstruct'

Usage

require 'cliprompt'
class Config < ConfigStruct

  include Cliprompt

  def set_defaults
    super
    default :name, 'default'
    default :url, 'http://greenruby.org'
  end

  def setup
    values = {}
    output.puts Paint['Applicaton configuration.', :blue]
    values['api_id'] = guess 'API_CLIENT', 'What is your Client ID?'
    values['api_secret'] = guess 'API_SECRET', 'What is your Secret Key?'
    write values
  end

end

Contributing

  1. Fork it
  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 a new Pull Request

Copyright

(c) Copy is right, 2014 - mose - this code is distributed under MIT license