neography 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,4 +1,4 @@
1
- script: "bundle exec rake neo4j:install['enterprise','1.8'] neo4j:start spec --trace"
1
+ script: "bundle exec rake neo4j:install['enterprise','1.8.1'] neo4j:start spec --trace"
2
2
  language: ruby
3
3
  rvm:
4
4
  - 1.9.3
data/lib/neography.rb CHANGED
@@ -1,18 +1,3 @@
1
- def find_and_require_user_defined_code
2
- extensions_path = ENV['neography_extensions'] || "~/.neography"
3
- extensions_path = File.expand_path(extensions_path)
4
- if File.exists?(extensions_path)
5
- Dir.open extensions_path do |dir|
6
- dir.entries.each do |file|
7
- if file.split('.').size > 1 && file.split('.').last == 'rb'
8
- extension = File.join(File.expand_path(extensions_path), file)
9
- require(extension) && puts("Loaded Extension: #{extension}")
10
- end
11
- end
12
- end
13
- end
14
- end
15
-
16
1
  require 'cgi'
17
2
  require 'httparty'
18
3
  require 'json'
@@ -47,8 +32,6 @@ require 'neography/relationship'
47
32
 
48
33
  require 'neography/railtie' if defined? Rails::Railtie
49
34
 
50
- find_and_require_user_defined_code
51
-
52
35
  module Neography
53
36
 
54
37
  def self.configure
@@ -11,10 +11,12 @@ module Neography
11
11
  key = key.to_sym
12
12
  k_str = key.to_s
13
13
  if value.nil?
14
- if self.is_a? Neography::Node
15
- neo_server.remove_node_properties(self.neo_id, [k_str])
16
- else
17
- neo_server.remove_relationship_properties(self.neo_id, [k_str])
14
+ unless @table[key].nil?
15
+ if self.is_a? Neography::Node
16
+ neo_server.remove_node_properties(self.neo_id, [k_str])
17
+ else
18
+ neo_server.remove_relationship_properties(self.neo_id, [k_str])
19
+ end
18
20
  end
19
21
  else
20
22
  if self.is_a? Neography::Node
@@ -33,7 +35,6 @@ module Neography
33
35
  meta = class << self; self; end
34
36
  meta.send(:define_method, name) { @table[name] }
35
37
  meta.send(:define_method, "#{name}=") do |value|
36
- @table[name] = value
37
38
  self[name.to_sym] = value
38
39
  end
39
40
  end
@@ -21,7 +21,7 @@ module Neography
21
21
 
22
22
  rel = db.get_relationship(rel)
23
23
  if rel
24
- rel = Neography::Relationship.new(rel)
24
+ rel = Neography::Relationship.new(rel, db)
25
25
  rel.start_node = Neography::Node.load(rel.start_node, db)
26
26
  rel.end_node = Neography::Node.load(rel.end_node, db)
27
27
  end
@@ -34,7 +34,7 @@ module Neography
34
34
  @start_node = hash["start"].split('/').last
35
35
  @end_node = hash["end"].split('/').last
36
36
  @rel_type = hash["type"]
37
- neo_server = server
37
+ self.neo_server = server
38
38
  end
39
39
 
40
40
  def neo_server
@@ -4,7 +4,7 @@ require 'os'
4
4
  namespace :neo4j do
5
5
  desc "Install Neo4j"
6
6
  task :install, :edition, :version do |t, args|
7
- args.with_defaults(:edition => "community", :version => "1.8")
7
+ args.with_defaults(:edition => "community", :version => "1.8.1")
8
8
  puts "Installing Neo4j-#{args[:edition]}-#{args[:version]}"
9
9
 
10
10
  if OS::Underlying.windows?
@@ -1,3 +1,3 @@
1
1
  module Neography
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
data/neography.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.add_development_dependency "rspec", ">= 2.0"
22
+ s.add_development_dependency "rspec", ">= 2.11"
23
23
  s.add_development_dependency "net-http-spy", "0.2.1"
24
24
  s.add_development_dependency "rake", ">= 0.8.7"
25
25
  s.add_dependency "httparty", ">= 0.8.1"
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module Neography
4
4
  describe Config do
5
5
 
6
- subject(:config)
6
+ subject(:config) { Config.new }
7
7
 
8
8
  context "defaults" do
9
9
 
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module Neography
4
4
  describe Connection do
5
5
 
6
- subject(:connection)
6
+ subject(:connection) { Connection.new }
7
7
 
8
8
  context "defaults" do
9
9
 
@@ -40,11 +40,13 @@ module Neography
40
40
 
41
41
  it "resets properties as accessor" do
42
42
  @db.should_receive(:"remove_node_properties").with(42, ["key"])
43
+ node.key = "value"
43
44
  node.key = nil
44
45
  end
45
46
 
46
47
  it "resets properties as array entry" do
47
48
  @db.should_receive(:"remove_node_properties").with(42, ["key"])
49
+ node["key"] = "value"
48
50
  node["key"] = nil
49
51
  end
50
52
 
@@ -104,11 +106,13 @@ module Neography
104
106
 
105
107
  it "resets properties as accessor" do
106
108
  @db.should_receive(:"remove_relationship_properties").with(42, ["key"])
109
+ relationship.key = "value"
107
110
  relationship.key = nil
108
111
  end
109
112
 
110
113
  it "resets properties as array entry" do
111
114
  @db.should_receive(:"remove_relationship_properties").with(42, ["key"])
115
+ relationship["key"] = "value"
112
116
  relationship["key"] = nil
113
117
  end
114
118
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neography
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-10 00:00:00.000000000 Z
12
+ date: 2012-12-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: '2.0'
21
+ version: '2.11'
22
22
  type: :development
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: '2.0'
29
+ version: '2.11'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: net-http-spy
32
32
  requirement: !ruby/object:Gem::Requirement