Suche senden
Hochladen
初めてのGemの読み方
•
Als PPTX, PDF herunterladen
•
10 gefällt mir
•
11,263 views
T
Takao Baba
Folgen
Technologie
Melden
Teilen
Melden
Teilen
1 von 25
Jetzt herunterladen
Empfohlen
Requestsで始める5分前帰社
Requestsで始める5分前帰社
Satoshi Yamada
pythonでemlファイルを扱う話
pythonでemlファイルを扱う話
Satoshi Yamada
bottle.pyをつかったチャットアプリ作成チュートリアル
bottle.pyをつかったチャットアプリ作成チュートリアル
Satoshi Yamada
読みやすいプログラム、書き換えやすいプログラム
読みやすいプログラム、書き換えやすいプログラム
amusementcreators
Koi::Bana〜恋に落ちたエンジニア〜
Koi::Bana〜恋に落ちたエンジニア〜
Munenori Sugimura
プログラミングを早くする方法
プログラミングを早くする方法
kazukiTakahashi18
ググリワードを探す話
ググリワードを探す話
toru ishikawa
ウェブエンジニアとしての1年目を振り返って
ウェブエンジニアとしての1年目を振り返って
Kohki Yamagiwa
Empfohlen
Requestsで始める5分前帰社
Requestsで始める5分前帰社
Satoshi Yamada
pythonでemlファイルを扱う話
pythonでemlファイルを扱う話
Satoshi Yamada
bottle.pyをつかったチャットアプリ作成チュートリアル
bottle.pyをつかったチャットアプリ作成チュートリアル
Satoshi Yamada
読みやすいプログラム、書き換えやすいプログラム
読みやすいプログラム、書き換えやすいプログラム
amusementcreators
Koi::Bana〜恋に落ちたエンジニア〜
Koi::Bana〜恋に落ちたエンジニア〜
Munenori Sugimura
プログラミングを早くする方法
プログラミングを早くする方法
kazukiTakahashi18
ググリワードを探す話
ググリワードを探す話
toru ishikawa
ウェブエンジニアとしての1年目を振り返って
ウェブエンジニアとしての1年目を振り返って
Kohki Yamagiwa
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
Toru Tamaki
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
CRI Japan, Inc.
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Hiroshi Tomioka
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
atsushi061452
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
iPride Co., Ltd.
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
iPride Co., Ltd.
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
Toru Tamaki
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
WSO2
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
iPride Co., Ltd.
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
sn679259
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NTT DATA Technology & Innovation
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
CRI Japan, Inc.
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Weitere ähnliche Inhalte
Kürzlich hochgeladen
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
Toru Tamaki
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
CRI Japan, Inc.
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Hiroshi Tomioka
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
atsushi061452
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
iPride Co., Ltd.
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
iPride Co., Ltd.
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
Toru Tamaki
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
WSO2
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
iPride Co., Ltd.
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
sn679259
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NTT DATA Technology & Innovation
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
CRI Japan, Inc.
Kürzlich hochgeladen
(12)
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
Empfohlen
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Empfohlen
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
初めてのGemの読み方
1.
初めてのGemの読み方 2013/07/25 Web team
MTG baba@BPS
2.
本資料について 本資料は、社内勉強会の補助資料です 外部向けに書かれていない記述などがあります
資料だけですべて伝わるような配慮はされていません 本資料の取り扱いについて 再配布等のご相談は baba@bpsinc.jp までお願いします。
3.
Gemとは何か Rubyのライブラリ 実体は単なるtar.gzファイル
rubygems.org
4.
なぜGemを読むのか 自分で安全を確認できる Gemは無保証
詳しい挙動を把握できる 一風変わったことを実現できるか調べたい ドキュメントは完璧ではない トラブル解決できる ブラックボックスに振り回されることがなくなる 勉強になる 知的好奇心 OSSは高品質なコードが多い
5.
なぜGemを読むのか レベル0 Gemを使えない
レベル1 解説サイトをコピペしながら基本的な機能を使える レベル2 READMEやリファレンスを読んでほとんどの機能を使え る レベル3 困ったときはソースを読んでトラブル解決できる レベル4 Gemのバグを見つけたらpull requestを送ってあげられる レベル5 積極的なGemの開発やメンテナンスをできる
6.
読む前に
7.
Gemのディレクトリ Gem::RUBYGEMS_DIR /home/baba/.rbenv/versions/2.0.0- p247/lib/ruby/gems/2.0.0
8.
Gemのフォルダ構成 例:mygem Gemfile
mygem.gemspec README lib mygem.rb mygem foo.rb bar.rb spec …
9.
Rubyのおさらい オープンクラス require
10.
読んでみよう
11.
読んでみよう 入門 settingslogic
activesupport (core_ext) 初級 capistrano kaminari 中級 paperclip rspec 上級 devise Rails
12.
読み方 何となく眺める デバッガで追いかける
テストコードから読む
13.
active_support 4.0.0 core_ext nil.blank?
true ‘’.present? false 10.minutes 600 seconds 10.minutes.class # => Fixnum ヒント:BasicObject
14.
active_support 4.0.0 core_ext active_support.rb
active_support/core_ext.rb active_support/core_ext/numeric.rb active_support/core_ext/numeric/time.rb active_support/core_ext/object.rb active_support/core_ext/object/blank.rb active_support/core_ext/object/try.rb active_support/proxy_object active_support/duration.rb
15.
kaminari 0.14.1 User.where(…).page(7).per(30)
<%= paginate @users %>
16.
kaminari 0.14.1 kaminari.rb
kaminari/railtie.rb kaminari/hooks.rb kaminari/models/active_record_extension.rb kaminari/models/active_record_model_extension .rb kaminari/models/active_record_relation_methods .rb kaminari/models/page_scope_methods.rb kaminari/helpers/action_view_extensio.rb
17.
devise 3.0.0 before_filter
:authenticate_user! current_user devise_for :users
18.
devise 3.0.0 devise.rb
devise/rails.rb devise/controllers/helpers.rb def authenticate_#{mapping} warden.authenticate!(opts) def current_#{mapping} @current_#{mapping} ||= warden.authenticate(:scope => #{mapping}) devise/rails/routes.rb devise_for devise_session, devise_password, … devise/mapping.rb devise/failure_app.rb store_location!
19.
rack class MyApp def call(env) [200,
{‘Content-Type’=>’text/plain’}, [‘Hello’]] end end class MyMiddleware def initialize(app) @app = app end def call(env) status, header, body = @app.call(env) body += ‘, world’ [status, header, body] end end
20.
warden 1.2.3 warden/manager.rb
process_unauthenticated call_failure_app warden/proxy.rb
21.
終わりに
22.
速く読むコツ 基本を押さえる Rubyの文法をいちいち調べてたら遅い
あたりをつける 1機能に絞って掘り下げてみる 関係ない細かいところは読み飛ばす ツールを活用する デバッガとか、良いエディタとか おすすめあれば教えて コミットログを見る 自分でGemを作る
23.
discussion
24.
「お客様」からの脱却 これだけじゃだめ サンプルコードのコピペ
日本語で検索 英語で検索 ドキュメントを調べる 「このGemが意味不明で1日はまった」 ソース読めよ (/_・)/ 「このGemにはバグがある」 直せよ (/_・)/
25.
「お客様」からの脱却 内部を理解しろというのは老害? これは「内部を知らなくても良い」という意味?
Jetzt herunterladen