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

libclimate-ruby

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libclimate-ruby

  • 0.17.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

libCLImate.Ruby

libCLImate, for Ruby

Gem Version

Table of Contents

  1. Introduction
  2. Installation
  3. Components
  4. Examples
  5. Project Information

Introduction

libCLImate is a portable, lightweight mini-framework that encapsulates the common aspects of Command-Line Interface boilerplate, including:

  • command-line argument parsing and sorting, into flags, options, and values;
  • validating given and/or missing arguments;
  • a declarative form of specifying the CLI elements for a program, including associating blocks with flag/option specifications;
  • provision of de-facto standard CLI facilities, such as responding to '--help' and '--version';

libCLImate.Ruby is the Ruby version.

Installation

Install via gem as in:

	gem install libclimate-ruby

or add it to your Gemfile.

Use via require, as in:

require 'libclimate'

Components

In common with several other variants of libCLImate, libCLImate.Ruby revolves around a Climate class whose initialiser takes a block and acts as a lightweight DSL for concise definition of a command-line parsing instance, as in:

options = {}
climate = LibCLImate::Climate.new do |cl|

	cl.add_flag('--debug', alias: '-d', help: 'runs in Debug mode') do

		options[:debug] = true
	end
	cl.add_option('--verbosity', alias: '-v', help: 'specifies the verbosity', values: [ 'terse', 'quiet', 'silent', 'chatty' ]) do |o, sp|

		options[:verbosity] = o.value
	end
	cl.add_alias('--verbosity=chatty', '-c')

	cl.version = [ 0, 1, 0 ]

	cl.info_lines =  [

		'libCLImate.Ruby examples',
		:version,
		"Illustrates use of libCLImate.Ruby's specification of flags, options, and specifications",
		'',
	]

	cl.constrain_values = 1..2
	cl.usage_values = "<dir-1> [ <dir-2> ]"
	cl.value_names = [

		"first directory",
		"second directory",
	]
end

Examples

Examples are provided in the examples directory, along with a markdown description for each. A detailed list TOC of them is provided in EXAMPLES.md.

It is instructive to see how much more succinct they are than those (offering precisely the same functionality) presented in CLASP.Ruby.

Project Information

Where to get help

GitHub Page

Contribution guidelines

Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/libCLImate.Ruby.

Dependencies

libCLImate.Ruby depends on:

License

libCLImate.Ruby is released under the 3-clause BSD license. See LICENSE for details.

FAQs

Package last updated on 10 Aug 2024

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