Slide 1

Slide 1 text

Contribution to Rails Naoto Kaneko

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

DEMO

Slide 6

Slide 6 text

ܦҢ • ͖͔͚ͬ͸brancherͷ։ൃͰ࢖͍ͬͯͨ։ൃ༻ͷ σόοάίʔυ • railsͷҰ࿈ͷىಈϓϩηεʹ͍ͭͯ͸ιʔείʔ υϦʔσΟϯάΛ͍ͯͨ͠ • ΄Μͷ͍ܰϊϦͰॻ͍ͨ5ߦఔ౓ͷίʔυΛPull requestͰૹͬͯΈͨ →✨merged ✨

Slide 7

Slide 7 text

ίϯτϦϏϡʔτͷ࢓ํ • fork, checkout, push, pull req • มߋ఺ΛCHANGELOGʹ௥ه • mergeઌʹ஫ҙ!!! • master͸rails 5ܥ • ͙͢ʹϦϦʔε͍ͨ͠ͳΒ4-1-stable, 4-2-stable

Slide 8

Slide 8 text

·ͣίʔυΛಡΉ • ಈ͔ͳ͍ͱ͜Ζ • ڍಈʹෆຬ͕͋Δͱ͜Ζ

Slide 9

Slide 9 text

ྫ͑͹ # config/secrets.yml development: secret_key_base: aaaaaaaa facebook: app_id: bbbbbbbb app_secret: ccccccccc # rails c > Rails.application.secrets.secret_key_base #=> aaaaaaaa > Rails.application.secrets.facebook[:app_id] #=> bbbbbbbb facebook.app_id ͬͯॻ͖͍ͨ

Slide 10

Slide 10 text

railties/lib/rails/ application.rb:386 def secrets @secrets ||= begin secrets = ActiveSupport::OrderedOptions.new yaml = config.paths["config/secrets"].first if File.exist?(yaml) require "erb" all_secrets = YAML.load(ERB.new(IO.read(yaml)).result) || {} env_secrets = all_secrets[Rails.env] secrets.merge!(env_secrets.symbolize_keys) if env_secrets end # Fallback to config.secret_key_base if secrets.secret_key_base isn't set secrets.secret_key_base ||= config.secret_key_base # Fallback to config.secret_token if secrets.secret_token isn't set secrets.secret_token ||= config.secret_token secrets end end

Slide 11

Slide 11 text

railties/lib/rails/ application.rb:386 def secrets @secrets ||= begin secrets = ActiveSupport::OrderedOptions.new yaml = config.paths["config/secrets"].first if File.exist?(yaml) require "erb" all_secrets = YAML.load(ERB.new(IO.read(yaml)).result) || {} env_secrets = all_secrets[Rails.env] secrets.merge!(env_secrets.symbolize_keys) if env_secrets end # Fallback to config.secret_key_base if secrets.secret_key_base isn't set secrets.secret_key_base ||= config.secret_key_base # Fallback to config.secret_token if secrets.secret_token isn't set secrets.secret_token ||= config.secret_token secrets end end ϝιουͬΆ͘ΞΫηεͰ͖Δ΍ͭ

Slide 12

Slide 12 text

railties/lib/rails/ application.rb:386 def secrets @secrets ||= begin secrets = ActiveSupport::OrderedOptions.new yaml = config.paths["config/secrets"].first if File.exist?(yaml) require "erb" all_secrets = YAML.load(ERB.new(IO.read(yaml)).result) || {} env_secrets = all_secrets[Rails.env] secrets.merge!(env_secrets.symbolize_keys) if env_secrets end # Fallback to config.secret_key_base if secrets.secret_key_base isn't set secrets.secret_key_base ||= config.secret_key_base # Fallback to config.secret_token if secrets.secret_token isn't set secrets.secret_token ||= config.secret_token secrets end end ͨͩͷHashΛmergeͯ͠ΔͬΆ͍ͷͰ ࠶ؼతʹAS::OrderedOptions࢖͑͹Αͦ͞͏

Slide 13

Slide 13 text

✨ϓϧϦΫνϟϯε✨

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

͜ΕͰ͋ͳͨ΋ RailsίϯτϦϏϡʔλʔʹ