Slide 1

Slide 1 text

Crafting Rails Culture to Your Company Hiroshi SHIBATA @hsbt RailsPacific

Slide 2

Slide 2 text

Thank you!

Slide 3

Slide 3 text

SHIBATA Hiroshi @hsbt

Slide 4

Slide 4 text

Tokyo Matze

Slide 5

Slide 5 text

RailsGirls in Japan

Slide 6

Slide 6 text

asakusa.rb

Slide 7

Slide 7 text

RubyKaigi 2014 RubyConf Taiwan 2014 RedDotRubyConf 2014 RailsPacific OedoRubyKaigi04

Slide 8

Slide 8 text

Ruby Committer

Slide 9

Slide 9 text

ruby rubygems rake rdoc psych syck ruby-build railsgirls railsgirls-jp kaminari tdiary hiki jenkins.rb fastladder commit bit collector

Slide 10

Slide 10 text

My work of Ruby 2.2.0 Update test-unit and minitest (removed from repository but bundled in tarball) coordinate to Ruby committers negotiate to sponsors make development environment

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

"MPOHUJNFBHP

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Pepabo Hosting EC Media

Slide 24

Slide 24 text

0WFSQFPQMF

Slide 25

Slide 25 text

organizations which design systems ... are constrained to produce designs which are copies of the communication structures of these organizations — M. Conway

Slide 26

Slide 26 text

PHP MySQL5 PHP MySQL4 Ruby and PHP Rails MySQL5 Pepabo

Slide 27

Slide 27 text

ϛυϧ΢ΣΞͷΞοϓάϨʔυ ࣾ಺։ൃج൫ͷߏங ౷ܭج൫ͷߏங +409ͷӡ༻੔උ HJUIVC ηΩϡϦςΟ؂ࠪ ίʔυϨϏϡʔ ςετج൫ͷߏங ΞΫηεղੳج൫ͷߏங ։ൃϓϩηε ৽ਓڭҭ ݪߘࣥච ΧϯϑΝϨϯεൃද 044։ൃ αʔόʔߏ੒؅ཧͷ࡮৽ ϦʔϯελʔτΞοϓ +FOLJOT 3VCZ3BJMT 3%#.4 ٕज़ج൫νʔϜ

Slide 28

Slide 28 text

Pepabo ٕज़ج൫νʔϜ PHP MySQL5 PHP MySQL4 Ruby and PHP Rails MySQL5

Slide 29

Slide 29 text

Ruby Rails MySQL5 Ruby Rails MySQL5 Ruby and PHP Rails MySQL5 Pepabo ٕज़ج൫νʔϜ

Slide 30

Slide 30 text

Why Ruby?

Slide 31

Slide 31 text

3. references Why Ruby? 2. environment 1. testing

Slide 32

Slide 32 text

Testing

Slide 33

Slide 33 text

3. rspec powerful testing framework 2. minitest 1. test-unit

Slide 34

Slide 34 text

Capybara

Slide 35

Slide 35 text

1) Failure: TestPowerAssert#test_power_assert_failed [test/test_power_assert.rb:10]: assert { "0".class == "3".to_i.times.map {|i| i + 1 }.class } | | | | | | | | | Array | | | [1, 2, 3] | | # | 3 String Power Assert

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

1) Failure: TestPowerAssert#test_power_assert_failed [test/test_power_assert.rb:10]: assert { "0".class == "3".to_i.times.map {|i| i + 1 }.class } | | | | | | | | | Array | | | [1, 2, 3] | | # | 3 String class TestPowerAssert < Minitest::Test def test_power_assert_failed assert { "0".class == "3".to_i.times.map {|i| i + 1 }.class } end end testcase assertion

Slide 38

Slide 38 text

3. run test -> fail -> detect fail reason Typical usecase 2. add inspection code 1. run test -> fail 5. run test -> success 4. fix code

Slide 39

Slide 39 text

