This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- @users.each do |user| | |
= user.profile // select * from profile | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rails | |
docker-compose config --services >/dev/null ^/dev/null | |
switch $status | |
case 0 | |
docker-compose exec app rails $argv | |
case '*' | |
if test -d bin | |
bin/rails $argv | |
else | |
set -l rails_cmd (which rails) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rspec' | |
require 'minitest' | |
require 'minitest-power_assert' | |
module Minitest | |
module Assertions | |
prepend Minitest::PowerAssert::Assertions | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe User do | |
describe '#nanrakano_method' do | |
subject { described_class.new.nanrakano_method(args) } | |
context 'context a' | |
context 'context b' | |
# many many context ... | |
context 'context z' do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :db do | |
desc "Redo target timestamp newer migration." | |
task :redo_timestamp => :environment do | |
timestamp = ENV['TIMESTAMP'] | |
files = Dir.glob("db/migrate/*.rb").map {|file| | |
md = file.split(File::SEPARATOR).last.match(/(^\d+)_\w+\.rb/) | |
[md[0], md[1].to_i] | |
}.select{|match| match[1] > timestamp.to_i }.map{|match| match[0]} | |
ENV['STEP'] = files.size.to_s | |
Rake::Task['db:migrate:redo'].invoke |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HP100%、銃弾70%、ミニマップ、HUD表示なし | |
アタッカー | |
突撃兵か工兵のみ | |
USAS-12,FAMAS,アンダーバレルのM26不可 | |
第二、第三拠点のMCOM破壊で勝利 | |
アタッカーは1人(人数次第で2、3人) | |
ディフェンス | |
ナイフのみ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
has_one :character | |
end | |
class Character | |
belongs_to :user | |
has_many :battles | |
has_many :battle_records | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rack::Utils::SYMBOL_TO_STATUS_CODE.each do |symbol,code| | |
matcher_name = symbol.to_s =~ /^not_/ ? symbol : "be_#{symbol}" | |
RSpec::Matchers.define matcher_name do | |
match do |response| | |
response.code.to_i == code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe Fixnum do | |
subject { [1,2,3,4] } | |
specify { subject.all?{|v| v==1} } | |
it { should_not be_all{|v| v==1 }} | |
it { should be_any{|v| v==1 } } | |
it { should be_any(&lambda{|v| v==1 }) } | |
end | |
class Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lambda/proc ver | |
class Proc | |
def self.compose(f, g) | |
lambda {|*args| f[g[*args]] } | |
end | |
def <<(g) | |
Proc.compose(self,g) | |
end | |
NewerOlder