geoff-importer 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -68,18 +68,18 @@ class Geoff
68
68
  @graph_db = if ha_enabled?
69
69
  start_ha_db(db_path)
70
70
  else
71
- start_embedded_db(db_path)
71
+ start_embedded_db(db_path)
72
72
  end
73
73
  end
74
74
 
75
75
  def start_embedded_db(db_path)
76
76
  Geoff.log 'starting embedded database'
77
- EmbeddedDB.new(db_path)
77
+ EmbeddedDB.new(db_path, config)
78
78
  end
79
79
 
80
80
  def start_ha_db(db_path)
81
81
  Geoff.log 'starting ha embedded database'
82
- HaDb.new(db_path, @options)
82
+ HaDb.new(db_path, config)
83
83
  end
84
84
 
85
85
  def ha_enabled?
@@ -112,6 +112,22 @@ class Geoff
112
112
  @invalid.empty?
113
113
  end
114
114
 
115
+ def config
116
+ map = java.util.HashMap.new
117
+ @options.each_pair do |k, v|
118
+ case v
119
+ when TrueClass
120
+ map[k.to_s] = "true"
121
+ when FalseClass
122
+ map[k.to_s] = "false"
123
+ when String, Fixnum, Float
124
+ map[k.to_s] = v.to_s
125
+ # skip list and hash values - not accepted by the Java Neo4j API
126
+ end
127
+ end
128
+ map
129
+ end
130
+
115
131
  def validate_rule(rule)
116
132
  Subgraph.new(Array(rule))
117
133
  nil
@@ -1,5 +1,5 @@
1
1
  class Geoff
2
2
  module Importer
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoff-importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-24 00:00:00.000000000 Z
12
+ date: 2013-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: neo4j-community