ღゝ◡╹)ノ♡ hanach.in

home diary

泥縄な日だった

27 Dec 2013

泥縄な日だった

今日やりたいこと

できたことだけ置いといて、できてないのは下へうつす

今日みつけたやりたいこと

今日のうんこ

むやみやたらにgemのバージョンを上げたばかりの俺達は…

実家KPT

### Keep - 無事帰宅する

Problem

Try

実家での家事

実家での家事、家族のものやことがパフォーマンス上の理由などで強結合になればなるほど、やりづらくなる。 一番家事をする人間がパフォーマンスを出せるように最適化されていても、個々が家事するのに最適とは限らない。

GitHub便利さ

Releases便利ですね。使っていきたい。

1.8.7、1.9.2のサポート延長とかに思うこと

bundle updateしてgemのchangelogなど見てるとruby 1.8のサポートうちきるものも多く、ruby 1.8.7のサポートが継続しててもgemがアップデートできずめんどくさそうだ…

Gemfile.lockみてchangelogおってみた感想

セキュリティフィックスがあったりとか、新しい機能が追加されてたりとか、こういうバグがあったんだ、とか、発見が多かった。 逆にちゃんとchangelog見ないとそういうの見落としてしまっているんだな… 毎日gemアップデートしないとchangelog追うのも辛い。 あとchangelogがないものとか見るのも結構しんどい。

changelog見るのもめんどいし、これbundle updateする期間があけばあくほど、どんな変更があったかわからなくなるんだろうな。 とりあえずテスト通れば上げても影響でないでしょ、あげちゃえ。みたいな。 テストすらない場合、changelogおったりコミットおわないとほんとにバージョン上げて問題なさそうかわからないんだろうな…

あとは依存してるgem増えると技術的な判断するの大変そう。例えばthreadベースのrackサーバー使いたいとき依存してるgemのどれかがthread-safeかそうでないかってどう判断すればよいのか。

VagrantとChef Solo

vagrant provisionでもknife solo cookchef solo cookでもうまく動くような共存みなさんどうやってるんですかね。 僕Vagrantfileにも他の場所にも似たような指定増えまくっていて管理不能状態になってる感ある。

消す

eachインデックスとるの引数の順番わすれたからvar i = 0; i++;の普段おこる手抜き実装です。

window.confirm = function () { return true; }; var i = 1; $($x('//div[contains(@class, "message") and ./*[@href="/hanachin"] and not(@style)]')).each(function () { var that = $(this); setTimeout(function () { that.find('.permalink a').click(); $('.delete').first().click(); }, i * 1000); i++; }); setTimeout(function () { window.location.href = $('.prev a').attr('href'); alert('done'); }, i * 1000);

Mac便利ソフト

アップル標準化はよ! iPhoneをノックして Macを解除する『ノック(Knock)』を試してみた【設定方法】 | TABROID(タブロイド) 10.8〜対応だった。最近多い。残念あきらめた…

Herokuで使いたいソフトをビルドするにはVulcanを使ってはならない

heroku/vulcanを使う。入ってるnodeとか環境変数の状況によってはたまにうごかないことがあった。

vulcan create vulcan-hanachin hub clone https://github.com/l4u/gifsicle-heroku.git cd gifsicle-heroku rbenv exec vulcan build -v -p /tmp/gifsicle -c "make clean; mkdir /tmp/gifsicle && autoreconf -i && ./configure --disable-gifview --prefix=/tmp/gifsicle && make && make install"

あれ、とおもったら

NOTE: The Vulcan build service is no longer maintained or supported, and it’s no longer recommended for building binaries. Use heroku run instead.

非推奨w 気づくのおくれた orz

普通にビルドしてアップロードした。 ビルドしたあとアップロードするの簡易にするrake task定義しとくべきだな。 すごくダメなハック感あるけどfogとかつかわず、設定されてるPaperclipのS3 storageつかって

ruby f = Foobar.new f.image = File.new('/tmp/hogehoge') s3o = f.image.s3_object.bucket.objects['jhead'] s3o.write Pathname.new '/tmp/jhead/jhead'

とかやってる。

herokuでimage_optim

糞だるいな…GIFSICLE_BINがない、とか、他色々。

画像の種類ごとにテスト実行したほうがよいかもしれない。 あと、バイナリが入ってないのとか、Herokuでしか起こりえない問題だし、やっぱHerokuにデプロイするならテストもHeroku上で実行するべきだと強く感じる。

現状のCIサーバーが低スペックなのもちょっとなー。 じゃあHerokuにしたら強いのかと言われると「うーん」っていう感じだけど…

Ruby 2.1

bundle install

なんかエラー出たやつ手動で入れる

