Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
OpenStruct è¦ç´ ãåçã«è¿½å ã»åé¤ã§ããæ軽ãªæ§é ä½ãæä¾ããã¯ã©ã¹ã§ãã OpenStruct ã®ã¤ã³ã¹ã¿ã³ã¹ã«å¯¾ãã¦æªå®ç¾©ãªã¡ã½ãã x= ãå¼ã¶ã¨ã OpenStruct ã¯ã©ã¹ã® BasicObject#method_missing ã§ææããããã®ã¤ã³ã¹ã¿ã³ã¹ã« ã¤ã³ã¹ã¿ã³ã¹ã¡ã½ãã x, x= ãå®ç¾©ããã¾ãã ãã®æåã«ãã£ã¦è¦ç´ ãåçã«å¤æ´ã§ããæ§é ä½ã¨ãã¦åãã¾ãã æ軽ã«ä½¿ãã require "ostruct" config = OpenStruct.new config.level #=> nil config.level = :debug config.level #=> :debug
çµè« : 1.9ããã¯ä¿è¨¼ããã Hash(1.8.7) ããã·ã¥ã«å«ã¾ããè¦ç´ ã®é åºã¯ä¿æããã¾ããã åæããé åºã¯ä¸å®ã§ãã Hash(1.9.3) ããã·ã¥ã«å«ã¾ããè¦ç´ ã®é åºãä¿æãããããã«ãªãã¾ããã ããã·ã¥ã«ãã¼ã追å ãããé åºã§åæãã¾ãã
èªåãCapybaraã§ä¸çªããã£ãã®ã¯ãç»é¢ã®åæåããAjaxãã¢ãã¡ã¼ã·ã§ã³ãªã©ã®é 延ãå¾ ããã«ãã©ãã©ãclickãªã©ãè¡ããã¨ãã¦æå³ããªãçµæã«ãªã£ã¦ãã¾ããã¨ã ãã©ã¦ã¶ããèªåã§è©¦ãã¦ã¿ã¦ããã¾ãè¡ãã®ã§ãèªåãã¹ãããã¾ãè¡ãããããã ãã®ãããã°ä½æ¥ã¨ãªããä½æ¥ã®ããã®ä½æ¥ãããã¯ç¡é§ä»¥å¤ã®ãªãã§ããªããè ¹ç«ãããã ã ãããæ å ±å ±æã findã§è¦ç´ ãæºåOKã«ãªãã¾ã§å¾ ããã æ¬å®¶ã® ã§ãæ¸ããã¦ããããCapybaraã«ã¯ããããéåæJavaScriptã®åé¡ã¸ã®å¯¾å¦ã¨ãã¦ãfindããhave_contentå®è¡æã«ã¾ã è¦ç´ ãè¦ã¤ãããªãå ´åã¯ãè¨å®ããæé(åæå¤2ç§)å¾ ã£ã¦ãããªãã©ã¤ããã¦ãããã ãã®æ©è½ã使ã£ã¦ãclickãããhave_xxx ã§æ¤è¨¼ãããªã©ã®åã«ãfindã§ã¡ããã¨åå¨ããã¾ã§capybaraã«å¾ ãããäºãéè¦ã åºæ¬çã«é表示è¦
fill_inã¡ã½ãã ã«ãã£ã¦ããã©ã¼ã è¦ç´ ã®name, ããã㯠id, ãããã¯ã©ãã«ã«ããã¿ã¤ãã«ã ã¨ããããã¹ããã£ã¼ã«ããåãããã¨ãåºæ¥ã¾ãã åé¡ ãã£ã¼ã«ãã1ã¤ãªãããã®ã§ãããä¾ãã°1対Nã®é¢é£ã ã£ãããã¦ãåãååã®è¤æ°ã®ã¤ã³ããããæãå ´åã以ä¸ã®ãããªã¨ã©ã¼ã¨ãªãã¾ãã Capybara::Ambiguous: Ambiguous match, found 2 elements matching field "ã¿ã°"
çµç·¯ Capybara + Turnip ãæ¸ãæãã ããããããã Feature ã«ãªãã¨æãã¾ã Feature: GitHub ãå·¡ã Background: When "https://github.com/login" ã«ã¢ã¯ã»ã¹ãã And ã¦ã¼ã¶åã« "gongo" ã¨å ¥åãã And ãã¹ã¯ã¼ãã« "gongo" ã¨å ¥åãã And "Sign in" ãã¿ã³ãã¯ãªãã¯ãã Scenario: ãããç»é¢ Then ã¢ã¯ãã£ããã£ã表示ããã¦ããã㨠And èªåã®ãªãã¸ããªä¸è¦§ã表示ããã¦ããã㨠Scenario: Explorer When "Explorer" ãã¯ãªãã¯ãã Then "Browse interesting projects" ã¨è¡¨ç¤ºããã¦ããã㨠Scenario: Blog When "Blog" ãã¯ãªãã¯ãã Then "The GitH
Spring Bootã«ããAPIããã¯ã¨ã³ãæ§ç¯å®è·µã¬ã¤ã 第2ç ä½å人ãã®éçºè ããInfoQã®ããããã¯ãPractical Guide to Building an API Back End with Spring BootããããSpring Bootã使ã£ãREST APIæ§ç¯ã®åºç¤ãå¦ãã ããã®æ¬ã§ã¯ãåºçæã«æ°ãããªãªã¼ã¹ããããã¼ã¸ã§ã³ã§ãã Spring Boot 2 ã使ç¨ãã¦ãããããããSpring Boot3ãæè¿ãªãªã¼ã¹ãããéè¦ãªå¤...
Spring Bootã«ããAPIããã¯ã¨ã³ãæ§ç¯å®è·µã¬ã¤ã 第2ç ä½å人ãã®éçºè ããInfoQã®ããããã¯ãPractical Guide to Building an API Back End with Spring BootããããSpring Bootã使ã£ãREST APIæ§ç¯ã®åºç¤ãå¦ãã ããã®æ¬ã§ã¯ãåºçæã«æ°ãããªãªã¼ã¹ããããã¼ã¸ã§ã³ã§ãã Spring Boot 2 ã使ç¨ãã¦ãããããããSpring Boot3ãæè¿ãªãªã¼ã¹ãããéè¦ãªå¤...
Testing Rake tasks is one of the most painful things I do as a Ruby developer. Even after extracting all the code out into a separate class (which helps a lot), I still want to make sure I test that the right classes got called correctly with the right arguments. I wanted the subject to be the task, where I could call invoke, check its prerequisites, etc. describe "cron:hourly" do its(:prerequisit
Rake 0.8.0 is released. The docs have not been updated yet, but I didn't want to delay the new version for that. We will get the documents up to date shortly. http://rubyforge.org/forum/forum.php?thread_id=20544&forum_id=20061 Rakeã®æ°ãããã¼ã¸ã§ã³ããªãªã¼ã¹ããããã¾ã æ°ããããã¥ã¡ã³ããåºã¦ãã¦ããªãã®ã ãããããããã¼ã¸ãä½ãç¨åº¦ã«ã¯Rakeã好ããªã®ã§ãå¾ ã¡ãããã«ä½¿ã£ã¦ã¿ãã ããããåãã¤ãã¦ãããããããªããããããªãé¨åããããããã¥ã¡ã³ãããªãªã¼ã¹ãããæ£ããæ å ±ãããã次第修æ£ãã¦ããäºå®ã 追è¨ï¼Rake 0.8.2ããªãªã¼ã¹ãããã®ã§ãã¾ã
BUNDLED WITH ã£ã¦ä½ï¼ bundler 1.10.0 以éã§ä½æããã Gemfile.lock ã§ã¯ãBUNDLED WITH ã¨ããã»ã¯ã·ã§ã³ããã£ã¦ã使ç¨ããã bundler ã®ãã¼ã¸ã§ã³ããã©ãã¯ãããããã«ãªã£ã¦ãã [3485] ã ä¾ãã° bundler 1.9.0 ã§ä½æããã Gemfile.lock ã®ããããã¸ã§ã¯ãä¸ã§ã ææ°ã® bundler 1.10.3 ã使ç¨ã㦠bundle install --path vendor/bundle ããã¨ã Gemfile.lock ã«ã¯ä»¥ä¸ã®å·®åãã§ããã ãããããä¸åº¦ 1.9.0 㧠bundle install ããã¨ãä¸ã®æåã¯ããããã£ã±ãæ¶ããã BUNDLED WITH ã®ä½ãå°ãã å¤äººæ°ã§éçºããã¨ãã«ã¯ããã®å¤æ´ã¯å¾®å¦ã«éªéã§ãæå³ããªã Gemfile.lock å¤æ´ãåºã¦ãã¾ããã¨ã§
Rails4ã ã¨CSRF対çãé常ã«åªç§ã§ãã ããã©ã«ãã§ãApplicationControllerãã«ã¯ãprotect_from_forgery with: :exceptionãã®è¨è¿°ãããã¾ãã CSRFã®ä»çµã¿ã«ã¤ãã¦ã¯ä»¥ä¸ã®è¨è¿°ãåèã«ãªãã¾ãã â Railsã®CSRF対çã®ä»çµã¿ã«ã¤ã㦠http://shindolog.hatenablog.com/entry/2014/09/01/013840 ã¾ãããprotect_from_forgeryãã«ã¤ãã¦ã¯ä»¥ä¸ã®è¨è¿°ãåèã«ãªãã¾ãã â Rails 4.0ã ã¨CSRFãã¼ã¯ã³ã§ã¨ã©ã¼ã«ãªã http://qiita.com/naoty_k/items/b40b13735fd7f06f8cb7 ããã¦ãã¡ãã§ãããå®æãªãaãã¿ã°ãå¤é¨ã®ãµã¤ãããã®æ¥ç¶ã®éã«ãCan't verify CSRF token authent
Railsã¯protect_from_forgeryã£ã¦æ¸ãã ãã§CSRF対çãæå¹ã«ãªã£ã¦ãã¸ä¾¿å©ãªããã ãã©ãã»ãã·ã§ã³ã§èªè¨¼ããããããªãã¦iOSããå¼ã¶APIã¨ãã§ãã¼ã¯ã³ä½¿ã£ã¦èªè¨¼ããå ´åã¯CSRFã®å¯¾çãããªãã®ã§ç¡å¹ã«ãããã ãã®å ´å㯠protect_from_forgery with: :null_session ã£ã¦ããã°ããããããããã¯CSRF Tokenãä¸è´ããªãã£ãå ´åã«ä¾å¤ãæããããããªãã¦ã»ãã·ã§ã³ã空ã«ããã¨ããåä½ã«ãªãã ã¡ãªã¿ã«protect_from_forgeryã®ããã©ã«ãã¯:null_sessionãªã®ã§ protect_from_forgery ã§ãããããï¼Rails 4.0.0ç¾å¨ï¼ ãã ãæåã¯ä»¥ä¸ã®ããã«ãªã£ã¦ãã®ã§æ示çã«å¤æ´ããå¿ è¦ã¯ããã class ApplicationController < ActionContr
ãç¥ãã
é害
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}