use Common::Exceptions
arnaud sellenet
committed Apr 14, 2014
commit 679a4d487930ef796f0c52ff716dce6e88706207
Showing 3
changed files with
4 additions
and 13 deletions
locomotive/wagon.rb b/lib/locomotive/wagon.rb
+1
-4
| @@ | @@ -1,7 +1,5 @@ |
| require 'locomotive/wagon/version' | |
| require 'locomotive/wagon/logger' | |
| - | require 'locomotive/wagon/exceptions' |
| - | |
| module Locomotive | |
| module Wagon | |
| @@ | @@ -74,7 +72,6 @@ module Locomotive |
| # | |
| def self.generate(name, *args) | |
| Bundler.require 'misc' | |
| - | binding.pry |
| lib = "locomotive/wagon/generators/#{name}" | |
| require lib | |
| @@ | @@ -195,7 +192,7 @@ module Locomotive |
| reader.run!(path: path) | |
| reader | |
| rescue Exception => e | |
| - | raise Locomotive::Wagon::MounterException.new "Unable to read the local LocomotiveCMS site. Please check the logs.", e |
| + | raise Locomotive::Common::MounterException.new "Unable to read the local LocomotiveCMS site. Please check the logs.", e |
| end | |
| end | |
| end | |
locomotive/wagon/logger.rb b/lib/locomotive/wagon/logger.rb
+2
-9
| @@ | @@ -2,7 +2,6 @@ module Locomotive |
| module Wagon | |
| class Logger | |
| - | |
| attr_accessor :logger, :logfile_path, :stdout | |
| def initialize | |
| @@ | @@ -40,15 +39,9 @@ module Locomotive |
| self.instance.setup(path, stdout) | |
| end | |
| - | class << self |
| - | %w(debug info warn error fatal unknown).each do |name| |
| - | define_method(name) do |message| |
| - | self.instance.logger.send(name.to_sym, message) |
| - | end |
| - | end |
| + | def method_missing method, *args |
| + | self.logger.send method, args |
| end | |
| - | |
| end | |
| - | |
| end | |
| end | |
| \ No newline at end of file | |
locomotivecms_wagon.gemspec
+1
-0
| @@ | @@ -27,6 +27,7 @@ Gem::Specification.new do |gem| |
| gem.add_dependency 'locomotivecms_mounter', '~> 1.4.0' | |
| gem.add_dependency 'locomotivecms_steam', '~> 0.1.0' | |
| gem.add_dependency 'locomotivecms_common', '~> 0.0.1' | |
| + | gem.add_dependency 'better_errors', '~> 1.0' |
| gem.add_dependency 'faker', '~> 0.9.5' | |