neography 1.3.0 → 1.3.1

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: c6478336dc213df2da26cfd9db4c8814222ea162
4
- data.tar.gz: 7d94c3529e2e0464108f16cfa58887db58b00940
3
+ metadata.gz: bea6a486eea4764972a7cc858acf46dfc65a7dfb
4
+ data.tar.gz: 81af1a37e6eddc6b454a1828aac084ff44e5060a
5
5
  SHA512:
6
- metadata.gz: 2435540bf31595f410aab104dd8d3d3d848cb45b03daee4d2d45233fd886234bc4de048221f5dadb6caf50452b291b83126854837072ead1d15e2444bd5ddc0d
7
- data.tar.gz: 8e9590e796a496cf69c1c4cf11c298a67dd602ab79d8fd9a3a1ec2c7912d6df433940ff6527e9593f378f84a0da620e94faab524ba5a01fa464ebc4edb7376f8
6
+ metadata.gz: cd4029c994e048e260d520aafff6c66c80c92238ea64594d11e45fd1f8c9968ab333009464aa74073177287441e02a8bebbdff9c847fafc353c2c746633f13e9
7
+ data.tar.gz: 46fd0ab7860c0f15b6db0600c0cf728fd82c4e69736a397c61c9c13aecae673f600a3c5e4255067c00e1e6d68565fcd48223f3da72b5b39eb625d2c4ec80e8ea
@@ -18,6 +18,7 @@ module Neography
18
18
  @client = HTTPClient.new
19
19
  @client.send_timeout = 1200 # 10 minutes
20
20
  @client.receive_timeout = 1200
21
+ authenticate
21
22
  end
22
23
 
23
24
  def configure(protocol, server, port, directory)
@@ -42,7 +43,6 @@ module Neography
42
43
  define_method(action) do |path, options = {}|
43
44
  query_path = configuration + path
44
45
  query_body = merge_options(options)[:body]
45
- authenticate(query_path)
46
46
  log path, query_body do
47
47
  evaluate_response(@client.send(action.to_sym, query_path, query_body, merge_options(options)[:headers]))
48
48
  end
@@ -61,7 +61,7 @@ module Neography
61
61
  end
62
62
  end
63
63
 
64
- def authenticate(path)
64
+ def authenticate(path = nil)
65
65
  @client.set_auth(path,
66
66
  @authentication[@authentication.keys.first][:username],
67
67
  @authentication[@authentication.keys.first][:password]) unless @authentication.empty?
@@ -1,3 +1,3 @@
1
1
  module Neography
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
@@ -2,43 +2,35 @@ require 'spec_helper'
2
2
 
3
3
  describe Neography::Rest, :slow => true do
4
4
  describe "basic authentication" do
5
- describe "get_root" do
5
+ describe "get_root", :reference => true do
6
6
  it "can get the root node"do
7
- @neo = Neography::Rest.new({:server => '4c36b641.neo4j.atns.de', :port => 7474, :directory => '/9dc1fda5be8b5cde29621e21cae5adece3de0f37', :authentication => 'basic', :username => "abbe3c012", :password => "34d7b22eb"})
7
+ @neo = Neography::Rest.new({:authentication => 'digest', :username => "username", :password => "password"})
8
8
  root_node = @neo.get_root
9
9
  root_node.should have_key("reference_node")
10
10
  end
11
- end
12
-
11
+ end
12
+
13
13
  describe "create_node" do
14
14
  it "can create an empty node" do
15
- @neo = Neography::Rest.new({:server => '4c36b641.neo4j.atns.de', :port => 7474, :directory => '/9dc1fda5be8b5cde29621e21cae5adece3de0f37', :authentication => 'basic', :username => "abbe3c012", :password => "34d7b22eb"})
15
+ @neo = Neography::Rest.new({:authentication => 'basic', :username => "username", :password => "password"})
16
16
  new_node = @neo.create_node
17
17
  new_node.should_not be_nil
18
18
  end
19
19
  end
20
20
 
21
21
  describe "quick initializer" do
22
- it "can get the root node" do
23
- @neo = Neography::Rest.new("http://abbe3c012:34d7b22eb@4c36b641.neo4j.atns.de:7474/9dc1fda5be8b5cde29621e21cae5adece3de0f37")
24
- root_node = @neo.get_root
25
- root_node.should have_key("reference_node")
22
+ it "can create an empty node" do
23
+ @neo = Neography::Rest.new("http://username:password@localhost:7474")
24
+ new_node = @neo.create_node
25
+ new_node.should_not be_nil
26
26
  end
27
27
  end
28
28
  end
29
29
 
30
30
  describe "digest authentication" do
31
- describe "get_root" do
32
- it "can get the root node" do
33
- @neo = Neography::Rest.new({:server => '4c36b641.neo4j.atns.de', :port => 7474, :directory => '/9dc1fda5be8b5cde29621e21cae5adece3de0f37', :authentication => 'digest', :username => "abbe3c012", :password => "34d7b22eb"})
34
- root_node = @neo.get_root
35
- root_node.should have_key("reference_node")
36
- end
37
- end
38
-
39
31
  describe "create_node" do
40
32
  it "can create an empty node" do
41
- @neo = Neography::Rest.new({:server => '4c36b641.neo4j.atns.de', :port => 7474, :directory => '/9dc1fda5be8b5cde29621e21cae5adece3de0f37', :authentication => 'digest', :username => "abbe3c012", :password => "34d7b22eb"})
33
+ @neo = Neography::Rest.new({:authentication => 'digest', :username => "username", :password => "password"})
42
34
  new_node = @neo.create_node
43
35
  new_node.should_not be_nil
44
36
  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.0
4
+ version: 1.3.1
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: 2013-12-11 00:00:00.000000000 Z
11
+ date: 2013-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec