From cc304c33f14c5aceb2f6ed1133d64b45ee8546e7 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Wed, 18 Jul 2012 09:01:29 +0100 Subject: [PATCH] Added exceptions and logger --- .gitignore | 6 ++++++ lib/erd_handler/exceptions.rb | 3 +++ lib/erd_handler/logger.rb | 6 ++++++ 3 files changed, 15 insertions(+) create mode 100644 lib/erd_handler/exceptions.rb create mode 100644 lib/erd_handler/logger.rb diff --git a/.gitignore b/.gitignore index 63a685e..8628242 100644 --- a/.gitignore +++ b/.gitignore @@ -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 index 0000000..ec38c4d --- /dev/null +++ b/lib/erd_handler/exceptions.rb @@ -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 index 0000000..2665077 --- /dev/null +++ b/lib/erd_handler/logger.rb @@ -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 -- 2.34.1