grepやRakで2つ以上のキーワードの共起を検索する方法
ある単語Xが出てくる場所の前後5行以内に別な単語Yが出現する場所を探したい。
たまにはそんなこともありますね。
-A -B -C オプションが実装されている Rak やgrepを使えば簡単。
1 % rak X -C 5 | rak Y
-A n
は後方n行、-B n
は前方n行、-C n
は前後n行を
含めて表示するので、それをパイプして前後の文脈の
中からさらに検索してあげればOK。
ある単語Xが出てくる場所の前後5行以内に別な単語Yが出現する場所を探したい。
たまにはそんなこともありますね。
-A -B -C オプションが実装されている Rak やgrepを使えば簡単。
1 % rak X -C 5 | rak Y
-A n
は後方n行、-B n
は前方n行、-C n
は前後n行を
含めて表示するので、それをパイプして前後の文脈の
中からさらに検索してあげればOK。
一時動かなくなっていた
restful_op
http://svn
ruby-openi
プラグイン中のmigrationジェネレータは、何も無い状態から DBを作るためのマイグレーションになっています。
すでにrestful_op
Enter at your own risk!
See Also
restful_op
1 # Use this migration to upgrade the old 1.1 ActiveRecord store schema 2 # to the new 2.0 schema. 3 class UpgradeOpe nIdStore < ActiveReco rd::Migrat ion 4 def self.up 5 drop_table "open_id_se ttings" 6 drop_table "open_id_no nces" 7 create_tab le "open_id_no nces", :force => true do |t| 8 t.column :server_url , :string, :null => false 9 t.column :timestamp, :integer, :null => false 10 t.column :salt, :string, :null => false 11 end 12 end 13 14 def self.down 15 drop_table "open_id_no nces" 16 create_tab le "open_id_no nces", :force => true do |t| 17 t.column "nonce", :string 18 t.column "created", :integer 19 end 20 21 create_tab le "open_id_se ttings", :force => true do |t| 22 t.column "setting", :string 23 t.column "value", :binary 24 end 25 end 26 end
ちなみにオリジナルのプラグインが生成したマイグレーションコードはこちら。
1 create_table :open_id_as sociations , :force => true do |t| 2 t.column :server_url , :binary 3 t.column :handle, :string 4 t.column :secret, :binary 5 t.column :issued, :integer 6 t.column :lifetime, :integer 7 t.column :assoc_type , :string 8 end 9 10 create_tab le :open_id_no nces, :force => true do |t| 11 t.column :nonce, :string 12 t.column :created, :integer 13 end 14 15 create_tab le :open_id_se ttings, :force => true do |t| 16 t.column :setting, :string 17 t.column :value, :binary 18 end
open_id_se
は不要になって、open_id_no
の
内容が変わります。
昨日RubyGemsを1.0.0にアップデートしたところ、
require_ge
が使えなくなってしまったため、
内部でrequire_ge
を使っているGemが使えなくなりました。
かなり前から移行措置が取られていたため、
使えなくなったGemはほとんど無かったのですが、
一個だけ、ruby-openi
その結果、愛用していた
restful_op
ruby-openi
しかし、アップグレードしないわけにもいかないので、
restful_op
すでに同じ問題に取り組んでいる方がいらっしゃいましたら、 喜んでご協力いたしますのでご連絡いただけるとありがたいです。
連絡先