naija-faker 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +136 -0
- data/lib/{data/data.rb → data.rb} +0 -0
- data/lib/naija-faker.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 292c5ba2ff172473374b07660b6ce4683cc08eafea78f306a7d49cab2b84fe85
|
4
|
+
data.tar.gz: 1e920310cbd75c0f20547e8fff89a93994395c975086369a8ba7b7d1d7e9e73f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d28dd5852a8303985cb5a047f83952350a1dc06fa572d45f5d5fecb745a32755941e1326b53264f507b0a31740fac3cb52f561f577274ce5b9a11bdb3fe0267c
|
7
|
+
data.tar.gz: 9239c09343c56da5173ac926b4c9be0e9ee8e008305de07098bd4566b492b4015c57d1011a0cd8b19d4aa076115fccf68a9d44833c8a3f7e3413c54481b4a071
|
data/README.md
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
[![Build Status](https://travis-ci.com/onedebos/naija-faker-gem.svg?branch=master)](https://travis-ci.com/onedebos/naija-faker-gem)[![codecov](https://codecov.io/gh/onedebos/naija-faker-gem/branch/master/graph/badge.svg)](https://codecov.io/gh/onedebos/naija-faker-gem)
|
2
|
+
|
3
|
+
# naija-faker
|
4
|
+
|
5
|
+
This gem helps you generate fake Nigerian data on the fly for use in your projects.
|
6
|
+
|
7
|
+
# Getting Started
|
8
|
+
|
9
|
+
**To get started, follow the instructions below**
|
10
|
+
|
11
|
+
- install the gem `gem install naija-faker`
|
12
|
+
- import it in your app using:
|
13
|
+
|
14
|
+
```
|
15
|
+
require "naija-faker"
|
16
|
+
```
|
17
|
+
|
18
|
+
- use it!
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
NaijaFaker.fname
|
22
|
+
```
|
23
|
+
|
24
|
+
# Available methods
|
25
|
+
|
26
|
+
### Generate an array of people with first name, last name, age, bank and state
|
27
|
+
|
28
|
+
- To generate an array of people, simply pass an `amt` value to `person_list` i.e `NaijaFaker.person_list(amt: 2)`
|
29
|
+
- NB: Default `amt` is 5
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
|
33
|
+
NaijaFaker.person_list(amt: 2)
|
34
|
+
# outputs:
|
35
|
+
[
|
36
|
+
{:fname=> 'abdul', :lname=>'qadr', :age=>40, :email=> 'abdul.qadr@hey.com', :state=>'ekiti' },
|
37
|
+
{:fname=>'frank', :lname=>'edoho', :age=>23, :email=> 'frank.edoho@gmail.com', :state=>'delta' }
|
38
|
+
]
|
39
|
+
|
40
|
+
```
|
41
|
+
|
42
|
+
### Generate a random First name or Last name
|
43
|
+
|
44
|
+
- `NaijaFaker.fname //=> 'abraham'`
|
45
|
+
- `NaijaFaker.lname //=> 'fatai`
|
46
|
+
|
47
|
+
### Generate a random First name or Last name that starts with a letter/letters
|
48
|
+
|
49
|
+
- `NaijaFaker.fname('r') //=> 'rahman'`
|
50
|
+
- `NaijaFaker.lname('bo') //=> 'bolanle'`
|
51
|
+
|
52
|
+
### Generate a person hash map with random values for First name, Last name and Age
|
53
|
+
|
54
|
+
- **NB: Default age is between 18 - 50**
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
NaijaFaker.person
|
58
|
+
# outputs:
|
59
|
+
{
|
60
|
+
:fname=>'abdul', :lname=>'qadr', :age=>20,
|
61
|
+
:email=>'abdul.qadr@hey.com', :state=>'ekiti'
|
62
|
+
}
|
63
|
+
```
|
64
|
+
|
65
|
+
-- To change the default `min` and `max` values for age, pass in min and max values as an object like below.
|
66
|
+
|
67
|
+
- e.g:
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
NaijaFaker.person(min:20, max:50)
|
71
|
+
#outputs:
|
72
|
+
{
|
73
|
+
:fname=>'abdul', :lname=>'qadr', :age=>40,
|
74
|
+
:email=>'abdul.qadr@hey.com', :state=>'ekiti', :bank=>'Access bank'
|
75
|
+
}
|
76
|
+
|
77
|
+
```
|
78
|
+
|
79
|
+
### Generate an array of only names
|
80
|
+
|
81
|
+
- Simply pass `amt` to `name_list()` e.g
|
82
|
+
|
83
|
+
**NB: Default `amt` is 5**
|
84
|
+
|
85
|
+
```
|
86
|
+
NaijaFaker.name_list(amt: 5)
|
87
|
+
|
88
|
+
```
|
89
|
+
|
90
|
+
### Generate a random Nigerian state
|
91
|
+
|
92
|
+
- Simply call `NaijaFaker.state //=> 'Ondo'`
|
93
|
+
|
94
|
+
### Generate a bank name
|
95
|
+
|
96
|
+
- Simply call `NaijaFaker.bank //=> 'Access Bank'`
|
97
|
+
|
98
|
+
### Test
|
99
|
+
|
100
|
+
- To run the test
|
101
|
+
|
102
|
+
```ruby
|
103
|
+
#install rspec and simplecov:
|
104
|
+
gem install rspec
|
105
|
+
gem install simplecov
|
106
|
+
|
107
|
+
# in /lib, run
|
108
|
+
bundle exec rspec spec/naija-faker.spec.rb
|
109
|
+
```
|
110
|
+
|
111
|
+
## Authors
|
112
|
+
|
113
|
+
👤 **Adebola Adeniran**
|
114
|
+
|
115
|
+
- Github: [@githubhandle](https://github.com/onedebos)
|
116
|
+
- Twitter: [@twitterhandle](https://twitter.com/debosthefirst)
|
117
|
+
- Linkedin: [linkedin](https://www.linkedin.com/in/adebola-niran/)
|
118
|
+
- Web: [Adebola.dev](https://adebola.dev)
|
119
|
+
|
120
|
+
## 🤝 Contributors
|
121
|
+
|
122
|
+
👤 **Nikhil Chaurasia**
|
123
|
+
|
124
|
+
- Github: [Github](https://github.com/nikhil-chaurasia14)
|
125
|
+
- Linkedin: [linkedin](https://www.linkedin.com/in/nikhil-chaurasia-613755192)
|
126
|
+
- Email: [Gmail](nikhil.chaurasia140298@gmail.com)
|
127
|
+
|
128
|
+
## Show your support
|
129
|
+
|
130
|
+
Give a ⭐️ if you like this project!
|
131
|
+
|
132
|
+
## Acknowledgments
|
133
|
+
|
134
|
+
## 📝 License
|
135
|
+
|
136
|
+
This project is [MIT](lic.url) licensed.
|
File without changes
|
data/lib/naija-faker.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: naija-faker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adebola Adeniran
|
@@ -17,9 +17,10 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
-
|
20
|
+
- README.md
|
21
|
+
- lib/data.rb
|
21
22
|
- lib/naija-faker.rb
|
22
|
-
homepage: https://
|
23
|
+
homepage: https://github.com/onedebos/naija-faker-gem
|
23
24
|
licenses:
|
24
25
|
- MIT
|
25
26
|
metadata: {}
|