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 'rubygems' | |
require 'spec' | |
require 'lru_cache' | |
describe LruCache, 'when Lru called' do | |
before(:all) do | |
puts 'Test Kaisi' | |
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
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'net/http' | |
require 'time' | |
def show(path, res) | |
puts "---- #{path} ----" | |
puts "Response: #{res.code} #{res.message}" | |
puts "Content-Length: #{res['Content-Length']}" |
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
def prime?(number) | |
return false if number == 1 | |
2.upto(number) do |key| | |
return false if number != key && number.to_f % key == 0 | |
end | |
true | |
end | |
primes = [*1...100].select{|n| prime? n} | |
data = [] |