SlideShare a Scribd company logo
1 of 27
“
Open Source Saturday

Introduction

”
“

Open Source Saturday

How can I
contribute to
Ruby on Rails?

”
“

I Want You

”
To Contribute To Rails
“
”
Sure You Can!

“
”
I felt like that too!

“
”
“
”
Find something you want to fix, then...

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

“
”
Search For Issues
Search For Pull Request

“
”
Set up a local copy

“

First,

fork Rails

”
Forking rails/rails

“
”
Set up a local copy

“

Clone

your repo

”
Add the new remote to your local

“

$ git remote add mine git://github.com/rails/rails.git
$ git remote
$ git fetch mine
Download new commits and branches from the official repository:

$ git checkout master
$ git rebase mine/master
Update your fork:

”
Get the tests running

“

- bundle update
install dependencies

- bundle exec rake test
run all test

”
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

”
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

”
Create database

“

- MySQL

$ cd activerecord
$ bundle exec rake mysql:build_databases

- PostgreSQL

$ cd activerecord
$ bundle exec rake postgresql:build_databases

- Both

activerecord
$ bundle exec rake db:create

- Cleanup the databases
activerecord

rake db:drop

”
$ cd

$ cd
$ bundle exec
Running Tests

“

- Test ActiveRecord
$ rake test

- Test Specific Adaptor
$ rake test_postgresql
$ rake -T

- Test Specific file

-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

”

$ ruby
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.

”
Push to github

“

- First, fetch from upstream and rebase your work.

- Push your branch to origin – your github repo.

”
do Pull Request

“

- Go to your new branch on github.
- Push the magic Pull Request button.

”
“
”
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.
Boom!

“
”
That was Easy
Now you're one of THEM

“
http://contributors.rubyonrails.org/

”
“

Question?

Thanks
By:
Pravin Mishra
Twitter: pravinmishra88

”

More Related Content

What's hot

PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize Django
Hannes Hapke
 
Put a Button on It: Removing Barriers to Going Fast
Put a Button on It: Removing Barriers to Going FastPut a Button on It: Removing Barriers to Going Fast
Put a Button on It: Removing Barriers to Going Fast
OSCON Byrum
 

What's hot (20)

Deploying E.L.K stack w Puppet
Deploying E.L.K stack w PuppetDeploying E.L.K stack w Puppet
Deploying E.L.K stack w Puppet
 
CPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolsCPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its tools
 
Where is my scalable api?
Where is my scalable api?Where is my scalable api?
Where is my scalable api?
 
Capistrano - automate all the things
Capistrano - automate all the thingsCapistrano - automate all the things
Capistrano - automate all the things
 
Capistrano
CapistranoCapistrano
Capistrano
 
Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2
 
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
 
Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - Greach 2016Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - Greach 2016
 
Getting Started with Capistrano
Getting Started with CapistranoGetting Started with Capistrano
Getting Started with Capistrano
 
Cook Infrastructure with chef -- Justeat.IN
Cook Infrastructure with chef  -- Justeat.INCook Infrastructure with chef  -- Justeat.IN
Cook Infrastructure with chef -- Justeat.IN
 
Heritrix REST API
Heritrix REST APIHeritrix REST API
Heritrix REST API
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize Django
 
Capybara with Rspec
Capybara with RspecCapybara with Rspec
Capybara with Rspec
 
Intro to Rack
Intro to RackIntro to Rack
Intro to Rack
 
Deployment with capistrano
Deployment with capistranoDeployment with capistrano
Deployment with capistrano
 
Capybara + RSpec - ruby dsl-based web ui qa automation
Capybara + RSpec - ruby dsl-based web ui qa automationCapybara + RSpec - ruby dsl-based web ui qa automation
Capybara + RSpec - ruby dsl-based web ui qa automation
 
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代[JCConf 2020] 用 Kotlin 跨入 Serverless 世代
[JCConf 2020] 用 Kotlin 跨入 Serverless 世代
 
Serverless Ballerina
Serverless BallerinaServerless Ballerina
Serverless Ballerina
 
Lies, Damn Lies, and Benchmarks
Lies, Damn Lies, and BenchmarksLies, Damn Lies, and Benchmarks
Lies, Damn Lies, and Benchmarks
 
Put a Button on It: Removing Barriers to Going Fast
Put a Button on It: Removing Barriers to Going FastPut a Button on It: Removing Barriers to Going Fast
Put a Button on It: Removing Barriers to Going Fast
 

Similar to Open Source Saturday - How can I contribute to Ruby on Rails?

