Soumettre la recherche
Mettre en ligne
Active support事始め
•
Télécharger en tant que KEY, PDF
•
0 j'aime
•
678 vues
Jun Yokoyama
Suivre
Formation
Technologie
Signaler
Partager
Signaler
Partager
1 sur 68
Télécharger maintenant
Recommandé
An introduction to cgroups and cgroupspy
An introduction to cgroups and cgroupspy
vpetersson
2015 11-17-programming inr.key
2015 11-17-programming inr.key
Yannick Wurm
OpenStack Summit Boston DMA Appendix
OpenStack Summit Boston DMA Appendix
Tomofumi Hayashi
Weather of the Century: Design and Performance
Weather of the Century: Design and Performance
MongoDB
The Ring programming language version 1.5.3 book - Part 50 of 184
The Ring programming language version 1.5.3 book - Part 50 of 184
Mahmoud Samir Fayed
The Ring programming language version 1.3 book - Part 40 of 88
The Ring programming language version 1.3 book - Part 40 of 88
Mahmoud Samir Fayed
Debugging: A Senior's Skill
Debugging: A Senior's Skill
Milton Lenis
Know your cirrus from your cumulus
Know your cirrus from your cumulus
Andrew Phillips
Recommandé
An introduction to cgroups and cgroupspy
An introduction to cgroups and cgroupspy
vpetersson
2015 11-17-programming inr.key
2015 11-17-programming inr.key
Yannick Wurm
OpenStack Summit Boston DMA Appendix
OpenStack Summit Boston DMA Appendix
Tomofumi Hayashi
Weather of the Century: Design and Performance
Weather of the Century: Design and Performance
MongoDB
The Ring programming language version 1.5.3 book - Part 50 of 184
The Ring programming language version 1.5.3 book - Part 50 of 184
Mahmoud Samir Fayed
The Ring programming language version 1.3 book - Part 40 of 88
The Ring programming language version 1.3 book - Part 40 of 88
Mahmoud Samir Fayed
Debugging: A Senior's Skill
Debugging: A Senior's Skill
Milton Lenis
Know your cirrus from your cumulus
Know your cirrus from your cumulus
Andrew Phillips
SecureSocial - Authentication for Play Framework
SecureSocial - Authentication for Play Framework
jaliss
Kotlinのcoroutine、async/awaitと同じでしょ?って思ってたけど意外と洗練されててすごいなぁって思った話をさせてほしい
Kotlinのcoroutine、async/awaitと同じでしょ?って思ってたけど意外と洗練されててすごいなぁって思った話をさせてほしい
Takuya Kikuchi
The Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High Performance
MongoDB
Elasticsearch sur Azure : Make sense of your (BIG) data !
Elasticsearch sur Azure : Make sense of your (BIG) data !
Microsoft
масштабирование в Sql azure
масштабирование в Sql azure
Денис Резник
Divolte collector overview
Divolte collector overview
GoDataDriven
Prototyping online ML with Divolte Collector
Prototyping online ML with Divolte Collector
fvanvollenhoven
Divolte Collector - meetup presentation
Divolte Collector - meetup presentation
fvanvollenhoven
The Ring programming language version 1.5.4 book - Part 50 of 185
The Ring programming language version 1.5.4 book - Part 50 of 185
Mahmoud Samir Fayed
Rails基礎講座 part.1
Rails基礎講座 part.1
Jun Yokoyama
社内LT資料
社内LT資料
Jun Yokoyama
Rails基礎講座 part.2
Rails基礎講座 part.2
Jun Yokoyama
Ruby with Hash
Ruby with Hash
Jun Yokoyama
Ruby on
Ruby on
Jun Yokoyama
First Step TDD
First Step TDD
Jun Yokoyama
Real world rails
Real world rails
Jun Yokoyama
5 Tips for a Successful Social Media Strategy
5 Tips for a Successful Social Media Strategy
Wine Glass Marketing
RではじめるTwitter解析
RではじめるTwitter解析
Takeshi Arabiki
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN
EDB
JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8
Serhii Kartashov
Tensor flow description of ML Lab. document
Tensor flow description of ML Lab. document
jeongok1
Becoming a better developer with EXPLAIN
Becoming a better developer with EXPLAIN
Louise Grandjonc
Contenu connexe
Tendances
SecureSocial - Authentication for Play Framework
SecureSocial - Authentication for Play Framework
jaliss
Kotlinのcoroutine、async/awaitと同じでしょ?って思ってたけど意外と洗練されててすごいなぁって思った話をさせてほしい
Kotlinのcoroutine、async/awaitと同じでしょ?って思ってたけど意外と洗練されててすごいなぁって思った話をさせてほしい
Takuya Kikuchi
The Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High Performance
MongoDB
Elasticsearch sur Azure : Make sense of your (BIG) data !
Elasticsearch sur Azure : Make sense of your (BIG) data !
Microsoft
масштабирование в Sql azure
масштабирование в Sql azure
Денис Резник
Divolte collector overview
Divolte collector overview
GoDataDriven
Prototyping online ML with Divolte Collector
Prototyping online ML with Divolte Collector
fvanvollenhoven
Divolte Collector - meetup presentation
Divolte Collector - meetup presentation
fvanvollenhoven
The Ring programming language version 1.5.4 book - Part 50 of 185
The Ring programming language version 1.5.4 book - Part 50 of 185
Mahmoud Samir Fayed
Tendances
(9)
SecureSocial - Authentication for Play Framework
SecureSocial - Authentication for Play Framework
Kotlinのcoroutine、async/awaitと同じでしょ?って思ってたけど意外と洗練されててすごいなぁって思った話をさせてほしい
Kotlinのcoroutine、async/awaitと同じでしょ?って思ってたけど意外と洗練されててすごいなぁって思った話をさせてほしい
The Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High Performance
Elasticsearch sur Azure : Make sense of your (BIG) data !
Elasticsearch sur Azure : Make sense of your (BIG) data !
масштабирование в Sql azure
масштабирование в Sql azure
Divolte collector overview
Divolte collector overview
Prototyping online ML with Divolte Collector
Prototyping online ML with Divolte Collector
Divolte Collector - meetup presentation
Divolte Collector - meetup presentation
The Ring programming language version 1.5.4 book - Part 50 of 185
The Ring programming language version 1.5.4 book - Part 50 of 185
En vedette
Rails基礎講座 part.1
Rails基礎講座 part.1
Jun Yokoyama
社内LT資料
社内LT資料
Jun Yokoyama
Rails基礎講座 part.2
Rails基礎講座 part.2
Jun Yokoyama
Ruby with Hash
Ruby with Hash
Jun Yokoyama
Ruby on
Ruby on
Jun Yokoyama
First Step TDD
First Step TDD
Jun Yokoyama
Real world rails
Real world rails
Jun Yokoyama
5 Tips for a Successful Social Media Strategy
5 Tips for a Successful Social Media Strategy
Wine Glass Marketing
En vedette
(8)
Rails基礎講座 part.1
Rails基礎講座 part.1
社内LT資料
社内LT資料
Rails基礎講座 part.2
Rails基礎講座 part.2
Ruby with Hash
Ruby with Hash
Ruby on
Ruby on
First Step TDD
First Step TDD
Real world rails
Real world rails
5 Tips for a Successful Social Media Strategy
5 Tips for a Successful Social Media Strategy
Similaire à Active support事始め
RではじめるTwitter解析
RではじめるTwitter解析
Takeshi Arabiki
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN
EDB
JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8
Serhii Kartashov
Tensor flow description of ML Lab. document
Tensor flow description of ML Lab. document
jeongok1
Becoming a better developer with EXPLAIN
Becoming a better developer with EXPLAIN
Louise Grandjonc
Java Time Puzzlers
Java Time Puzzlers
Eric Jain
Writing Faster Python 3
Writing Faster Python 3
Sebastian Witowski
Similaire à Active support事始め
(7)
RではじめるTwitter解析
RではじめるTwitter解析
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN
JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8
Tensor flow description of ML Lab. document
Tensor flow description of ML Lab. document
Becoming a better developer with EXPLAIN
Becoming a better developer with EXPLAIN
Java Time Puzzlers
Java Time Puzzlers
Writing Faster Python 3
Writing Faster Python 3
Dernier
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
Sarwono Sutikno, Dr.Eng.,CISA,CISSP,CISM,CSX-F
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
pboyjonauth
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
pboyjonauth
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
Celine George
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Krashi Coaching
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
PoojaSen20
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
VS Mahajan Coaching Centre
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
RoyAbrique
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
dawncurless
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
JhengPantaleon
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
NirmalaLoungPoorunde1
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
SafetyChain Software
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
Chameera Dedduwage
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
David Douglas School District
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
sanyamsingh5019
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Sapana Sha
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
TechSoup
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
JemimahLaneBuaron
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
UmakantAnnand
Dernier
(20)
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
Active support事始め
1.
ActiveSupport事始め 2012/8/30 yoyogi.rb
2.
自己紹介 curl http://cui-about.me/nysalor
3.
今回どうしよう
4.
今回どうしよう
5.
ActiveSupportについて
6.
ActiveSupportについて パクリ 意外と知らないメソッドが多い 復習の意味で
7.
ActiveSupport? https://github.com/rails/rails/tree/master/activesupport Railsに入っている便利ライブラリ Railsをインストールすると勝手に入る Rails抜きでも使える
8.
試してみよう
9.
試してみよう % gem install
activesupport Fetching: activesupport-3.2.8.gem (100%) Successfully installed activesupport-3.2.8 1 gem installed
10.
ついでにpryも
11.
ついでにpryも % gem install
pry % gem install pry-coolline
12.
pry? http://pryrepl.org/ irbの強化版
13.
インストール
14.
インストール % gem install
pry % gem install pry-coolline
15.
起動
16.
起動 % pry 1.9.3 (main):0
>
17.
ActiveSupportを読み込む
18.
ActiveSupportを読み込む 1.9.3 (main):0 >
require 'active_support/all' => true 1.9.3 (main):0 >
19.
String系
20.
pluralize
21.
pluralize 1.9.3 (main):0 >
'magazine'.pluralize => “magazines” 1.9.3 (main):0 > 'fantasy'.pluralize => “fantasies”
22.
singularize
23.
singularize 1.9.3 (main):0 >
'magazines'.singularize => “magazine” 1.9.3 (main):0 > 'fantasies'. singularize => “fantasy”
24.
camelize,under_score
25.
camelize,under_score 1.9.3 (main):0 >
'active_support'.camelize => “ActiveSupport” 1.9.3 (main):0 > 'ActiveSupport'.underscore => “active_support”
26.
constantize
27.
constantize 1.9.3 (main):0 >
'CurrentUser'.constantize => CurrentUser
28.
from
29.
from 1.9.3 (main):0 >
‘active_support’.from(3) => “ive_support” 1.9.3 (main):0 > ‘active_support’[3..-1] => “ive_support” # 同じ
30.
blank?
31.
blank? 1.9.3 (main):0
> nil.blank? => true 1.9.3 (main):0 > ''.blank? => true 1.9.3 (main):0 > ‘ ‘.blank? => true 1.9.3 (main):0 > ‘ ‘.blank? => true 1.9.3 (main):0 > ‘blank‘.blank? => false
32.
present?
33.
present? 1.9.3 (main):0
> true.present? => true 1.9.3 (main):0 > 'blank'.present? => true 1.9.3 (main):0 > ‘‘.present? => false 1.9.3 (main):0 > ‘ ‘.present? => false 1.9.3 (main):0 > nil.present? => false
34.
presence
35.
presence 1.9.3 (main):0
> true.presence => true 1.9.3 (main):0 > 'blank'.presence => 'blank' 1.9.3 (main):0 > ‘‘.presence => nil 1.9.3 (main):0 > ‘ ‘.presence => nil 1.9.3 (main):0 > nil.presence => nil
36.
presence
37.
presence 1.9.3 (main):0 >
‘cool’.presence || ‘oops!’ => “cool” 1.9.3 (main):0 > ["aaa", "bbb", "ccc"].map{|x| 1.9.3 (main):0 * x.gsub("a","").presence && 1.9.3 (main):0 * x.upcase} => [nil, "BBB", "CCC"]
38.
inquiry
39.
inquiry 1.9.3 (main):0 >
‘tiger’.inquiry => “tiger” 1.9.3 (main):0 > 'tiger'.inquiry.tiger? => true 1.9.3 (main):0 > 'tiger'.inquiry.bunny? => false 1.9.3 (main):0 > 'tiger'.inquiry.class => ActiveSupport::StringInquirer
40.
どうやっているのか? http://goo.gl/qt8Sz
41.
DateTime系
42.
Time.zone
43.
Time.zone 1.9.3 (main):0
> Time.zone => nil 1.9.3 (main):0 > Time.zone = ‘Tokyo’ => “Tokyo” 1.9.3 (main):0 > Time.zone => (GMT+09:00) Tokyo 1.9.3 (main):0 > Time.zone.now => Thu, 30 Aug 2012 17:41:49 JST +09:00
44.
yesterday,tommorow
45.
yesterday,tommorow 1.9.3 (main):0
> Time.zone.now => Thu, 30 Aug 2012 17:41:49 JST +09:00 1.9.3 (main):0 > Time.zone.now.tomorrow => Fri, 31 Aug 2012 17:41:49 JST +09:00 1.9.3 (main):0 > Time.zone.now.yesterday => Wed, 29 Aug 2012 17:41:49 JST +09:00
46.
ago
47.
ago 1.9.3 (main):0
> Time.zone.now => Thu, 30 Aug 2012 17:41:49 JST +09:00 1.9.3 (main):0 > 3.days.ago => Mon, 27 Aug 2012 17:41:49 JST +09:00 1.9.3 (main):0 > 10.month.ago => Sun, 30 Oct 2011 17:41:49 JST +09:00
48.
since
49.
since 1.9.3 (main):0
> Time.zone.now => Thu, 30 Aug 2012 17:41:49 JST +09:00 1.9.3 (main):0 > 3.days.since => Sun, 02 Sep 2012 17:41:49 JST +09:00 1.9.3 (main):0 > 10.month.since => Sun, 30 Jun 2013 17:41:49 JST +09:00
50.
引数
51.
引数 1.9.3 (main):0
> Time.zone.now => Thu, 30 Aug 2012 17:41:49 JST +09:00 1.9.3 (main):0 > Time.zone.now.ago(3.days) => Mon, 27 Aug 2012 17:41:49 JST +09:00 1.9.3 (main):0 > Time.zone.now.since(3.years) => Sun, 30 Aug 2015 17:41:49 JST +09:00
52.
始まりと終わり
53.
始まりと終わり 1.9.3 (main):0
> Time.zone.now => Thu, 30 Aug 2012 17:41:49 JST +09:00 1.9.3 (main):0 > Time.zone.now.beginning_of_day => Thu, 30 Aug 2012 00:00:00 JST +09:00 1.9.3 (main):0 > Time.zone.now.end_of_year => Mon, 31 Dec 2012 23:59:59 JST +09:00
54.
任意の時刻
55.
任意の時刻 1.9.3 (main):0
> Time.zone.now => Thu, 30 Aug 2012 17:41:49 JST +09:00 1.9.3 (main):0 > Time.zone.now.change(:hour => 19) => Thu, 30 Aug 2012 19:00:00 JST +09:00
56.
範囲
57.
範囲 1.9.3 (main):0 >
Time.zone.now => Thu, 30 Aug 2012 17:41:49 JST +09:00 1.9.3 (main):0 > Time.zone.now.all_day => 2012-08-30 00:00:00 UTC..2012-08-30 23:59:59 UTC 1.9.3 (main):0 > Time.now.all_day => 2012-08-30 00:00:00 +0900..2012-08-30 23:59:59 +0900
58.
Array/Hash系
59.
Array#from
60.
Array#from 1.9.3 (main):0 >
‘cool’.presence || ‘oops!’ => “cool” 1.9.3 (main):0 > ["aaa", "bbb", "ccc"].map{|x| 1.9.3 (main):0 * x.gsub("a","").presence && 1.9.3 (main):0 * x.upcase} => [nil, "BBB", "CCC"]
61.
Hash#assert_valid_keys
62.
Hash#assert_valid_keys 1.9.3 (main):0 >
hash = { 1.9.3 (main):0 * :tiger => 10.4, 1.9.3 (main):0 * :lion => 10.7 1.9.3 (main):0 * } 1.9.3 (main):0 > hash.assert_valid_keys( 1.9.3 (main):0 * :tiger, :leopard, :lion) => {:tiger=>10.5, :leopard=>10.6, :lion=>10.8} 1.9.3 (main):0 > hash.assert_valid_keys( 1.9.3 (main):0 * :tiger, :bunny) => ArgumentError: Unknown key: lion
63.
Array#forty_two
64.
Array#forty_two 1.9.3 (main):0 >
[1,2,3,4].forty_two => nil 1.9.3 (main):0 > (1..100).to_a.forty_two => 42
65.
なにこれ?
66.
なにこれ?
67.
質疑応答
68.
質疑応答 if available? Question.all.map{|x|
x.try(:answer).presence || x.to_a.forty_two}
Notes de l'éditeur
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Télécharger maintenant