rubyonjets / jets

Ruby on Jets
http://rubyonjets.com
MIT License
2.6k stars 181 forks source link

jets generate --noop flag ignored #248

Closed undefinedvalue closed 5 years ago

undefinedvalue commented 5 years ago

[edited: forgot to upgrade jets. Problem still exists in 1.8.14]

Checklist

My Environment

Software Version
Operating System OSX 10.14.4
Jets 1.8.14
Ruby 2.5.3

Expected Behaviour

Running jets generate --noop scaffold Foo should not create anything.

The --noop flag is documented in jets help generate. It doesn't actually say what it does (which should be fixed), but I'd expect it to not change any files.

Current Behavior

Running jets generate --noop scaffold Foo ignores the --noop flag and creates resources.

Note: I was unsure whether --noop is an argument to generate or scaffold, so I also tried jets generate scaffold --noop Foo, which still ignores the flag.

Step-by-step reproduction instructions

  1. Run jets generate --noop scaffold Foo
  2. git status (or ls or whatever) to show that files were actually changed

Code Sample

N/A

Solution Suggestion

Make the flag work (preferable), or remove it as an option.

Also: the documentation shown by jets help generate is pretty unhelpful. It literally just links to the rails generate online documentation. I get that jets is based on rails, but I don't want to have to open a browser and look through a bunch of verbose documentation when all I want is a command list to remind me what options are available.

tongueroo commented 5 years ago

Yup. The jets generator code delegates to the rails generators to spare coding work. This is the reason the help menu puts out the rails generator help method. That being said, wondering how to override the help menus for improved help messages. Would probably a decent amount of time to update docs for each of these CLI commands. Unsure if it's worth it right now. Happy to consider PRs here though. 😁

Also, we should fix the noop mode. So will dig into that in time also. Will also consider PRs here!

tongueroo commented 5 years ago

Done #318 Released in v2.0.0 🎉