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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8c2e7f6f48a4ccfcbf734f40931eaeafd45e395
4
- data.tar.gz: ac553ba2b7c61ef3f39a8d840a09d60a6b261a80
3
+ metadata.gz: fab71ef1b33640b72154b8789896a266f66a6912
4
+ data.tar.gz: 7f9b3361ed0716a389a001bb2c9d61fd05063239
5
5
  SHA512:
6
- metadata.gz: 0e16b1f89f316bc4a45328bbc1847188cb954887e3efa4cdf433822bbf1ac1e9aa49ada1f9971f550234bff99c0526517d902a7d5b3c4e9c565ae0621b9a6fe6
7
- data.tar.gz: bf32221ad679f2c8ab1738d220dfcbad490d140095d507c31c1303005d4cb106f22496d50bbdd993d0d9eb7b5e3c016ceab65c136b9deb11a7699c353190aa97
6
+ metadata.gz: 6031aed127874c3c0738b805f2c79b6ef8527de299c3e0556095ef1a23cf529a8079a835f46bf57f4570d1ac3a7f16ffe8f4fa57422ea1771d1faddf882de343
7
+ data.tar.gz: 4b42a9011e53bbd68c406c3fc392db9a0c9641c44572fe9a0dde1035d6cdd2c0c2215398dcaa899cd2eb819e454ec00cc31f3395a49f733a78d1587912f20a3d
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
- [![Codeship Status for msx2/fantasy_faker](https://codeship.com/projects/367f3fe0-7500-0132-c61e-22ab3bab314c/status?branch=master)](https://codeship.com/projects/55108) [![Code Climate](https://codeclimate.com/github/msx2/fantasy_faker/badges/gpa.svg)](https://codeclimate.com/github/msx2/fantasy_faker)
1
+ [![Gem Version](https://badge.fury.io/rb/fantasy_faker.svg)](http://badge.fury.io/rb/fantasy_faker)
2
+ [![Code Climate](https://codeclimate.com/github/msx2/fantasy_faker/badges/gpa.svg)](https://codeclimate.com/github/msx2/fantasy_faker)
3
+ [![Codeship Status for msx2/fantasy_faker](https://codeship.com/projects/367f3fe0-7500-0132-c61e-22ab3bab314c/status?branch=master)](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.male_name => "Sarillon"
36
+ FantasyFaker::Character.male_first_name => "Sarillon"
35
37
  FantasyFaker::Character.male_nickname => "Dziecię Pustyni"
36
- FantasyFaker::Character.male_full_name => "Aemanti Lepka Dłoń"
38
+ FantasyFaker::Character.male_name => "Sarillon Dziecię Pustyni" # OR "Sarillon"
37
39
 
38
- FantasyFaker::Character.female_name => "Linani"
40
+ FantasyFaker::Character.female_first_name => "Linani"
39
41
  FantasyFaker::Character.female_nickname => "Wstydliwa"
40
- FantasyFaker::Character.female_full_name => "Setaris Krwawa Klinga"
41
- ```
42
+ FantasyFaker::Character.female_name => "Linani Wstydliwa" # OR "Linani"
43
+ ```
42
44
 
43
45
  ## Contributing
44
46
 
data/lib/fantasy_faker.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module FantasyFaker
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
 
4
4
  require 'fantasy_faker/utils/array_utils'
5
5
  require 'fantasy_faker/utils/base_module'
@@ -6,7 +6,7 @@ module FantasyFaker
6
6
  extend BaseModule
7
7
  extend self
8
8
 
9
- def male_name
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 male_full_name
18
- "%s %s" % [male_name, male_nickname]
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 female_name
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 female_full_name
30
- "%s %s" % [female_name, female_nickname]
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
@@ -2,8 +2,8 @@ require 'spec_helper'
2
2
 
3
3
  describe FantasyFaker::Character do
4
4
 
5
- describe '#male_name' do
6
- subject { described_class.male_name }
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 '#male_full_name' do
18
- subject { described_class.male_nickname }
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 '#female_name' do
24
- subject { described_class.female_name }
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 '#female_full_name' do
36
- subject { described_class.female_nickname }
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.2
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-02 00:00:00.000000000 Z
11
+ date: 2015-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler