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

===================== /Users/richardschneeman/documents/projects/my_rails_app/app/controllers/projects_controller.rb:18:in `new' /Users/richardschneeman/.gem/ruby/2.3.0/gems/actionpack-5.0.0.beta1/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action' /Users/richardschneeman/.gem/ruby/2.3.0/gems/actionpack-5.0.0.beta1/lib/abstract_controller/base.rb:183:in `process_action' /Users/
Continuing the from the previous post, here is a cheat sheet for RSpec’s assertion library: RSpec::Expectations. RSpec is a mature, feature-packed testing framework, but the documentation can be difficult to navigate. As an alternative to the official documentation, this cheat sheet contains short example code to demonstrate all the built-in expectation matchers. These examples were created with R
自分用にメモしておく コマンド実行 CMD1; CMD2, CMD1 && CMD2 ;はCMD1の結果に関わらずCMD2も実行される &&はCMD1の結果が正常な場合のみCMD2が実行される CMD1 || CMD2 - 失敗時に後続コマンドを実行する CMD || printf "%b" "MSG"でエラーメッセージを表示する エラーメッセージ表示後exit 1したい場合 = CMD || { printf "%b" "FAILED.\n" ; exit 1 } CMD || printf "%b" "FAILED.\n" ; exit 1と波括弧無しで書くと期待通り動作しない(CMDが成功時もexit 1してしまう) CMD & - バックグラウンド実行 CMD &で[1] 4592のようにジョブ番号とプロセスIDが表示される killしたければkill %ジョブ番号 か kill
After creating cheat sheets for RSpec::Core and RSpec::Expectations, I think it is only fair to have a cheat sheet for Minitest too. Minitest also provides an optional RSpec-like DSL, which is not covered here. Minitest is a small (some might say “mini”) testing framework, where tests are written in “plain Ruby,” as opposed to using a custom DSL. It has a gentler learning curve than RSpec, and is
RSpec is a mature, feature-packed testing framework, but the documentation can be difficult to navigate. The official documentation is written as a set of Cucumber tests within Relish. It’s very comprehensive, but also quite sparse, and Cucumber tests are kind of unnatural to read. When I forget how to do something in RSpec, I usually just look for an example in a test I’ve written previously, so
Ruby on Rails Cheat Sheet¶ Introduction¶ This Cheatsheet intends to provide quick basic Ruby on Rails security tips for developers. It complements, augments or emphasizes points brought up in the Rails security guide from rails core. The Rails framework abstracts developers from quite a bit of tedious work and provides the means to accomplish complex tasks quickly and with ease. New developers, th
テストを書かないようになってしまっていた。 大きなアプリケーションではないし一人で作ってるし… まぁいいか的な。 ただ、コードの量が増えていくにつれやっぱりちょっと辛い。 書き方すっかり忘れたので、RSpec再入門。 環境 Vagrant + CentOS (centos64box) Ruby 2.2.1 Rails 4.1.1 最終的なGemfile(テスト関係だけ) テスト用のDBの設定をお忘れなく。 gem 'pg' group :development, :test do gem 'rspec-rails' gem 'factory_girl_rails' gem 'guard-rspec' gem 'spring-commands-rspec' end group :test do gem 'faker' gem 'capybara' gem 'database_cleaner'
In math, a unary operation is an operation with a single input. In Ruby, a unary operator is an operator which only takes a single ‘argument’ in the form of a receiver. For example, the – on -5 or ! on !true. In contrast, a binary operator, such as in 2 + 3, deals with two arguments. Here, 2 and 3 (which become one receiver and one argument in a method call to +). Ruby only has a handful of unary
Skip to main content John Croisant Software, web, and game design and development ATTENTION: This page is very out of date. It has not been updated since 2007, and will not be updated in the future. I got tired of looking all over for call sequences (let alone proper documentation) for functions used for creating Ruby extensions written in C, so I’m making notes about some functions I have found u
Ruby QuickRef Table of Contents Table of Contents Language General Tips General Syntax Rules Reserved Words Types Numbers Strings Symbols Ranges Regexen Arrays Hashes Files Variables Pseudo variables Pre-defined variables require “English” Pre-defined global constants Expressions Operators and Precedence Control Expressions Invoking a Method Defining a Class Defining a Module Defining a Method Acc
Railsで使いまくりActive Supportなので、そんなにまとめがいが無いし、沢山あるのでまとめられないけれど、代表的なモノをとりあえずまとめておく。 blank?やpresent?やtryなんかは省略する。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く