faker 2.6.0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74df7e5e60856bfe1283a1e8de2b425e3b5617dfc9de2a05d651ab7ef69a35c0
4
- data.tar.gz: 53b1457eb640182a15c4a34eb909aa252bd2f34b3990ef28ff2e8390b8417638
3
+ metadata.gz: 6cacd4170df63c267efee25b7e575509b1ff16528a143a916e90c6381bd48a8b
4
+ data.tar.gz: 7165d20574c9994f703d6c5b473b42125c27421754c7e387e3d34d5c174307e7
5
5
  SHA512:
6
- metadata.gz: b5f3096b849d9aca43c94143b40411b52b29ea5c67468dd8a3f880d684ed7df02f4128281ffe36d8d144a3258324e64b3d7f3095177bee0cee066fa309beb14e
7
- data.tar.gz: b303d58bc31496ad5913d273ab05b08b0dd8d45560725e15fd7c44200b0afb674671a2c70e3a291aad65a39367d3bd5b5ca63c206f219df8347fe260d0e41a4a
6
+ metadata.gz: 5fc24fc4438f8737f09597f0f8b7be162f5d609c3e8b7799423eae173635d0762688f51e4790e915913e6e263ba9dbb45f6f02829f4ff5cf1fab724e4118acbd
7
+ data.tar.gz: ca6e471b882bca1b98ab777d6dfdf8798f4cb061d4c98781a8e93869d979ba8eefdf98541387fa309d745cd67fcb5a91b7adc8a23f647da3c8a705291b5f1989
@@ -1,5 +1,38 @@
1
1
  # Change Log
2
2
 
