Changeset 6432
- Timestamp:
- 02/09/08 16:17:50 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/chokan/branches/citrus/plugins/hatena.rb
r6430 r6432 8 8 case message 9 9 when /\bg:([a-z][a-z\d]*)(?::id:([a-z][a-z0-9_-]{1,30}[a-z0-9]))?/i 10 _, g, id = *Regexp.last_match10 g, id = Regexp.last_match.captures 11 11 id << '/' if id 12 12 notice(channel, "http://#{g}.g.hatena.ne.jp/#{id}") 13 13 when /\b(?:([a-z][a-z\d]*):)?id:([a-z][a-z0-9_-]{1,30}[a-z0-9])/i 14 _, s, id = *Regexp.last_match15 return unless exist? id16 s ||= "d"17 notice(channel, "http://#{s}.hatena.ne.jp/#{id}/")14 s, id = *Regexp.last_match.captures 15 if exist?(id) 16 notice(channel, "http://#{s || "d"}.hatena.ne.jp/#{id}/") 17 end 18 18 end 19 19 end … … 62 62 it "should check id existance" do 63 63 @plugin.exist?("jkondo").should be_true 64 @plugin.exist?("jkondo", 0.001).should be_false64 @plugin.exist?("jkondo", Float::MIN).should be_false 65 65 end 66 66 end
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)