lib/sym.rb in sym-2.2.1 vs lib/sym.rb in sym-2.3.0
- old
+ new
@@ -30,11 +30,13 @@
}
}
end
-
+require 'sym/extensions/stdlib'
+require 'sym/extensions/class_methods'
+require 'sym/extensions/instance_methods'
#
# == Using Sym Library
#
# This library is a "wrapper" that allows you to take advantage of the
# symmetric encryption functionality provided by the {OpenSSL} gem (and the
@@ -92,27 +94,11 @@
# +#private_key+ method on the class that includes the +Sym+ module.
#
# Each class including the +Sym+ module would get their own +#private_key#
# class-instance variable accessor, and a possible value.
#
-# For example:
-#
-#
-module Kernel
- def require_dir(___dir)
- @___dir ||= File.dirname(__FILE__)
- # require files using a consistent order based on the dir/file name.
- # this should be OS-neutral
- Dir["#{@___dir}/#{___dir}/*.rb"].sort.each do |___file|
- require(___file)
- end
- end
-end
-
-require_dir 'sym/extensions'
-
module Sym
def self.included(klass)
klass.instance_eval do
include ::Sym::Extensions::InstanceMethods
extend ::Sym::Extensions::ClassMethods
@@ -131,10 +117,11 @@
end
end
COMPLETION_FILE = '.sym.completion'.freeze
COMPLETION_PATH = "#{ENV['HOME']}/#{COMPLETION_FILE}".freeze
- LOGGER = Logger.new(nil).freeze # empty logger
+ NIL_LOGGER = Logger.new(nil).freeze # empty logger
+ LOGGER = Logger.new(STDOUT).freeze
ENV_ARGS_VARIABLE_NAME = 'SYM_ARGS'.freeze
BASH_COMPLETION = {
file: File.expand_path('../../bin/sym.completion', __FILE__),
script: "[[ -f '#{COMPLETION_PATH}' ]] && source '#{COMPLETION_PATH}'",