1回、Ruby - インストールされている gem を全て削除する。 - Qiita [キータ] とかやってみたんだけどダメだった

CIサーバーのruby2.1対応

workerのアップデート

chefのレシピいじる。 Chefのレシピ入れてるリポジトリのGemfileもruby '2.1.0'にあげてbundle installする。 とりまステージングいじる。

入らない。Vagrantだとうまく動く糞レシピ書いてた。

secret = Chef::EncryptedDataBagItem.load_secret “/tmp/encrypted_data_bag_secret”

Vagrant確かchef soloの場合、デフォルトだと/tmp/encrypted_data_bag_secretencrypted_data_bag_secret_key_pathで指定したキーおいてくれる。 そこを期待してレシピ書いてたのでvagrant provision以外の、ふつうにknife solo cookとかでやると動かないレシピになっていた。

ほかにもbundle installで入らないやつが…

速度

spec遅くてもうしわけない。たまに落ちるやつもあるしちょっと書き直したい…

** 2.1.0 ** Finished in 11 minutes 18 seconds 1307 examples, 1 failure, 52 pending

** 2.0.0-p353 ** Finished in 11 minutes 41 seconds 1307 examples, 1 failure, 52 pending

開発用

perftools.rbが入らない

これっぽい。とりあえずコメントアウトする

paperclip-meta

warningでるのなおすPRある

PR結構たまっててメンテされてないっぽい?

OpenSSL::Digest::Digest

Deprecateになった

Bundler 1.5

参考: What’s New in v1.5

bundler並列の設定やる

bundle update

