📸 Photo by Joshua Fuller on Unsplash
I am working on a static site generator using just Ruby and a few gems.
It seems that testing with RSpec is the way to go, however most tutorials or blog posts associate RSpec with Rails and I don't have, want, or need a Rails component to this; it's just a CLI tool.
My question is can I use RSpec with a pure Ruby CLI tool or should I try something like Minitest instead?
**Oh and maybe someone would be willing to take a look at what I've got?"
twhite96 / static-gen-ruby
A static site generator scaffold built with Ruby
Static Gen
A static site generator built with Ruby.
How to use:
- 🌀 Clone the repo at
https://github.com/twhite96/static-gen-ruby.git
or with GitHub CLIgh repo clone twhite96/static-gen-ruby
- 🏃 Run:
bundle
to install dependencies. - 🎊 Have fun with it.
Motivation for this app
I wanted to show that I could build something, even if it was small, on my own, with little guidance.
Ben Halpern started a thread about his generator on DEV and I took his scaffold and ran with it.
🥞 Stack
Ruby and ruby-handlebars
👊🏽 Wins
Just getting the script running is a win for me, as I am not a Ruby dev at all.
😐 Difficulties
Ruby is a whole other animal compared to JavaScript and React. No semicolons, defining different methods (Ruby is class based, so there are more methods than functions in this instance), etc. I spent a whole month stuck on what this method did:
Top comments (1)
You can totally use Rspec for testing your non-Rails CLI! RuboCop does it too, here's an example: github.com/rubocop/rubocop/pull/11...