You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
ããã«ã¡ã¯ã2021å¹´12æã«CAMPFIREã«å ¥ç¤¾ããå°å·ã§ãã CAMPFIREã§ã¯Railsã使ã£ã¦éçºãã¦ãã¾ãããããã®å ¥ç¤¾å¾ãããã¤ãRailsã®ããã©ã¼ãã³ã¹ãã¥ã¼ãã³ã°ãããæ©ä¼ããã£ãã®ã§ãããä»åã¯ãã®ãã¡ãéçºç°å¢ã§ã®Railsã®èµ·åæéãç´7åã®1ã«ç縮ãããã¨ãã§ããäºä¾ã«ã¤ãã¦ãç´¹ä»ãããã¨æãã¾ãã Railsã®èµ·åãé ãCAMPFIREã§éçºããã¯ããã¦ã²ã¨ã¤æ°ã¥ããã®ããéçºç°å¢ã§ã®Railsã®èµ·åã«ããã«æéãããããã¨ã§ãããè¨æ¸¬ãã¦ã¿ãã¨1å以ä¸ããã£ã¦ãã¾ãã»ã»ã»ã $ time bundle exec rake environment # ... real 1m10.845s user 0m8.075s sys 0m2.086s ããã¯é ããã¢ããªã±ã¼ã·ã§ã³ã®è¦æ¨¡ã¯ãããã«å¤§ããã®ã§ããããããå å³ãã¦ãé ãããå°è±¡ã§ãã ãã¼ã ã¡ã³ãã¼ã«å°ãã¦
ç¾å¨ãRuby 製 worker ãä½æãããã¨ãæ¥åã§è¡ã£ã¦ããã®ã§ãããç¶ç¶çã«ã¡ã¢ãªä½¿ç¨éãå¢å ããç¾è±¡ã«ééãã¦ã¾ããã ï¼ã°ã©ãã®å¤ãä¸ãã£ãã¿ã¤ãã³ã°ãæ°åããã¾ãããããããã§ãããã¤ãè¡ããã¦ãªã»ãããããã ãï¼ ObjectSpace.allocation_sourcefile ã ObjectSpace.allocation_sourceline ãå©ç¨ãã¦ã©ã®ãã¡ã¤ã«ã®ã©ã®è¡ã§ã¡ã¢ãªç¢ºä¿ãå¤ããªãã®ã調ã¹ããããã«ãã¾ããã 以ä¸ã®ãããªã³ã¼ãã worker ã«è¿½å ãã¾ããã require 'objspace' class MemoryProfiler INTERVAL = 5 * 60 DISPLAY_COUNT = 20 def self.start Thread.start do loop do memory_usages = {} ObjectSpace.
æ¦è¦ å ãµã¤ãã®è¨±è«¾ãå¾ã¦ç¿»è¨³ã»å ¬éãããã¾ãã è±èªè¨äº: Don't Use Floats and Use the Ruby Money Gem to Represent Currencies - Andy Croll åæå ¬éæ¥: 2021/11/15 èè : Andy Croll æ¥æ¬èªã¿ã¤ãã«ã¯å 容ã«å³ãããã®ã«ãã¾ããã ã¢ããªã±ã¼ã·ã§ã³ã§éé¡ã管çããªããã°ãªããªããªããã¨ã¯ããã«ããã¾ããä½ã®è©±ãã¨ããã¨ãRubyã³ãã¥ããã£ã«ããç´ æ´ããããªã¼ãã³ã½ã¼ã¹ã®ã½ãªã¥ã¼ã·ã§ã³ã使ãã°ãèªåã§éçºããããããã£ã¨è¯ãçµæãå¾ãããã®ã§ãã 以ä¸ã®ããã«ããã®ã§ã¯ãªã éé¡ã表ç¾ããã¨ãã«FloatãBigDecimalã使ãã # ãã¤ã°ã¬ã¼ã·ã§ã³ add_column :products, :price, :decimal class Product < Application
Rails(ã¨ãããActiveRecord)ã«åãä»ããã®ã¯å¤§å¤ã ããRailsã絡ã¾ãªãrubygemã«ã¯ãããªã«è¦å´ãªãåãæ¸ããã®ã§ãããããgemãæ¸ãæã«ã¯åãæ¸ãããã¨ãã人åãã«ä»ã®ã¨ãããªã¹ã¹ã¡ã®è¨å®ãç´¹ä»ãã¾ãã ã¨ãããèªåãå¿ããã®ã§ã¾ã¨ãã¦ããã¾ãã ç¾ç¶ã¨ã¯steep-1.3.1, rbs-2.8.4ãæãã¾ãã rbsã¯æ¢ã«3ç³»ãåºã¦ãã¾ãããä¸è¬å©ç¨è ãåæ¤æ»ã«å©ç¨ããå ´åã¯steepã使ãã¯ãã§ãsteepã¯ã¾ã rbsã®3ç³»ã«å¯¾å¿ãã¦ãã¾ãããã¾ããrbs-3.0ã§å¤å°å¤ãã£ã¦ããã¨ãããããã®ã§ãå²ã¨å¯¿å½ãçã話ããããã¾ããã è¨å®ä¾ ã¨ããããçµè«ãããSteepfileã¨rbs_collection.yamlãä¿®æ£ãã¾ãã Steepfile: D = Steep::Diagnostic target :lib do signature "sig"
Railsããã¸ã§ã¯ãã§gemãå¤æ´ããªããéçºããå ´åã Gemfileã«:pathã§ãã¼ã«ã«ã®gemãæå® gem 'mygem', :path => '../mygem' gemãå¤æ´ãããgemå´ãããã·ã¥ æ¬ä½ã®ããã¸ã§ã¯ãã®Gemfileã®gemã®æå®ããªã¢ã¼ãåãã«æ»ãã¦bundle update mygem ãã£ã¨æ¬ä½ã®ããã¸ã§ã¯ããã³ããããããã·ã¥ ã¾ãGemfileã«:pathã§ãã¼ã«ã«ã®gemãæå® ãããã¨ã«ãªãã¾ãããé »åº¦ãå¤ãã¨é¢åã«ãªãã¾ãã bundle local 以ä¸ã®ã³ãã³ãã«ãããGemfileãå¤æ´ããå¿ è¦ããªããªãã¾ãã $ bundle config local.mygem ../mygem ($ bundle config local.mygem /Users/user/path/to/mygem)
æ¦è¦ VS Code Debug Visualizer ã¨ãã VS Code ã®ã¨ã¯ã¹ãã³ã·ã§ã³ããåç¥ã§ããããããããã°ä¸ã®ãªãã¸ã§ã¯ãã以ä¸ã®ããã«ãã¸ã¥ã¢ã©ã¤ãºãã¦ããããã®ã§ãã VS Code Debug Visualizer ã§ã¯ããã¾ã§ Ruby ã®ãµãã¼ãã¯ããã¦ãã¾ããã§ããããææ°ãã¼ã¸ã§ã³ï¼æ¬ç¨¿å·çæç¹ã§ã¯ãã¼ã¸ã§ã³2.4ï¼ãã debug.gem ãç¨ãã¦ã®ãã¸ã¥ã¢ã©ã¤ãºãå¯è½ã«ãªãã¾ããã æ¬ç¨¿ã§ã¯ãããã®å®éã®ä½¿ãæ¹ã«ã¤ãã¦ã話ããã¦ããã¾ãã 対象èªè æ¬è¨äºã§ã¯ VScode ãç¨ãã debug.gem ã®ç°¡åãªå©ç¨æ¹æ³ã«ã¤ãã¦ç解ãã¦ãã¦ãæ¢ã«ãããã®ã»ããã¢ãããå®äºãã¦ããæ¹ãæ³å®ãã¦ãã¾ãã VScode ãç¨ãã debug.gem ã®ä½¿ãæ¹ãã»ããã¢ããæ¹æ³ã«ã¤ãã¦ã¯ä»¥ä¸ã®ãªã³ã¯ãªã©ãã覧ãã ããã äºåæºå äºåæºåã¨ã㦠VS Code
ãã®è¨äºã¯Ruby Advent Calendar 2022ã®ç¬¬20æ¥ã®è¨äºã§ããåæ¥ã®è¨äºã¯@ydahããã«ãããRuboCopã®ãã¼ã¸ã§ã³ãææ°ã«ä¿ã¤æè¡ãã§ããã 2022å¹´11æ22æ¥ã«ãRuby cgi gemã®HTTPãããã¤ã³ã¸ã§ã¯ã·ã§ã³èå¼±æ§CVE-2021-33621ãçºè¡¨ãããã¾ããã CVE-2021-33621: HTTP response splitting in CGI Rubyã®CGIã©ã¤ãã©ãªã«HTTPã¬ã¹ãã³ã¹åå²èå¼±æ§ããããç§å¯æ å ±ãæ¼æ´©ãã - HackerOne CGI::Cookieã¯ã©ã¹ã«ãããã»ãã¥ãªãã£ä¸å¥½ã¾ãããªãä»æ§ããã³å®è£ - HackerOne ç§ã¯HackerOneãéãã¦ãã®èå¼±æ§ãå ±åãã¾ããããã®è¨äºã§ã¯ãå½è©²èå¼±æ§ã®æ¦è¦ã¨çºè¦ã®çµç·¯ãªã©ã«ã¤ãã¦å ±åãã¾ãã æ¦è¦ èå¼±æ§çºè¦ã®çµç·¯ å½±é¿ãåããã¢ããªã±ã¼ã·ã§ã³ å½±é¿ å¯¾ç
æ¦è¦ åèè ã®è¨±è«¾ãå¾ã¦ç¿»è¨³ã»å ¬éãããã¾ãã è±èªè¨äº: What It Took to Build a Rails Integration for Rodauth | Janko's Blog åæå ¬éæ¥: 2022/10/12 åèè : Janko MarohniÄ æ¥æ¬èªã¿ã¤ãã«ã¯å 容ã«å³ãããã®ã«ãã¾ããã åè: é±åRailsã¦ã©ãã20221025 RodauthãRailsã¨çµ±åããã®ã«å¿ è¦ã ã£ãã㨠以ä¸ã®rodauth-rails READMEãã©ããã Rails: èªè¨¼gem ârodauth-railsâ READMEï¼ç¿»è¨³ï¼ Rodauthãç»å ´ããå½æã®æ¢åã®ã½ãªã¥ã¼ã·ã§ã³ã¯ãRailsï¼DeviseãSorceryã®å ´åï¼ãå°ãªãã¨ãActive Recordï¼Authlogicã®å ´åï¼ãå¿ è¦ã ã£ãã®ã§ãã¤ãã«Railsã«ç¸ãããªããã«æ©è½ã®èªè¨¼ãã¬ã¼ã ã¯
ã¯ããã« Ruby 3.1ã§æ¨æºã©ã¤ãã©ãªã«ãªã£ã debug.gemã¨VSCodeãçµã¿åãããã¨ãVSCodeã®ãããã°æ©è½ãRubyã§ã®éçºã«ä½¿ããããã«ãªãã¾ãã ãã®è¨äºã§ã¯ãæè¿ç§ãããæ´»ç¨ããDevContainerã使ã£ãRailséçºã«ãã㦠debug.gem ã使ãã«ã¯ã©ã®ããã«ããã°ããã®ãï¼ è©¦ãããã¨ããç´¹ä»ãã¾ãã debug.gem debug.gem ã«ã¤ãã¦ã¯éçºããã笹ç°ããã®è¨äºãã覧ä¸ããã vscode-rdbg vscode-rdbgã¯VSCodeã®ãããã°æ©è½ããdebug.gemãå©ç¨ããããã®ã¨ã¯ã¹ãã³ã·ã§ã³ã§ãã ã½ã¼ã¹ã³ã¼ãã®å·¦ãã¯ãªãã¯ãã¦ãã¬ã¼ã¯ãã¤ã³ããè¨å®ã§ããpryã®ããã«ã³ã¼ãä¸ã«ä»è¾¼ãå¿ è¦ããªãã®ã§ã¨ã¦ã便å©ã§ãã Dev Container Dev Containerã¯VSCodeã®æ©è½ã®1ã¤ã§ãä»»æã®Dockerã³ã³
èªã¿ã¾ããã Take My Money: Accepting Payments on the Web ä½è :Rappin, NoelPragmatic BookshelfAmazon ã©ããªæ¬ã å¯é¡ã "Accepting Payments on the Web" ã¨ãªã£ã¦ããããã«ãæ±ºæ¸ (payment) ã·ã¹ãã ãã㤠Web ã¢ããªã±ã¼ã·ã§ã³ãä½ãæ¹æ³ã«ã¤ãã¦èª¬æãã¦ãã¾ãããé人ããã°ã©ãã¼ããªã©ã§ããªãã¿ã® The Pragmatic Bookshelf ã·ãªã¼ãºã®æ¬ã§ãã ãã±ãã販売ã·ã¹ãã ã®éçºãéãã¦ã次ã®ãããªå ·ä½çãªè©±é¡ã«è§¦ãã¦ãã¾ããåºæ¬çã«ã¯ Rails 5 ã使ã£ã¦ãã¸ãã¯ãããã¥ã¼ã¾ã§ãéçºãã¦ããã¾ã*1ã 決æ¸ã·ã¹ãã ã®å®è£ ã·ã§ããã³ã°ã«ã¼ã å¤é¨æ±ºæ¸ãµã¼ãã¹ã¨ã®é£æº ãµãã¹ã¯ãªãã·ã§ã³æ©è½ ã¨ã©ã¼ã±ã¼ã¹ã¨ãã®å¯¾ç 管çç»é¢ã®å®è£ è¿éãªã©æ³¨æã®æ
èªåã¯ä¾¿å©ã ãã使ããããã©ãä»ã®äººã«ã¾ã§å¼·å¶ããã®ã¯ãªãã ãªã¼ã£ã¦æãgemãéçºæã«ä½¿ãããæã©ããããã¡ã¢ æ¦è¦ ç°å¢å¤æ°BUNDLE_GEMFILEã§ä½¿ç¨ããGemfileãè¨å®ã§ããã®ã§ãå人ç¨ã®Gemfileãç¨æãã åæ direnv/direnvã使ã£ã¦ãã㨠ãããã Gemfile.localã«å人çã«ä½¿ç¨ãããgemãæ¸ã #Gemfile.local eval_gemfile "Gemfile" gem "pry" ç°å¢å¤æ°BUNDLE_GEMFILEãè¨å® echo "export BUNDLE_GEMFILE=./Gemfile.local" >> .envrc Gemfile.localãglobal gitignoreã«è¿½å ãªãã¸ããªã«å ¥ããªãããã« cat <<EOS >> ~/.gitignore Gemfile.local Gemfile.loca
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}