diff --git a/Gemfile.lock b/Gemfile.lock index de5f7a6..33ed186 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ GIT remote: git://github.com/guard/guard.git - revision: 8b83d2968108ef19e4dca7781f5d24abb01c188d + revision: d77556380687bcb61616162385170a34df92f1bb specs: - guard (2.2.3) + guard (2.2.5) formatador (>= 0.2.4) listen (~> 2.1) lumberjack (~> 1.0) @@ -27,26 +27,26 @@ GIT GEM remote: https://rubygems.org/ specs: - actionmailer (4.0.1) - actionpack (= 4.0.1) + actionmailer (4.0.2) + actionpack (= 4.0.2) mail (~> 2.5.4) - actionpack (4.0.1) - activesupport (= 4.0.1) + actionpack (4.0.2) + activesupport (= 4.0.2) builder (~> 3.1.0) erubis (~> 2.7.0) rack (~> 1.5.2) rack-test (~> 0.6.2) active_decorator (0.3.4) - activemodel (4.0.1) - activesupport (= 4.0.1) + activemodel (4.0.2) + activesupport (= 4.0.2) builder (~> 3.1.0) - activerecord (4.0.1) - activemodel (= 4.0.1) + activerecord (4.0.2) + activemodel (= 4.0.2) activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.1) + activesupport (= 4.0.2) arel (~> 4.0.0) activerecord-deprecated_finders (1.0.3) - activesupport (4.0.1) + activesupport (4.0.2) i18n (~> 0.6, >= 0.6.4) minitest (~> 4.2) multi_json (~> 1.3) @@ -56,8 +56,9 @@ GEM airbrake (3.1.14) builder json - annotate (2.5.0) - rake + annotate (2.6.1) + activerecord (>= 2.3.0) + rake (>= 0.8.7) arel (4.0.1) asset_sync (1.0.0) activemodel @@ -74,16 +75,16 @@ GEM nokogiri (>= 1.4.4) uuidtools (~> 2.1) bcrypt-ruby (3.1.2) - better_errors (1.0.1) + better_errors (1.1.0) coderay (>= 1.0.0) erubis (>= 2.6.6) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) builder (3.1.4) - byebug (2.3.1) + byebug (2.5.0) columnize (~> 0.3.6) debugger-linecache (~> 1.2.0) - capybara (2.1.0) + capybara (2.2.0) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) @@ -97,7 +98,7 @@ GEM chunky_png (1.2.9) climate_control (0.0.3) activesupport (>= 3.0) - cliver (0.2.2) + cliver (0.3.2) cocaine (0.5.3) climate_control (>= 0.0.3, < 1.0) code_analyzer (0.4.3) @@ -129,8 +130,8 @@ GEM debug_inspector (0.0.2) debugger-linecache (1.2.0) diff-lcs (1.2.5) - docile (1.1.0) - doorkeeper (0.7.3) + docile (1.1.1) + doorkeeper (0.7.4) jquery-rails (>= 2.0.2) railties (>= 3.1) dotenv (0.9.0) @@ -141,7 +142,7 @@ GEM http_parser.rb (~> 0.5.3) erubis (2.7.0) eventmachine (1.0.3) - excon (0.28.0) + excon (0.31.0) execjs (2.0.2) exifr (1.1.3) factory_girl (4.3.0) @@ -151,11 +152,11 @@ GEM railties (>= 3.0.0) faker-japanese (0.0.1) fakeweb (1.3.0) - ffaker (1.20.0) + ffaker (1.22.1) ffi (1.9.3) - fog (1.18.0) + fog (1.19.0) builder - excon (~> 0.28.0) + excon (~> 0.31.0) formatador (~> 0.2.0) mime-types multi_json (~> 1.0) @@ -166,7 +167,7 @@ GEM font-awesome-rails (3.2.1.3) railties (>= 3.2, < 5.0) formatador (0.2.4) - fspath (2.0.5) + fspath (2.1.0) fssm (0.2.10) gherkin (2.12.2) multi_json (~> 1.3) @@ -177,37 +178,38 @@ GEM gmail_xoauth (0.4.1) oauth (>= 0.3.6) growl (1.0.3) - guard-livereload (2.0.0) + guard-livereload (2.1.0) em-websocket (~> 0.5) guard (~> 2.0) multi_json (~> 1.8) - guard-rspec (4.0.4) + guard-rspec (4.2.0) guard (>= 2.1.1) - rspec (~> 2.14) + rspec (>= 2.14, < 4.0) haml (4.0.4) tilt - handlebars_assets (0.14.1) + handlebars_assets (0.15) execjs (>= 1.2.9) + multi_json sprockets (>= 2.0.3) tilt hike (1.2.3) - hipchat (0.12.0) + hipchat (1.0.1) httparty http_parser.rb (0.5.3) httparty (0.12.0) json (~> 1.8) multi_xml (>= 0.5.2) - i18n (0.6.5) - image_optim (0.9.1) + i18n (0.6.9) + image_optim (0.10.0) exifr (~> 1.1.3) - fspath (~> 2.0.5) + fspath (~> 2.1.0) image_size (~> 1.1.2) in_threads (~> 1.2.0) progress (~> 3.0.0) image_optim_bin (0.0.2) - image_size (1.1.4) + image_size (1.1.5) in_threads (1.2.0) - jbuilder (1.5.2) + jbuilder (2.0.1) activesupport (>= 3.0.0) multi_json (>= 1.2.0) jquery-rails (3.0.4) @@ -218,61 +220,59 @@ GEM multi_json (~> 1.0) rspec (~> 2.0) kgio (2.8.1) - launchy (2.3.0) + launchy (2.4.2) addressable (~> 2.3) - letter_opener (1.1.2) + letter_opener (1.2.0) launchy (~> 2.2) libv8 (3.16.14.3) - listen (2.2.0) + listen (2.4.0) celluloid (>= 0.15.2) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) - lockfile (2.1.0) lumberjack (1.0.4) mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) memcachier (0.0.2) method_source (0.8.2) - mime (0.1) - mime-types (1.25) + mime (0.2.0) + mime-types (1.25.1) mini_portile (0.5.2) minitest (4.7.5) mono_logger (1.1.0) multi_json (1.8.2) multi_xml (0.5.5) - multipart-post (1.2.0) + multipart-post (2.0.0) mustache (0.99.5) net-scp (1.1.2) net-ssh (>= 2.6.5) net-ssh (2.7.0) - newrelic_rpm (3.6.9.171) - nokogiri (1.6.0) + newrelic_rpm (3.7.1.180) + nokogiri (1.6.1) mini_portile (~> 0.5.0) oauth (0.4.7) open4 (1.3.0) - paperclip (3.4.2) + paperclip (3.5.2) activemodel (>= 3.0.0) - activerecord (>= 3.0.0) activesupport (>= 3.0.0) - cocaine (~> 0.5.0) + cocaine (~> 0.5.3) mime-types - paperclip-optimizer (0.2.0) - image_optim (~> 0.8) + paperclip-optimizer (1.0.0) + image_optim (~> 0.9) paperclip - paperclip (~> 3.4.1) + paperclip (~> 3.5.2) perftools.rb (2.0.1) - pg (0.17.0) - poltergeist (1.4.1) - capybara (~> 2.1.0) - cliver (~> 0.2.1) + pg (0.17.1) + poltergeist (1.5.0) + capybara (~> 2.1) + cliver (~> 0.3.1) multi_json (~> 1.0) websocket-driver (>= 0.2.0) polyglot (0.3.3) progress (3.0.0) protected_attributes (1.0.5) activemodel (>= 4.0.1, < 5.0) - pry (0.9.12.3) + pry (0.9.12.4) coderay (~> 1.0) method_source (~> 0.8) slop (~> 3.4) @@ -284,7 +284,7 @@ GEM pry-remote (0.1.7) pry (~> 0.9) slop (~> 3.0) - psych (2.0.1) + psych (2.0.2) rack (1.5.2) rack-contrib (1.1.0) rack (>= 0.9.1) @@ -298,17 +298,17 @@ GEM rack rack-test (0.6.2) rack (>= 1.0) - raddocs (0.2.0) + raddocs (0.3.0) haml json sinatra - rails (4.0.1) - actionmailer (= 4.0.1) - actionpack (= 4.0.1) - activerecord (= 4.0.1) - activesupport (= 4.0.1) + rails (4.0.2) + actionmailer (= 4.0.2) + actionpack (= 4.0.2) + activerecord (= 4.0.2) + activesupport (= 4.0.2) bundler (>= 1.3.0, < 2.0) - railties (= 4.0.1) + railties (= 4.0.2) sprockets-rails (~> 2.0.0) rails-clean-logs (1.1) rails4_upgrade (0.5.0) @@ -326,22 +326,22 @@ GEM i18n require_all ruby-progressbar - rails_serve_static_assets (0.0.1) + rails_serve_static_assets (0.0.2) rails_stdout_logging (0.0.3) - railties (4.0.1) - actionpack (= 4.0.1) - activesupport (= 4.0.1) + railties (4.0.2) + actionpack (= 4.0.2) + activesupport (= 4.0.2) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) raindrops (0.12.0) - rake (10.1.0) + rake (10.1.1) rb-fchange (0.0.6) ffi rb-fsevent (0.9.3) - rb-inotify (0.9.2) + rb-inotify (0.9.3) ffi (>= 0.5.0) redis (3.0.6) - redis-namespace (1.3.2) + redis-namespace (1.4.1) redis (~> 3.0.4) ref (1.0.5) require_all (1.3.2) @@ -355,9 +355,9 @@ GEM rake resque (~> 1.20) trollop (~> 1.16) - resque_mailer (2.2.5) + resque_mailer (2.2.6) actionmailer (>= 3.0) - resque_spec (0.14.2) + resque_spec (0.14.4) resque (>= 1.19.0) rspec-core (>= 2.5.0) rspec-expectations (>= 2.5.0) @@ -388,26 +388,25 @@ GEM rspec (>= 2.14.0) webmock (>= 1.7.0) ruby-hmac (0.4.0) - ruby-progressbar (1.2.0) + ruby-progressbar (1.3.2) safe_yaml (0.9.7) - sass (3.2.12) + sass (3.2.13) sass-rails (4.0.1) railties (>= 4.0.0, < 5.0) sass (>= 3.1.10) sprockets-rails (~> 2.0.0) settingslogic (2.0.9) - sexp_processor (4.4.0) + sexp_processor (4.4.1) shoulda (3.5.0) shoulda-context (~> 1.0, >= 1.0.1) shoulda-matchers (>= 1.4.1, < 3.0) shoulda-context (1.1.6) shoulda-matchers (2.4.0) activesupport (>= 3.0.0) - simple_enum (1.6.7) + simple_enum (1.6.8) activesupport (>= 3.0.0) - simplecov (0.8.1) + simplecov (0.8.2) docile (~> 1.1.0) - lockfile (>= 2.1.0) multi_json simplecov-html (~> 0.8.0) simplecov-html (0.8.0) @@ -417,9 +416,9 @@ GEM rack (~> 1.4) rack-protection (~> 1.4) tilt (~> 1.3, >= 1.3.4) - slop (3.4.6) - spring (0.9.2) - sprockets (2.10.0) + slop (3.4.7) + spring (1.0.0) + sprockets (2.10.1) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) @@ -448,10 +447,10 @@ GEM gherkin (>= 2.5) rspec (~> 2.0) tzinfo (0.3.38) - uglifier (2.3.1) + uglifier (2.4.0) execjs (>= 0.3.0) json (>= 1.8.0) - unf (0.1.2) + unf (0.1.3) unf_ext unf_ext (0.0.6) unicorn (4.7.0) @@ -462,12 +461,12 @@ GEM validates_email_format_of (1.5.3) vegas (0.1.11) rack (>= 1.0.0) - webmock (1.15.2) + webmock (1.16.1) addressable (>= 2.2.7) crack (>= 0.3.2) - websocket-driver (0.3.0) + websocket-driver (0.3.1) will_paginate (3.0.5) - xml-simple (1.1.2) + xml-simple (1.1.3) xpath (2.0.0) nokogiri (~> 1.3) zurui-sass-rails (0.0.4)