-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Faker::Computer #1948
Add Faker::Computer #1948
Conversation
lib/locales/en/computer.yml
Outdated
- openSUSE Leap 15.1 | ||
- Ubuntu Desktop 18.04 | ||
- Ubuntu Desktop 19.10 | ||
os_x: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this should be named macOS
like the value on platform
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks. That is changed.
lib/faker/default/computer.rb
Outdated
# | ||
# @faker.version next | ||
def search_format(key) | ||
key.split.length > 1 ? key.split.join('_').downcase : key.downcase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the .split.join
is no longer required since the OS X
is not present anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed code to handle platforms with spaces
@Zeragamba If a PR contains work-in-progress commits, could you like to merge it into master branch by either:
First of all, thank you for your OSS activities 😃 |
Follow up to faker-ruby#1948. This PR fixes the following error for `Faker::Computer.os`. ```console % cd path/to/faker-ruby/faker % bundle exec ruby -Itest test/test_determinism.rb Loaded suite test/test_determinism (snip) test/test_determinism.rb:13:in `test_determinism' test/test_determinism.rb:13:in `each_index' 11: def test_determinism 12: Faker::Config.random = Random.new(42) 13: @all_methods.each_index do |index| => 14: store_result @all_methods[index] 15: end 16: 17: @first_run.freeze test/test_determinism.rb:14:in `block in test_determinism' test/test_determinism.rb:34:in `store_result' test/test_determinism.rb:37:in `rescue in store_result' Error: test_determinism(TestDeterminism): RuntimeError: Faker::Computer.os raised "missing keyword: :platform" ```
Follow up to faker-ruby#1948. This PR fixes the following error for `Faker::Computer.os`. ```console % cd path/to/faker-ruby/faker % bundle exec ruby -Itest test/test_determinism.rb Loaded suite test/test_determinism (snip) test/test_determinism.rb:13:in `test_determinism' test/test_determinism.rb:13:in `each_index' 11: def test_determinism 12: Faker::Config.random = Random.new(42) 13: @all_methods.each_index do |index| => 14: store_result @all_methods[index] 15: end 16: 17: @first_run.freeze test/test_determinism.rb:14:in `block in test_determinism' test/test_determinism.rb:34:in `store_result' test/test_determinism.rb:37:in `rescue in store_result' Error: test_determinism(TestDeterminism): RuntimeError: Faker::Computer.os raised "missing keyword: :platform" ```
@koic will do :) |
Issue# none
No-Story
Description:
Faker to generate data for computer types, platforms and OS. Used to populate host data.
Note:
All spec tests failed until
test_helper.rb
:changed to
require_relative 'support/assert_not_english'