- Create a fork of this repository.
- Make sure asdf is installed as well as ruby plugin
- In root directory of project, install ruby using
asdf install - Install project dependencies using
bundle install
Lorem ipsum is a placeholder text used to show how a block of text would look like on something without needing content. It is usually a random combination of words that have no meaning. For this exercise, create a ruby gem that will generate a simple version of Lorem ipsum. Refer to this guide for an idea of the structure of gems.
Create a method that will take in a number and return a string with random words equal to the number passed. You can use a list of any words to generate.
Example list:
["lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit"]Let's say we want 20 words. An example output can look like this:
"Sit dolor elit sit sit sit elit dolor amet ipsum amet ipsum dolor Lorem Lorem adipiscing sit elit consectetur adipiscing."Create a separate method that will take in a number and return generated sentences equal to that number. It's up to you how long the sentences should be. Apply proper punctuation and capitalization.
Create another method that will take in a number and return generated paragraphs equal to that number.
Allow user to change the words used in each method by passing an optional argument.
- Build the gem using
gem build ruby_gems_exercise.gemspec - Install gem using
gem install ./ruby_gems_exercise-0.0.0.gem
- Open
irb - Import file to use in console e.g.
require "ruby_gems_exercise". - You should be able to use the class in the console.
Run the specs using rspec. Make them pass.
Create a Pull Request directed to your fork of this repository then provide a link to the PR to the facilitators.