open source saturday - how can i contribute to ruby on rails?

27
Open Source Saturday Introduction

Upload: pravin-mishra

Post on 09-Dec-2014

744 views

Category:

Education


0 download

DESCRIPTION

Making your first contribution to an open source library can be very daunting. If you’re like me, I was/am nagged by self-doubt and a fear that I would/will “do it wrong.” I worry about the mocking of other developers, all solidified by years of open source contributions. If you are stuck in the self-doubt phase, but want to jump in, you may be asking “What’s the first step?” or “How do I contribute?” Well, We aim to answer those kinds of questions by walking you through steps.

TRANSCRIPT

Page 1: Open Source Saturday - How can I contribute to Ruby on Rails?

” Open Source Saturday

Introduction

Page 2: Open Source Saturday - How can I contribute to Ruby on Rails?

Open Source Saturday

How can I

contribute to

Ruby on Rails?

Page 3: Open Source Saturday - How can I contribute to Ruby on Rails?

I Want You

To Contribute To Rails

Page 4: Open Source Saturday - How can I contribute to Ruby on Rails?

Page 5: Open Source Saturday - How can I contribute to Ruby on Rails?

Sure You Can!

Page 6: Open Source Saturday - How can I contribute to Ruby on Rails?

I felt like that too!

Page 7: Open Source Saturday - How can I contribute to Ruby on Rails?

Page 8: Open Source Saturday - How can I contribute to Ruby on Rails?

Find something you want to fix, then...

Page 9: Open Source Saturday - How can I contribute to Ruby on Rails?

open http://github.com/rails/rails

Search For Issues

Page 10: Open Source Saturday - How can I contribute to Ruby on Rails?

Search For Pull Request

Page 11: Open Source Saturday - How can I contribute to Ruby on Rails?

Set up a local copy

First, fork Rails

Page 12: Open Source Saturday - How can I contribute to Ruby on Rails?

Forking rails/rails

Page 13: Open Source Saturday - How can I contribute to Ruby on Rails?

Set up a local copy

Clone your repo

Page 14: Open Source Saturday - How can I contribute to Ruby on Rails?

Add the new remote to your local

$ git remote add mine git://github.com/rails/rails.git

$ git remote

$ git fetch mineDownload new commits and branches from the official repository:

$ git checkout master

$ git rebase mine/masterUpdate your fork:

Page 15: Open Source Saturday - How can I contribute to Ruby on Rails?

Get the tests running

- bundle update install dependencies

- bundle exec rake test run all test

Page 16: Open Source Saturday - How can I contribute to Ruby on Rails?

Active Record Setup

- Database Configuration The Active Record test suite requires a custom config file - activerecord/test/config.yml

- MySQL and PostgreSQL To be able to run the suite for MySQL and PostgreSQL we need their gems $ sudo apt-get install mysql-server libmysqlclient15-dev $ sudo apt-get install postgresql postgresql-client postgresql-contrib libpq-dev

Page 17: Open Source Saturday - How can I contribute to Ruby on Rails?

Create User Name

- MySQL mysql -uroot -p mysql> CREATE USER 'rails'@'localhost';

mysql> GRANT ALL PRIVILEGES ON activerecord_unittest.* to 'rails'@'localhost';

mysql> GRANT ALL PRIVILEGES ON activerecord_unittest2.* to 'rails'@'localhost';

- PostgreSQL sudo -u postgres createuser --superuser $USER

Page 18: Open Source Saturday - How can I contribute to Ruby on Rails?

Create database

- MySQL $ cd activerecord $ bundle exec rake mysql:build_databases

- PostgreSQL $ cd activerecord $ bundle exec rake postgresql:build_databases

- Both

$ cd activerecord $ bundle exec rake db:create

- Cleanup the databases $ cd activerecord

$ bundle exec rake db:drop

Page 19: Open Source Saturday - How can I contribute to Ruby on Rails?

Running Tests

- Test ActiveRecord $ rake test

- Test Specific Adaptor $ rake test_postgresql $ rake -T

- Test Specific file

$ ruby -Itest test/cases/base_test.rb $ ARCONN=postgresql ruby -Itest test/cases/base_test.rb

- Run Specific test $ruby -Itest test/cases/base_test.rb -n test_if_something_works

Page 20: Open Source Saturday - How can I contribute to Ruby on Rails?

Create a branch and go to work

- Pick a good branch name. Others will see it.

- Clear, concise code as always! Follow the Rails coding style.

- Write tests, and make sure all tests pass.

Page 21: Open Source Saturday - How can I contribute to Ruby on Rails?

Push to github

- First, fetch from upstream and rebase your work.

- Push your branch to origin – your github repo.

Page 22: Open Source Saturday - How can I contribute to Ruby on Rails?

do Pull Request

- Go to your new branch on github.

- Push the magic Pull Request button.

Page 23: Open Source Saturday - How can I contribute to Ruby on Rails?

Page 24: Open Source Saturday - How can I contribute to Ruby on Rails?

Pull Request primer

- Explain your code and why it should be merged into Rails.

- Your message starts a discussion thread.

- If you need to make changes, do them and push them. The pull request will be automatically updated.

- Help the Rails team. Be kind. In return, they'll help you.

Page 25: Open Source Saturday - How can I contribute to Ruby on Rails?

Boom!

That was Easy

Page 26: Open Source Saturday - How can I contribute to Ruby on Rails?

Now you're one of THEM

http://contributors.rubyonrails.org/

Page 27: Open Source Saturday - How can I contribute to Ruby on Rails?

Question?

Thanks By: Pravin Mishra Twitter: pravinmishra88