
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
= bit_hash
A simple class that can convert an option hash into a compact string.
== Usage
When writing these config maps. Try to put the mose used options first so the string can be shorter.
require 'rubygems' require 'bit_hash'
config_map = [ { :name => :air, # name of option :options => 2, # number of options must be 2 or greater }, { :name => :color, :options => ['blue','green','red'] # bit_hash can map arrays of data, the default setting will be the first value in the array }, { :name => :body_style, :options => [:sedan,:mini_van,:suv], # Array values can be anything that can be found using the Array#index function :default => :mini_van # for arrays the default is any array value }, { :name => :transmission, # name of option :options => 6, :default => 5 # for numbers the default must be between 0 and the options value }, { :name => :min_price, :options => (50..100).to_a, # ( just a way to store ranges of numbers) :default => 60 # basically any default can be used as long as it is a valid option }, { :name => :max_price,
# intervals of 20 starting at 10000 (just a way to store ranges of numbers)
:options => (1..5).to_a.map {|n| 10000+(n*20)},
# you can use :default_index option to reference something in the option arrays but it really isn't suggested, :default take precedence
:default_index => 2
}
]
@config = BitHash.new(config_map)
@config[:color]='red'
@config[:value]
@config.replace({:air=>1})
@config.parse('e')
@config.save
@config.to_s
== TODO
== Contributing to bit_hash
== Credits
Ryan Ong - ryanong@gmail.com
Developed for and with CarZen[link:http://carzen.com]
== Copyright
Copyright (c) 2011 Ryan Ong. See LICENSE.txt for further details.
FAQs
Unknown package
We found that bit_hash 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
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.