Rewrite of pysword in ruby.