Top Level Namespace

Includes:
Java

Defined Under Namespace

Modules: Neo4jr Classes: JsonPrinter

Instance Method Summary collapse

Instance Method Details

#find_and_require_neo4jr_simpleObject



3
4
5
6
7
8
9
10
11
# File 'lib/neo4jr-social.rb', line 3

def find_and_require_neo4jr_simple
  neo4jr_simple_root = java.lang.System.getProperty('neo4jr.simple') || ENV['neo4jr_simple']
  if neo4jr_simple_root
    $LOAD_PATH.unshift(File.join(neo4jr_simple_root, 'lib'))
  else
    gem 'neo4jr-simple'
  end  
  require 'neo4jr-simple'
end

#find_and_require_user_defined_codeObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/neo4jr-social.rb', line 13

def find_and_require_user_defined_code
  extensions_path = java.lang.System.getProperty('neo4jr.extensions') || ENV['neo4jr_extensions'] || "~/.neo4jr-social"
  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
  else
    puts "No Extensions Found: #{extensions_path}"
  end
end

#logging_properties(log_file, log_level) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
# File 'bin/start-neo4jr-social', line 57

def logging_properties( log_file, log_level )
  temp_file = Tempfile.new 'logging.properties'
  temp_file << <<PROPERTIES
.level = #{log_level}
handlers = java.util.logging.FileHandler
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.pattern   = #{log_file}
PROPERTIES
  temp_file.flush
  temp_file.close
  temp_file.path
end