From 97f898e674a3547c739b177ed626810f4c377b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20B=C3=B6ttger?= Date: Fri, 3 May 2013 23:48:12 +0200 Subject: [PATCH] don't repeat yourself --- lib/aasm.rb | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/aasm.rb b/lib/aasm.rb index 5059104..0a0c370 100644 --- a/lib/aasm.rb +++ b/lib/aasm.rb @@ -1,17 +1,18 @@ require 'ostruct' -# TODO shorten this [thorsten, 2011-12-20] -require File.join(File.dirname(__FILE__), 'aasm', 'version') -require File.join(File.dirname(__FILE__), 'aasm', 'errors') -require File.join(File.dirname(__FILE__), 'aasm', 'base') -require File.join(File.dirname(__FILE__), 'aasm', 'instance_base') -require File.join(File.dirname(__FILE__), 'aasm', 'transition') -require File.join(File.dirname(__FILE__), 'aasm', 'event') -require File.join(File.dirname(__FILE__), 'aasm', 'state') -require File.join(File.dirname(__FILE__), 'aasm', 'localizer') -require File.join(File.dirname(__FILE__), 'aasm', 'state_machine') -require File.join(File.dirname(__FILE__), 'aasm', 'persistence') -require File.join(File.dirname(__FILE__), 'aasm', 'aasm') +%w( + version + errors + base + instance_base + transition + event + state + localizer + state_machine + persistence + aasm + ).each { |file| require File.join(File.dirname(__FILE__), 'aasm', file) } # load the deprecated methods and modules Dir[File.join(File.dirname(__FILE__), 'aasm', 'deprecated', '*.rb')].sort.each { |f| require File.expand_path(f) }