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
#-*- encoding: utf-8 -*- | |
require 'net/http' | |
https = Net::HTTP.new('api.github.com', 443) | |
https.use_ssl = true | |
https.ca_file = '/usr/share/ssl/cert.pem' | |
https.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
https.verify_depth = 5 | |
https.start { |w| | |
response = w.get('/repos/nakamura-akifumi/enju_nakamura/hooks') | |
puts response |
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
module M | |
def foo | |
puts "M#foo" | |
super | |
end | |
end | |
class Object | |
Const1 = "Object.Const1" | |
def 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
thread_list = [] | |
3.times do |i| | |
thread_list << Thread.new do | |
10.times do |j| | |
puts "i=#{i} j=#{j}" | |
end | |
end | |
end | |
thread_list.map do |t| |
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 'ostruct' | |
thread_list = [] | |
thread_control = [] | |
record = 1000 | |
split_number = 2 | |
width_num = (record / split_number.to_f).ceil | |
puts "w=#{width_num}" | |
split_number.times do |i| | |
t = OpenStruct.new |
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 'roo' | |
book = Excelx.new("sequence.xlsx") | |
puts book.sheets | |
puts "sheets.count=#{book.sheets.count}" |
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
# see 1) http://roo.rubyforge.org/ | |
# 2) http://roo.rubyforge.org/rdoc/index.html | |
require 'rubygems' | |
require 'roo' | |
require 'pp' | |
oo = Excelx.new("./sample.xlsx") | |
puts "sheet list" | |
oo.sheets.each_with_index do |s, i| |
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
gem 'enju_oai', '0.1.0.pre5' | |
gem 'enju_book_jacket', '0.1.0.pre2' | |
gem 'enju_manifestation_viewer', '0.1.0.pre3' | |
gem 'enju_message', :git => 'git://github.com/shinozuka/enju_trunk_message.git' | |
gem 'enju_ndl', :git => 'git://github.com/MiraitSystems/enju_ndl.git' | |
gem 'enju_trunk_event', :git => 'git://github.com/shinozuka/enju_trunk_event.git', :require => 'enju_event' | |
gem 'enju_subject', '0.1.0.pre5' | |
gem 'kgio' |
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
echo "start sciprt." | |
# enju_leafの動作環境。developmentかproductionを指定 | |
ENJU_ENV=production | |
# enju_leaf-1.1系の場合 | |
RAILS_VERSION=3.2.18 | |
TEMPLATE_URL=https://gist.github.com/nabeta/5357321.txt | |
# enju_leaf-1.2系の場合 | |
#RAILS_VERSION=4.1.1 |
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
echo "start script" | |
#RUBY_VERSION=1.9.3-p484 | |
#RUBY_VERSION=2.0.0-p481 | |
RUBY_VERSION=2.1.2 | |
PGDATA=/var/lib/pgsql/9.3/data | |
PGLOG=/var/lib/pgsql/9.3/pgstartup.log | |
echo "Ruby version ${RUBY_VERSION}" |
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
RAILS_VERSION=3.2.19 | |
ENJU_TRUNK_DIR=/home/vagrant/app/enju_trunk | |
USER=vagrant | |
echo "step6 : install rails" | |
gem install rails -v ${RAILS_VERSION} --no-rdoc --no-ri -f | |
echo "step7 : clone enju_trunk" | |
mkdir -p /home/vagrant/app | |
cd /home/vagrant/app |
OlderNewer