Sha256: 850604ba677774b631890f1dc1c3d7b5fe89ce1351f352a215c67618ba9fbc60

Contents?: true

Size: 1.46 KB

Versions: 1

Compression:

Stored size: 1.46 KB

Contents

# haveibeenpwned-ruby-sdk
Ruby wrapper for V2 haveibeenpwned.com API.

[![Build Status](https://travis-ci.org/Dales-Lab/haveibeenpwned-ruby-sdk.svg?branch=master)](https://travis-ci.org/Dales-Lab/haveibeenpwned-ruby-sdk) [![codecov](https://codecov.io/gh/Dales-Lab/haveibeenpwned-ruby-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/Dales-Lab/haveibeenpwned-ruby-sdk) [![Gem](https://img.shields.io/gem/v/have-i-been-pwned.svg?style=flat)](http://rubygems.org/gems/have-i-been-pwned "View this project on Rubygems")

## Installation
```
gem install have-i-been-pwned
```

## Use
#### General Use
```
require 'have-i-been-pwned'
...
# returns true if the password is found, false otherwise
result = HaveIBeenPwned.pwned 'abc123'
```

```
require 'have-i-been-pwned'
...
# returns an array with symbolized hashs of breachers (ie. [ { :name => 'Adobe' } ]) for that account, nil if none are found
result = HaveIBeenPwned.pwned_account 'some-email@gmail.com'
```

#### Rails
```
# Gemfile
gem 'have-i-been-pwned'
```

```
# some controller
# check the password
if !HaveIBeenPwned.pwned params[:password]
   puts "Yay! You can use this password!"
else
   puts "No! Bad!!"
end
```

## Contributing
- Open an issue about your change
- Fork it, DL it
- Run `bundle`
- Run `bundle exec rake`
- Make your additions, changes, fixes, etc. (Do not make changes to version, Rakefile or spec
- Add tests for the above (no pr acceptance without them)
- Run `bundle exec rake`
- Make your PR. :smile:

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
have-i-been-pwned-1.1.0 README.md