neography 1.3.10 → 1.3.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/neography/config.rb +5 -2
- data/lib/neography/connection.rb +5 -3
- data/lib/neography/errors.rb +4 -0
- data/lib/neography/version.rb +1 -1
- data/spec/unit/config_spec.rb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4089edb953cf8a75450a374587509e36a7ebc2cb
|
4
|
+
data.tar.gz: 23729f4789ae38f437570cc3cb40bd81a07159e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 838825f354af0d739a24aac78a89afa1a9c95d733460ba7a59ab18fd27e182cc445b736686bffcbdbb69e035b1c4a39e47ee3139d6164795099d2a3e3a0744f3
|
7
|
+
data.tar.gz: a656969ff18920af8302a87ac33b7f89e130d7e813ae2c091edbaf0c6799d667001cba24c0b972e81af07a02e280b5e32fc24b3d9a4e23c5b325e158141f38c6
|
data/lib/neography/config.rb
CHANGED
@@ -6,7 +6,8 @@ module Neography
|
|
6
6
|
:log_file, :log_enabled, :logger, :slow_log_threshold,
|
7
7
|
:max_threads,
|
8
8
|
:authentication, :username, :password,
|
9
|
-
:parser, :max_execution_time
|
9
|
+
:parser, :max_execution_time,
|
10
|
+
:proxy
|
10
11
|
|
11
12
|
def initialize
|
12
13
|
set_defaults
|
@@ -29,7 +30,8 @@ module Neography
|
|
29
30
|
:username => @username,
|
30
31
|
:password => @password,
|
31
32
|
:parser => @parser,
|
32
|
-
:max_execution_time => @max_execution_time
|
33
|
+
:max_execution_time => @max_execution_time,
|
34
|
+
:proxy => @proxy
|
33
35
|
}
|
34
36
|
end
|
35
37
|
|
@@ -51,6 +53,7 @@ module Neography
|
|
51
53
|
@password = nil
|
52
54
|
@parser = MultiJsonParser
|
53
55
|
@max_execution_time = 6000
|
56
|
+
@proxy = nil
|
54
57
|
end
|
55
58
|
|
56
59
|
end
|
data/lib/neography/connection.rb
CHANGED
@@ -10,12 +10,13 @@ module Neography
|
|
10
10
|
:log_file, :log_enabled, :logger, :slow_log_threshold,
|
11
11
|
:max_threads,
|
12
12
|
:authentication, :username, :password,
|
13
|
-
:parser, :client
|
13
|
+
:parser, :client,
|
14
|
+
:proxy
|
14
15
|
|
15
16
|
def initialize(options = ENV['NEO4J_URL'] || {})
|
16
17
|
config = merge_configuration(options)
|
17
18
|
save_local_configuration(config)
|
18
|
-
@client = HTTPClient.new
|
19
|
+
@client = HTTPClient.new(config[:proxy])
|
19
20
|
@client.send_timeout = 1200 # 10 minutes
|
20
21
|
@client.receive_timeout = 1200
|
21
22
|
authenticate
|
@@ -101,6 +102,7 @@ module Neography
|
|
101
102
|
@max_threads = config[:max_threads]
|
102
103
|
@parser = config[:parser]
|
103
104
|
@logger = config[:logger]
|
105
|
+
@proxy = config[:proxy]
|
104
106
|
|
105
107
|
@max_execution_time = { 'max-execution-time' => config[:max_execution_time] }
|
106
108
|
@user_agent = { "User-Agent" => USER_AGENT }
|
@@ -190,7 +192,7 @@ module Neography
|
|
190
192
|
message = parsed_body["message"]
|
191
193
|
stacktrace = parsed_body["stacktrace"]
|
192
194
|
|
193
|
-
@logger.error "#{response.dump} error: #{body}
|
195
|
+
@logger.error "#{response.dump} error: #{body}" if @log_enabled
|
194
196
|
raise_errors(code, parsed_body["exception"], message, stacktrace, request, index)
|
195
197
|
end
|
196
198
|
|
data/lib/neography/errors.rb
CHANGED
@@ -12,6 +12,10 @@ module Neography
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
+
def to_s
|
16
|
+
"NeographyError: \n--message: #{@message}, \n--code: #{@code}, \n--stacktrace: #{@stacktrace}, \n--request: #{@request}, \n--index: #{@index}"
|
17
|
+
end
|
18
|
+
|
15
19
|
# HTTP Authentication error
|
16
20
|
class UnauthorizedError < NeographyError; end
|
17
21
|
|
data/lib/neography/version.rb
CHANGED
data/spec/unit/config_spec.rb
CHANGED
@@ -23,6 +23,8 @@ module Neography
|
|
23
23
|
its(:password) { should == nil }
|
24
24
|
its(:parser) { should == MultiJsonParser}
|
25
25
|
its(:max_execution_time) { should == 6000 }
|
26
|
+
its(:proxy) { should == nil }
|
27
|
+
|
26
28
|
|
27
29
|
it "has a hash representation" do
|
28
30
|
expected_hash = {
|
@@ -41,7 +43,8 @@ module Neography
|
|
41
43
|
:username => nil,
|
42
44
|
:password => nil,
|
43
45
|
:parser => MultiJsonParser,
|
44
|
-
:max_execution_time => 6000
|
46
|
+
:max_execution_time => 6000,
|
47
|
+
:proxy => nil
|
45
48
|
}
|
46
49
|
config.to_hash.should == expected_hash
|
47
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neography
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max De Marzi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|