require 'mkmf' have_library('pq') checking for main() in -lpq... yes => true
mkmf.rb を読んだところ、C++ のコードを生成してチェックしていた。
Kernel.have_library のコードはこちら。
カレントディレクトリに mkmf.log が作られるが、これを防止するには
以下で良いみたいだ。
MakeMakefile::Logging::logfile('/dev/null')
ネット上には以下のコードがあったが、mkmf.rb を読んだら上でいけた。
MakeMakefile::Logging::logfile('/dev/null') module MakeMakefile module Logging @logfile = '/dev/null' end end
参考情報
instance method Kernel#have_library (Ruby 2.5.0)
Module: MakeMakefile (Ruby 2.5.0)
masutaka/github-nippou
Print today's your GitHub action.
《続きを読む》
先日会社の tech channel で話題になったのでメモ。Rubiest の方々にとっ
ては常識なんですかね...?
$ ruby -v ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin15] $ ruby -e 'raise "aaa" rescue p $!' #<RuntimeError: aaa> $ ruby -e 'raise "aaa" rescue p $ERROR_INFO' nil $ ruby -r English -e 'raise "aaa" rescue p $ERROR_INFO' #<RuntimeError: aaa>
Ruby はグローバル変数の初期値が nil なのがたちが悪い。個人的にはも
う $ERROR_INFO とかは使わないと思う。
《続きを読む》
個人のいくつかのリポジトリで bundle install できないことがあり、困っ
ていました。
$ bundle install Fetching gem metadata from https://rubygems.org/............ Fetching version metadata from https://rubygems.org/. Resolving dependencies... Using rake 11.3.0 Using concurrent-ruby 1.0.2 Using i18n 0.7.0 Using thread_safe 0.3.5 Using net-ssh 3.2.0 Installing minitest 5.10.1 Your Gemfile.lock is corrupt. The following gem is missing from the DEPENDENCIES section: 'ffi'
《続きを読む》
compare_linker | RubyGems.org | your community gem host
RubyGems.org is the Ruby community's gem hosting service. Instantly publish your gems and install them. Use the API to interact and find out more information about available gems. Become a contributor and enhance the site with your own changes.
《続きを読む》
必要に迫られて Ruby のスクリプトを作ったら、汎用化できたので
Gem にしてみました。
gist_updater | RubyGems.org | your community gem host
RubyGems.org is the Ruby community's gem hosting service. Instantly publish your gems and install them. Use the API to interact and find out more information about available gems. Become a contributor and enhance the site with your own changes.
《続きを読む》
個人的なメモ
[1] pry(main)> Ripper.lex(':manage/home') => [[[1, 0], :on_symbeg, ":"], [[1, 1], :on_ident, "manage"], [[1, 7], :on_op, "/"], [[1, 8], :on_ident, "home"]]
":" → シンボルの開始
"manage" → 識別子(identifier)
"/" → 演算子(operator)
"home" → 識別子
class Ripper (Ruby 2.3.0)
[2016-06-13-1] にも書いたとおり、こちらの PR で fluent-logger-ruby
を導入しました。
fluentd にも POST する by masutaka · Pull Request #40 · masutaka/masutaka-metrics
その時に、こんな問題に気づきました。
loading...
結論から言うと、Wrapper を作る必要はありません(一度作ってしまった
けど...)。fluent-logger-ruby がいい感じに処理してくれます。
《続きを読む》
[2016-03-23-1] に予告したとおり、今回は破壊的変更をしました。
https://github.com/masutaka/github-nippou/releases/tag/v2.0.0
- 改良
- --all と --num オプションを削除
- 代わりに --since-date と --until-date を追加
- デバッグオプション --debug を追加
- サブコマンド version を追加
- パフォーマンスの改善
- バグ修正
- Issue や Pull request 発生時ではなく、現在のタイトルを使用
- 同じく現在のステータスを使用
- その他
- ソースコードのリファクタリング
《続きを読む》
https://github.com/masutaka/github-nippou/releases/tag/v1.2.0
- 改良
- URL でソートしたリストを出力
- Issue や PR がクローズされていたら、closed! を付加
v2.0.0 では [2016-03-21-1] に追加した -a, -n オプションが早くもな
くなる予定です・・・!
https://github.com/masutaka/github-nippou/releases/tag/v1.1.0
https://github.com/masutaka/github-nippou/releases/tag/v1.1.1
-a オプションを追加しました。今日より前のイベントも(存在すれば)
標準出力に出力します。日報書き忘れの時などにご利用下さい。
-n オプションも追加しました。たまに、作成した PR の取りこぼしがあ
ったのはこのせいでした。以前 Issue 作って忘れてました。
Events|GitHub Developer Guide
Events support pagination, however the per_page option is
unsupported. The fixed page size is 30 items. Fetching up to ten
pages is supported, for a total of 300 events.
Octokit::Client::Events#user_events が使う
"GET /users/:username/events" は pagination をサポートしており、
デフォルトでは 30 イベントしか返さないからです。
デフォルトを 50 にして且つ、オプションで指定可能にしました。10 の
倍数を指定して下さい。上限は 300 です。
あとは "<" と ">" をエスケープしたり、使用する Gem のバージョンの
縛りをなくしてみたり。
今回初めて Thor を使いました。お手軽にコマンドラインオプションや
ヘルプを実装できるので、良い感じですね。
El Capitan から openssl のヘッダファイルが削除されました。ヽ(`Д´)ノプンプン
Homebrew をお使いの方は、eventmachine や puma をインストールしよう
とすると、こんなエラーが発生すると思います。(発生しない方は、すで
に後述のコマンドを実行しているのだと思います。)
make "DESTDIR=" clean make "DESTDIR=" compiling binder.cpp In file included from binder.cpp:20: ./project.h:116:10: fatal error: 'openssl/ssl.h' file not found #include <openssl/ssl.h> ^ 1 error generated. make: *** [binder.o] Error 1 make failed, exit code 2
《続きを読む》
http://rubykaigi.org/2015
12/11(金)から始まった RubyKaigi 2015 に 3 日間参加してきました。
1 日目は自宅を出た時は小雨で、東銀座駅に着いたら暴風雨、
会場に着いたら快晴と、汐留とはなんとハードな場所かと疲労困憊
汗ダラダラで始まりました。
以下、自分用のメモです。
《続きを読む》