Skip to content

Commit

Permalink
Merge branch 'main' into fix/remove_example_with_leading_whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremasPosta authored Oct 18, 2024
2 parents 65fca9f + b07650f commit efb26b4
Show file tree
Hide file tree
Showing 22 changed files with 12 additions and 441 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require:
- rubocop-rake

AllCops:
TargetRubyVersion: 2.7
TargetRubyVersion: 3.0
NewCops: enable

# Suppress noise for obvious operator precedence.
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion faker.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions lib/faker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')]

Expand Down Expand Up @@ -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 }
5 changes: 1 addition & 4 deletions lib/faker/default/id_number.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -421,7 +421,4 @@ def _translate(key)
end
end
end

include Faker::Deprecator
deprecate_generator('IDNumber', IdNumber)
end
3 changes: 0 additions & 3 deletions lib/faker/default/theater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,4 @@ def play
end
end
end

include Faker::Deprecator
deprecate_generator('Show', Theater)
end
11 changes: 0 additions & 11 deletions lib/faker/games/heroes_of_the_storm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down
3 changes: 0 additions & 3 deletions lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,5 @@ def country
end
end
end

include Faker::Deprecator
deprecate_generator('FmaBrotherhood', FullmetalAlchemistBrotherhood)
end
end
3 changes: 0 additions & 3 deletions lib/faker/locations/australia.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,4 @@ def state
end
end
end

include Deprecator
deprecate_generator('Australia', Locations::Australia)
end
13 changes: 0 additions & 13 deletions lib/faker/tv_shows/buffy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down
13 changes: 0 additions & 13 deletions lib/faker/tv_shows/dr_who.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down
13 changes: 0 additions & 13 deletions lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down
6 changes: 3 additions & 3 deletions test/faker/default/test_faker_crypto_coin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit efb26b4

Please sign in to comment.