From 97cfd1a1b0522a16b402e9d14c3248076b24c942 Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Wed, 17 Jul 2024 15:40:44 +0200 Subject: [PATCH 01/25] Fix typos (#2982) --- CHANGELOG.md | 2 +- lib/faker/default/invoice.rb | 2 +- lib/faker/movies/star_wars.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43a4b1eec9..19679289e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2549,7 +2549,7 @@ Fix lib/faker/version.rb - Fixed typo in dutch translation [\#679](https://github.com/stympy/faker/pull/679) ([nschmoller](https://github.com/nschmoller)) - Add pokemon [\#677](https://github.com/stympy/faker/pull/677) ([bakunyo](https://github.com/bakunyo)) - Food [\#672](https://github.com/stympy/faker/pull/672) ([martymclaugh](https://github.com/martymclaugh)) -- Added charcaters and houses data for game of thrones in en.yml [\#670](https://github.com/stympy/faker/pull/670) ([vamsipavanmahesh](https://github.com/vamsipavanmahesh)) +- Added characters and houses data for game of thrones in en.yml [\#670](https://github.com/stympy/faker/pull/670) ([vamsipavanmahesh](https://github.com/vamsipavanmahesh)) - add Faker::Commerce.promotion\_code [\#669](https://github.com/stympy/faker/pull/669) ([jGRUBBS](https://github.com/jGRUBBS)) - Eliminate and prevent leading and trailing white space [\#665](https://github.com/stympy/faker/pull/665) ([retroGiant89](https://github.com/retroGiant89)) - Fix for memory overflow error Issue: \#478 [\#664](https://github.com/stympy/faker/pull/664) ([anuj-verma](https://github.com/anuj-verma)) diff --git a/lib/faker/default/invoice.rb b/lib/faker/default/invoice.rb index 46d47c897f..2913ce767b 100644 --- a/lib/faker/default/invoice.rb +++ b/lib/faker/default/invoice.rb @@ -22,7 +22,7 @@ def amount_between(from: 0, to: 0) end ## - # Produces a random valid reference accoring to the International bank slip reference https://en.wikipedia.org/wiki/Creditor_Reference + # Produces a random valid reference according to the International bank slip reference https://en.wikipedia.org/wiki/Creditor_Reference # # @param ref [String] Specifies reference base. # @return [String] diff --git a/lib/faker/movies/star_wars.rb b/lib/faker/movies/star_wars.rb index 279870eb58..a5e26f7695 100644 --- a/lib/faker/movies/star_wars.rb +++ b/lib/faker/movies/star_wars.rb @@ -204,7 +204,7 @@ def characters # @example # Faker::Movies::StarWars.droids # - # @faker.versionn 1.6.2 + # @faker.version 1.6.2 def droids fetch_all('star_wars.droids') end From 3b2d4db43fc2579c65327aa5568a0731352c956a Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Fri, 9 Aug 2024 02:59:23 +0900 Subject: [PATCH 02/25] Exclude Faker::Deprecator module from benchmark target follows up f586da74ebbf2eda105d3be5d22ccf2e4e031903 --- tasks/benchmark.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/benchmark.rake b/tasks/benchmark.rake index ed0bea4cc4..501224402b 100644 --- a/tasks/benchmark.rake +++ b/tasks/benchmark.rake @@ -48,7 +48,7 @@ class BenchmarkHelper def subclasses Faker.constants.delete_if do |subclass| - %i[Base Bank Books Cat Char Base58 ChileRut CLI Config Creature Date Dog DragonBall Dota ElderScrolls Fallout Games GamesHalfLife HeroesOfTheStorm Internet JapaneseMedia LeagueOfLegends Movies Myst Overwatch OnePiece Pokemon Religion Sports SwordArtOnline TvShows Time VERSION Witcher WorldOfWarcraft Zelda].include?(subclass) + %i[Base Bank Books Cat Char Base58 ChileRut CLI Config Creature Date Deprecator Dog DragonBall Dota ElderScrolls Fallout Games GamesHalfLife HeroesOfTheStorm Internet JapaneseMedia LeagueOfLegends Movies Myst Overwatch OnePiece Pokemon Religion Sports SwordArtOnline TvShows Time VERSION Witcher WorldOfWarcraft Zelda].include?(subclass) end.sort end From 4a46d17f9215faff294f5213969d14b57900a1ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:28:52 -0600 Subject: [PATCH 03/25] Bump rubocop from 1.65.0 to 1.65.1 (#2986) Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.65.0 to 1.65.1. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.65.0...v1.65.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 1dc8f5ac5e..e31b3e5d21 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ gem 'benchmark' gem 'minitest', '5.24.1' gem 'pry', '0.14.2' gem 'rake', '13.2.1' -gem 'rubocop', '1.65.0' +gem 'rubocop', '1.65.1' gem 'rubocop-minitest', '0.35.1' gem 'rubocop-rake', '0.6.0' gem 'simplecov', '0.22.0' diff --git a/Gemfile.lock b/Gemfile.lock index 6b69c581d5..3e856c0429 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -26,13 +26,13 @@ GEM pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - racc (1.8.0) + racc (1.8.1) rainbow (3.1.1) rake (13.2.1) regexp_parser (2.9.2) - rexml (3.3.1) + rexml (3.3.4) strscan - rubocop (1.65.0) + rubocop (1.65.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -74,7 +74,7 @@ DEPENDENCIES minitest (= 5.24.1) pry (= 0.14.2) rake (= 13.2.1) - rubocop (= 1.65.0) + rubocop (= 1.65.1) rubocop-minitest (= 0.35.1) rubocop-rake (= 0.6.0) simplecov (= 0.22.0) From 130a504eb9c7a802a5f3bd5358c9aa614dd89a85 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 15:42:37 -0600 Subject: [PATCH 04/25] Bump minitest from 5.24.1 to 5.25.0 (#2991) Bumps [minitest](https://github.com/minitest/minitest) from 5.24.1 to 5.25.0. - [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc) - [Commits](https://github.com/minitest/minitest/compare/v5.24.1...v5.25.0) --- updated-dependencies: - dependency-name: minitest dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index e31b3e5d21..2a2cff4bb4 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ source 'https://rubygems.org' gemspec gem 'benchmark' -gem 'minitest', '5.24.1' +gem 'minitest', '5.25.0' gem 'pry', '0.14.2' gem 'rake', '13.2.1' gem 'rubocop', '1.65.1' diff --git a/Gemfile.lock b/Gemfile.lock index 3e856c0429..2f33a90102 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,7 +17,7 @@ GEM json (2.7.2) language_server-protocol (3.17.0.3) method_source (1.0.0) - minitest (5.24.1) + minitest (5.25.0) parallel (1.25.1) parser (3.3.4.0) ast (~> 2.4.1) @@ -71,7 +71,7 @@ PLATFORMS DEPENDENCIES benchmark faker! - minitest (= 5.24.1) + minitest (= 5.25.0) pry (= 0.14.2) rake (= 13.2.1) rubocop (= 1.65.1) From f86ba5e35f190909b99918876b8404e0b1869873 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Fri, 30 Aug 2024 09:00:09 -0600 Subject: [PATCH 05/25] Deprecator improvements In preparation for removing deprecations for certain generators, this commit documents the Deprecator and how to test deprecated generators. It also adds a unit test using newly added matchers based on Rails deprecation matchers. With this change, we can remove generators in a follow up PR while having the Deprecator covered and documented. --- lib/helpers/deprecator.rb | 71 +++++++++++++++++++++++++-- test/helpers/test_faker_deprecator.rb | 53 ++++++++++++++++++++ test/support/deprecation.rb | 41 ++++++++++++++++ test/test_faker_deprecator.rb | 23 --------- test/test_helper.rb | 1 + 5 files changed, 163 insertions(+), 26 deletions(-) create mode 100644 test/helpers/test_faker_deprecator.rb create mode 100644 test/support/deprecation.rb delete mode 100644 test/test_faker_deprecator.rb diff --git a/lib/helpers/deprecator.rb b/lib/helpers/deprecator.rb index 8cf7532ba8..fd46ac5849 100644 --- a/lib/helpers/deprecator.rb +++ b/lib/helpers/deprecator.rb @@ -1,17 +1,70 @@ # frozen_string_literal: true # Based on Rails ActiveSupport Deprecator -# https://github.com/rails/rails/blob/6f0d1ad14b92b9f5906e44740fce8b4f1c7075dc/activesupport/lib/active_support/deprecation/constant_accessor.rb +# https://github.com/rails/rails/blob/main/activesupport/lib/active_support/deprecation/constant_accessor.rb # rubocop:disable Style/ClassVars module Faker + # Provides a way to rename generators, including their namespaces, with a deprecation cycle in which + # both the old and new names work, but using the old one prints a deprecation message. + # + # Deprecator provides a deprecate_generator method to be used when + # renaming a generator. For example, let's say we want to change the following Generator's + # name to Faker::NewGenerator: + # + # module Faker + # class Generator + # def self.generate + # "be kind" + # end + # end + # end + # + # To rename it, you need to do the update the name and declare the deprecation by + # including the Deprecator module and using the deprecate_generator method: + # + # module Faker + # class NewGenerator + # def self.generate + # "be kind" + # end + # end + # + # include Deprecator + # deprecate_generator('DeprecatedGenerator', NewGenerator) + # end + # + # The first argument is a constant name (no colons) as a string. It is the name of + # the constant you want to deprecate. + # + # The second argument is the constant path of the replacement (no colons) as a constant. + # + # For this to work, a +const_missing+ hook is installed. When users + # reference the deprecated constant, the callback prints the + # message and constantizes the replacement. + # + # With that in place, references to Faker::Deprecator still work, they + # evaluate to Faker::NewGenerator now, and trigger a deprecation warning: + # + # Faker::Generator.generate + # # DEPRECATION WARNING: Faker::Generator is deprecated. Use Faker::NewGenerator instead + # # "be kind" + # + # For testing the deprecations, we provide assert_deprecated + # and assert_not_deprecated matchers. + # + # There's also a Faker::Deprecator.skip_warning helper to silence + # the deprecation messages in the *test* output. Use it for generators that have lots of tests + # to avoid too many noise when running the tests. module Deprecator def self.included(base) extension = Module.new do def const_missing(missing_const_name) if class_variable_defined?(:@@_deprecated_constants) && (replacement = class_variable_get(:@@_deprecated_constants)[missing_const_name.to_s]) unless Faker::Deprecator.skip_warning? - $stdout.puts("DEPRECATION WARNING: #{name}::#{replacement[:old_generator]} is deprecated. Use #{replacement[:new_constant]} instead.") + deprecated_message = "#{name}::#{replacement[:old_generator]} is deprecated." + replacement_message = "Use #{replacement[:new_constant]} instead." + $stdout.puts("DEPRECATION WARNING: #{deprecated_message} #{replacement_message}") end return replacement[:new_constant] @@ -22,13 +75,25 @@ def const_missing(missing_const_name) def deprecate_generator(old_generator_name, new_generator_constant) class_variable_set(:@@_deprecated_constants, {}) unless class_variable_defined?(:@@_deprecated_constants) - class_variable_get(:@@_deprecated_constants)[old_generator_name] = { new_constant: new_generator_constant, old_generator: old_generator_name } + class_variable_get(:@@_deprecated_constants)[old_generator_name] = { + new_constant: new_generator_constant, + old_generator: old_generator_name + } end end base.singleton_class.prepend extension end + # Silence deprecation warnings within the block. + # + # Faker::Generator.generate + # # => DEPRECATION WARNING: Faker::Generator is deprecated. Use Faker::NewGenerator instead. + # + # Faker::Deprecator.skip_warning do + # Faker::Generator.generate + # end + # # => nil def self.skip_warning original = Faker::Deprecator.skip Faker::Deprecator.skip = true diff --git a/test/helpers/test_faker_deprecator.rb b/test/helpers/test_faker_deprecator.rb new file mode 100644 index 0000000000..931bf96e87 --- /dev/null +++ b/test/helpers/test_faker_deprecator.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +require_relative '../test_helper' + +class TestFakerDeprecation < Test::Unit::TestCase + def test_using_a_deprecated_generator_returns_a_warning_message + assert_deprecated do + Faker::Dogs.say + end + + assert_equal 'meow', Faker::Dogs.say + end + + def test_using_a_non_deprecated_generator_does_not_return_a_warning_message + assert_not_deprecated do + Faker::Cats.say + end + assert_equal 'meow', Faker::Cats.say + end + + def test_testing_a_deprecated_generator_with_skip_warning_does_not_return_a_warning_message + actual_stdout, actual_stderr = capture_output do + Faker::Deprecator.skip_warning do + Faker::Dogs.say + end + end + + assert_empty(actual_stdout) + assert_empty(actual_stderr) + assert_equal 'meow', Faker::Dogs.say + end + + def test_deprecated_with_skip_warning_does_not_generate_message + Faker::Deprecator.skip_warning do + assert_not_deprecated do + Faker::Dogs.say + end + end + + assert_equal 'meow', Faker::Dogs.say + end +end + +module Faker + class Cats < Base + def self.say + 'meow' + end + end + + include Faker::Deprecator + deprecate_generator('Dogs', Cats) +end diff --git a/test/support/deprecation.rb b/test/support/deprecation.rb new file mode 100644 index 0000000000..0f98e5a2fe --- /dev/null +++ b/test/support/deprecation.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Based on Rails Testing Deprecator +# https://github.com/rails/rails/blob/main/activesupport/lib/active_support/testing/deprecation.rb + +# Asserts that a matching deprecation warning was emitted during the execution of the yielded block. +# +# assert_deprecated do +# DeprecatedGenerator.generate +# end +# +def assert_deprecated(&block) + warning = with_captured_stdout(&block) + result = yield block + + refute_predicate warning, :empty?, 'Expected a deprecation warning within the block but received none' + + result +end + +# Asserts that no deprecation warnings are emitted during the execution of the yielded block. +# +# assert_not_deprecated do +# Faker::Internet.email +# end +def assert_not_deprecated(&block) + warning = with_captured_stdout(&block) + result = yield block + + assert_predicate warning, :empty?, "Expected no deprecation warning within the block but received a deprecation: #{warning}" + result +end + +def with_captured_stdout(&block) + original_stdout = $stdout + $stdout = StringIO.new + yield block + $stdout.string +ensure + $stdout = original_stdout +end diff --git a/test/test_faker_deprecator.rb b/test/test_faker_deprecator.rb deleted file mode 100644 index 0083a2203c..0000000000 --- a/test/test_faker_deprecator.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require_relative 'test_helper' - -class TestFakerDeprecation < Test::Unit::TestCase - def test_using_a_deprecated_generator_returns_a_warning_message - actual_stdout, actual_stderr = capture_output do - Faker::IDNumber.valid - end - - assert_includes(actual_stdout, 'DEPRECATION WARNING: Faker::IDNumber is deprecated. Use Faker::IdNumber instead') - assert_empty(actual_stderr) - end - - def test_using_a_non_deprecated_generator_does_not_return_a_warning_message - actual_stdout, actual_stderr = capture_output do - Faker::IdNumber.valid - end - - assert_empty(actual_stdout) - assert_empty(actual_stderr) - end -end diff --git a/test/test_helper.rb b/test/test_helper.rb index 5d615e92e6..53588e9296 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -11,6 +11,7 @@ require_relative 'support/assert_not_english' require_relative 'support/assert_email_regex' +require_relative 'support/deprecation' require 'minitest/autorun' require 'test/unit' require 'rubygems' From d8b23276ea25729f6e66f83193ecedeec651e82b Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Fri, 30 Aug 2024 12:18:09 -0600 Subject: [PATCH 06/25] Bump minitest version for ruby head compatibility --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 2a2cff4bb4..1627e22992 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ source 'https://rubygems.org' gemspec gem 'benchmark' -gem 'minitest', '5.25.0' +gem 'minitest', '5.25.1' gem 'pry', '0.14.2' gem 'rake', '13.2.1' gem 'rubocop', '1.65.1' diff --git a/Gemfile.lock b/Gemfile.lock index 2f33a90102..4465b72b62 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,7 +17,7 @@ GEM json (2.7.2) language_server-protocol (3.17.0.3) method_source (1.0.0) - minitest (5.25.0) + minitest (5.25.1) parallel (1.25.1) parser (3.3.4.0) ast (~> 2.4.1) @@ -71,7 +71,7 @@ PLATFORMS DEPENDENCIES benchmark faker! - minitest (= 5.25.0) + minitest (= 5.25.1) pry (= 0.14.2) rake (= 13.2.1) rubocop (= 1.65.1) From 961cafd7486a1902ae86f79e01c7d08f717976f8 Mon Sep 17 00:00:00 2001 From: muri Date: Tue, 3 Sep 2024 18:47:20 -0300 Subject: [PATCH 07/25] Add Brazilian Portuguese translations for `Faker::Subscription` (#2960) * Add Brazilian Portuguese translations for `Faker::Subscription` * Fix typo in yml * Remove tests for subscriptions * Add and revise payment and plan terms --------- Co-authored-by: Stefanni Brasil --- lib/locales/pt-BR.yml | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/lib/locales/pt-BR.yml b/lib/locales/pt-BR.yml index b27b16d45d..d143dcc976 100644 --- a/lib/locales/pt-BR.yml +++ b/lib/locales/pt-BR.yml @@ -6873,6 +6873,56 @@ pt-BR: - "(#{PhoneNumber.area_code}) #{PhoneNumber.subscriber_number}-#{PhoneNumber.subscriber_number}" subscriber_number: - "####" + subscription: + plans: + - Teste gratuito + - Básico + - Starter + - Essencial + - Estudante + - Bronze + - Standard + - Prata + - Ouro + - Platinum + - Profissional + - Business + - Diamante + - Premium + statuses: + - Ativo + - Inativo + - Bloqueado + - Pendente + payment_methods: + - Cartão de crédito + - Cartão de débito + - Paypal + - Dinheiro + - Transferência de dinheiro + - Bitcoins + - Cheque + - Apple Pay + - Google Pay + - WeChat Pay + - Alipay + - Visa Checkout + - Pix + - Boleto + subscription_terms: + - Diária + - Semanal + - Mensal + - Anual + - Bienal + - Trienal + - Quinquenal + - Vitalícia + payment_terms: + - Pagamento antecipado + - Mensal + - Anual + - Assinatura completa cell_phone: formats: - "(#{PhoneNumber.area_code}) 9#{PhoneNumber.subscriber_number}-#{PhoneNumber.subscriber_number}" From 2aff94317712b76f80338bacd2067e5e6ff482f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 23:53:37 +0000 Subject: [PATCH 08/25] Bump yard from 0.9.36 to 0.9.37 Bumps [yard](https://github.com/lsegal/yard) from 0.9.36 to 0.9.37. - [Release notes](https://github.com/lsegal/yard/releases) - [Changelog](https://github.com/lsegal/yard/blob/main/CHANGELOG.md) - [Commits](https://github.com/lsegal/yard/compare/v0.9.36...v0.9.37) --- updated-dependencies: - dependency-name: yard dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 2a2cff4bb4..03dad3e39a 100644 --- a/Gemfile +++ b/Gemfile @@ -15,4 +15,4 @@ gem 'rubocop-rake', '0.6.0' gem 'simplecov', '0.22.0' gem 'test-unit', '3.6.2' gem 'timecop', '0.9.10' -gem 'yard', '0.9.36' +gem 'yard', '0.9.37' diff --git a/Gemfile.lock b/Gemfile.lock index 2f33a90102..48decf314a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -62,7 +62,7 @@ GEM power_assert timecop (0.9.10) unicode-display_width (2.5.0) - yard (0.9.36) + yard (0.9.37) PLATFORMS arm64-darwin-22 @@ -80,7 +80,7 @@ DEPENDENCIES simplecov (= 0.22.0) test-unit (= 3.6.2) timecop (= 0.9.10) - yard (= 0.9.36) + yard (= 0.9.37) BUNDLED WITH 2.4.22 From caa55073c3217c65c4929c49d48cf5b0617d5fb6 Mon Sep 17 00:00:00 2001 From: Adam Tanner <27502+admtnnr@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:12:05 -0400 Subject: [PATCH 09/25] Faker::Alphanumeric.alphanumeric determinism fix (#2996) * Faker::Alphanumeric.alphanumeric determinism fix * Faker::Alphanumeric.alphanumeric changes from PR feedback --- lib/faker.rb | 4 ++++ lib/faker/default/alphanumeric.rb | 2 +- test/faker/default/test_alphanum.rb | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/faker.rb b/lib/faker.rb index ad286e67f0..46c2547dd7 100644 --- a/lib/faker.rb +++ b/lib/faker.rb @@ -249,6 +249,10 @@ def shuffle(list) list.shuffle(random: Faker::Config.random) end + def shuffle!(list) + list.shuffle!(random: Faker::Config.random) + end + def rand(max = nil) if max.nil? Faker::Config.random.rand diff --git a/lib/faker/default/alphanumeric.rb b/lib/faker/default/alphanumeric.rb index 83caf4ec23..7ddaa5ff62 100644 --- a/lib/faker/default/alphanumeric.rb +++ b/lib/faker/default/alphanumeric.rb @@ -60,7 +60,7 @@ def alphanumeric(number: 32, min_alpha: 0, min_numeric: 0) randoms = Array.new(random_count) { sample(ALPHANUMS) } combined = alphas + numbers + randoms - combined.shuffle.join + shuffle!(combined).join end end end diff --git a/test/faker/default/test_alphanum.rb b/test/faker/default/test_alphanum.rb index 7b4ed11fdb..bcaf856054 100644 --- a/test/faker/default/test_alphanum.rb +++ b/test/faker/default/test_alphanum.rb @@ -48,4 +48,12 @@ def test_alphanumeric_with_min_numeric assert_operator numbers.compact.size, :>=, 4 end + + def test_alphanumeric_with_min_alpha_and_min_numeric + deterministically_verify -> { @tester.alphanumeric(number: 10, min_alpha: 5, min_numeric: 5) } do |alphanum| + assert_equal 10, alphanum.size + assert_equal 5, alphanum.scan(/[[:alpha:]]/).size + assert_equal 5, alphanum.scan(/[[:digit:]]/).size + end + end end From 95519f52a80e9ce633dc660bb7dced2a39cc02f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:35:27 +0000 Subject: [PATCH 10/25] Bump rubocop-minitest from 0.35.1 to 0.36.0 Bumps [rubocop-minitest](https://github.com/rubocop/rubocop-minitest) from 0.35.1 to 0.36.0. - [Release notes](https://github.com/rubocop/rubocop-minitest/releases) - [Changelog](https://github.com/rubocop/rubocop-minitest/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-minitest/compare/v0.35.1...v0.36.0) --- updated-dependencies: - dependency-name: rubocop-minitest dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index 1627e22992..64ccc95866 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,7 @@ gem 'minitest', '5.25.1' gem 'pry', '0.14.2' gem 'rake', '13.2.1' gem 'rubocop', '1.65.1' -gem 'rubocop-minitest', '0.35.1' +gem 'rubocop-minitest', '0.36.0' gem 'rubocop-rake', '0.6.0' gem 'simplecov', '0.22.0' gem 'test-unit', '3.6.2' diff --git a/Gemfile.lock b/Gemfile.lock index 4465b72b62..2346e343d6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,8 +18,8 @@ GEM language_server-protocol (3.17.0.3) method_source (1.0.0) minitest (5.25.1) - parallel (1.25.1) - parser (3.3.4.0) + parallel (1.26.3) + parser (3.3.5.0) ast (~> 2.4.1) racc power_assert (2.0.3) @@ -30,8 +30,7 @@ GEM rainbow (3.1.1) rake (13.2.1) regexp_parser (2.9.2) - rexml (3.3.4) - strscan + rexml (3.3.7) rubocop (1.65.1) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -43,9 +42,9 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) + rubocop-ast (1.32.3) parser (>= 3.3.1.0) - rubocop-minitest (0.35.1) + rubocop-minitest (0.36.0) rubocop (>= 1.61, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) @@ -57,7 +56,6 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - strscan (3.1.0) test-unit (3.6.2) power_assert timecop (0.9.10) @@ -75,7 +73,7 @@ DEPENDENCIES pry (= 0.14.2) rake (= 13.2.1) rubocop (= 1.65.1) - rubocop-minitest (= 0.35.1) + rubocop-minitest (= 0.36.0) rubocop-rake (= 0.6.0) simplecov (= 0.22.0) test-unit (= 3.6.2) From 7490facae4f44a7fa35f3ae98917c816b22e81dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 23:05:29 +0000 Subject: [PATCH 11/25] Bump rubocop from 1.65.1 to 1.66.1 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.65.1 to 1.66.1. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.65.1...v1.66.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 64ccc95866..5ecffb6fa4 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ gem 'benchmark' gem 'minitest', '5.25.1' gem 'pry', '0.14.2' gem 'rake', '13.2.1' -gem 'rubocop', '1.65.1' +gem 'rubocop', '1.66.1' gem 'rubocop-minitest', '0.36.0' gem 'rubocop-rake', '0.6.0' gem 'simplecov', '0.22.0' diff --git a/Gemfile.lock b/Gemfile.lock index 2346e343d6..8dcae8f08b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,16 +30,14 @@ GEM rainbow (3.1.1) rake (13.2.1) regexp_parser (2.9.2) - rexml (3.3.7) - rubocop (1.65.1) + rubocop (1.66.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.4, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.32.3) @@ -59,7 +57,7 @@ GEM test-unit (3.6.2) power_assert timecop (0.9.10) - unicode-display_width (2.5.0) + unicode-display_width (2.6.0) yard (0.9.36) PLATFORMS @@ -72,7 +70,7 @@ DEPENDENCIES minitest (= 5.25.1) pry (= 0.14.2) rake (= 13.2.1) - rubocop (= 1.65.1) + rubocop (= 1.66.1) rubocop-minitest (= 0.36.0) rubocop-rake (= 0.6.0) simplecov (= 0.22.0) From 33bbe3a45b058585b66aac26d8253620823bd15c Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Mon, 9 Sep 2024 18:22:15 +0200 Subject: [PATCH 12/25] Remove CodeClimate badges Code Climate integration is removed due to access issues after the project moved to an organization. We will reassess the need for a static analysis tool in the future. This commit removes the Code Climate configuration and badge from the repository and updates CI to remove related steps. Close #2983 --- .github/workflows/ruby.yml | 13 ------------- README.md | 2 -- 2 files changed, 15 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 110f681399..60d97bb8af 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -55,18 +55,5 @@ jobs: - name: Install dependencies run: bundle install - - name: Setup Code Climate test-reporter - run: | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build - - name: Run tests run: bundle exec rake test - - - name: Publish code coverage - env: - CC_TEST_REPORTER_ID: c9b8356df2031a5a72462555fe898245cf24d83c7bb82c40ddb5c6c6976c4319 - run: | - export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" - ./cc-test-reporter after-build -r $CC_TEST_REPORTER_ID diff --git a/README.md b/README.md index e6356c0b2a..c0cb756e40 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ [![Tests](https://github.com/faker-ruby/faker/workflows/Tests/badge.svg)](https://github.com/faker-ruby/faker/actions?query=workflow%3ATests) [![Gem Version](https://badge.fury.io/rb/faker.svg)](https://badge.fury.io/rb/faker) [![Inline docs](https://inch-ci.org/github/faker-ruby/faker.svg?branch=main)](https://inch-ci.org/github/faker-ruby/faker) -[![Test Coverage](https://api.codeclimate.com/v1/badges/ef54c7f9df86e965d64b/test_coverage)](https://codeclimate.com/github/stympy/faker/test_coverage) -[![Maintainability](https://api.codeclimate.com/v1/badges/ef54c7f9df86e965d64b/maintainability)](https://codeclimate.com/github/stympy/faker/maintainability) Faker is a port of [Perl's Data::Faker library](https://metacpan.org/pod/Data::Faker). It's a library for generating fake data such as names, addresses, and phone numbers. From 690006faa804c3391af8b3cde8b9d2fc6e7f421e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 23:58:36 +0000 Subject: [PATCH 13/25] Bump i18n from 1.14.5 to 1.14.6 Bumps [i18n](https://github.com/ruby-i18n/i18n) from 1.14.5 to 1.14.6. - [Release notes](https://github.com/ruby-i18n/i18n/releases) - [Changelog](https://github.com/ruby-i18n/i18n/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby-i18n/i18n/compare/v1.14.5...v1.14.6) --- updated-dependencies: - dependency-name: i18n dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c231967f38..2d7b43f6d0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,9 +10,9 @@ GEM ast (2.4.2) benchmark (0.3.0) coderay (1.1.3) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.4) docile (1.4.0) - i18n (1.14.5) + i18n (1.14.6) concurrent-ruby (~> 1.0) json (2.7.2) language_server-protocol (3.17.0.3) From 68de42c847e731e24e2fc44d344cbaf3499a3428 Mon Sep 17 00:00:00 2001 From: Nick Dirschel Date: Thu, 26 Sep 2024 13:25:52 -0400 Subject: [PATCH 14/25] Update Company.logo example url The logos are on pigment.github.io, not pigment.github.com --- doc/default/company.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/default/company.md b/doc/default/company.md index 5e0774c65d..3cf92b16e4 100644 --- a/doc/default/company.md +++ b/doc/default/company.md @@ -22,7 +22,7 @@ Faker::Company.ein #=> "34-8488813" Faker::Company.duns_number #=> "08-341-3736" # Get a random company logo url in PNG format. -Faker::Company.logo #=> "https://pigment.github.com/fake-logos/logos/medium/color/5.png" +Faker::Company.logo #=> "https://pigment.github.io/fake-logos/logos/medium/color/5.png" Faker::Company.type #=> "Privately Held" From 5507705008477c931ae0a94529939da93887b7ef Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Tue, 15 Oct 2024 19:04:41 -0600 Subject: [PATCH 15/25] Bump Rubocop and fix offense --- Gemfile | 2 +- Gemfile.lock | 4 ++-- lib/faker.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 4bff00d252..9dc1045789 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ gem 'benchmark' gem 'minitest', '5.25.1' gem 'pry', '0.14.2' gem 'rake', '13.2.1' -gem 'rubocop', '1.66.1' +gem 'rubocop', '1.67.0' gem 'rubocop-minitest', '0.36.0' gem 'rubocop-rake', '0.6.0' gem 'simplecov', '0.22.0' diff --git a/Gemfile.lock b/Gemfile.lock index 2d7b43f6d0..55b0cb693c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,7 +30,7 @@ GEM rainbow (3.1.1) rake (13.2.1) regexp_parser (2.9.2) - rubocop (1.66.1) + rubocop (1.67.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -70,7 +70,7 @@ DEPENDENCIES minitest (= 5.25.1) pry (= 0.14.2) rake (= 13.2.1) - rubocop (= 1.66.1) + rubocop (= 1.67.0) rubocop-minitest (= 0.36.0) rubocop-rake (= 0.6.0) simplecov (= 0.22.0) diff --git a/lib/faker.rb b/lib/faker.rb index 46c2547dd7..21124798d1 100644 --- a/lib/faker.rb +++ b/lib/faker.rb @@ -107,7 +107,7 @@ def regexify(reg) # with an array of values and selecting one of them. def fetch(key) fetched = sample(translate("faker.#{key}")) - if fetched&.match(%r{^/}) && fetched&.match(%r{/$}) # A regex + if fetched&.match(%r{^/}) && fetched.match(%r{/$}) # A regex regexify(fetched) else fetched From 8640f3b33dc5d33106516522fe8feb2c91fdcf50 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Tue, 15 Oct 2024 19:21:36 -0600 Subject: [PATCH 16/25] Removes deprecated generators Preparing for the next release by removing deprecated generators. --- lib/faker/default/id_number.rb | 3 - lib/faker/default/theater.rb | 3 - lib/faker/games/heroes_of_the_storm.rb | 11 - .../fullmetal_alchemist_brotherhood.rb | 3 - lib/faker/locations/australia.rb | 3 - lib/faker/tv_shows/buffy.rb | 13 - lib/faker/tv_shows/dr_who.rb | 13 - .../tv_shows/the_fresh_prince_of_bel_air.rb | 13 - test/faker/default/test_faker_id_number.rb | 289 ------------------ test/faker/default/test_faker_theater.rb | 21 -- ...t_faker_fullmetal_alchemist_brotherhood.rb | 20 -- test/faker/locations/test_faker_australia.rb | 20 -- test/faker/tv_shows/test_buffy.rb | 5 - test/faker/tv_shows/test_dr_who.rb | 6 - .../test_the_fresh_prince_of_bel_air.rb | 5 - 15 files changed, 428 deletions(-) diff --git a/lib/faker/default/id_number.rb b/lib/faker/default/id_number.rb index b02c17b77e..786034e983 100644 --- a/lib/faker/default/id_number.rb +++ b/lib/faker/default/id_number.rb @@ -421,7 +421,4 @@ def _translate(key) end end end - - include Faker::Deprecator - deprecate_generator('IDNumber', IdNumber) end diff --git a/lib/faker/default/theater.rb b/lib/faker/default/theater.rb index b9e8af3db5..03cd237cba 100644 --- a/lib/faker/default/theater.rb +++ b/lib/faker/default/theater.rb @@ -46,7 +46,4 @@ def play end end end - - include Faker::Deprecator - deprecate_generator('Show', Theater) end diff --git a/lib/faker/games/heroes_of_the_storm.rb b/lib/faker/games/heroes_of_the_storm.rb index 2557b3e9bc..89e7955664 100644 --- a/lib/faker/games/heroes_of_the_storm.rb +++ b/lib/faker/games/heroes_of_the_storm.rb @@ -17,17 +17,6 @@ def battleground fetch('heroes_of_the_storm.battlegrounds') end - ## - # This method is deprecated. The implementation will be removed in a near future release. - # Use `HeroesOfTheStorm.class_name` instead. - # - # @deprecated Use {#class_name} instead. - def class - warn '`HeroesOfTheStorm.class` is deprecated. Use `HeroesOfTheStorm.class_name` instead.' - - super - end - ## # Produces a class name from Heroes of the Storm. # diff --git a/lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb b/lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb index 493cdf51a0..c112eb7255 100644 --- a/lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb +++ b/lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb @@ -44,8 +44,5 @@ def country end end end - - include Faker::Deprecator - deprecate_generator('FmaBrotherhood', FullmetalAlchemistBrotherhood) end end diff --git a/lib/faker/locations/australia.rb b/lib/faker/locations/australia.rb index e3696d5fa6..a0358b93a5 100644 --- a/lib/faker/locations/australia.rb +++ b/lib/faker/locations/australia.rb @@ -46,7 +46,4 @@ def state end end end - - include Deprecator - deprecate_generator('Australia', Locations::Australia) end diff --git a/lib/faker/tv_shows/buffy.rb b/lib/faker/tv_shows/buffy.rb index 80d21e6568..1848f18194 100644 --- a/lib/faker/tv_shows/buffy.rb +++ b/lib/faker/tv_shows/buffy.rb @@ -45,19 +45,6 @@ def actor fetch('buffy.actors') end - ## - # Produces a actor from Buffy the Vampire Slayer. - # - # @return [String] - # - # @example - # Faker::TvShows::Buffy.celebrity #=> "John Ritter" - # - # @deprecated Use the `actor` method instead. - # - # @faker.version 1.9.2 - alias celebrity actor - ## # Produces a big bad from Buffy the Vampire Slayer. # diff --git a/lib/faker/tv_shows/dr_who.rb b/lib/faker/tv_shows/dr_who.rb index 9951ff3106..b1b9c34bb0 100644 --- a/lib/faker/tv_shows/dr_who.rb +++ b/lib/faker/tv_shows/dr_who.rb @@ -84,19 +84,6 @@ def villain fetch('dr_who.villains') end - ## - # Produces a villain from Doctor Who. - # - # @return [String] - # - # @example - # Faker::TvShows::DrWho.villian #=> "The Master" - # - # @deprecated Use the correctly-spelled `villain` method instead. - # - # @faker.version 1.8.0 - alias villian villain - ## # Produces a species from Doctor Who. # diff --git a/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb b/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb index bead810c33..cf13bf7f51 100644 --- a/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb +++ b/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb @@ -32,19 +32,6 @@ def actor fetch('the_fresh_prince_of_bel_air.actors') end - ## - # Produces a actor from The Fresh Prince of Bel-Air. - # - # @return [String] - # - # @example - # Faker::TvShows::TheFreshPrinceOfBelAir.celebrity #=> "Quincy Jones" - # - # @deprecated Use the `actor` method instead. - # - # @faker.version 1.8.3 - alias celebrity actor - ## # Produces a quote from The Fresh Prince of Bel-Air. # diff --git a/test/faker/default/test_faker_id_number.rb b/test/faker/default/test_faker_id_number.rb index 6f3aecd84d..12ceff83c7 100644 --- a/test/faker/default/test_faker_id_number.rb +++ b/test/faker/default/test_faker_id_number.rb @@ -288,292 +288,3 @@ def assert_valid_south_african_id_number(sample) assert Date.parse(south_african_id_number_to_date_of_birth_string(sample)) end end - -class TestFakerIDNumber < Test::Unit::TestCase - def setup - Faker::Deprecator.skip_warning do - @tester = Faker::IDNumber - end - end - - def test_valid_ssn - sample = @tester.valid - - assert_equal(11, sample.length) - assert_equal '-', sample[3] - assert_equal '-', sample[6] - assert sample[0..2].split.map { :to_i }.all? { :is_digit? } - assert sample[4..5].split.map { :to_i }.all? { :is_digit? } - assert sample[7..9].split.map { :to_i }.all? { :is_digit? } - end - - def test_invalid_ssn - sample = @tester.invalid - - assert_equal(11, sample.length) - assert_equal '-', sample[3] - assert_equal '-', sample[6] - assert sample[0..2].split.map { :to_i }.all? { :is_digit? } - assert sample[4..5].split.map { :to_i }.all? { :is_digit? } - assert sample[7..9].split.map { :to_i }.all? { :is_digit? } - end - - def test_spanish_dni - sample = @tester.spanish_citizen_number - - assert_equal 10, sample.length - assert sample[0..7].split.map { :to_i }.all? { :is_digit? } - assert_equal('-', sample[8]) - mod = sample[0..7].to_i % 23 - - assert_equal Faker::IdNumber::CHECKS[mod], sample[9] - end - - def test_spanish_nie - sample = @tester.spanish_foreign_citizen_number - - assert_equal 11, sample.length - assert_includes 'XYZ', sample[0] - assert_equal '-', sample[1] - assert sample[2..8].split.map { :to_i }.all? { :is_digit? } - assert_equal '-', sample[9] - prefix = 'XYZ'.index(sample[0]).to_s - mod = "#{prefix}#{sample[2..8]}".to_i % 23 - - assert_equal Faker::IdNumber::CHECKS[mod], sample[10] - end - - def test_south_african_id_number - assert_valid_south_african_id_number(@tester.south_african_id_number) - end - - def test_valid_south_african_id_number - assert_valid_south_african_id_number(@tester.valid_south_african_id_number) - end - - def test_invalid_south_african_id_number - sample = @tester.invalid_south_african_id_number - - assert_raises Date::Error do - Date.parse(south_african_id_number_to_date_of_birth_string(sample)) - end - end - - def test_brazilian_citizen_number - sample = @tester.brazilian_citizen_number - - assert_match(/^\d{11}$/, sample) - assert_match(/(\d)((?!\1)\d)+/, sample) - end - - def test_brazilian_citizen_number_formatted - sample = @tester.brazilian_citizen_number(formatted: true) - - assert_match(/^\d{3}\.\d{3}\.\d{3}-\d{2}$/, sample) - end - - def test_brazilian_id - sample = @tester.brazilian_id - - assert_match(/^\d{8}(X|\d)?$/, sample) - assert_match(/(\d)((?!\1)\d)+/, sample) - end - - def test_brazilian_id_formatted - sample = @tester.brazilian_id(formatted: true) - - assert_match(/^\d{1,2}.\d{3}.\d{3}-[\dX]$/, sample) - end - - def test_brazilian_citizen_number_checksum_digit - digits = '128991760' - checksum_digit = Faker::IdNumber.send(:brazilian_citizen_number_checksum_digit, digits) - - assert_equal('4', checksum_digit) - digits = '1289917604' - checksum_digit = Faker::IdNumber.send(:brazilian_citizen_number_checksum_digit, digits) - - assert_equal('8', checksum_digit) - end - - def test_brazilian_id_checksum_digit - digits = '41987080' - checksum_digit = Faker::IdNumber.send(:brazilian_id_checksum_digit, digits) - - assert_equal('5', checksum_digit) - end - - def test_brazilian_document_checksum - digits = '123456789' - checksum = Faker::IdNumber.send(:brazilian_document_checksum, digits) - - assert_equal(2100, checksum) - end - - def test_brazilian_document_digit - citizen_number_digit10 = Faker::IdNumber.send(:brazilian_document_digit, 10) - citizen_number_digit_other = Faker::IdNumber.send(:brazilian_document_digit, 9) - id_digit10 = Faker::IdNumber.send(:brazilian_document_digit, 1, id: true) - id_digit11 = Faker::IdNumber.send(:brazilian_document_digit, 0, id: true) - id_digit_other = Faker::IdNumber.send(:brazilian_document_digit, 2, id: true) - - assert_equal('0', citizen_number_digit10) - assert_equal('9', citizen_number_digit_other) - assert_equal('X', id_digit10) - assert_equal('0', id_digit11) - assert_equal('9', id_digit_other) - end - - def test_brazilian_citizen_number_digit - digit10 = Faker::IdNumber.send(:brazilian_citizen_number_digit, 10) - digit_other = Faker::IdNumber.send(:brazilian_citizen_number_digit, 9) - - assert_equal('0', digit10) - assert_equal('9', digit_other) - end - - def test_brazilian_id_digit - digit10 = Faker::IdNumber.send(:brazilian_id_digit, 1) - digit11 = Faker::IdNumber.send(:brazilian_id_digit, 0) - digit_other = Faker::IdNumber.send(:brazilian_id_digit, 2) - - assert_equal('X', digit10) - assert_equal('0', digit11) - assert_equal('9', digit_other) - end - - def test_chilean_id - sample = @tester.chilean_id - - assert_match(/^\d{8}-[K\d]$/, sample) - end - - def test_chilean_verification_code_k - verification_code = Faker::IdNumber.send(:chilean_verification_code, 20_680_873) - - assert_equal('K', verification_code) - end - - def test_chilean_verification_code_0 - verification_code = Faker::IdNumber.send(:chilean_verification_code, 13_196_022) - - assert_equal(0, verification_code) - end - - def test_croatian_id - sample = @tester.croatian_id - - assert_match(/^\d{11}$/, sample) - end - - def test_croatian_id_international - sample = @tester.croatian_id(international: true) - - assert_match(/^HR\d{11}$/, sample) - end - - def test_croatian_id_checksum_digit - digits = '8764670153' - checksum_digit = Faker::IdNumber.send(:croatian_id_checksum_digit, digits) - - assert_equal(5, checksum_digit) - end - - def test_danish_id_number - sample = @tester.danish_id_number - - assert_match(/^\d{10}$/, sample) - end - - def test_french_insee_number - sample = @tester.french_insee_number - - assert_match(/^(?\d{1})(?\d{2})(?\d{2})(?\d{1})(?[0-9AB]{1})(?\d{3})(?\d{3})(?\d{2})$/, sample) - end - - def test_danish_id_number_formatted - sample = @tester.danish_id_number(formatted: true) - - assert_match(/^\d{6}-\d{4}$/, sample) - end - - def test_danish_id_number_birthday - sample = @tester.danish_id_number(birthday: Date.new(1995, 1, 2)) - - assert_match(/^020195\d{4}$/, sample) - end - - def test_danish_id_number_birthday_early_1800 - assert_raises ArgumentError do - @tester.danish_id_number(birthday: Date.new(1815, 1, 2)) - end - end - - def test_danish_id_number_birthday_late_1800 - sample = @tester.danish_id_number(birthday: Date.new(1895, 1, 2)) - - assert_match(/^020195[5678]\d{3}$/, sample) - end - - def test_danish_id_number_birthday_early_1900 - sample = @tester.danish_id_number(birthday: Date.new(1915, 1, 2)) - - assert_match(/^020115[0123]\d{3}$/, sample) - end - - def test_danish_id_number_birthday_late_1900 - sample = @tester.danish_id_number(birthday: Date.new(1995, 1, 2)) - - assert_match(/^020195[012349]\d{3}$/, sample) - end - - def test_danish_id_number_birthday_early_2000 - sample = @tester.danish_id_number(birthday: Date.new(2015, 1, 2)) - - assert_match(/^020115[456789]\d{3}$/, sample) - end - - def test_danish_id_number_birthday_mid_2000 - sample = @tester.danish_id_number(birthday: Date.new(2055, 1, 2)) - - assert_match(/^020155[5678]\d{3}$/, sample) - end - - def test_danish_id_number_birthday_late_2000 - assert_raises ArgumentError do - @tester.danish_id_number(birthday: Date.new(2095, 1, 2)) - end - end - - def test_danish_id_number_gender_female - sample = @tester.danish_id_number(gender: :female) - - assert_predicate sample.chars.last.to_i, :even? - end - - def test_danish_id_number_gender_male - sample = @tester.danish_id_number(gender: :male) - - assert_predicate sample.chars.last.to_i, :odd? - end - - def test_danish_id_number_invalid_gender - assert_raises ArgumentError do - @tester.danish_id_number(gender: :invalid) - end - end - - private - - def south_african_id_number_to_date_of_birth_string(sample) - "19#{sample[0..1]}/#{sample[2..3]}/#{sample[4..5]}}" - end - - def assert_valid_south_african_id_number(sample) - assert_equal 13, sample.length - assert_match(/^\d{13}$/, sample) - assert_include Faker::IdNumber::ZA_CITIZENSHIP_DIGITS, sample[10] - assert_equal Faker::IdNumber::ZA_RACE_DIGIT, sample[11] - assert Date.parse(south_african_id_number_to_date_of_birth_string(sample)) - end -end diff --git a/test/faker/default/test_faker_theater.rb b/test/faker/default/test_faker_theater.rb index bded8c8a59..bf0ad2857f 100644 --- a/test/faker/default/test_faker_theater.rb +++ b/test/faker/default/test_faker_theater.rb @@ -15,24 +15,3 @@ def test_play assert_match(/\w+/, Faker::Theater.play) end end - -# with test_faker_show.rb -class TestFakerShow < Test::Unit::TestCase - def setup - Faker::Deprecator.skip_warning do - @tester = Faker::Show - end - end - - def test_adult_musical - assert_match(/\w+/, @tester.adult_musical) - end - - def test_kids_musical - assert_match(/\w+/, @tester.kids_musical) - end - - def test_play - assert_match(/\w+/, @tester.play) - end -end diff --git a/test/faker/japanese_media/test_faker_fullmetal_alchemist_brotherhood.rb b/test/faker/japanese_media/test_faker_fullmetal_alchemist_brotherhood.rb index f13ae6dde6..d5ac5ac9d3 100644 --- a/test/faker/japanese_media/test_faker_fullmetal_alchemist_brotherhood.rb +++ b/test/faker/japanese_media/test_faker_fullmetal_alchemist_brotherhood.rb @@ -2,26 +2,6 @@ require_relative '../../test_helper' -class TestFakerFmaBrotherhood < Test::Unit::TestCase - def setup - Faker::Deprecator.skip_warning do - @tester = Faker::JapaneseMedia::FmaBrotherhood - end - end - - def test_character - assert_match(/\w+/, @tester.character) - end - - def test_city - assert_match(/\w+/, @tester.city) - end - - def test_country - assert_match(/\w+/, @tester.country) - end -end - class TestFakerFullmetalAlchemistBrotherhood < Test::Unit::TestCase def setup @tester = Faker::JapaneseMedia::FullmetalAlchemistBrotherhood diff --git a/test/faker/locations/test_faker_australia.rb b/test/faker/locations/test_faker_australia.rb index 4cce00fc6e..f6d0f6912e 100644 --- a/test/faker/locations/test_faker_australia.rb +++ b/test/faker/locations/test_faker_australia.rb @@ -15,23 +15,3 @@ def test_state assert_match(/\w+/, Faker::Locations::Australia.state) end end - -class TestFakerAustralia < Test::Unit::TestCase - def setup - Faker::Deprecator.skip_warning do - @tester = Faker::Australia - end - end - - def test_deprecated_location - assert_match(/\w+/, @tester.location) - end - - def test_deprecated_animal - assert_match(/\w+/, @tester.animal) - end - - def test_state - assert_match(/\w+/, @tester.state) - end -end diff --git a/test/faker/tv_shows/test_buffy.rb b/test/faker/tv_shows/test_buffy.rb index b5128ff00e..d9b5b55880 100644 --- a/test/faker/tv_shows/test_buffy.rb +++ b/test/faker/tv_shows/test_buffy.rb @@ -19,11 +19,6 @@ def test_actor assert_match(/\w+/, @tester.actor) end - # deprecated - def test_celebrity - assert_match(/\w+/, @tester.celebrity) - end - def test_big_bad assert_match(/\w+/, @tester.big_bad) end diff --git a/test/faker/tv_shows/test_dr_who.rb b/test/faker/tv_shows/test_dr_who.rb index 57539855bd..7d06713dba 100644 --- a/test/faker/tv_shows/test_dr_who.rb +++ b/test/faker/tv_shows/test_dr_who.rb @@ -28,11 +28,6 @@ def test_quote deterministically_verify(-> { @tester.quote }) { |result| assert_match(/\w+/, result) } end - # deprecated - def test_villian - deterministically_verify(-> { @tester.villian }) { |result| assert_match(/\w+/, result) } - end - def test_villain deterministically_verify(-> { @tester.villain }) { |result| assert_match(/\w+/, result) } end @@ -49,7 +44,6 @@ def test_locales assert_kind_of String, @tester.the_doctor assert_kind_of String, @tester.catch_phrase assert_kind_of String, @tester.quote - assert_kind_of String, @tester.villian # deprecated assert_kind_of String, @tester.villain assert_kind_of String, @tester.specie end diff --git a/test/faker/tv_shows/test_the_fresh_prince_of_bel_air.rb b/test/faker/tv_shows/test_the_fresh_prince_of_bel_air.rb index 44c067e079..f147c2f791 100644 --- a/test/faker/tv_shows/test_the_fresh_prince_of_bel_air.rb +++ b/test/faker/tv_shows/test_the_fresh_prince_of_bel_air.rb @@ -15,11 +15,6 @@ def test_actor assert_match(/\w+/, @tester.actor) end - # deprecated - def test_celebrity - assert_match(/\w+/, @tester.celebrity) - end - def test_quote assert_match(/\w+/, @tester.quote) end From 4e400f2f808ff91cb4f132a07f3235982c46c388 Mon Sep 17 00:00:00 2001 From: Tatheer Fatima Date: Tue, 24 Sep 2024 23:04:40 -0400 Subject: [PATCH 17/25] fix #2885: Set target ruby version to 3.0 and remove references to 2.7 Co-authored-by: Ayana Siddiqui ayanasiddiqui@gmail.com --- .github/workflows/ruby.yml | 3 +-- .rubocop.yml | 2 +- MAINTAINING.md | 2 +- faker.gemspec | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 60d97bb8af..cb9c0114d7 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7' + ruby-version: '3.0' - name: Install dependencies run: bundle install @@ -38,7 +38,6 @@ jobs: fail-fast: false # don't fail all matrix builds if one fails matrix: ruby: - - '2.7' - '3.0' - '3.1' - '3.2' diff --git a/.rubocop.yml b/.rubocop.yml index 2973cfe4cb..20059e21bb 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,7 +3,7 @@ require: - rubocop-rake AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.0 NewCops: enable # Suppress noise for obvious operator precedence. diff --git a/MAINTAINING.md b/MAINTAINING.md index f0c5504e6c..23672914f9 100644 --- a/MAINTAINING.md +++ b/MAINTAINING.md @@ -13,7 +13,7 @@ If you're reviewing a PR, ask yourself: ## Managing libraries dependencies EOL As a guideline for Ruby's End of Life (EOL) versions, a good heuristic (that's not too hard on maintainers) is to keep support for 1 EOL version. -In other words, once Ruby 3.0 is EOL, drop support for 2.7. +In other words, once Ruby 3.1 is EOL, drop support for 3.0. ## Security diff --git a/faker.gemspec b/faker.gemspec index 8f7b324918..b13fed9e55 100644 --- a/faker.gemspec +++ b/faker.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| spec.bindir = 'bin' spec.executables = ['faker'] spec.require_paths = ['lib'] - spec.required_ruby_version = '>= 2.7' + spec.required_ruby_version = '>= 3.0' spec.metadata['changelog_uri'] = 'https://github.com/faker-ruby/faker/blob/main/CHANGELOG.md' spec.metadata['source_code_uri'] = 'https://github.com/faker-ruby/faker' From 3846dc0c2f68c354c4baf6219630d081a2ab942d Mon Sep 17 00:00:00 2001 From: Jeremias Ramirez Date: Wed, 16 Oct 2024 10:38:57 -0300 Subject: [PATCH 18/25] fix(music.band): removes leading whitespace [FIX #3011] - There was an example with a leading whitespace: ' The' - Replacing it with 'The Killers' --- lib/locales/en/music.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/locales/en/music.yml b/lib/locales/en/music.yml index cf47228581..3b855e4f37 100644 --- a/lib/locales/en/music.yml +++ b/lib/locales/en/music.yml @@ -59,7 +59,7 @@ en: - Coldplay - Cootie Williams - Cortinas - - " The" + - The Killers - The Cramps - The Cranberries - Cream From a148f629e81df8007a58af647924b05b2461ce5a Mon Sep 17 00:00:00 2001 From: Tatheer Date: Wed, 16 Oct 2024 09:39:46 -0400 Subject: [PATCH 19/25] Rubocop fixes --- lib/faker.rb | 4 ++-- lib/faker/default/id_number.rb | 2 +- test/faker/default/test_faker_crypto_coin.rb | 6 +++--- test/faker/default/test_faker_vehicle.rb | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/faker.rb b/lib/faker.rb index 21124798d1..5e5bb5924e 100644 --- a/lib/faker.rb +++ b/lib/faker.rb @@ -5,7 +5,7 @@ require 'psych' require 'i18n' -Dir.glob(File.join(mydir, 'helpers', '*.rb')).sort.each { |file| require file } +Dir.glob(File.join(mydir, 'helpers', '*.rb')).each { |file| require file } I18n.load_path += Dir[File.join(mydir, 'locales', '**/*.yml')] @@ -275,4 +275,4 @@ def disable_enforce_available_locales end # require faker objects -Dir.glob(File.join(mydir, 'faker', '/**/*.rb')).sort.each { |file| require file } +Dir.glob(File.join(mydir, 'faker', '/**/*.rb')).each { |file| require file } diff --git a/lib/faker/default/id_number.rb b/lib/faker/default/id_number.rb index b02c17b77e..c695a9065a 100644 --- a/lib/faker/default/id_number.rb +++ b/lib/faker/default/id_number.rb @@ -12,7 +12,7 @@ class IdNumber < Base ].freeze ZA_RACE_DIGIT = '8' ZA_CITIZENSHIP_DIGITS = %w[0 1].freeze - BRAZILIAN_ID_FORMAT = /(\d{1,2})(\d{3})(\d{3})([\dX])/.freeze + BRAZILIAN_ID_FORMAT = /(\d{1,2})(\d{3})(\d{3})([\dX])/ BRAZILIAN_ID_FROM = 10_000_000 BRAZILIAN_ID_TO = 99_999_999 diff --git a/test/faker/default/test_faker_crypto_coin.rb b/test/faker/default/test_faker_crypto_coin.rb index feafa6e958..aecb23621a 100644 --- a/test/faker/default/test_faker_crypto_coin.rb +++ b/test/faker/default/test_faker_crypto_coin.rb @@ -7,9 +7,9 @@ class TestFakerCryptoCoin < Test::Unit::TestCase ACRONYM = 1 URL_LOGO = 2 - REGEX_COIN_NAME = /[a-zA-Z .]{3,}/.freeze - REGEX_ACRONYM = /\w+{3,}/.freeze - REGEX_URL_LOGO = /^https:\/\/i.imgur.com\/.......\./.freeze + REGEX_COIN_NAME = /[a-zA-Z .]{3,}/ + REGEX_ACRONYM = /\w+{3,}/ + REGEX_URL_LOGO = /^https:\/\/i.imgur.com\/.......\./ def setup @tester = Faker::CryptoCoin diff --git a/test/faker/default/test_faker_vehicle.rb b/test/faker/default/test_faker_vehicle.rb index 71a43943f4..8926651d1c 100644 --- a/test/faker/default/test_faker_vehicle.rb +++ b/test/faker/default/test_faker_vehicle.rb @@ -3,8 +3,8 @@ require_relative '../../test_helper' class TestFakerVehicle < Test::Unit::TestCase - WORD_MATCH = /\w+\.?/.freeze - VIN_REGEX = /\A[A-HJ-NPR-Z0-9]{17}\z/.freeze + WORD_MATCH = /\w+\.?/ + VIN_REGEX = /\A[A-HJ-NPR-Z0-9]{17}\z/ def setup @tester = Faker::Vehicle From 65fca9f6345507d7ae5fa36fd8522ac5cd0e5472 Mon Sep 17 00:00:00 2001 From: Jeremias Ramirez Date: Fri, 18 Oct 2024 14:50:56 -0300 Subject: [PATCH 20/25] feat(music.band): reorder alphabetically --- lib/locales/en/music.yml | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/locales/en/music.yml b/lib/locales/en/music.yml index 3b855e4f37..58cc6ac2fd 100644 --- a/lib/locales/en/music.yml +++ b/lib/locales/en/music.yml @@ -32,10 +32,8 @@ en: - Arctic Monkeys - B.B. King - Bauhaus - - The Beatles - Beck - Billy Idol - - The Birthday Party - Björk - Blinker The Star - Blondie @@ -54,16 +52,11 @@ en: - Chris Isaak - Chrissie Hynde - Chuck Berry - - The Clash - Cliff Richard (and the Shadows) - Coldplay - Cootie Williams - Cortinas - - The Killers - - The Cramps - - The Cranberries - Cream - - The Cure - David Bowie - David Gilmour - Deepest Blue @@ -77,7 +70,6 @@ en: - Elvis Costello - Elvis Presley - Eric Clapton - - The Faces - Fats Domino - Flaming Lips - Florence and the Machine @@ -94,7 +86,6 @@ en: - Hugh Masekela - Ian Dury - Iggy Pop - - The Jam - James Brown - Jeff Beck - Jeff Buckley @@ -111,14 +102,11 @@ en: - Kate Bush - Keith Moon - Keith Richards - - The Kinks - Kiss - - The La's - Led Zeppelin - Lenny Kravitz - Leonard Cohen - Liam Gallagher - - The Libertines - Madness - Madonna - Manic Street Preachers @@ -126,7 +114,6 @@ en: - Marianne Faithfull - Marilyn Manson - Maroon 5 - - The Mars Volta - Max Roach - Michael Jackson - Miles Davis @@ -145,6 +132,7 @@ en: - Oasis - Offspring - Ozzy Osbourne + - PJ Harvey - Paramore - Pat Metheny - Patti Smith @@ -154,21 +142,16 @@ en: - Phil Collins - Phish - Pink Floyd - - PJ Harvey - - The Police - - The Pretenders - Primal Scream - Prince - Program The Dead - Pulp - Queen + - R.E.M. - Radiohead - - The Ramones - Red Hot Chili Peppers - - R.E.M. - Rick Wright - Rod Stewart - - The Rolling Stones - Rory Gallagher - Roxy Music - Roy Hargrove @@ -179,15 +162,35 @@ en: - Simply Red - Sinead O'connor - Siouxsie and The Banshees - - The Slits - - The Smiths - Sonic Youth - - The Specials - Squeeze - Status Quo - Stereophonics - Stone Roses - Syd Barrett + - The Beatles + - The Birthday Party + - The Clash + - The Cramps + - The Cranberries + - The Cure + - The Faces + - The Jam + - The Killers + - The Kinks + - The La's + - The Libertines + - The Mars Volta + - The Police + - The Pretenders + - The Ramones + - The Rolling Stones + - The Slits + - The Smiths + - The Specials + - The Undertones + - The Who + - The Yardbirds - Thelonius Monk - Thin Lizzy - Thornley @@ -196,12 +199,9 @@ en: - Tom Robinson - Tom Waits - U2 - - The Undertones - Van Morrison - Velvet Revolver - White Stripes - - The Who - - The Yardbirds - Yumi Matsutoya albums: - Thriller From 6a8ad8dc328bbc27250df6fdc83c409f0a2b0162 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Fri, 18 Oct 2024 18:18:52 -0600 Subject: [PATCH 21/25] Create SECURITY.md following the template from Loofah: https://github.com/flavorjones/loofah/blob/main/SECURITY.md --- SECURITY.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..6d6f6df7bc --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,9 @@ +## Security and Vulnerability Reporting + +The faker-ruby core contributors take security very seriously and investigate all reported vulnerabilities. + +If you would like to report a vulnerablity or have a security concern regarding faker-ruby, please report it by contacting the current security coordinators (Stefanni Brasil stefanni@hexdevs.com and Thiago Araujo thd@hexdevs.com). + +The information you share with the faker-ruby core contributors as part of this process will be kept confidential within the team, unless or until we need to share information upstream with our dependent libraries' core teams, at which point we will notify you. + +If a vulnerability is first reported by you, we will credit you with the discovery in the public disclosure. From ca7c33602014b731c1aee9afc7f75ada9c85dca8 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Fri, 18 Oct 2024 18:21:56 -0600 Subject: [PATCH 22/25] Update SECURITY.md --- SECURITY.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index 6d6f6df7bc..5908471a3f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,4 +1,12 @@ -## Security and Vulnerability Reporting +## Security Policy + +### Supported Versions + +Only the the latest version of this project is supported at a given time. If you find a security issue with an older version, please try updating to the latest version first. + +If for some reason you can't update to the latest version, please let us know your reasons so that we can have a better understanding of your situation. + +## Reporting a Vulnerability The faker-ruby core contributors take security very seriously and investigate all reported vulnerabilities. From f39b41db16e67583b3167403b6cc98394b879c8e Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Fri, 18 Oct 2024 18:22:32 -0600 Subject: [PATCH 23/25] Update SECURITY.md --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index 5908471a3f..ffee60031a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -10,7 +10,7 @@ If for some reason you can't update to the latest version, please let us know yo The faker-ruby core contributors take security very seriously and investigate all reported vulnerabilities. -If you would like to report a vulnerablity or have a security concern regarding faker-ruby, please report it by contacting the current security coordinators (Stefanni Brasil stefanni@hexdevs.com and Thiago Araujo thd@hexdevs.com). +If you would like to report a vulnerablity or have a security concern regarding faker-ruby, please report it by contacting the current security coordinators (Stefanni Brasil stefanni@hexdevs.com and Thiago Araujo thiago@hexdevs.com). The information you share with the faker-ruby core contributors as part of this process will be kept confidential within the team, unless or until we need to share information upstream with our dependent libraries' core teams, at which point we will notify you. From 0aa5963fa4b66a79d2dc42b548a7324d55252ec8 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Fri, 18 Oct 2024 18:17:07 -0600 Subject: [PATCH 24/25] Remove unused rake task We had a PR opened recently updating this task. It turns out this isn't used anymore because RubyForge has been deprecated. Docs can be found at https://www.rubydoc.info/github/faker-ruby/faker https://www.rubydoc.info/github/faker-ruby/faker --- tasks/website.rake | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 tasks/website.rake diff --git a/tasks/website.rake b/tasks/website.rake deleted file mode 100644 index f7281bb5d3..0000000000 --- a/tasks/website.rake +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -desc 'Generate website files' -task :website_generate do - (Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt| - sh %( ./script/txt2html #{txt} > #{txt.gsub(/txt$/, 'html')} ) - end -end - -desc 'Upload website files to rubyforge' -task :website_upload do - remote_dir = '/var/www/gforge-projects/faker/' - local_dir = 'website' - sh %(rsync -acCv #{local_dir}/ #{ENV.fetch('USER', nil)}@rubyforge.org:#{remote_dir}) -end - -desc 'Generate and upload website files' -task website: %i[website_generate website_upload publish_docs] From 656f96f540c431474d49113c68440d73b3944409 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Fri, 18 Oct 2024 18:51:05 -0600 Subject: [PATCH 25/25] Bump faker to 3.5.1 --- CHANGELOG.md | 57 ++++++++++++++++++++++++++++++++++++++++++++ Gemfile.lock | 2 +- lib/faker/version.rb | 2 +- 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19679289e2..2903f7b12c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,62 @@ # Changelog +## [v3.5.1](https://github.com/faker-ruby/faker/tree/v3.5.1) (2024-10-18) + +Happy October! 🎃 + +This version **drops support for Ruby < 3.0**. We only support one EOL Ruby version at a time. Please upgrade to Ruby 3.0 to update to this and future versions of faker-ruby. + +Besides that, this version removes deprecated generators, fixes some bugs, and adds a Security Policy. + +Thanks to all contributors! + +## Breaking Changes +* Drop support for Ruby 2.7 by @tatheerf02 in https://github.com/faker-ruby/faker/pull/3006 +* Removes deprecated generators by @stefannibrasil in https://github.com/faker-ruby/faker/pull/3014 + +The following deprecated generators are being removed. Please use the new generators: + + +| Deprecated | New | +| -------- | ------- | +| Faker::TvShows::TheFreshPrinceOfBelAir.celebrity | Faker::TvShows::TheFreshPrinceOfBelAir.actor | +| Faker::TvShows::Buffy.celebrity | Faker::TvShows::Buffy.actor | +| Faker::TvShows::DrWho.villian | Faker::TvShows::DrWho.villain | +| Faker::Games::HeroesOfTheStorm.class | Faker::Games::HeroesOfTheStorm.class_name | +| Faker::JapaneseMedia::FmaBrotherhood | Faker::JapaneseMedia::FullmetalAlchemistBrotherhood | +| Faker::Show | Faker::Theater | +| Faker::Australia | Faker::Locations::Australia | +| Faker::IDNumber | Faker::IdNumber | + +### Improvements & Bug fixes +* Fix typos by @tagliala in https://github.com/faker-ruby/faker/pull/2982 +* Fix benchmark:all_methods task by excluding Faker::Deprecator module from benchmark target by @amatsuda in https://github.com/faker-ruby/faker/pull/2988 +* Add Brazilian Portuguese translations for `Faker::Subscription` by @murichristopher in https://github.com/faker-ruby/faker/pull/2960 +* Deprecator improvements by @stefannibrasil in https://github.com/faker-ruby/faker/pull/2997 +* Faker::Alphanumeric.alphanumeric determinism fix by @admtnnr in https://github.com/faker-ruby/faker/pull/2996 +* Remove CodeClimate badges by @tagliala in https://github.com/faker-ruby/faker/pull/3003 +* Update Company.logo example url by @dirschn in https://github.com/faker-ruby/faker/pull/3007 +* fix(music.band): removes leading whitespace by @JeremasPosta in https://github.com/faker-ruby/faker/pull/3015 +* Create SECURITY.md by @stefannibrasil in https://github.com/faker-ruby/faker/pull/3016 + +### Update local dependencies +* Bump i18n from 1.14.5 to 1.14.6 by @dependabot in https://github.com/faker-ruby/faker/pull/3005 +* Bump minitest from 5.24.1 to 5.25.0 by @dependabot in https://github.com/faker-ruby/faker/pull/2991 +* Bump rubocop-minitest from 0.35.1 to 0.36.0 by @dependabot in https://github.com/faker-ruby/faker/pull/2999 +* Bump yard from 0.9.36 to 0.9.37 by @dependabot in https://github.com/faker-ruby/faker/pull/3000 +* Bump rubocop from 1.65.1 to 1.66.1 by @dependabot in https://github.com/faker-ruby/faker/pull/3001 + +## New Contributors +* @murichristopher made their first contribution in https://github.com/faker-ruby/faker/pull/2960 +* @admtnnr made their first contribution in https://github.com/faker-ruby/faker/pull/2996 +* @dirschn made their first contribution in https://github.com/faker-ruby/faker/pull/3007 +* @tatheerf02 made their first contribution in https://github.com/faker-ruby/faker/pull/3006 +* @JeremasPosta made their first contribution in https://github.com/faker-ruby/faker/pull/3015 + +**Full Changelog**: https://github.com/faker-ruby/faker/compare/v3.4.2...v3.5.1 + +-------------------------------------- + ## [v3.4.2](https://github.com/faker-ruby/faker/tree/v3.4.2) (2024-07-16) Happy July with a new faker-ruby release. diff --git a/Gemfile.lock b/Gemfile.lock index 55b0cb693c..6eb3c97d69 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - faker (3.4.2) + faker (3.5.1) i18n (>= 1.8.11, < 2) GEM diff --git a/lib/faker/version.rb b/lib/faker/version.rb index c172af5b45..6676ee0e12 100644 --- a/lib/faker/version.rb +++ b/lib/faker/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Faker # :nodoc: - VERSION = '3.4.2' + VERSION = '3.5.1' end