module Rounders::Plugins::Pluggable::ClassMethods

Public Instance Methods

directory_name() click to toggle source
# File lib/rounders/plugins/pluggable.rb, line 21
def directory_name
  @directory_name ||= Util.infrect(feature_name.split('_').first).pluralize
end
feature_name() click to toggle source
# File lib/rounders/plugins/pluggable.rb, line 13
def feature_name
  @feature_name ||= begin
    name_spaces = name.to_s.split('::')
    class_name = name_spaces.last
    Rounders::Util.infrect(class_name).underscore
  end
end
load_path() click to toggle source
# File lib/rounders/plugins/pluggable.rb, line 29
def load_path
  @load_path ||= File.join(Rounders::APP_PATH, directory_name)
end
load_plugins() click to toggle source
# File lib/rounders/plugins/pluggable.rb, line 33
def load_plugins
  Pathname.glob("#{load_path}/**/*.rb").each do |plugin|
    begin
      Rounders.logger.info "load #{plugin.expand_path}"
      require_relative plugin.expand_path
    rescue => e
      Rounders.logger.error e
    end
  end
end
symbol() click to toggle source
# File lib/rounders/plugins/pluggable.rb, line 25
def symbol
  Util.infrect(name.split('::').last).underscore.to_sym
end