LibEagle Code Climate

LibEagle is a library for Cadsoft Eagle PCB Design Software. Eagle uses xml based files. This library implements Eagle xml files and converts it to Objects and reverse.




gem 'libeagle'  


$ gem install libeagle


The usage is really simple first you include gem in your file:

require "libeagle"


Parsing eagle files (schematic, board or library) or block of eagle elements (packages, devices, symbols and etc.) you have two options parse from file or string:

eagle = LibEagle::Parser.parseFile(file_name)
 => #<LibEagle::Eagle:0x007fd5ca956738>

or string:

eagle = LibEagle::Parser.parseXML("…")
 => #<LibEagle::Eagle:0x007fd5ca956738>

Hand Crafting:

To Create eagle files with hands or dynamically. Just use as simple objects:

eagle =
# Create a drawing object
eagle.object_drawing =

Setting attributes

eagle.attribute_version = "6.0"

Setting object

eagle.object_drawing =

XML Saving:

After creating, parsing, editing if you want to save file use .saveXML will generate xml code of that object:

eagle =
eagle.attribute_version = "6.0"
 => "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE eagle SYSTEM \"eagle.dtd\">\n<eagle version=\"6.0\">\n</eagle>\n"


  1. Create API DOcs
  2. Optimize source code

Thank you:

  • Martin DeMello (for pointing out how to optimize code)


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request


Copyright (c) 2012 Aurimas Niekis Dual licensed under the MIT license and GPL license.