How to start using Scala
How to start using ScalaHow to start using Scala
How to start using Scala
Ngoc Dao
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chef
LeanDog
 

Similar to Open Source Saturday - How can I contribute to Ruby on Rails? (20)

Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10
 
Deploying a simple Rails application with AWS Elastic Beanstalk
Deploying a simple Rails application with AWS Elastic BeanstalkDeploying a simple Rails application with AWS Elastic Beanstalk
Deploying a simple Rails application with AWS Elastic Beanstalk
 
How to start using Scala
How to start using ScalaHow to start using Scala
How to start using Scala
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
Buildr In Action @devoxx france 2012
Buildr In Action @devoxx france 2012Buildr In Action @devoxx france 2012
Buildr In Action @devoxx france 2012
 
Build application using sbt
Build application using sbtBuild application using sbt
Build application using sbt
 
Gem That (2009)
Gem That (2009)Gem That (2009)
Gem That (2009)
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chef
 
ASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & docker
 
Pourquoi ruby et rails déchirent
Pourquoi ruby et rails déchirentPourquoi ruby et rails déchirent
Pourquoi ruby et rails déchirent
 
Week6
Week6Week6
Week6
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developer
 
Gradle
GradleGradle
Gradle
 
Smalltalk on rubinius
Smalltalk on rubiniusSmalltalk on rubinius
Smalltalk on rubinius
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes Back
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0
 
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
 
Create your-own-gem-with-github-jeweler-rubygems
Create your-own-gem-with-github-jeweler-rubygemsCreate your-own-gem-with-github-jeweler-rubygems
Create your-own-gem-with-github-jeweler-rubygems
 
Linecook - A Chef Alternative
Linecook - A Chef AlternativeLinecook - A Chef Alternative
Linecook - A Chef Alternative
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and Lingvokot
 

More from Pravin Mishra

A journey from monolith to micro services
A journey from monolith to micro servicesA journey from monolith to micro services
A journey from monolith to micro services
Pravin Mishra
 

More from Pravin Mishra (8)

A journey from monolith to micro services
A journey from monolith to micro servicesA journey from monolith to micro services
A journey from monolith to micro services
 
App42 PaaS - Application Hosting Platform
App42 PaaS - Application Hosting PlatformApp42 PaaS - Application Hosting Platform
App42 PaaS - Application Hosting Platform
 
Happy Go programing
Happy Go programingHappy Go programing
Happy Go programing
 
Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )
 
App42 PaaS
App42 PaaSApp42 PaaS
App42 PaaS
 
Hosting rails apps
Hosting rails appsHosting rails apps
Hosting rails apps
 
Node.js
Node.jsNode.js
Node.js
 
Selenium By Pravin Mishra
Selenium By Pravin MishraSelenium By Pravin Mishra
Selenium By Pravin Mishra
 

Recently uploaded

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 

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

  • 2. “ Open Source Saturday How can I contribute to Ruby on Rails? ”
  • 3. “ I Want You ” To Contribute To Rails
  • 6. I felt like that too! “ ”
  • 8. Find something you want to fix, then... “ ”
  • 10. Search For Pull Request “ ”
  • 11. Set up a local copy “ First, fork Rails ”
  • 13. Set up a local copy “ Clone your repo ”
  • 14. Add the new remote to your local “ $ git remote add mine git://github.com/rails/rails.git $ git remote $ git fetch mine Download new commits and branches from the official repository: $ git checkout master $ git rebase mine/master Update your fork: ”
  • 15. Get the tests running “ - bundle update install dependencies - bundle exec rake test run all test ”
  • 16. 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 ”
  • 17. 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 ”
  • 18. Create database “ - MySQL $ cd activerecord $ bundle exec rake mysql:build_databases - PostgreSQL $ cd activerecord $ bundle exec rake postgresql:build_databases - Both activerecord $ bundle exec rake db:create - Cleanup the databases activerecord rake db:drop ” $ cd $ cd $ bundle exec
  • 19. Running Tests “ - Test ActiveRecord $ rake test - Test Specific Adaptor $ rake test_postgresql $ rake -T - Test Specific file -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 ” $ ruby
  • 20. 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. ”
  • 21. Push to github “ - First, fetch from upstream and rebase your work. - Push your branch to origin – your github repo. ”
  • 22. do Pull Request “ - Go to your new branch on github. - Push the magic Pull Request button. ”
  • 24. 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.
  • 26. Now you're one of THEM “ http://contributors.rubyonrails.org/ ”