You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
8
6
9
-
## What's Publify?
7
+
We encourage you work together and tackle it in pairs.
8
+
9
+
10
+
### What's Publify?
11
+
You will be forking & cloning an open source (MIT LICENSE) blogging platform called [Publify](github.com/publify/publify).
10
12
11
13
Publify is a simple but full featured web publishing software. It's built
12
14
around a blogging engine and a small message system connected to Twitter.
@@ -17,7 +19,7 @@ site, and Publish On your Own Site, Syndicate Everywhere.
17
19
Publify has been around since 2004 and is the oldest Ruby on Rails open source
# if ruby version >= 2.2.5 then STOP, otherwise...
59
+
$ rvm get 2.2.5
60
+
$ rvm use 2.2.5 --default # sets ruby-2.2.5 as global default
61
+
```
50
62
51
-
If you want to run the master branch, you can [clone the Publify
52
-
repository](https://github.com/publify/publify.git). However, random things may
53
-
be broken there at any time, so tread carefully!
63
+
If necessary, install `imagemagick` (used by `mini_magick` gem).
54
64
55
-
**Running the master branch in production is not recommended!**
65
+
```bash
66
+
$ which convert
67
+
# if you see path/to/bin/convert then STOP, otherwise...
68
+
$ brew update
69
+
$ brew link
70
+
$ brew install imagemagick # this can take a while!
71
+
```
56
72
57
-
### Install Publify locally
73
+
Finally, you should be ready to `bundle`:
58
74
59
-
To install Publify you need the following:
75
+
```bash
76
+
$ bundle install
77
+
```
60
78
61
-
- CRuby (MRI) 2.1, 2.2 or 2.3
62
-
- Ruby on Rails 4.2.x
63
-
- A database engine, MySQL, PgSQL or SQLite3
64
-
- A compatible JavaScript installation for asset compilation. See [the execjs
65
-
readme](https://github.com/sstephenson/execjs#readme) for details.
66
-
- ImageMagick (used by mini_magick).
79
+
> Stop and check for **errors** in your bundle output. (A "warning" is not an error! Warnings are okay for now, but errors are bad!)
67
80
68
-
1. Unzip Publify archive
69
-
2. Rename database.yml.yourEngine as database.yml
70
-
3. Edit database.yml to add your database name, login and password.
81
+
#### Setup Rails Application
82
+
Now we'll set up and seed our database:
71
83
72
84
```bash
73
-
$ bundle install
74
85
$ rake db:setup
75
86
$ rake db:migrate
76
-
$ rake db:seed
77
-
$ rake assets:precompile
78
-
$ rails server
79
87
```
80
88
81
-
You can now launch you browser and access 127.0.0.1:3000.
89
+
Launch you browser and access 127.0.0.1:3000.
82
90
83
-
### Install Publify on Heroku
84
-
85
-
In order to install Publify on Heroku, you’ll need to do some minor tweaks.
86
-
87
-
First of all, you need to setup Amazon S3 storage to be able to upload files on
88
-
your blog. Set Heroku config vars.
89
-
90
-
```yaml
91
-
heroku config:set provider=AWS
92
-
aws_access_key_id=YOUR_AWS_ACCESS_KEY_ID
93
-
aws_secret_access_key=YOUR_AWS_SECRET_ACCESS_KEY
94
-
aws_bucket=YOUR_AWS_BUCKET_NAME
95
-
```
96
-
97
-
To generate the Gemfile.lock, run:
98
91
```bash
99
-
HEROKU=true bundle install
92
+
$ rails server
100
93
```
101
94
102
-
Remove Gemfile.lock from .gitignore and commit it.
95
+
Supply a blog `title` and `email`:
103
96
104
-
Add the HEROKU config variable to your Heroku instance:
97
+
<imgwidth="382"alt="setup blog screenshot"src="https://cloud.githubusercontent.com/assets/1489337/12763124/9cbd3a5e-c9a7-11e5-97e3-e39e6098adf3.png">
105
98
106
-
```bash
107
-
heroku config:set HEROKU=true
108
-
```
99
+
Write down your *admin*`username` and `password`:
100
+
101
+
<imgwidth="380"alt="setup example login info screenshot"src="https://cloud.githubusercontent.com/assets/1489337/12763208/0440d834-c9a8-11e5-9c81-05a4b60e9722.png">
109
102
110
-
Push the repository to Heroku.
103
+
Choose a theme:
111
104
112
-
When deploying for the first time, Heroku will automatically add a Database
113
-
plugin to your instance and links it to the application. After the first
114
-
deployment, don't forget to run the database migration and seed.
105
+
* in the `/admin` section, click `Design > Choose theme`
106
+
* select the "bootstrap-2" theme option.
115
107
108
+
Finally, **seed your blog with `articles`**:
116
109
```bash
117
-
heroku run rake db:migrate db:seed
110
+
$ rake db:seed:articles
111
+
# => Seeded 24 articles...
118
112
```
119
113
120
-
If application error has occurred after migration, you need to restart Heroku server.
114
+
## Now Look Around!
115
+
* Poke around in the `/admin` section (it's similar to wordpress).
116
+
* Visit your blog homepage at `localhost:3000/`
117
+
* Publish your first blog post!
121
118
122
-
```bash
123
-
heroku restart
124
-
```
119
+
##The Bugs
120
+
121
+
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:
-[Publify on Twitter](https://twitter.com/getpublify)
134
-
- IRC: \#publify on irc.freenode.net
129
+
> To view more details, go to the "issues" section of this repo!
135
130
136
-
## Maintainers
131
+
### Resolving the Issue
132
+
Please fix each bug on its own branch (e.g. `fix_sidebar_styles`).
137
133
138
-
This is a list of Publify maintainers. If you have committed, please add
139
-
your name and contact details to the list.
134
+
When you're finished with a bug, create a pull request from your fork back to the main repo.
140
135
141
-
**Frédéric de Villamil**<frederic@publify.co>
142
-
blog: http://t37.net
143
-
irc: neuro`
136
+
Make sure to [explicitily reference](https://help.github.com/articles/autolinked-references-and-urls/#issues-and-pull-requests) the issue you are resolving in the _body_ of your pull request!
144
137
145
-
**Matijs van Zuijlen**
146
-
blog: http://www.matijs.net/blog/
147
-
irc: matijs
138
+
You can even [close an issue from inside your commit message](https://help.github.com/articles/closing-issues-via-commit-messages/))!
0 commit comments