This Rails application has been intentionally broken!
In this lab you will dive into a mature rails application and attempt to fix some reported bugs. This lab will stretch your debugging skills and your ability to navigate a large rails project. It will also simulate a real-world scenario: contributing to an open source project.
We encourage you work together and tackle it in pairs.
You will be forking & cloning an open source (MIT LICENSE) blogging platform called Publify.
Publify is a simple but full featured web publishing software. It's built around a blogging engine and a small message system connected to Twitter.
Publify follows the principles of the IndieWeb, which are self hosting your Web site, and Publish On your Own Site, Syndicate Everywhere.
Publify has been around since 2004 and is the oldest Ruby on Rails open source project alive.
- A classic multi user blogging engine
- Short messages with a Twitter connection
- Text filters (Markdown, Textile, SmartyPants, @mention to link, #hashtag to link)
- A widgets system and a plugin API
- Custom themes
- Advanced SEO capabilities
- Multilingual : Publify is (more or less) translated in English, French, German, Danish, Norwegian, Japanese, Hebrew, Simplified Chinese, Mexican Spanish, Italian, Lithuanian, Dutch, Polish, Romanian…
To install Publify you need the following:
- Ruby >= 2.2.5
- Ruby On Rails ~> 4.2.5
- Postgresql
- ImageMagick
First things first, Fork & Clone the Publify repo.
If necessary, update rake
to ~> 11.1
.
$ rake --version
# if rake version >= 11.1 then STOP, otherwise...
$ bundle update rake
If necessary, switch to ruby 2.2.5.
$ ruby -v
# if ruby version >= 2.2.5 then STOP, otherwise...
$ rvm get 2.2.5
$ rvm use 2.2.5 --default # sets ruby-2.2.5 as global default
If necessary, install imagemagick
(used by mini_magick
gem).
$ which convert
# if you see path/to/bin/convert then STOP, otherwise...
$ brew update
$ brew link
$ brew install imagemagick # this can take a while!
Finally, you should be ready to bundle
:
$ bundle install
Stop and check for errors in your bundle output. (A "warning" is not an error! Warnings are okay for now, but errors are bad!)
Now we'll set up and seed our database:
$ rake db:setup
$ rake db:migrate
Launch you browser and access 127.0.0.1:3000.
$ rails server
Supply a blog title
and email
:
Write down your admin username
and password
:
Choose a theme:
- in the
/admin
section, clickDesign > Choose theme
- select the "bootstrap-2" theme option.
Finally, seed your blog with articles
:
$ rake db:seed:articles
# => Seeded 24 articles...
- Poke around in the
/admin
section (it's similar to wordpress). - Visit your blog homepage at
localhost:3000/
- Publish your first blog post!
##The Bugs
A number of issues have been added to the main github repo. Please fix each bug on its own branch (e.g. fix_sidebar_styles
). We suggest you do them in order:
- Inconsistent Sidebar Styles
- Post tags are shown as "object"
- Load spinner does not go away
- Top Month Always Empty (Archive Sidebar)
- Months sorted incorrectly (Archive Sidebar)
To view more details, go to the "issues" section of this repo!
Please fix each bug on its own branch (e.g. fix_sidebar_styles
).
When you're finished with a bug, create a pull request from your fork back to the main repo.
Make sure to explicitily reference the issue you are resolving in the body of your pull request!
You can even close an issue from inside your commit message)!
We will hold you to the highest professional standards of software development.
We will not accept pull requests that:
- fail to reference the issue number in the body of the pull request
- have poor code style -- e.g. incorrect indentation / whitespace
- modify files that are not immediately relevant to the bug at hand
- have poor commit messages or too many commits
- fail to explain, in plain english, what the problem was and how and why the pull request fixes it
Before you push, make sure to run
rubocop
to lint your ruby code and ensure it meets the standards established by this project.
- Use Rubber Duck Debugging -- Make sure you understand the issue!
- Use frequent Sanity Checks
- What are you testing / what are you expecting?
- Follow the trail
- How do you work backwards from the view to the server?
- How do you find specific files in your rails application?
- How do you find specific keywords or method calls?
- Sometimes you need to resart the server if the views you are working with are being cached.