Skip to content

Instantly share code, notes, and snippets.

# coding: utf-8
RSpec.configure do |c|
c.filter_run_excluding :ruby => lambda{|version|
!(RUBY_VERSION.to_s =~ /^#{version.to_s}/)
}
end
describe Hash do
context 'object_id' do
before(:all) do
#!/usr/bin/env ruby
# coding: utf-8
require 'rubygems'
require 'optparse'
require 'progressbar'
class Progress
def self.start(title, size)
progress = ProgressBar.new(title, size)
yield progress
# coding: utf-8
require 'rubygems'
require 'net/irc'
class JigokuClient < Net::IRC::Client
def on_rpl_welcome(m)
post JOIN, opts.channel
end
def on_privmsg(m)
# coding: utf-8
File.open(ARGV.shift) do |f|
text = f.read
text_to_array = text.split(//)
puts(text_to_array.map do |c|
if c.ascii_only?
0.5
else
1.0
# coding: utf-8
require 'rspec'
describe Array do
class << self
alias それは it
alias なにを subject
alias 状況は context
end
# coding: utf-8
require 'rspec'
describe Array do
subject { [] }
it { should 空であること }
it { should 配列であること }
context 'not empty' do
subject { [1] }
# coding: utf-8
require 'rspec'
describe Array do
subject { [] }
it { should 空であること }
it { should 配列であること }
end
# coding: utf-8
module Searchable
def search(params={})
return self.scoped if params.nil?
params.reject{|k,v|v.blank?}.to_a.inject(self.scoped) do |base,param|
base.send(param.first, param.last)
end
end
end
namespace :spec do
task :statsetup do
require 'rails/code_statistics'
::STATS_DIRECTORIES << %w(Steak\ features spec/acceptance) if File.exist?('spec/acceptance')
::CodeStatistics::TEST_TYPES << "Steak features" if File.exist?('spec/acceptance')
end
end
group :macos do
gem 'autotest-growl'
gem 'autotest-fsevent'
end
# bundle --without macos