Sha256: ffdc739fcc10836aeb16b4d95098388ce4b5f99445f286f087619532193cf71a

Contents?: true

Size: 824 Bytes

Versions: 1

Compression:

Stored size: 824 Bytes

Contents

# PpSortHash

Pretty print a sorted hash by key.

[![Gem Version](https://badge.fury.io/rb/pp_sort_hash.svg)](https://badge.fury.io/rb/pp_sort_hash)
[![Build Status](https://travis-ci.org/winebarrel/pp_sort_hash.svg?branch=master)](https://travis-ci.org/winebarrel/pp_sort_hash)

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'pp_sort_hash'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install pp_sort_hash

## Usage

```ruby
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}}
```

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pp_sort_hash-0.1.0 README.md