Comments (7)
@akabiru Thank you. 😄
On Faker
gem, each file of like Faker::ABCD
extends Gem::Deprecate
.
And if there are deprecate method, add deprecate
method.
[faker] ag deprecate --ruby
lib/faker/name.rb
8: extend Gem::Deprecate
59: deprecate :title, 'Faker::Job.title', 2018, 9
60: deprecate :job_titles, :none, 2018, 9
lib/faker/educator.rb
8: extend Gem::Deprecate
19: deprecate :course, :course_name, 2018, 10
I think it's available to pick up these methods. 😄
from faker-bot.
Awesome detective work @shtakai ! 🔍 Would you like to work on this issue? It'd be great of you would. 🙂
from faker-bot.
I implemented checking deprecation like as follows.
renderer.rb
def leaf_args(method, const)
[method.to_s].tap do |arr|
if verbose?
fake, deprecated = begin
deprecate = const.respond_to?("_deprecated_#{method.to_s}".to_sym) ? ' ( WILL BE DEPRECATED )' : ''
[const.public_send(method), deprecate]
rescue ArgumentError
['N/A', '']
end
arr << crayon.dim.white("=> #{fake.to_s}#{deprecated}")
end
end
end
The output is...
$ fakerbot list -v
:
:
Faker::Name
├── name=> Brett Metz
├── title=> Senior Legal Specialist ( WILL BE DEPRECATED )
├── _deprecated_title=> Legacy Advertising Assistant
└── _deprecated_job_titles=> ["Supervisor", "Associate", "Executive", "Liaison", "Officer",....]
:
But I am not sure how to track the name after deprecation
.....
I'll clean code, refactor and make Pull Request. 😄
from faker-bot.
Nice one! This is a brilliant start. We can start with the ( WILL BE DEPRECATED )
message and figure out how to get the name after. 🥇 Looking forward to the PR. 😄
from faker-bot.
The location of testing is spec/integration/list_spec.rb line 27
. 🍣 😢
alyson@HARDCORE ~/p/g/fakerbot> rspec ./spec/integration/list_spec.rb:27
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's default settings.
Run options: include {:locations=>{"./spec/integration/list_spec.rb"=>[27]}}
`fakerbot list command
NOTE: Faker::Name.title is deprecated; use Faker::Job.title instead. It will be removed on or after 2018-09-01.
Faker::Name.title called from /Users/alyson/project/gems/fakerbot/lib/fakerbot/renderer.rb:60.
NOTE: Faker::Name.job_titles is deprecated with no replacement. It will be removed on or after 2018-09-01.
Faker::Name.job_titles called from /Users/alyson/project/gems/fakerbot/lib/fakerbot/renderer.rb:60.
executes `fakerbot list -v` command successfully
Finished in 8.14 seconds (files took 5.44 seconds to load)
1 example, 0 failures
from faker-bot.
Thank you @shtakai! 🙂You're right, the deprecation warnings are triggered by the --verbose
flag from calling methods with dep warnings https://github.com/akabiru/fakerbot/blob/master/lib/fakerbot/renderer.rb#L60
I think it'd be cool if we displayed the dep warnings in a more user friendly manner. E.g.
$ fakerbot list -v
Faker::SomeClass
├── a_method [deprecated use Faker::NewClass.a_method] => sample output
from faker-bot.
@akabiru Thank you 😄
from faker-bot.
Related Issues (20)
- Add Unit tests for `FakerBot::Renderer` HOT 4
- Improve Search HOT 5
- Faker issue: Byebug reporting error at require "faker" HOT 1
- Faker-bot list -v fails at first time execution HOT 1
- Let `faker list` accept arguments HOT 9
- Fix "NestedIterators" issue in lib/fakerbot/reflectors/search.rb
- faker-bot should be a separate gem HOT 8
- Integrate faker-bot in faker-ruby organization
- Only show public class methods
- Migrate FakerBot CI & QA integrations HOT 5
- Fakerbot not searching namespace HOT 2
- Namespace missing in fakerbot HOT 3
- Sort `fakerbot list` alphabetically HOT 11
- Define a Release Process HOT 6
- Faker Bot Logo Anyone? 🙃 HOT 11
- Add flag to show sample faker output
- Code Climate maintainability badge is broken HOT 1
- Should search include namespaces in addition to methods? HOT 6
- CI Builds Stuck
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faker-bot.