Top Level Namespace

Defined Under Namespace

Modules: Neography Classes: Railtie

Constant Summary collapse

DIRECTIONS =
["incoming", "in", "outgoing", "out", "all", "both"]

Instance Method Summary collapse

Instance Method Details

#find_and_require_user_defined_codeObject



1
2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/neography.rb', line 1

def find_and_require_user_defined_code
  extensions_path = ENV['neography_extensions'] || "~/.neography"
  extensions_path = File.expand_path(extensions_path)
  if File.exists?(extensions_path)
    Dir.open extensions_path do |dir|
      dir.entries.each do |file|
        if file.split('.').size > 1 && file.split('.').last == 'rb'
          extension = File.join(File.expand_path(extensions_path), file) 
          require(extension) && puts("Loaded Extension: #{extension}")
        end
      end
    end
  end
end