neography 1.5.2 → 1.6.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: 89f4b73b7076509662fa63dcd258140246c1eba9
4
- data.tar.gz: c7d4f53d9ab25de8d6c1e392387581b667cb4688
3
+ metadata.gz: 43f8b62b22553c1f708d41329413b6a111632aa8
4
+ data.tar.gz: 9125641aee1bcd52bcaa82576138c19302312357
5
5
  SHA512:
6
- metadata.gz: ee4def6fd87563f802e9019f43b808525c6d9a13d2d137613b587c37cbd714cb832d0fb243702c0b3a9f53009b71f8c743820a88ef27b58f16a21e330360f631
7
- data.tar.gz: 0c63606246d769a7af6e45eb3fe44903994e6a201514e27d56807da6953dc7a3267c3b5f96a9bdce2a6f2f51ff5f0a6aeaf6ada15fe961edc03584a2d032d2cc
6
+ metadata.gz: 51bab8d2105cedfa26e7b27c2c71a8dc9b52387ce3187ab34bf0b068cdcde4e26d7a7191b493051657b7850b61582a0fb92be9cf2a4dd08e634a601aa06245de
7
+ data.tar.gz: a21caf2565507a07421d8b63b0ca2187280378d3c485d361142bd7dbdcbd8104439510e110e8b83daab68f1e4bc6b994c5c0e5439131c55cdab4f929b92e45e7
@@ -7,7 +7,8 @@ module Neography
7
7
  :max_threads,
8
8
  :authentication, :username, :password,
9
9
  :parser, :max_execution_time,
10
- :proxy, :http_send_timeout, :http_receive_timeout
10
+ :proxy, :http_send_timeout, :http_receive_timeout,
11
+ :persistent
11
12
 
12
13
  def initialize
13
14
  set_defaults
@@ -33,7 +34,8 @@ module Neography
33
34
  :max_execution_time => @max_execution_time,
34
35
  :proxy => @proxy,
35
36
  :http_send_timeout => @http_send_timeout,
36
- :http_receive_timeout => @http_receive_timeout
37
+ :http_receive_timeout => @http_receive_timeout,
38
+ :persistent => @persistent
37
39
  }
38
40
  end
39
41
 
@@ -58,7 +60,7 @@ module Neography
58
60
  @proxy = nil
59
61
  @http_send_timeout = 1200
60
62
  @http_receive_timeout = 1200
61
- end
62
-
63
+ @persistent = true
64
+ end
63
65
  end
64
66
  end
@@ -19,7 +19,7 @@ module Neography
19
19
  @client ||= Excon.new(config[:proxy] || "#{@protocol}#{@server}:#{@port}",
20
20
  :read_timeout => config[:http_receive_timeout],
21
21
  :write_timeout => config[:http_send_timeout],
22
- :persistent => true,
22
+ :persistent => config[:persistent],
23
23
  :user => config[:username],
24
24
  :password => config[:password])
25
25
  #authenticate
@@ -3,10 +3,6 @@ module Neography
3
3
  # == This mixin is used for both nodes and relationships to decide if two entities are equal or not.
4
4
  #
5
5
  module Equal
6
- def equal?(o)
7
- eql?(o)
8
- end
9
-
10
6
  def eql?(o)
11
7
  return false unless o.respond_to?(:neo_id)
12
8
  o.neo_id == neo_id
@@ -18,9 +18,10 @@ module Neography
18
18
  else
19
19
  data = []
20
20
  end
21
-
22
- for k,v in data
23
- new_ostruct_member(k.to_sym, v)
21
+ unless data.nil?
22
+ for k,v in data
23
+ new_ostruct_member(k.to_sym, v)
24
+ end
24
25
  end
25
26
  end
26
27
 
@@ -6,7 +6,7 @@ require 'net/http'
6
6
  namespace :neo4j do
7
7
  desc "Install Neo4j"
8
8
  task :install, :edition, :version do |t, args|
9
- args.with_defaults(:edition => "community", :version => "2.0.3")
9
+ args.with_defaults(:edition => "community", :version => "2.1.3")
10
10
  puts "Installing Neo4j-#{args[:edition]}-#{args[:version]}"
11
11
 
12
12
  if OS::Underlying.windows?
@@ -1,3 +1,3 @@
1
1
  module Neography
2
- VERSION = "1.5.2"
2
+ VERSION = "1.6.0"
3
3
  end
data/neography.gemspec CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.add_development_dependency "coveralls"
26
26
  s.add_development_dependency "debugger"
27
27
  s.add_development_dependency "guard-rspec"
28
- s.add_dependency "excon", "~> 0.33.0"
28
+ s.add_dependency "excon", ">= 0.33.0"
29
29
  s.add_dependency "json", ">= 1.7.7"
30
30
  s.add_dependency "os", ">= 0.9.6"
31
31
  s.add_dependency "rubyzip", ">= 1.0.0"
@@ -121,12 +121,6 @@ describe Neography::Node do
121
121
  end
122
122
 
123
123
  describe "equality" do
124
- it "can tell two nodes are the same with equal?" do
125
- new_node = Neography::Node.create
126
- another_node = Neography::Node.load(new_node)
127
- expect(new_node.equal?(another_node)).to be true
128
- end
129
-
130
124
  it "can tell two nodes are the same with eql?" do
131
125
  new_node = Neography::Node.create
132
126
  another_node = Neography::Node.load(new_node)
@@ -102,6 +102,11 @@ module Neography
102
102
  it { should == 1200 }
103
103
  end
104
104
 
105
+ describe '#persistent' do
106
+ subject { super().persistent }
107
+ it { should == true }
108
+ end
109
+
105
110
 
106
111
  it "has a hash representation" do
107
112
  expected_hash = {
@@ -123,7 +128,8 @@ module Neography
123
128
  :max_execution_time => 6000,
124
129
  :proxy => nil,
125
130
  :http_send_timeout => 1200,
126
- :http_receive_timeout => 1200
131
+ :http_receive_timeout => 1200,
132
+ :persistent => true
127
133
 
128
134
  }
129
135
  expect(config.to_hash).to eq(expected_hash)
@@ -79,6 +79,25 @@ module Neography
79
79
  connection
80
80
  end
81
81
  end
82
+
83
+ context "persistent" do
84
+ let(:persistent) { double(:persistent)}
85
+ let(:options) do
86
+ {
87
+ :persistent => false
88
+ }
89
+ end
90
+
91
+ it 'configures persistent' do
92
+ expect(Excon).to receive(:new).with("http://localhost:7474",
93
+ :read_timeout => 1200,
94
+ :write_timeout => 1200,
95
+ :persistent => false,
96
+ :user => nil,
97
+ :password => nil).and_return(persistent)
98
+ connection
99
+ end
100
+ end
82
101
  end
83
102
 
84
103
 
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.5.2
4
+ version: 1.6.0
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-06-17 00:00:00.000000000 Z
11
+ date: 2014-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -84,14 +84,14 @@ dependencies:
84
84
  name: excon
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: 0.33.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.33.0
97
97
  - !ruby/object:Gem::Dependency