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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89023a93271f59dea6fa05a98b70f459bf4d6b26
4
- data.tar.gz: 82c4afb82a045d86f231d2330591c512fc11afb5
3
+ metadata.gz: fedf11c93ff329de09c8c6e529ffd4612fb743d6
4
+ data.tar.gz: 786710564e9b2a4c21807e9492d73b5cd7933156
5
5
  SHA512:
6
- metadata.gz: 135b1f1188780828302371977b930b40778460d29d6d6b66f188d3c61d10bbb92d8fbf7bdcf047282d2e7ae38ee242c23de5b5fb186b07ba2f78f24b31c60bfb
7
- data.tar.gz: 4cb5e535fe4c08e479b92cd2a9c300ec3909a59a59fce3ae1cdc63228eb782461fa8af07df3d1fe4037ecd33f78fe2d6766c8413cc63868f66f7477cf5e9140b
6
+ metadata.gz: b36a2e013ecf99bc50334181ffc03dc22ede8c2a8abcacf47b4f05398ab533dc261e3be1e5aff9566afdc930ef3c6668fb088a800965ce13b18fa0e5385b9c92
7
+ data.tar.gz: c1876201d6fe0291f3d1236eca33fbb60bbbdce74d9b61f14696e01d0f37911a013521b907dde3ae794fe6485eb60a84c5af55ef7615ee124668f0d33776bdc3
@@ -154,7 +154,7 @@ QUERY
154
154
 
155
155
  def set_attributes(var, properties)
156
156
  properties.map do |property|
157
- "#{var}.#{property} = {props}.#{property}"
157
+ "#{var}.`#{property}` = {props}.`#{property}`"
158
158
  end.join(', ')
159
159
  end
160
160
 
@@ -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
- uri = URI.parse(@neo4j_session.resource_url)
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
- response_data = JSON.parse(response.body)
50
- if response_data['errors'].size > 0
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
 
@@ -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.7.1'
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", ">= 3.0")
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.7.1
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-02-20 00:00:00.000000000 Z
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: '3.0'
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: '3.0'
40
+ version: 4.0.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: thor
43
43
  requirement: !ruby/object:Gem::Requirement