Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Build, Debug & Prosper

rishi jain
August 25, 2014

Build, Debug & Prosper

This is the talk I gave at RubyConf Brazil.

rishi jain

August 25, 2014
Tweet

More Decks by rishi jain

Other Decks in Technology

Transcript

  1. Facts about INDIA • 7th largest country by area in

    world.! • 2nd most populous country at 1.2 billion people! • Chess was invented in India! • Value of “pi” was first calculated by Indian mathematician Budhayana.! • Exports software to 90 countries.
  2. 2. command line gem query --remote rails! ! *** REMOTE

    GEMS *** ! aa-rails4 (0.6.0) aaronchi-jrails (0.5.1) aavkontakte-rails3 (0.1.9) abcjs-rails (1.11) access-granted-rails (0.1.0) activerecord-import-rails4 (0.5.0)
  3. require 'net_explore/version'! require 'os'! module NetExplore! def self.open_url url! !

    ! #open page on mac OS! ! ! ! ! #open page on linux! ! ! #raise an error! end! ! end
  4. require 'net_explore/version'! require 'os'! module NetExplore! def self.open_url url! !

    ! if OS.mac?! system("open #{url}")! ! ! elsif OS.linux?! system("xdg-open #{url}")! ! ! else! raise 'Operating system type not supported ... please file the issue on gitub page with your OS name and I will try to include it in next release.'! ! ! end! ! end! end
  5. SCENARIO: • INITIAL CLASS IS RELEASED! • MORE FEATURES ADDED

    TO CLASS! • BUG FIXES IN EXISTING METHODS! • CHANGES WHICH BREAK EARLIER CODE
  6. Incremental Versioning: • INITIAL CLASS IS RELEASED • MORE FEATURES

    ADDED TO CLASS! • BUG FIXES IN EXISTING METHODS • CHANGES WHICH BREAK EARLIER CODE VERSION1 VERSION2 VERSION3 VERSION4
  7. Semantic Versioning: • INITIAL CLASS IS RELEASED VERSION 0.0.1 VERSION

    0.1.0 VERSION 0.1.1 VERSION 1.0.0 • MORE FEATURES ADDED TO CLASS • BUG FIXES IN EXISTING METHODS • CHANGES WHICH BREAK EARLIER CODE
  8. ~ >

  9. Step2: Update gem with certs cd /path/to/your/gem! mkdir certs! cp

    ~/.ssh/gem-public_cert.pem certs/ yourhandle.pem! git add certs/yourhandle.pem!
  10. Security Policies: • No security: Signed packages are treated like

    unsigned packages. • Low security: Checks expiry of certificate. • Medium Security: Validation + inclusion in cert chain. • High Security: Medium security + un- signed gems restriction.
  11. Scenario(hypothetical): • You have a problem.! • Solution found on

    stack overflow (some gem)! • gem install gem-name
  12. Vulnerability on gem installation: • Read/Write files on your system.!

    • Connect to remote server.! • Grab Passwords! • Own all your ruby gems.