Socket
Book a DemoInstallSign in
Socket

pp_sort_hash

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pp_sort_hash

0.1.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

PpSortHash

Pretty print a sorted hash by key.

Gem Version Build Status

Installation

Add this line to your application's Gemfile:

gem 'pp_sort_hash'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pp_sort_hash

Usage

require 'pp'

hash1 = {a: 1, c: {c1: 10, c2: 20}, b: 2}
hash2 = {b: 2, a: 1, c: {c2: 20, c1: 10}}

pp hash1
#=> {:a=>1, :c=>{:c1=>10, :c2=>20}, :b=>2}

pp hash2
#=> {:b=>2, :a=>1, :c=>{:c2=>20, :c1=>10}}

require 'pp_sort_hash'

pp hash1
#=> {:a=>1, :b=>2, :c=>{:c1=>10, :c2=>20}}

pp hash2
#=> {:a=>1, :b=>2, :c=>{:c1=>10, :c2=>20}}

FAQs

Package last updated on 19 Aug 2016

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.