![Rubyのスケール時にGVLの特性を効果的に活用する(翻訳)|TechRacho by BPS株式会社](https://cdn-ak-scissors.b.st-hatena.com/image/square/bbcf57716f97a8da50438a870550d5067c74bcaf/height=288;version=1;width=512/https%3A%2F%2Ftechracho.bpsinc.jp%2Fwp-content%2Fuploads%2F2020%2F05%2Fpractical_effects_ruby_gvl_eyecatch-min.png)
test-unitはRuby用のxUnit系の単体テストフレームワークです。2.3.1からデータ駆動テスト機能が追加されていたのですが、2.5.3まではリファレンスに記述がなく、知る人ぞ知る機能でした。 2013-01-23にリリースされた2.5.4ではデータ駆動テスト機能についてのドキュメントが追加されています。 データ駆動テスト自体の説明はUxUを用いたデータ駆動テストの記述を参照してください。 Cucumberのscenario outlinesに似ていると言えばピンと来る人もいるのではないでしょうか。 Cucumberのscenario outlinesも前述のククログ記事の通り、テストのデータとロジックを分離しているのでデータ駆動テストの一種と言えます。 今回は、データ駆動テストを導入した例を見ながらtest-unitでのデータ駆動テスト機能の使い方を紹介します。なお、以降の説明
type 型のメモリを n 個スタックフレームに割り当てる。このメモリは関数が終わると自動的に解放される。
TL;DR After introducing what complexity is, how it can be measured, and how to monitor it in Ruby - I'll get to the difficult part: how to reduce it in Ruby. The post is concluded with some thoughts and recap. Intro Even Vader does not know what are those buttons for. Developing a feature requires some attention on code quality - for the sake of reliability, efficiency, security, and maintainabili
Treetop is a language for describing languages. Combining the elegance of Ruby with cutting-edge parsing expression grammars, it helps you analyze syntax with revolutionarily ease. sudo gem install treetop Intuitive Grammar Specifications Parsing expression grammars (PEGs) are simple to write and easy to maintain. They are a simple but powerful generalization of regular expressions that are easie
RubyのProcの説明は巷に溢れているから今更感があるけどここ数回Procを使ったネタを書いていたらProcがかわいくなっちゃってもっとみんなにもProcのこと知ってもらいたいという欲求が生まれてきたからProcについての基本的なことを僕なりのやり方でここに書くよ。長いよ。 Rubyの関数(メソッド) Rubyにおいて関数(メソッド)はファーストクラス(オブジェクト)ではありません。つまり文字列や数字や配列などの他のオブジェクトとは異なって、Rubyではそれを直接変数に代入したり、他の関数に渡したりすることはできません。 def square(n) n * n end sq = square # squareメソッドを変数sqに代入してみる # ~> -:1:in `square': wrong number of arguments (0 for 1) (ArgumentError)
$ bundle config [NAME [VALUE]] [--local] [--global] [--delete] Options: --local: Get/set local configuration --global: Get/set global configuration --delete: Delete NAME value Retrieves or sets a configuration value. If only parameter is provided, retrieve the value. If two parameters are provided, replace the existing value with the newly provided one. By default, setting a configuration value se
require 'celluloid' class Counter include Celluloid attr_reader :count def initialize @count = 0 end def increment(n = 1) sleep n @count += n end end actor = Counter.new p actor.count #=> 0 p actor.increment #=> 1 p actor.async.increment(41) #=> nil p actor.count #=> 1 Celluloidの機能を使うには、ActorにしたいクラスにCellloidをincludeします。 #asyncをはそれに続くメソッド呼び出しが非同期になるようなプロキシを返します。メソッド呼び出しはnilを返すため、本来返ってくるはずの返り値は使えません
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く