Added exceptions and logger
authorNeil Smith <neil.github@njae.me.uk>
Wed, 18 Jul 2012 08:01:29 +0000 (09:01 +0100)
committerNeil Smith <neil.github@njae.me.uk>
Wed, 18 Jul 2012 08:01:29 +0000 (09:01 +0100)
.gitignore
lib/erd_handler/exceptions.rb [new file with mode: 0644]
lib/erd_handler/logger.rb [new file with mode: 0644]

index 63a685ebda4ffd6d68cfe485ed1f4555856f6b98..86282428b15149a90373005e0590c4fa36b83980 100644 (file)
@@ -14,6 +14,12 @@ doc
 # jeweler generated
 pkg
 
+# simplecov
+coverage
+
+# log files
+.log
+
 # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore: 
 #
 # * Create a file at ~/.gitignore
diff --git a/lib/erd_handler/exceptions.rb b/lib/erd_handler/exceptions.rb
new file mode 100644 (file)
index 0000000..ec38c4d
--- /dev/null
@@ -0,0 +1,3 @@
+module ErdHandler
+  class InvalidErdFile < ArgumentError; end;
+end
\ No newline at end of file
diff --git a/lib/erd_handler/logger.rb b/lib/erd_handler/logger.rb
new file mode 100644 (file)
index 0000000..2665077
--- /dev/null
@@ -0,0 +1,6 @@
+module ErdHandler
+  #$ERD_LOGGER = Logger.new(STDERR)
+  $ERD_LOGGER = Logger.new('erd.log')
+  #$ERD_LOGGER.level = Logger::WARN
+  $ERD_LOGGER.level = Logger::DEBUG
+end