- Run
bundle install
- Run
bundle exec ruby -run -e httpd . -p 8000
to get a server running on port 8000 - Open http://localhost:8000/activity in your browser
- Open
activity/my_class.rb
in your editor - Change the functionality of
MyClass
to something you're interested in. Just make sure you still implement theto_s
method.
Not very likely that it will work in this particular setup. But possible, especially if the gem doesn't have any runtime dependencies.
gem install -i activity/gems numerizer -v 0.2.0
- Add
<script type="text/ruby" src="gems/gems/numerizer-0.2.0/lib/numerizer.rb"></script>
to activity/index.html - After that
<script>
tag, you can then use your gem like so:
<script type="text/ruby">
puts Numerizer.numerize('two and three eighths')
# => should print "2.375" to the console
</script>