3
+ ## [v2.7.0](https://github.com/faker-ruby/faker/tree/v2.7.0) (2019-11-01)
4
+
5
+ This version:
6
+ - adds `Faker::IDNumber.chilean_id`
7
+ - updates some translations/locales
8
+ - updates local dependencies
9
+ - adds SemVer badge
10
+
11
+ ## Documentation
12
+
13
+ - [PR #1814](https://github.com/faker-ruby/faker/pull/1814) Add Discord link [@vbrazo](https://github.com/vbrazo)
14
+ - [PR #1289](https://github.com/faker-ruby/faker/pull/1289) Add SemVer compatibility badge to README [@greysteil](https://github.com/greysteil)
15
+
16
+ ## Feature Request
17
+
18
+ - [PR #1819](https://github.com/faker-ruby/faker/pull/1819) Adding chilean_id in Faker::IDNumber [@cristofer](https://github.com/cristofer)
19
+
20
+ ## Update locales
21
+
22
+ - [PR #1824](https://github.com/faker-ruby/faker/pull/1824) Added Canadian Country Code [@clinch](https://github.com/clinch)
23
+ - [PR #1817](https://github.com/faker-ruby/faker/pull/1817) Add Japanese animal names [@shouichi](https://github.com/shouichi)
24
+ - [PR #1816](https://github.com/faker-ruby/faker/pull/1816) Add Japanese bank names [@shouichi](https://github.com/shouichi)
25
+ - [PR #1813](https://github.com/faker-ruby/faker/pull/1813) Translate Canadian provinces for fr-CA [@Bhacaz](https://github.com/Bhacaz)
26
+ - [PR #1806](https://github.com/faker-ruby/faker/pull/1806) Add Terry Bogard to Super Smash Bros. options [@clinch](https://github.com/clinch)
27
+
28
+ ## Update local dependencies
29
+
30
+ - Update rubocop requirement from = 0.75.0 to = 0.75.1 (#1811)
31
+ - Update rubocop requirement from = 0.75.1 to = 0.76.0 (#1822)
32
+ - Update minitest requirement from = 5.12.2 to = 5.13.0 (#1823)
33
+
34
+ ------------------------------------------------------------------------------
35
+
3
36
  ## [v2.6.0](https://github.com/faker-ruby/faker/tree/v2.6.0) (2019-10-10)
4
37
 
5
38
  This version:
data/README.md CHANGED
@@ -7,6 +7,7 @@
7
7
  [![Inline docs](https://inch-ci.org/github/faker-ruby/faker.svg?branch=master)](https://inch-ci.org/github/faker-ruby/faker)
8
8
  [![Test Coverage](https://api.codeclimate.com/v1/badges/ef54c7f9df86e965d64b/test_coverage)](https://codeclimate.com/github/stympy/faker/test_coverage)
9
9
  [![Maintainability](https://api.codeclimate.com/v1/badges/ef54c7f9df86e965d64b/maintainability)](https://codeclimate.com/github/stympy/faker/maintainability)
10
+ [![SemVer compatibility](https://api.dependabot.com/badges/compatibility_score?dependency-name=faker&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=faker&package-manager=bundler&version-scheme=semver)
10
11
 
11
12
  This gem is a port of [Perl's Data::Faker library](https://metacpan.org/pod/Data::Faker) that generates fake data.
12
13
 
@@ -360,5 +361,7 @@ See [CONTRIBUTING.md](https://github.com/stympy/faker/blob/master/CONTRIBUTING.m
360
361
  ## Contact
361
362
  Comments and feedback are welcome. Send an email to Benjamin Curtis via the [google group](http://groups.google.com/group/ruby-faker).
362
363
 
364
+ You can also join our [discord channel](https://discord.gg/RMumTwB) to discuss anything regarding improvements or feature requests.
365
+
363
366
  ## License
364
367
  This code is free to use under the terms of the MIT license.
@@ -16,6 +16,8 @@ module Faker
16
16
  BRAZILIAN_ID_FROM = 10_000_000
17
17
  BRAZILIAN_ID_TO = 99_999_999
18
18
 
19
+ CHILEAN_MODULO = 11
20
+
19
21
  class << self
20
22
  def valid
21
23
  _translate('valid')
@@ -105,8 +107,35 @@ module Faker
105
107
 
106
108
  alias brazilian_rg brazilian_id
107
109
 
110
+ def chilean_id
111
+ digits = Faker::Number.number(digits: 8)
112
+ verification_code = chilean_verification_code(digits)
113
+
114
+ digits.to_s + '-' + verification_code.to_s
115
+ end
116
+
108
117
  private
109
118
 
119
+ def chilean_verification_code(digits)
120
+ # First digit is multiplied by 3, second by 2, and so on
121
+ multiplication_rule = [3, 2, 7, 6, 5, 4, 3, 2]
122
+ digits_splitted = digits.to_s.chars.map(&:to_i)
123
+
124
+ sum = digits_splitted.map.with_index { |digit, index| digit * multiplication_rule[index] }.reduce(:+)
125
+
126
+ modulo = sum.modulo(CHILEAN_MODULO)
127
+ difference = CHILEAN_MODULO - modulo
128
+
129
+ case difference
130
+ when 0..9
131
+ difference
132
+ when 10
133
+ 'K'
134
+ when 11
135
+ 0
136
+ end
137
+ end
138
+
110
139
  def south_african_id_checksum_digit(id_number)
111
140
  value_parts = id_number.chars
112
141
  even_digits = value_parts
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Faker #:nodoc:
4
- VERSION = '2.6.0'
4
+ VERSION = '2.7.0'
5
5
  end
@@ -5,6 +5,7 @@ en-CA:
5
5
  state: [Alberta, British Columbia, Manitoba, New Brunswick, Newfoundland and Labrador, Nova Scotia, Northwest Territories, Nunavut, Ontario, Prince Edward Island, Quebec, Saskatchewan, Yukon]
6
6
  state_abbr: ["AB", "BC", "MB", "NB", "NL", "NS", "NU", "NT", "ON", "PE", "QC", "SK", "YT"]
7
7
  default_country: [Canada]
8
+ country_code: [CA]
8
9
 
9
10
  internet:
10
11
  free_email: [gmail.com, yahoo.ca, hotmail.com]
@@ -75,6 +75,7 @@ en:
75
75
  - Snake
76
76
  - Sonic
77
77
  - Squirtle
78
+ - Terry Bogard
78
79
  - Toon Link
79
80
  - Villager
80
81
  - Wario
@@ -2,7 +2,7 @@ fr-CA:
2
2
  faker:
3
3
  address:
4
4
  postcode: /[A-CEJ-NPR-TVXY][0-9][A-CEJ-NPR-TV-Z] ?[0-9][A-CEJ-NPR-TV-Z][0-9]/
5
- state: [Alberta, British Columbia, Manitoba, New Brunswick, Newfoundland and Labrador, Nova Scotia, Northwest Territories, Nunavut, Ontario, Prince Edward Island, Quebec, Saskatchewan, Yukon]
5
+ state: ["Alberta", "Colombie-Britannique", "Île-du-Prince-Édouard", "Manitoba", "Nouveau-Brunswick", "Nouvelle-Écosse", "Nunavut", "Ontario", "Terre-Neuve-et-Labrador", "Territoires du Nord-Ouest", "Québec", "Saskatchewan", "Yukon"]
6
6
  state_abbr: ["AB", "BC", "MB", "NB", "NL", "NS", "NU", "NT", "ON", "PE", "QC", "SK", "YT"]
7
7
  country_code: ['CA']
8
8
  building_number: ['####', '###', '##', '#']
@@ -15,7 +15,11 @@ ja:
15
15
  - "#{Name.first_name}"
16
16
  - "#{Name.last_name}"
17
17
  default_country: [日本]
18
+ bank:
19
+ name: ["日本銀行", "みずほ銀行", "三菱UFJ銀行", "三井住友銀行", "りそな銀行", "埼玉りそな銀行", "三菱UFJ信託銀行", "みずほ信託銀行", "三井住友信託銀行", "バンクオブニューヨークメロン信託銀行", "日本マスタートラスト信託銀行", "野村信託銀行", "オリックス銀行", "あおぞら信託銀行", "農中信託銀行", "中央三井アセット信託銀行", "新生信託銀行", "日証金信託銀行", "日本トラスティ・サービス信託銀行", "資産管理サービス信託銀行", "株式会社SMBC信託銀行", "新生銀行", "あおぞら銀行", "ジャパンネット銀行", "セブン銀行", "ソニー銀行", "楽天銀行", "住信SBIネット銀行", "じぶん銀行", "イオン銀行", "大和ネクスト銀行", "北海道銀行", "青森銀行", "みちのく銀行", "秋田銀行", "北都銀行", "荘内銀行", "山形銀行", "岩手銀行", "東北銀行", "七十七銀行", "東邦銀行", "北洋銀行", "きらやか銀行", "北日本銀行", "仙台銀行", "福島銀行", "大東銀行", "群馬銀行", "足利銀行", "常陽銀行", "筑波銀行", "武蔵野銀行", "千葉銀行", "千葉興業銀行", "横浜銀行", "東和銀行", "栃木銀行", "京葉銀行", "きらぼし銀行", "東日本銀行", "東京スター銀行", "神奈川銀行", "第四銀行", "北越銀行", "山梨中央銀行", "八十二銀行", "北陸銀行", "富山銀行", "北國銀行", "福井銀行", "大光銀行", "長野銀行", "富山第一銀行", "福邦銀行", "静岡銀行", "スルガ銀行", "清水銀行", "大垣共立銀行", "十六銀行", "三重銀行", "百五銀行", "静岡中央銀行", "愛知銀行", "名古屋銀行", "中京銀行", "第三銀行", "滋賀銀行", "京都銀行", "近畿大阪銀行", "池田泉州銀行", "南都銀行", "紀陽銀行", "但馬銀行", "関西みらい銀行", "大正銀行", "みなと銀行", "鳥取銀行", "山陰合同銀行", "中国銀行", "広島銀行", "山口銀行", "阿波銀行", "百十四銀行", "伊予銀行", "四国銀行", "島根銀行", "トマト銀行", "もみじ銀行", "西京銀行", "徳島銀行", "香川銀行", "愛媛銀行", "高知銀行", "福岡銀行", "筑邦銀行", "西日本シティ銀行", "北九州銀行", "佐賀銀行", "十八銀行", "親和銀行", "肥後銀行", "大分銀行", "宮崎銀行", "鹿児島銀行", "琉球銀行", "沖縄銀行", "福岡中央銀行", "佐賀共栄銀行", "長崎銀行", "熊本銀行", "豊和銀行", "宮崎太陽銀行", "南日本銀行", "沖縄海邦銀行"]
18
20
  creature:
21
+ animal:
22
+ name: ["ホンドテン", "ホワイトタイガー", "コツメカワウソ", "マンドリル", "エランド", "アムールヒョウ", "ブラッザグエノン", "カバ", "アルパカ", "ポニー", "オウサマペンギン", "アンデスコンドル", "オシドリ", "チーター", "ホンドリス", "ホンシュウジカ", "タンチョウ", "レッサーパンダ", "アメリカビーバー", "ジェフロイクモザル", "カピバラ", "マレーバク", "アカゲザル", "フンボルトペンギン", "パルマワラビー", "ビルマニシキヘビ", "アカカンガルー", "ワオキツネザル", "ラブラドールレトリバー", "アルダブラゾウガメ", "モルモット", "ヒヨコ(ニワトリ)", "ヤギ", "ヒツジ", "ウサギ", "ブラックバック", "シロクジャク", "ヒグマ", "アクシスジカ", "ヒクイドリ", "エミュー", "アフリカゾウ", "フラミンゴ", "シタツンガ", "ハゴロモヅル", "エジプトガン", "ライオン", "ミーアキャット", "ホオジロカンムリヅル", "コフラミンゴ", "ショウジョウトキ", "オウギバト", "ホンドフクロウ", "ホンドタヌキ", "ホンドキツネ", "オオワシ", "ヘビクイワシ", "コクチョウ", "アメリカバイソン", "ワピチ", "ミナミアフリカオットセイ", "ゴマフアザラシ", "アビシニアコロブス", "マントヒヒ", "シロテテナガザル", "シシオザル", "モモイロペリカン", "コモンリスザル", "オオサイチョウ", "シワコブサイチョウ", "メガネカイマン", "ラマ", "フタコブラクダ", "シナガチョウ", "アライグマ", "エジプトルーセットオオコウモリ", "アフリカタテガミヤマアラシ", "キリン", "ダチョウ", "シロサイ", "シマウマ", "バーバリーシープ"]
19
23
  cat:
20
24
  breed: ["アジアンセミロングヘア", "アビシニアン", "アメリカンカール", "アメリカンショートヘア", "アメリカンボブテイル", "アメリカンワイヤーヘア", "アラビアンマウ", "イジアン", "エキゾチックショートヘア", "エキゾチックフォールド", "エジプシャンマウ", "オーストラリアンミスト", "オシキャット", "オリエンタルショートヘア", "カオマニー", "キムリック", "キンカロー", "コーニッシュレックス", "コラット", "サイベリアン", "ジャパニーズボブテイル", "シャム", "シャルトリュー", "シンガプーラ", "ラパーマ", "リュコイ", "ジャーマンレックス", "ハバマブラウン", "ハイランダーリンクス", "スコティッシュフォールド", "スノーシュー", "スフィンクス", "セルカークレックス", "ソマリ", "クリルアイランドボブテイル", "ターキッシュアンゴラ", "ターキッシュバン", "チャウシー", "チートー", "カラーポイントショートヘア", "コーニッシュレックス", "デボンレックス", "ドンスコイ", "ドラゴンリー", "ヨーロピアンショートヘア", "デボンレックス", "トンキニーズ", "ノルウェージャンフォレストキャット", "バーマン", "バーミーズ", "バーミラ", "バリニーズ", "シャンティリー", "バンビーノ", "ヒマラヤン", "メコンボブテイル", "ミンスキン", "ブラジリアンショートヘア", "ブリティッシュロングヘア", "ブリティッシュショートヘア", "カリフォルニアスパングルド", "ペルシャ", "ベンガル", "ボンベイ", "マンクス", "マンチカン", "ミヌエット", "メインクーン", "ヨーロピアンバーミーズ", "ラガマフィン", "ラグドール", "ラパーマ", "ラムキン", "ロシアンブルー"]
21
25
  dog:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faker
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Curtis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-10-10 00:00:00.000000000 Z
12
+ date: 2019-11-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
@@ -37,14 +37,14 @@ dependencies:
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 5.12.2
40
+ version: 5.13.0
41
41
  type: :development
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 5.12.2
47
+ version: 5.13.0
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: pry
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -79,14 +79,14 @@ dependencies:
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 0.75.0
82
+ version: 0.76.0
83
83
  type: :development
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 0.75.0
89
+ version: 0.76.0
90
90
  - !ruby/object:Gem::Dependency
91
91
  name: simplecov
92
92
  requirement: !ruby/object:Gem::Requirement