- 両者のソースは割りと似ている(github-markdownがredcarpetを元にしたのか、あるいは両者のもとになったC実装があるとかかな)
github-markdownは、redcapetの提供するオプションの一部をデフォルトで有効化します。 (ちなみに有効化するオプションを選ぶAPIはない模様。用途を考えるとそれで正しいが)
★がついているのが有効化されるもの。gfmモード(.render_gfmメソッド)の場合のみ、★★も有効化される。
| module TwitterOAuth | |
| class Client | |
| def update_profile(params) | |
| post("/account/update_profile.json", params) | |
| end | |
| end | |
| end | |
| Earthquake.init do | |
| %w[name description url location].each do |word| |
| # -*- coding: utf-8 -*- | |
| Earthquake.init do | |
| command %r|^:create_shindanmaker_plugin\s+(.+)\s(.+)$|, :as => :create_shindanmaker_plugin do |m| | |
| name = m[1] | |
| url = m[2] | |
| dir = File.dirname(__FILE__) | |
| tmpl = <<TMPL | |
| # -*- coding: utf-8 -*- | |
| require 'httpclient' |
| # -*- coding: utf-8 -*- | |
| # RubyBestPracticeに載っている書き方 | |
| # 以下の解説ページを参照 | |
| # http://www.mapee.jp/ruby/post_66.html | |
| class BlockRun | |
| def initialize | |
| @handlers = { } | |
| end |
| # -*- coding: utf-8 -*- | |
| # favstar / earthquakge.gem plugin | |
| # | |
| # e.g. :favstar #=> your favstar | |
| # :favstar who #=> who's favstar | |
| # | |
| require 'rss' | |
| Earthquake.init do |
| # -*- coding: utf-8 -*- | |
| # haiku tweet / earthquake plugin | |
| # | |
| Earthquake.init do | |
| command :haiku do |m| | |
| input(":update #{m[1]} ここで一句、 %s" % [open("http://haiku.jgate.de/"){|f| f.read}]) | |
| end | |
| end |