--- /dev/null
+source "http://rubygems.org"
+# Add dependencies required to use your gem here.
+# Example:
+# gem "activesupport", ">= 2.3.5"
+
+# Add dependencies to develop your gem here.
+# Include everything needed to run rake, tests, features, etc.
+group :development do
+ gem "rspec", "~> 2.6.0"
+ gem "bundler", "~> 1.0.0"
+ gem "rdoc"
+ gem "rake"
+ gem "graph.njae", "0.2.1"
+end
--- /dev/null
+GEM
+ remote: http://rubygems.org/
+ specs:
+ diff-lcs (1.1.2)
+ graph.njae (0.2.1)
+ rake (0.9.2)
+ rdoc (3.7)
+ rspec (2.6.0)
+ rspec-core (~> 2.6.0)
+ rspec-expectations (~> 2.6.0)
+ rspec-mocks (~> 2.6.0)
+ rspec-core (2.6.4)
+ rspec-expectations (2.6.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.6.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ bundler (~> 1.0.0)
+ graph.njae (= 0.2.1)
+ rake
+ rdoc
+ rspec (~> 2.6.0)
--- /dev/null
+# encoding: utf-8
+
+require 'rubygems'
+require 'bundler'
+begin
+ Bundler.setup(:default, :development)
+rescue Bundler::BundlerError => e
+ $stderr.puts e.message
+ $stderr.puts "Run `bundle install` to install missing gems"
+ exit e.status_code
+end
+require 'rake'
+
+require 'rspec/core'
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new(:spec) do |spec|
+ spec.pattern = FileList['spec/**/*_spec.rb']
+end
+
+RSpec::Core::RakeTask.new(:rcov) do |spec|
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.rcov = true
+end
+
+task :default => :spec
+
+require 'rdoc/task'
+RDoc::Task.new do |rdoc|
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "graph.njae #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
--- /dev/null
+module ErdHandler
+ class Box < Vertex
+ def initialize(box_element = nil)
+ super()
+ read(box_element) unless box_element.nil?
+ self
+ end # initialize
+
+ def read(box_element)
+ self.id = box_element.attributes["id"].to_i
+ self.name = box_element.attributes["name"]
+ self.mark = box_element.attributes["mark"].to_f
+
+ self.x = box_element.elements["location"].attributes["x"].to_f
+ self.y = box_element.elements["location"].attributes["y"].to_f
+ self.width = box_element.elements["size"].attributes["width"].to_f
+ self.height = box_element.elements["size"].attributes["height"].to_f
+ self.comment = box_element.elements["comment"].text
+ self
+ end
+
+ end
+end
--- /dev/null
+module ErdHandler
+ class Link < Edge
+ def initialize(link_element = nil, vertices = nil)
+ super()
+ read(link_element, vertices) unless link_element.nil?
+ self
+ end
+
+ def read(link_element, vertices)
+ self.id = link_element.attributes["id"].to_i
+ self.mark = link_element.attributes["mark"].to_f
+
+ end
+ end
+end
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><Drawing
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ name="Untitled" mark="4.5">
+
+<box id="0" name="Unit" mark="0.0">
+ <location x="87.0" y="69.0"/>
+ <size width="80.0" height="40.0"/>
+ <comment></comment>
+</box>
+
+<box id="1" name="Employee" mark="0.0">
+ <location x="326.0" y="72.0"/>
+ <size width="80.0" height="40.0"/>
+ <comment></comment>
+</box>
+
+<link id="0" mark="0.0">
+ <moveableName name="PreparedBy">
+ <point x="236" y="95"/>
+ </moveableName>
+ <converseName name="converseName"/>
+ <box1 id="0"/>
+ <box2 id="1"/>
+ <bendPoints>
+ <point x="127.0" y="89.0"/>
+ <point x="167.0" y="89.5020920502092"/>
+ <point x="246.5" y="90.5"/>
+ <point x="326.0" y="91.4979079497908"/>
+ <point x="366.0" y="92.0"/>
+ </bendPoints>
+ <midMoved value="false"/>
+ <box1EndAdornments blob="Closed" crowsfoot="Yes"/>
+ <box2EndAdornments blob="Open" crowsfoot="No"/>
+ <comment></comment>
+</link>
+</Drawing>
\ No newline at end of file