# # rubykaigi.rb: make badges of RubyKaigi. # # usage: <%= rubykaigi 'role', 'size' %> # role: attendee (default), speaker, sponsor, staff, committer, individual sponsor, away # size: large(160x160), small(160x90) # # Copyright (C) TADA Tadashi # Distributed under GPL. # def rubykaigi2014( role = 'attendee', size = nil ) r = role.split(/[ _]+/).join('-') s = "@#{h size}" unless size.nil? %Q|RubyKaigi 2014 #{h r}| end def rubykaigi2013( role = 'attendee', size = nil ) r = role.split(/[ _]+/).map{|s| s.capitalize}.join s = "@#{h size}" unless size.nil? %Q|RubyKaigi 2013 #{h r}| end def sappororubykaigi2012( role = 'attendee' ) r = role.split(/[ _]+/).map{|s| s.capitalize}.join %Q|SapporoRubyKaigi 2012 #{h r}| end def kansairubykaigi04( role = 'attendee' ) badges = { 'attendee' => "attendee_taiyou", 'speaker' => "speaker_shika", 'staff' => "staff_daibutsu" } %Q|KansaiRubyKaigi04 #{h role.capitalize}| end def rubykaigi2011( role = 'attendee', size = 'large' ) badges = Hash::new( 'attendee' ).update({ 'committer' => 'committer', 'individual sponsor' => 'individualSponsor', 'sponsor' => 'sponsor', 'staff' => 'staff', 'speaker' => 'speaker', 'attendee' => 'attendee', 'away' => 'attendeeAway' }) width, height = size == 'large' ? ['160','160'] : ['160', '90'] %Q|RubyKaigi2010 #{h role.capitalize}| end alias :rubykaigi :rubykaigi2011 #----- OLD EDITIONS -----# def sappororubykaigi03( role = 'attendee' ) %Q|badge_#{h role}.gif| end def rubykaigi2010( role = 'attendee' ) badges = Hash::new( 'attendee' ).update({ 'committer' => 'committer', 'individual sponsor' => 'individual_sponsor', 'sponsor' => 'sponsor', 'staff' => 'staff', 'speaker' => 'speaker', 'attendee' => 'attendee', 'away' => 'away' }) %Q|RubyKaigi2010 #{h role.capitalize}| end def rubykaigi2009( role = 'attendee' ) %Q|
RubyKaigi2009#{h role.capitalize}
| end def rubykaigi2008( role = 'attendee' ) img = case role when 'speaker' 1 when 'sponsor' 2 when 'staff' 3 else role = 'attendee' 0 end %Q|
RubyKaigi2008#{h role.capitalize}
| end def sappororubykaigi02( role = 'attendee' ) %Q|
SapporoRubyKaigi02#{h role.capitalize}
| end # Local Variables: # mode: ruby # indent-tabs-mode: t # tab-width: 3 # ruby-indent-level: 3 # End: # vim: ts=3