neo4apis 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/neo4apis/base.rb +1 -1
- data/lib/neo4apis/cli/base.rb +6 -0
- data/lib/neo4apis/query_buffer.rb +3 -9
- data/neo4apis.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fedf11c93ff329de09c8c6e529ffd4612fb743d6
|
4
|
+
data.tar.gz: 786710564e9b2a4c21807e9492d73b5cd7933156
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b36a2e013ecf99bc50334181ffc03dc22ede8c2a8abcacf47b4f05398ab533dc261e3be1e5aff9566afdc930ef3c6668fb088a800965ce13b18fa0e5385b9c92
|
7
|
+
data.tar.gz: c1876201d6fe0291f3d1236eca33fbb60bbbdce74d9b61f14696e01d0f37911a013521b907dde3ae794fe6485eb60a84c5af55ef7615ee124668f0d33776bdc3
|
data/lib/neo4apis/base.rb
CHANGED
data/lib/neo4apis/cli/base.rb
CHANGED
@@ -2,6 +2,12 @@ module Neo4Apis
|
|
2
2
|
module CLI
|
3
3
|
class Base < ::Thor
|
4
4
|
class_option :neo4j_url, type: :string, default: 'http://localhost:7474'
|
5
|
+
class_option :neo4j_username, type: :string
|
6
|
+
class_option :neo4j_password, type: :string
|
7
|
+
|
8
|
+
def neo4j_session
|
9
|
+
Neo4j::Session.open(:server_db, options[:neo4j_url], basic_auth: {username: options[:neo4j_username], password: options[:neo4j_password]})
|
10
|
+
end
|
5
11
|
end
|
6
12
|
end
|
7
13
|
end
|
@@ -5,12 +5,7 @@ module Neo4Apis
|
|
5
5
|
@neo4j_session = neo4j_session
|
6
6
|
@flush_size = flush_size
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
@faraday_connection = Faraday.new(:url => "#{uri.scheme}://#{uri.host}:#{uri.port}") do |faraday|
|
11
|
-
faraday.request :url_encoded # form-encode POST params
|
12
|
-
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
|
13
|
-
end
|
8
|
+
@faraday_connection = @neo4j_session.connection
|
14
9
|
|
15
10
|
super()
|
16
11
|
end
|
@@ -46,9 +41,8 @@ module Neo4Apis
|
|
46
41
|
if response.status != 200
|
47
42
|
fail "ERROR: response status #{response.status}:\n#{response.body}"
|
48
43
|
else
|
49
|
-
|
50
|
-
|
51
|
-
error_string = response_data['errors'].map do |error|
|
44
|
+
if response.body[:errors].size > 0
|
45
|
+
error_string = response.body[:errors].map do |error|
|
52
46
|
[error['code'], error['message']].join("\n")
|
53
47
|
end.join("\n\n")
|
54
48
|
|
data/neo4apis.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.unshift lib unless $:.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "neo4apis"
|
6
|
-
s.version = '0.
|
6
|
+
s.version = '0.8.0'
|
7
7
|
s.required_ruby_version = ">= 1.9.1"
|
8
8
|
|
9
9
|
s.authors = "Brian Underwood"
|
@@ -22,7 +22,7 @@ A core library for importing data from APIs into neo4j. Designed to be used wit
|
|
22
22
|
s.executables << 'neo4apis'
|
23
23
|
|
24
24
|
s.add_dependency('faraday', "~> 0.9.0")
|
25
|
-
s.add_dependency("neo4j-core", ">=
|
25
|
+
s.add_dependency("neo4j-core", ">= 4.0.5")
|
26
26
|
s.add_dependency('thor', '~> 0.19.1')
|
27
27
|
s.add_dependency('colorize', '~> 0.7.3')
|
28
28
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4apis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Underwood
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 4.0.5
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 4.0.5
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: thor
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|