ruby14kyoto
14th Ruby Kansai Workshop
Event Page (in japanese)
New place – now the usual computer lab. We are devided in groups – A,B,C etc. Hm, maybe some team working ahead ;)
I decided to change my usual way of taking notes (gedit ;)) and installed JunebugWiki + litespeed on my notebook. Pretty cool – notes powered by textile.
The world of Ruby
Hm, maybe the title of the lesson is not right.
Nishimoto-san (keisuken)
Always using some java-powered presentation tool.
What is Ruby?
What exactly is Ruby – interpreter? compiler?
using virtual mchine
JIT AOT
Ruby can run several application inside one VM? (no sandboxes?)
C Ruby
YARV
Still not ready – maybe after 1-2 years
JRuby
Using Java VM. parsing parse.y from inside Ruby sources. Ruby 1.8 compatible. Maybe J2EE+RoR will be good for the enterprise.
xruby
http://code.google.com/p/xruby/
Using Java VM. Have compiler and runtime. Ruby 1.8 compatible. Need to compile the code every time (what for scripts?)
Rubinius – Evan Phoenix
http://blog.fallingsnow.net/rubinius/
BSD Licence. written in C, bytecode compiler and interpreter. Smalltalk bulebook. Very small runtime – for embedded systems?
RubyCLR – John Lam
MIT license, Windows .NET framework, C++ → .NET bridge. CLR is .NET VM.
Benchmark
Several basic algorithms – count,compare,array,fib
YARV is good and quick. Already in the trunk(1.9). Maybe there will be JRuby release in february?
The libraries are important. Cool and easy to use, if possible ;) Problematic/missing libs in Ruby: GUI, Multimedia But if you search – there is a lot already done: Ruby/Tk, Ruby-GNOME2 etc. Where to found them: RAA, sf.net, rubyforge etc.
Questions
Ruby on top Parot? (Perl is doing this)
Plagger meets Ruby
yhara-san (Yataka Hara) Ruby/SDL starter kit, Down! game (there was 2ch annonce
manga-like dialogs with cute girl hahahaha – japanese style
What is Plagger
automatic RSS information getting (aggregator)
input-process-output example: blog_rss – process – announce to IRC example: Ruby site (ruby-lang) – find news and send them to gmail
Internals
YAML config: global and plugins sectionsglobal: ... plugins: module: .... (input) module: .... (process) module: .... (output)Automation via cron. Plagger plugins are in Perl. Pipe between plagger and ruby. $stdin and $stdout
Plagger - (pipe with text data) - $stdin Ruby $stdout - (pipe with text) - Plagger
Plugins
CustomFeed::Script, Filter::Pipe, Filter::RubyMan, Filter::Tateyomi, Publish::Pipe
Plagger only working with title and links, no other RSS elements
Plagger installation
cpan:>force install Plagger
Questions
PRagger – system in pure ruby, plugins in ruby plagger.rb – just call plagger from the command linesystem "plagger ..."
Lightning talk
okkez-san
ruby/tk what is the topic? – ruby documentation? who is sheepman?
kazuhiko-san
letmesee+royal-fpw: Using electronic dictionary data from the browser (HTML output)
what is letmesee?
- EB library – C library for dictionaries, EPWING format (JISX0208) of data
- RubyEB library – using EB from Ruby (also in C)
- letmesee – CGI using RubyEB
- bookmarklet (JavaScript)
what is royal-fpw? FreePWING – software for creating EPWING cdroms with data? written in Perl
No need to be expert in every language – perl, c etc. Just try. Happy hacking!
Beginners Lesson #11 – okkez-san
irb basic usage, irb config customize, debug with irb
okkez-san, sakai-san (konami-san student)
What is irb?
interactive shell, come by default with ruby
there is something named irbsh.irb(main):001:0> '%03d' %1 => "001" irb(main):002:0> '%*s' %[10,'aaa'] => " aaa" irb(main):003:0> 'a' *20 => "aaaaaaaaaaaaaaaaaaaa"
Type of prompts: XMP, DEFAULT, NULL, CLASSIC, SIMPLE, INF_RUBY (when using irb in emacs mode)
IRB/conf[:PROMPT] =
{:XMP =>
{:PROMPT_I => nil,
...
on *nix: ~/.irbrc
interesting .irbrc
def ri(*args)
puts `ri "#{args.join(' ')}"`
end
IRB.conf[:EVAL_HISTORY] = 1000
require 'irb/completion'
# history
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
require 'pp'
require 'yaml'
The difference between load ”..” and require ”..” : load rereading the file, if it is changed. load is mostly for config files.
Other usages
rails script/console, iar (interactive active record), irbdb
irb subsession
type irb from the irb:# subsession irb(main):001:0> irb irb#1(main):001:0> jobs => #0->irb on main (#<Thread:0xb7d29748>: stop) #1->irb#1 on main (#<Thread:0xb7b99e40>: running) # send an object irb(main):002:0> irb Array irb#1(Array):001:0> def hoge irb#1(Array):002:1> puts 'Hoge' irb#1(Array):003:1> end => nil irb#1(Array):004:0> [].hoge Hoge => nil