neography 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7f2234bb146cd1e3f2a8982a50ed7a40cc55cf7e
4
+ data.tar.gz: 27d36db4460e5c928e22714c22e6d198a4af8178
5
+ SHA512:
6
+ metadata.gz: 7b0fe9807a4ce69b2befcebe432f214bc4db21aa86ebd8c900f80062946ed44732c2a5b887b4666ad35c989beab923079d713ed2813d44431301b6fb529b865c
7
+ data.tar.gz: 5753e7142a9e9d19598faec7ea62cc27613a45b386e184c2a004fddb9e85ff558abec6fb4c85e6b853a1ecd16d3cd0dc7689998424cbca4d2ef4886d392a5e00
data/.travis.yml CHANGED
@@ -1,4 +1,4 @@
1
- script: "bundle exec rake neo4j:install['enterprise','2.0.0-M04'] neo4j:start spec --trace"
1
+ script: "bundle exec rake neo4j:install['enterprise','2.0.0-M06'] neo4j:start spec --trace"
2
2
  language: ruby
3
3
  rvm:
4
4
  - 1.9.3
@@ -60,24 +60,43 @@ module Neography
60
60
  query = nil
61
61
  parameters = nil
62
62
  Array(statements).each do |statement|
63
- if query && parameters
64
- array << {:statement => query, :parameters => {:props => parameters}}
65
- query = statement
66
- parameters = nil
67
- elsif query && statement.is_a?(String)
68
- array << {:statement => query}
69
- query = statement
70
- parameters = nil
71
- elsif query && statement.is_a?(Hash)
72
- array << {:statement => query, :parameters => {:props => parameters}}
73
- query = nil
74
- parameters = nil
63
+ case
64
+ when query && parameters && statement.is_a?(Array)
65
+ then
66
+ array << {:statement => query, :parameters => parameters, :resultDataContents => statement }
67
+ query = nil
68
+ parameters = nil
69
+ when query && parameters && statement.is_a?(String)
70
+ then
71
+ array << {:statement => query, :parameters => parameters}
72
+ query = statement
73
+ parameters = nil
74
+ when query && statement.is_a?(Hash)
75
+ then
76
+ parameters = statement
77
+ when query && statement.is_a?(Array)
78
+ then
79
+ array << {:statement => query, :resultDataContents => statement }
80
+ query = nil
81
+ parameters = nil
82
+ else
83
+ query = statement
75
84
  end
76
- query = statement
85
+
86
+ end
87
+
88
+ if query && parameters
89
+ array << {:statement => query, :parameters => parameters}
90
+ query = nil
77
91
  end
78
- array << {:statement => query} if query
92
+
93
+ if query
94
+ array << {:statement => query}
95
+ end
96
+
79
97
  { :statements => array }
80
98
  end
99
+
81
100
  end
82
101
  end
83
102
  end
@@ -7,7 +7,7 @@ require 'net/http'
7
7
  namespace :neo4j do
8
8
  desc "Install Neo4j"
9
9
  task :install, :edition, :version do |t, args|
10
- args.with_defaults(:edition => "community", :version => "1.9.3")
10
+ args.with_defaults(:edition => "community", :version => "1.9.4")
11
11
  puts "Installing Neo4j-#{args[:edition]}-#{args[:version]}"
12
12
 
13
13
  if OS::Underlying.windows?
@@ -1,3 +1,3 @@
1
1
  module Neography
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -18,6 +18,19 @@ describe Neography::Rest do
18
18
  tx.should have_key("results")
19
19
  tx["results"].should_not be_empty
20
20
  end
21
+
22
+ it "can start a transaction with statements and represent them as a graph" do
23
+ tx = @neo.begin_transaction(["CREATE ( bike:Bike { weight: 10 } ) CREATE ( frontWheel:Wheel { spokes: 3 } ) CREATE ( backWheel:Wheel { spokes: 32 } ) CREATE p1 = bike -[:HAS { position: 1 } ]-> frontWheel CREATE p2 = bike -[:HAS { position: 2 } ]-> backWheel RETURN bike, p1, p2",
24
+ ["row", "graph", "rest"]])
25
+ tx.should have_key("transaction")
26
+ tx.should have_key("results")
27
+ tx["results"].should_not be_empty
28
+ tx["results"].first["data"].first["row"].should_not be_empty
29
+ tx["results"].first["data"].first["graph"].should_not be_empty
30
+ tx["results"].first["data"].first["rest"].should_not be_empty
31
+ end
32
+
33
+
21
34
  end
22
35
 
23
36
  describe "keep a transaction" do
@@ -43,6 +56,37 @@ describe Neography::Rest do
43
56
  existing_tx.should have_key("results")
44
57
  existing_tx["results"].should_not be_empty
45
58
  end
