![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
adhearsion-loquacious
Advanced tools
= Loquacious by Tim Pease http://rubygems.org/gems/loquacious
== DESCRIPTION:
Descriptive configuration files for Ruby written in Ruby.
Loquacious provides a very open configuration system written in ruby and descriptions for each configuration attribute. The attributes and descriptions can be iterated over allowing for helpful information about those attributes to be displayed to the user.
In the simple case we have a file something like
Loquacious.configuration_for('app') { name 'value', :desc => "Defines the name" foo 'bar', :desc => "FooBar" id 42, :desc => "Ara T. Howard" }
Which can be loaded via the standard Ruby loading mechanisms
Kernel.load 'config/app.rb'
The attributes and their descriptions can be printed by using a Help object
help = Loquacious.help_for('app') help.show :values => true # show the values for the attributes, too
Descriptions are optional, and configurations can be nested arbitrarily deep.
Loquacious.configuration_for('nested') { desc "The outermost level" a { desc "One more level in" b { desc "Finally, a real value" c 'value' } } }
config = Loquacious.configuration_for('nested')
p config.a.b.c #=> "value"
And as you can see, descriptions can either be given inline after the value or they can appear above the attribute and value on their own line.
== INSTALL:
== EXAMPLES:
==== example/simple.rb
require 'loquacious' include Loquacious
Configuration.for(:simple) { desc 'Your first configuration option' a "value for 'a'"
desc 'To be or not to be'
b "William Shakespeare"
desc 'The underpinings of Ruby'
c 42
}
help = Configuration.help_for :simple help.show :values => true
====== output ====== Your first configuration option - a => "value for 'a'"
To be or not to be - b => "William Shakespeare"
The underpinings of Ruby - c => 42
==== examples/nested.rb
require 'loquacious' include Loquacious
Configuration.for(:nested) { root_path '.', :desc => "The application's base directory."
desc "Configuration options for ActiveRecord::Base."
active_record {
colorize_logging true, :desc => <<-__
Determines whether to use ANSI codes to colorize the logging statements committed
by the connection adapter. These colors make it much easier to overview things
during debugging (when used through a reader like +tail+ and on a black background),
but may complicate matters if you use software like syslog. This is true, by default.
__
default_timezone :local, :desc => <<-__
Determines whether to use Time.local (using :local) or Time.utc (using :utc)
when pulling dates and times from the database. This is set to :local by default.
__
}
log_level :info, :desc => <<-__
The log level to use for the default Rails logger. In production mode,
this defaults to :info. In development mode, it defaults to :debug.
__
log_path 'log/development.log', :desc => <<-__
The path to the log file to use. Defaults to log/\#{environment}.log
(e.g. log/development.log or log/production.log).
__
}
help = Configuration.help_for :nested help.show :values => true
====== output ====== Configuration options for ActiveRecord::Base. - active_record
Determines whether to use ANSI codes to colorize the logging statements committed by the connection adapter. These colors make it much easier to overview things during debugging (when used through a reader like +tail+ and on a black background), but may complicate matters if you use software like syslog. This is true, by default. - active_record.colorize_logging => true
Determines whether to use Time.local (using :local) or Time.utc (using :utc) when pulling dates and times from the database. This is set to :local by default. - active_record.default_timezone => :local
The log level to use for the default Rails logger. In production mode, this defaults to :info. In development mode, it defaults to :debug. - log_level => :info
The path to the log file to use. Defaults to log/#{environment}.log (e.g. log/development.log or log/production.log). - log_path => "log/development.log"
The application's base directory. - root_path => "."
==== examples/gutters.rb
require 'loquacious' include Loquacious
Configuration.for(:gutters) { log_path "log/development.log", :desc => <<-__ The path to the log file to use. Defaults to log/#{environment}.log (e.g. log/development.log or log/production.log). | | config.log_path = File.join(ROOT, "log", "#{environment}.log | __
log_level :warn, :desc => <<-__
|The log level to use for the default Rails logger. In production mode,
|this defaults to :info. In development mode, it defaults to :debug.
|
| config.log_level = 'debug'
| config.log_level = :warn
|
__
}
help = Configuration.help_for :gutters help.show :values => true
====== output ====== The log level to use for the default Rails logger. In production mode, this defaults to :info. In development mode, it defaults to :debug.
config.log_level = 'debug'
config.log_level = :warn
- log_level => :warn
The path to the log file to use. Defaults to log/#{environment}.log (e.g. log/development.log or log/production.log).
config.log_path = File.join(ROOT, "log", "#{environment}.log
- log_path => "log/development.log"
== LICENSE:
(The MIT License)
Copyright (c) 2009-2011
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Unknown package
We found that adhearsion-loquacious demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.