<commit_before># URN [![Build Status](https://travis-ci.org/altmetric/urn.svg?branch=master)](https://travis-ci.org/altmetric/urn)

Ruby library to validate and normalize URNs according to [RFC 2141](https://www.ietf.org/rfc/rfc2141.txt).

**Current version:** 1.0.0  
**Supported Ruby versions:** 1.8.7, 1.9.2, 1.9.3, 2.0, 2.1, 2.2, 2.3

## Installation

Add this line to your application's `Gemfile`:

```ruby
gem 'urn', '~> 1.0'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install urn -v '~> 1.0'

## Usage

```ruby
urn = URN.new('URN:NameSpace:Identifier')
#=> #<URN:0x007fd97a835558 @urn="URN:NameSpace:Identifier">

urn.valid?
#=> true

urn.normalize<commit_msg>Automate current version of the gem<commit_after># URN [![Build Status](https://travis-ci.org/altmetric/urn.svg?branch=master)](https://travis-ci.org/altmetric/urn)

Ruby library to validate and normalize URNs according to [RFC 2141](https://www.ietf.org/rfc/rfc2141.txt).

[![Gem Version](https://badge.fury.io/rb/urn.svg)](https://badge.fury.io/rb/urn)  

**Supported Ruby versions:** 1.8.7, 1.9.2, 1.9.3, 2.0, 2.1, 2.2, 2.3

## Installation

Add this line to your application's `Gemfile`:

```ruby
gem 'urn', '~> 1.0'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install urn -v '~> 1.0'

## Usage

```ruby
urn = URN.new('URN:NameSpace:Identifier')
#=> #<URN:0x007fd97a835558 @urn="URN:NameSpace:Identifier">

urn.valid?
#=> true

urn.normalize
{'fraction_non_alphanumeric': 0.1916046039268788, 'fraction_numerical': 0.05754908598510494, 'mean_word_length': 4.185964912280702, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3415711', 'n_tokens_mistral': 659, 'n_tokens_neox': 586, 'n_words': 129}