ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
OSS¥Ï¥Ã¥«¥½¥ó 2021-10
shunichi
System spec ¤¬¤¿¤Þ¤Ëʧ”¡¤¹¤ë¤ó¤À¤è¤Ê©`
dekiru ¤Ë capybara ¤Î¥¢¥Ë¥á©`¥·¥ç¥ó´ý¤Á¥Ø¥ë¥Ñ©`
¡ñ https://github.com/mataki/dekiru/pull/24
¡ñ ¥¢¥Ë¥á©`¥·¥ç¥ó¤¹¤ë¥â©`¥À¥ë¤ä¥¢¥³©`¥Ç¥£¥ª¥ó¤Ê¤É¤¬¤¢¤ë¤È¡¢¥¯¥ê¥Ã¥¯Ê§”¡¤¹¤ë¤Î¤Ç¡¢
Ö¸¶¨¤·¤¿DOMÒªËؤ¬„Ó¤«¤Ê¤¯¤Ê¤ë¤Þ¤Ç´ý¤Ä¥Ø¥ë¥Ñ©`¤ò×÷¤Ã¤¿
# CSS¥»¥ì¥¯¥¿¤ÇÖ¸¶¨¤·¤¿ÒªËؤÎλÖ䬄Ӥ«¤Ê¤¯¤Ê¤ë¤Þ¤Ç´ý¤Ä
wait_for_position_stable(:css, '[data-test-id="confirmation-modal"]')
click_button 'OK'
# ¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¤ÎλÖä¬0.5ÃëégÍ£Ö¹¤·¾A¤±¤ë¤Þ¤Ç´ý¤Ä
# ¥¿¥¤¥à¥¢¥¦¥È¤Ï5Ãë
wait_for_position_stable(:checkbox, 'Red', wait: 5, stable_wait: 0.5)
check 'Red'
# find¤·¤¿ÒªËؤòÖ¸¶¨¤·¤Æ¥¢¥Ë¥á©`¥·¥ç¥ó½KÁË´ý¤Á
element = find('[data-test-id="confirmation-modal"]')
wait_for_element_position_stable(element)
rails ¤Î date_select ¤¬ÈÕ±¾Óï¤À¤È΢Ãî
¡ñ https://github.com/rails/rails/pull/43567
¡ñ year_format ¤Ï¤â¤È¤â¤È¤¢¤Ã¤¿¤¬ day_format ¤¬¤Ê¤«¤Ã¤¿
f.date_select :published_date, year_format: ->(year) { "#{year}Äê" }, day_format: ->(day) { "#{day}ÈÕ" }
date_select ¤Ë day_format option ¤ò×㤷¤¿
f.date_select :published_date
rails¤Îégß`¤Ã¤¿¥³¥á¥ó¥È¤ä²»Òª¤Ê¥³©`¥É¤ÎÐÞÕý
¡ñ https://github.com/rails/rails/pull/43566
¡ñ date_select ¤ÎÐÞÕý¤ò¤¹¤ë¤È¤­¤ËÒŠ¤Ä¤±¤¿¤¬¡¢¤É¤Á¤é¤«¤¬reject¤µ¤ì¤Æ¤â¤è¤¤¤è¤¦¤Ë
·Ö¤±¤¿
Rails ¤Ë enum ¤Ï¤¢¤ë¤Î¤Ë enumerize gem
¤òʹ¤¦¤Î¤ÏØ“¤±¤¿¸Ð¤¸
ActiveRecord::Enum ¤Ë I18n ¤Î¥á¥½¥Ã¥É¤ò×·¼Ó
¡ñ https://github.com/rails/rails/pull/43568
¡ñ human_attribute_name ¤ß¤¿¤¤¤Ê¤Î¤ò×㤷¤¿
¡ñ ¤³¤ì¤¬È¡¤êÞz¤Þ¤ì¤ì¤Ð enumerize gem ¤òʹ¤ï¤Ê¤¯¤Æ¤â¤è¤¤¤«¤â
class Report < ActiveRecord::Base
enum :status, [ :confidential, :publicly_available ]
end
report = Report.new(status: "publicly_available")
report.human_enum_name(:status) # => "Publicly available"
Report.human_enum_name(:status, :confidential) # => "Confidential"
Report.human_enum_names_hash(:status)
# => { "confidential" => "Confidential", "publicly_available" => "Publicly available" }

