akabiru / faker-bot Goto Github PK
View Code? Open in Web Editor NEWA tool to make it easier to pick the right Faker methods to generate the fake data you need. ๐
License: MIT License
A tool to make it easier to pick the right Faker methods to generate the fake data you need. ๐
License: MIT License
Following faker-bot documentation while executing faker list -v
I got the following error:
/hidden/path/faker-2.19.0/lib/faker.rb:188:in `method_missing': super: no superclass method `species' for Faker::Games::DnD:Class (NoMethodError)
As per described in Usage section it should retrieve a method list with sample output included.
Instead I got the following error:
`DnD.species` is deprecated. Use `DnD.race` instead.
/hidden/path/gems/faker-2.19.0/lib/faker.rb:188:in `method_missing': super: no superclass method `species' for Faker::Games::DnD:Class (NoMethodError)
gem install faker-bot
faker list -v
App type: CLI
Operating System: macOS 12.1
Shell: zsh 5.8 (x86_64-apple-darwin21.0)
Ruby version: 3.0.3
Not sure if this could be related but when install asked for overwrite the executable I answered yes:
Overwrite the executable? [yN] y
Successfully installed faker-bot-0.5.3
13 gems installed
At the moment running faker list
will list out all Faker constants and the methods they respond to. This is cool and all but what if I just want to list Faker::Internet
?
I should be able to run sth like faker list internet
and this should list out the Faker::Internet
class
The command should also support the verbose option and any other sensible options e.g. data type.
README.md
README.md
in faker
to mention this repositoryWhen listing, $ fakerbot list -v
you'll notice that things such as Faker::Bitcoin
will list protected methods.
Faker::Bitcoin.singleton_methods(false)
#=> [:address, :address_for, :testnet_address, :base58]
This should list only "address" and "testnet_address" Ref stympy/faker
FakerBot::Reflectors::Search#search_descendants_matching_query contains iterators nested 2 deep
CHANGELOG.md
possibly use a tool for this, similar to Faker โCONTRIBUTING.md
and include details on how releases are handledAs it stands, calling 'fakerbot list' will list faker constants in an arbitrary order. This should be alphabetical.
Faker core has a very cool logo, I think it'd be really cool to have one for faker bot as well. ๐
At the moment executing fakerbot search star
does not include results like Faker::StarWars
i.e. "everything matching star
".
This is because the fakerbot reflector only searches through the class method names and doesn't include the class names.
Find a sensible way of implementing a "full" search i.e. one that includes the class and it's method names.
Gem built from latest master. Windows 10, ruby 2.4.4p296 (2018-03-28 revision 63013) and ruby 2.5.3p105 (2018-10-18 revision 65156)
Expecting to see full namespace at top of tree, ie Faker::PhoneNumber (as shown in #1507 )
From: faker-ruby/faker#1565
Example1:
C:\Users\richard.bulger>faker search beer -v Sorry, we couldn't find a match ๐ข C:\Users\richard.bulger>faker search yeast -v Faker โโโ yeast=> 5526 - Brettanomyces lambicus Faker โโโ as_you_like_it=> I like this place and willingly could waste my time in it. โโโ as_you_like_it_quote=> Can one desire too much of a good thing?.
Note that the first result for
beer
returns nothing. But the second foryeast
, which is a method ofbeer
does. (Also note that the namespace name isn't shown in the result tree, which I've raised in #1565 )Also, in the second result, you can see it also returns irrelevant results from the Shakespeare namespace. Not sure why.
Example2:
C:\Users\richard.bulger>faker search simpsons -v Faker โโโ i_groups=> Two Two
Doesn't return any simpons namespace stuff, but returns a Kpop one...
From: faker-ruby/faker#1566
Still very new to Rails and am trying to use Faker to -- of course -- seed my userdata db with realistic-looking data. When I execute the code below via rails db:seed, I don't get any response from the CLI, rather just a returned line with no output, messaging, etc.
Seeds.rb:
require "faker"
10.times do
data = Userdatum.new(
adds1: Faker::Address.street_address,
adds2: '-',
addcity: Faker::Address.city,
addstate: Faker::Address.state,
addzip: Faker::Address.zip,
phone: Faker::PhoneNumber.cell_phone,
taxpref: Faker::Boolean.boolean,
mtgepref: Faker::Boolean.boolean,
inspref: Faker::Boolean.boolean,
created_at: '123456',
updated_at: '123456',
user_id: 10000,
fName: Faker::Name.first_name,
lName: Faker::Name.last_name,
email: Faker::Internet.email
)
data.save
end
Byebug error message:
[4, 13] in /Users/robertmaxwell/RUBY/GULF/GULF/db/seeds.rb
4: # Examples:
5: #
6: # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
7: # Character.create(name: 'Luke', movie: movies.first)
8:
=> 9: require "faker"
10:
11: 10.times do
12: data = Userdatum.new(
13: adds1: Faker::Address.street_address,
Schema.db
ActiveRecord::Schema.define(version: 2021_07_26_050246) do
create_table "userdata", force: :cascade do |t|
t.string "adds1"
t.string "adds2"
t.string "addcity"
t.string "addstate"
t.string "addzip"
t.string "phone"
t.boolean "taxpref"
t.boolean "mtgepref"
t.boolean "inspref"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.integer "user_id"
t.string "fName"
t.string "lName"
t.string "email"
t.index ["user_id"], name: "index_userdata_on_user_id"
end
Please, please, please and thank you in advance for any assistance here!
When listing faker namespace it would be nice to include a flag in the command that triggers sample output from the methods.
E.g.
$ fakerbot list --verbose --with-samples
# Output
Faker::Currency
โโโ name#=> Tala
โโโ code#=> MUR
โโโ symbol#=> PhP
Faker::BackToTheFuture
โโโ quote#=> I noticed your band is on the roster for the dance auditions after school today. Why even bother, McFly? You don't have a chance. You're too much like your old man. No McFly ever amounted to anything in the history of Hill Valley!
โโโ date#=> October 26, 1985
โโโ character#=> Goldie Wilson
Faker::Artist
โโโ name#=> Seurat
This feature could also be extended to other commands such as search
spec/fakerbot/renderer_spec.rb
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.