lib/fusuma/plugin/manager.rb in fusuma-2.0.0.pre vs lib/fusuma/plugin/manager.rb in fusuma-2.0.0.pre2
- old
+ new
@@ -1,9 +1,9 @@
# frozen_string_literal: true
-require 'pathname'
-require_relative '../multi_logger.rb'
+require_relative '../multi_logger'
+require_relative '../string_support'
module Fusuma
module Plugin
# Manage Fusuma plugins
class Manager
@@ -56,18 +56,18 @@
manager.require_siblings_from_plugin_dir
manager.require_siblings_from_gems
end
def require_base_plugins
- require_relative './base.rb'
- require_relative './events/event.rb'
- require_relative './inputs/input.rb'
- require_relative './filters/filter.rb'
- require_relative './parsers/parser.rb'
- require_relative './buffers/buffer.rb'
- require_relative './detectors/detector.rb'
- require_relative './executors/executor.rb'
+ require_relative './base'
+ require_relative './events/event'
+ require_relative './inputs/input'
+ require_relative './filters/filter'
+ require_relative './parsers/parser'
+ require_relative './buffers/buffer'
+ require_relative './detectors/detector'
+ require_relative './executors/executor'
end
def plugins
@plugins ||= {}
end
@@ -86,25 +86,7 @@
plugins[base].include?(plugin_class)
end
end
end
- end
-end
-
-# support camerize and underscore
-class String
- def camerize
- split('_').map do |w|
- w[0].upcase!
- w
- end.join
- end
-
- def underscore
- gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
- .gsub(/([a-z\d])([A-Z])/, '\1_\2')
- .gsub('::', '/')
- .tr('-', '_')
- .downcase
end
end