3. run test -> fail -> detect fail reason Typical usecase 2. add inspection code 1. run test -> fail 5. run test -> fail!!! -> turn to 2 4. fix code

Slide 40

Slide 40 text

Typical usecase 1. run test -> fail 5. run test -> fail!!! -> turn to 4 4. fix code 1) Failure: TestPowerAssert#test_power_assert_failed [test/test_power_assert.rb:10]: assert { "0".class == "3".to_i.times.map {|i| i + 1 }.class } | | | | | | | | | Array | | | [1, 2, 3] | | # | 3 String

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

Development Environment 2. rbenv + ruby-build 1. osx + homebrew

Slide 43

Slide 43 text

Many references

Slide 44

Slide 44 text

Rails Good Parts Why Rails?

Slide 45

Slide 45 text

3. admin integration Why Rails? 2. oss way 1. modern architecture

Slide 46

Slide 46 text

enforce modern architecture

Slide 47

Slide 47 text

case.1 Ruby 1.8.6 to Ruby 2.1.2

Slide 48

Slide 48 text

Ruby 1.8.6 Rails 2.0.2 Ruby 2.1.3 Rails 4.1.6 new!

Slide 49

Slide 49 text

Ruby 1.8.6 1.8.7 1.9.3 2.0.0 2.1 Rails 2.0/2.1 2.3 3.0 3.2 4.0/4.1

Slide 50

Slide 50 text

KyotoTycoon to memcached case.2 replace legacy middleware

Slide 51

Slide 51 text

app1 app2

Slide 52

Slide 52 text

begin require 'dalli' rescue LoadError => e $stderr.puts "You don't have dalli installed in your application. Please add it to your Gemfile and run bundle install" raise e end rails4 need to dalli

Slide 53

Slide 53 text

kyoto tycoon is slower than mysql… dalli is not support to kyoto tycoon…

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

enforce oss way

Slide 56

Slide 56 text

Ruby Rails MySQL5 Ruby Rails MySQL5 Ruby and PHP Rails MySQL5 Pepabo ٕज़ج൫νʔϜ

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

class Bar def bar(foo = foo()) foo end def buzz(foo = foo) foo end def foo :buzz end end p Bar.new.bar p Bar.new.buzz

Slide 59

Slide 59 text

% ruby -v r45272.rb ruby 2.2.0dev (2014-04-13 trunk 45580) [x86_64-darwin13] :buzz nil % ruby -v r45272.rb ruby 2.1.2p80 (2014-03-01 revision 45231) [x86_64-darwin13.0] :buzz :buzz

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

admin integration

Slide 62

Slide 62 text

3. no console What’s admin? 2. payment/refund 1. customer support

Slide 63

Slide 63 text

organizations which design systems ... are constrained to produce designs which are copies of the communication structures of these organizations — M. Conway

Slide 64

Slide 64 text

Developer Director Customer Support Our Typical Team

Slide 65

Slide 65 text

VONBJOUBJOFEʜ

Slide 66

Slide 66 text

3. other app better admin 2. Rails Engine 1. app internal

Slide 67

Slide 67 text

app internal pros better testing better deploy cons including difference application including effective code

Slide 68

Slide 68 text

Rails Engine pros splitting application code better deploy cons difficulty testing can’t use production code directly

Slide 69

Slide 69 text

Other app pros definitely splitting app cons separated develop cycle duplicated code

Slide 70

Slide 70 text

No silver bullet

Slide 71

Slide 71 text

Rails like a php MySQL5 Rails like a java MySQL5 Rails like a php MySQL5 Optimize Your Company ٕज़ج൫νʔϜ

Slide 72

Slide 72 text

Lern to Rails Internal step by step

Slide 73

Slide 73 text

Lern to Active Record Internal

Slide 74

Slide 74 text

github workflow

Slide 75

Slide 75 text

ChatOps github issue costomer’s contact nagios

Slide 76

Slide 76 text

DevOps

Slide 77

Slide 77 text

Go to the next 10 years