Giter VIP home page Giter VIP logo

faker-bot's Introduction

faker-bot's People

Contributors

akabiru avatar amrrbakry avatar bpleslie avatar dependabot-preview[bot] avatar kfpo avatar piotrmurach avatar shtakai avatar vbrazo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

faker-bot's Issues

Namespace missing in fakerbot

image

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

Should search include namespaces in addition to methods?

Description

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.

Task

Find a sensible way of implementing a "full" search i.e. one that includes the class and it's method names.

Improve Search

It's worrying that search cannot match "first_name" to "firstname" - maybe look into a different approach that's more "fuzzy like"

screen shot 2018-10-05 at 15 53 34

Handle Deprecation Warnings

Lookups that include methods with deprecation warnings are currently not handled gracefully.

We should find a way of showing this nicely as it's still valuable info.

Steps to reproduce bug

$ fakerbot list -v

screen shot 2018-08-16 at 10 38 44

After pager exit ๐Ÿ˜ญ

screen shot 2018-08-16 at 10 38 35

Add flag to show sample faker output

Description

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

Faker-bot list -v fails at first time execution

Issue summary

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)

Expected behavior

As per described in Usage section it should retrieve a method list with sample output included.

Actual behavior

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)
ย  from /hidden/path/gems/faker-2.19.0/lib/faker/games/dnd.rb:131:in `species'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:172:in `public_send'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:172:in `faker_method'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:158:in `verbose_output'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:137:in `block in leaf_args'
ย  from :90:in `tap'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:136:in `leaf_args'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:132:in `block in leaf'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:132:in `map'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:132:in `leaf'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:121:in `node'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:107:in `block in build_tree'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:106:in `each'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:106:in `reduce'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:106:in `build_tree'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:74:in `tree'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:94:in `gt_screen_height?'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:84:in `paginable?'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:50:in `call'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/renderer.rb:22:in `call'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/command.rb:47:in `render'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/commands/list.rb:40:in `render'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot/commands/list.rb:22:in `execute'
ย  from /hidden/path/gems/faker-bot-0.5.3/lib/faker/bot.rb:32:in `list'
ย  from /hidden/path/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
ย  from /hidden/path/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
ย  from /hidden/path/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
ย  from /hidden/path/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
ย  from /hidden/path/gems/faker-bot-0.5.3/bin/faker:14:in `'
ย  from /hidden/path/bin/faker:25:in `load'
ย  from /hidden/path/bin/faker:25:in `'
ย  from /hidden/path/bin/ruby_executable_hooks:22:in `eval'
ย  from /hidden/path/bin/ruby_executable_hooks:22:in `'

Steps to reproduce the problem

  1. gem install faker-bot
  2. faker list -v

Specifications

App type: CLI
Operating System: macOS 12.1
Shell: zsh 5.8 (x86_64-apple-darwin21.0)
Ruby version: 3.0.3

Additional considerations

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

CI Builds Stuck

#94 #93 Have been stuckfor quite some time now. It's also not possible to view the builds o travis afaics.

Maybe a good time to try out GitHub actions? WDYT @bpleslie @vbrazo ?

Faker issue: Byebug reporting error at require "faker"

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!

Only show public class methods

Description

When 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

Let `faker list` accept arguments

Description

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.

Screenshot ๐Ÿ“ท

screenshot 2019-01-18 at 10 50 08

Fakerbot not searching namespace

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 for yeast, which is a method of beer 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.