More Related Content

Oss hackathon 2021-10

  • 3. dekiru ¤Ë capybara ¤Î¥¢¥Ë¥á©`¥·¥ç¥ó´ý¤Á¥Ø¥ë¥Ñ©` ¡ñ https://github.com/mataki/dekiru/pull/24 ¡ñ ¥¢¥Ë¥á©`¥·¥ç¥ó¤¹¤ë¥â©`¥À¥ë¤ä¥¢¥³©`¥Ç¥£¥ª¥ó¤Ê¤É¤¬¤¢¤ë¤È¡¢¥¯¥ê¥Ã¥¯Ê§”¡¤¹¤ë¤Î¤Ç¡¢ Ö¸¶¨¤·¤¿DOMÒªËؤ¬„Ó¤«¤Ê¤¯¤Ê¤ë¤Þ¤Ç´ý¤Ä¥Ø¥ë¥Ñ©`¤ò×÷¤Ã¤¿ # CSS¥»¥ì¥¯¥¿¤ÇÖ¸¶¨¤·¤¿ÒªËؤÎλÖ䬄Ӥ«¤Ê¤¯¤Ê¤ë¤Þ¤Ç´ý¤Ä wait_for_position_stable(:css, '[data-test-id="confirmation-modal"]') click_button 'OK' # ¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¤ÎλÖä¬0.5ÃëégÍ£Ö¹¤·¾A¤±¤ë¤Þ¤Ç´ý¤Ä # ¥¿¥¤¥à¥¢¥¦¥È¤Ï5Ãë wait_for_position_stable(:checkbox, 'Red', wait: 5, stable_wait: 0.5) check 'Red' # find¤·¤¿ÒªËؤòÖ¸¶¨¤·¤Æ¥¢¥Ë¥á©`¥·¥ç¥ó½KÁË´ý¤Á element = find('[data-test-id="confirmation-modal"]') wait_for_element_position_stable(element)
  • 4. rails ¤Î date_select ¤¬ÈÕ±¾Óï¤À¤È΢Ãî
  • 5. ¡ñ https://github.com/rails/rails/pull/43567 ¡ñ year_format ¤Ï¤â¤È¤â¤È¤¢¤Ã¤¿¤¬ day_format ¤¬¤Ê¤«¤Ã¤¿ f.date_select :published_date, year_format: ->(year) { "#{year}Äê" }, day_format: ->(day) { "#{day}ÈÕ" } date_select ¤Ë day_format option ¤ò×㤷¤¿ f.date_select :published_date
  • 6. rails¤Îégß`¤Ã¤¿¥³¥á¥ó¥È¤ä²»Òª¤Ê¥³©`¥É¤ÎÐÞÕý ¡ñ https://github.com/rails/rails/pull/43566 ¡ñ date_select ¤ÎÐÞÕý¤ò¤¹¤ë¤È¤­¤ËÒŠ¤Ä¤±¤¿¤¬¡¢¤É¤Á¤é¤«¤¬reject¤µ¤ì¤Æ¤â¤è¤¤¤è¤¦¤Ë ·Ö¤±¤¿
  • 7. Rails ¤Ë enum ¤Ï¤¢¤ë¤Î¤Ë enumerize gem ¤òʹ¤¦¤Î¤ÏØ“¤±¤¿¸Ð¤¸
  • 8. ActiveRecord::Enum ¤Ë I18n ¤Î¥á¥½¥Ã¥É¤ò×·¼Ó ¡ñ https://github.com/rails/rails/pull/43568 ¡ñ human_attribute_name ¤ß¤¿¤¤¤Ê¤Î¤ò×㤷¤¿ ¡ñ ¤³¤ì¤¬È¡¤êÞz¤Þ¤ì¤ì¤Ð enumerize gem ¤òʹ¤ï¤Ê¤¯¤Æ¤â¤è¤¤¤«¤â class Report < ActiveRecord::Base enum :status, [ :confidential, :publicly_available ] end report = Report.new(status: "publicly_available") report.human_enum_name(:status) # => "Publicly available" Report.human_enum_name(:status, :confidential) # => "Confidential" Report.human_enum_names_hash(:status) # => { "confidential" => "Confidential", "publicly_available" => "Publicly available" }