Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin system #16

Open
shokai opened this issue Oct 5, 2012 · 0 comments
Open

plugin system #16

shokai opened this issue Oct 5, 2012 · 0 comments
Labels

Comments

@shokai
Copy link
Owner

shokai commented Oct 5, 2012

出力をフックできるだけでいい?

$HOME/.tw/plugins/output/
に.rbファイルを配置する
$HOME/.tw/plugins/output/PLUGIN_NAME.rb

tweetが1つ来る毎に、その都度instance_evalされれば良さげ

今はTweet1つをHashで表現しているが、Tw::Tweetを作ってそれに入れる

module Tw
  class Tweet
    attr_reader :id, :time, :text, :user
  end
end

Tw::App::Render.disprayに渡したら、Tw::Tweetのコンテキスト内でinstance_evalする

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant