fantasy_faker 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -6
- data/lib/fantasy_faker.rb +1 -1
- data/lib/fantasy_faker/character.rb +10 -6
- data/spec/character_spec.rb +8 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fab71ef1b33640b72154b8789896a266f66a6912
|
4
|
+
data.tar.gz: 7f9b3361ed0716a389a001bb2c9d61fd05063239
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6031aed127874c3c0738b805f2c79b6ef8527de299c3e0556095ef1a23cf529a8079a835f46bf57f4570d1ac3a7f16ffe8f4fa57422ea1771d1faddf882de343
|
7
|
+
data.tar.gz: 4b42a9011e53bbd68c406c3fc392db9a0c9641c44572fe9a0dde1035d6cdd2c0c2215398dcaa899cd2eb819e454ec00cc31f3395a49f733a78d1587912f20a3d
|
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
[](http://badge.fury.io/rb/fantasy_faker)
|
2
|
+
[](https://codeclimate.com/github/msx2/fantasy_faker)
|
3
|
+
[](https://codeship.com/projects/55108)
|
2
4
|
|
3
5
|
# FantasyFaker
|
4
6
|
|
@@ -31,14 +33,14 @@ $ gem install fantasy_faker
|
|
31
33
|
```ruby
|
32
34
|
require 'fantasy_faker'
|
33
35
|
|
34
|
-
FantasyFaker::Character.
|
36
|
+
FantasyFaker::Character.male_first_name => "Sarillon"
|
35
37
|
FantasyFaker::Character.male_nickname => "Dziecię Pustyni"
|
36
|
-
FantasyFaker::Character.
|
38
|
+
FantasyFaker::Character.male_name => "Sarillon Dziecię Pustyni" # OR "Sarillon"
|
37
39
|
|
38
|
-
FantasyFaker::Character.
|
40
|
+
FantasyFaker::Character.female_first_name => "Linani"
|
39
41
|
FantasyFaker::Character.female_nickname => "Wstydliwa"
|
40
|
-
FantasyFaker::Character.
|
41
|
-
```
|
42
|
+
FantasyFaker::Character.female_name => "Linani Wstydliwa" # OR "Linani"
|
43
|
+
```
|
42
44
|
|
43
45
|
## Contributing
|
44
46
|
|
data/lib/fantasy_faker.rb
CHANGED
@@ -6,7 +6,7 @@ module FantasyFaker
|
|
6
6
|
extend BaseModule
|
7
7
|
extend self
|
8
8
|
|
9
|
-
def
|
9
|
+
def male_first_name
|
10
10
|
"%s%s" % [NAME_PREFIXES_MALE.rand, NAME_SUFIXES_MALE.rand]
|
11
11
|
end
|
12
12
|
|
@@ -14,11 +14,13 @@ module FantasyFaker
|
|
14
14
|
NICKNAMES_MALE.rand
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
18
|
-
|
17
|
+
def male_name
|
18
|
+
first_name = male_first_name
|
19
|
+
|
20
|
+
["#{first_name} #{male_nickname}", first_name].sample
|
19
21
|
end
|
20
22
|
|
21
|
-
def
|
23
|
+
def female_first_name
|
22
24
|
"%s%s" % [NAME_PREFIXES_FEMALE.rand, NAME_SUFIXES_FEMALE.rand]
|
23
25
|
end
|
24
26
|
|
@@ -26,8 +28,10 @@ module FantasyFaker
|
|
26
28
|
NICKNAMES_FEMALE.rand
|
27
29
|
end
|
28
30
|
|
29
|
-
def
|
30
|
-
|
31
|
+
def female_name
|
32
|
+
first_name = female_first_name
|
33
|
+
|
34
|
+
["#{first_name} #{female_nickname}", first_name].sample
|
31
35
|
end
|
32
36
|
|
33
37
|
end
|
data/spec/character_spec.rb
CHANGED
@@ -2,8 +2,8 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe FantasyFaker::Character do
|
4
4
|
|
5
|
-
describe '#
|
6
|
-
subject { described_class.
|
5
|
+
describe '#male_first_name' do
|
6
|
+
subject { described_class.male_first_name }
|
7
7
|
|
8
8
|
it { is_expected.to match(/[a-z]+/i) }
|
9
9
|
end
|
@@ -14,14 +14,14 @@ describe FantasyFaker::Character do
|
|
14
14
|
it { is_expected.to match(/[ a-zęóąśłżźćń]+/i) }
|
15
15
|
end
|
16
16
|
|
17
|
-
describe '#
|
18
|
-
subject { described_class.
|
17
|
+
describe '#male_name' do
|
18
|
+
subject { described_class.male_name }
|
19
19
|
|
20
20
|
it { is_expected.to match(/[ a-zęóąśłżźćń]+/i) }
|
21
21
|
end
|
22
22
|
|
23
|
-
describe '#
|
24
|
-
subject { described_class.
|
23
|
+
describe '#female_first_name' do
|
24
|
+
subject { described_class.female_first_name }
|
25
25
|
|
26
26
|
it { is_expected.to match(/[a-z]+/i) }
|
27
27
|
end
|
@@ -32,8 +32,8 @@ describe FantasyFaker::Character do
|
|
32
32
|
it { is_expected.to match(/[ a-zęóąśłżźćń]+/i) }
|
33
33
|
end
|
34
34
|
|
35
|
-
describe '#
|
36
|
-
subject { described_class.
|
35
|
+
describe '#female_name' do
|
36
|
+
subject { described_class.female_name }
|
37
37
|
|
38
38
|
it { is_expected.to match(/[ a-zęóąśłżźćń]+/i) }
|
39
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fantasy_faker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konrad Jurkowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|