This is a XML Parser that will parse Aesop's Absence XML data and insert it into any SQL database according to the sequel gem (https://github.com/jeremyevans/sequel)
1.0
Dillinger uses a number of open source projects to work properly:
- [Ruby] - awesome web-based text editor
- [Sequel Gem] - a super fast port of Markdown to JavaScript
- [NokoGiri] - great UI boilerplate for modern web apps
run
$ bundle install
to include two dependencies: 1) gem 'nokogirl'
and 2) gem 'sequel'
$ ruby parser.rb
.
.
$ sqlite3 absencedb [or whatever you want to name the database file here. For example change 49 if necessary]
$ SELECT * FROM absencedata [whatever table name]
You may change the passing variables in lines 49, 52, 55, and 58 to whatever names or file you'd like.
For example:
#creates the database file after each new instance
absence = Absence.new("choose DB Name")
#parses for AesopAbsences.xml or any file
parse = absence.parse('Choose XML file')
#creates table within the database
absence.create_table(:choose_table_name)
#inserts table with data in the database
absence.insert_table(:choose_table_name, parse)