System Security Level: 0.8
Name: Frey Jorgurand (laid the final blow)
Ship Type: Punisher
Security Status: 0.1
Weapon Type: Dual Light Pulse Laser I
parsing would be helpful.
I’d start with something like
class Thing
attr_accessor :alliance, :corporation
def initialize(alliance, corporation) @alliance = alliance @corporation = corporation
end
end
class Victim < Thing
attr_accessor :dest_type, :solar_system, :sec_level
Victim: im187
Alliance: Unknown
Corporation: Rebellion Corp
Destroyed Type: Ferox
Solar System: Polfaly
System Security Level: 0.8
You should be able to pretty easily chunk it out into blocks like this,
then you might notice that
it looks a little like … valid YAML! Try feeding the above block of
text to YAML.load, I think you’ll
find the results convenient (for kicks also try YAML.load(svn info)
in a subversion repository).
Involved parties:
Of course you will have to separate the blocks, because that one isn’t
valid YAML, and the blocks
below repeat, but it should be pretty simple to handle.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.