59
+
60
+ it "can add to a transaction with parameters" do
61
+ tx = @neo.begin_transaction
62
+ tx.should have_key("transaction")
63
+ tx["results"].should be_empty
64
+ existing_tx = @neo.in_transaction(tx, ["start n=node({id}) return n", {:id => 0}])
65
+ existing_tx.should have_key("transaction")
66
+ existing_tx.should have_key("results")
67
+ existing_tx["results"].should_not be_empty
68
+ end
69
+
70
+ it "can add to a transaction with representation" do
71
+ tx = @neo.begin_transaction
72
+ tx.should have_key("transaction")
73
+ tx["results"].should be_empty
74
+ existing_tx = @neo.in_transaction(tx, ["start n=node(0) return n", [:row,:rest]])
75
+ existing_tx.should have_key("transaction")
76
+ existing_tx.should have_key("results")
77
+ existing_tx["results"].should_not be_empty
78
+ end
79
+
80
+ it "can add to a transaction with parameters and representation" do
81
+ tx = @neo.begin_transaction
82
+ tx.should have_key("transaction")
83
+ tx["results"].should be_empty
84
+ existing_tx = @neo.in_transaction(tx, ["start n=node({id}) return n", {:id => 0}, [:row,:rest]])
85
+ existing_tx.should have_key("transaction")
86
+ existing_tx.should have_key("results")
87
+ existing_tx["results"].should_not be_empty
88
+ end
89
+
46
90
  end
47
91
 
48
92
  describe "commit a transaction" do
metadata CHANGED
@@ -1,36 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neography
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
5
- prerelease:
4
+ version: 1.2.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Max De Marzi
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-09-04 00:00:00.000000000 Z
11
+ date: 2013-10-03 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '2.11'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '2.11'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: net-http-spy
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - '='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - '='
44
39
  - !ruby/object:Gem::Version
@@ -46,103 +41,90 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: 0.8.7
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: 0.8.7
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: coveralls
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: httpclient
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: 2.3.3
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: 2.3.3
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rake
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - '>='
100
88
  - !ruby/object:Gem::Version
101
89
  version: 0.8.7
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - '>='
108
95
  - !ruby/object:Gem::Version
109
96
  version: 0.8.7
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: json
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - '>='
116
102
  - !ruby/object:Gem::Version
117
103
  version: 1.7.7
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - '>='
124
109
  - !ruby/object:Gem::Version
125
110
  version: 1.7.7
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: os
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ! '>='
115
+ - - '>='
132
116
  - !ruby/object:Gem::Version
133
117
  version: 0.9.6
134
118
  type: :runtime
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ! '>='
122
+ - - '>='
140
123
  - !ruby/object:Gem::Version
141
124
  version: 0.9.6
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: rubyzip
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
129
  - - ~>
148
130
  - !ruby/object:Gem::Version
@@ -150,7 +132,6 @@ dependencies:
150
132
  type: :runtime
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
136
  - - ~>
156
137
  - !ruby/object:Gem::Version
@@ -158,17 +139,15 @@ dependencies:
158
139
  - !ruby/object:Gem::Dependency
159
140
  name: multi_json
160
141
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
142
  requirements:
163
- - - ! '>='
143
+ - - '>='
164
144
  - !ruby/object:Gem::Version
165
145
  version: 1.3.2
166
146
  type: :runtime
167
147
  prerelease: false
168
148
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
149
  requirements:
171
- - - ! '>='
150
+ - - '>='
172
151
  - !ruby/object:Gem::Version
173
152
  version: 1.3.2
174
153
  description: A Ruby wrapper to the Neo4j Rest API see http://docs.neo4j.org/chunked/stable/rest-api.html
@@ -299,27 +278,26 @@ files:
299
278
  - spec/unit/rest/transactions_spec.rb
300
279
  homepage: http://rubygems.org/gems/neography
301
280
  licenses: []
281
+ metadata: {}
302
282
  post_install_message:
303
283
  rdoc_options: []
304
284
  require_paths:
305
285
  - lib
306
286
  required_ruby_version: !ruby/object:Gem::Requirement
307
- none: false
308
287
  requirements:
309
- - - ! '>='
288
+ - - '>='
310
289
  - !ruby/object:Gem::Version
311
290
  version: '0'
312
291
  required_rubygems_version: !ruby/object:Gem::Requirement
313
- none: false
314
292
  requirements:
315
- - - ! '>='
293
+ - - '>='
316
294
  - !ruby/object:Gem::Version
317
295
  version: '0'
318
296
  requirements: []
319
297
  rubyforge_project: neography
320
- rubygems_version: 1.8.24
298
+ rubygems_version: 2.0.6
321
299
  signing_key:
322
- specification_version: 3
300
+ specification_version: 4
323
301
  summary: ruby wrapper to Neo4j Rest API
324
302
  test_files:
325
303
  - spec/integration/authorization_spec.rb
@@ -378,3 +356,4 @@ test_files:
378
356
  - spec/unit/rest/relationships_spec.rb
379
357
  - spec/unit/rest/schema_index_spec.rb
380
358
  - spec/unit/rest/transactions_spec.rb
359
+ has_rdoc: