neo4j-rake_tasks 0.4.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/neo4j/rake_tasks/server_manager.rb +27 -9
- data/lib/neo4j/rake_tasks/version.rb +1 -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: 9fce042842aabac57204740ae7abbbd7563ebb0f
|
4
|
+
data.tar.gz: 47861a40fffd416dcc861544a07a5279e9a51be8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56e0d63c72fd7dc70e3b404f9f5cc4ac04d39f0d997e594bf3b61c6bade6295372aeaa4d9ebc14ba2d03a41ea7bfd4b9b7e4dca2d6a5a65c72eed84937bcf963
|
7
|
+
data.tar.gz: fffcdaa7daefad8cc2a20b2991fe38f2c6fe1557a64a6fb296c3daeabaa795e35de3be2b5a27aaa5543ba74a78b011dd2405c4dba72e02221329c7a2e719e630
|
@@ -110,9 +110,17 @@ module Neo4j
|
|
110
110
|
def config_port!(port)
|
111
111
|
puts "Config ports #{port} / #{port - 1}"
|
112
112
|
|
113
|
-
|
114
|
-
|
115
|
-
|
113
|
+
if server_version >= '3.0.0'
|
114
|
+
# These are not ideal, perhaps...
|
115
|
+
modify_config_file('dbms.connector.https.enabled' => false,
|
116
|
+
'dbms.connector.http.enabled' => true,
|
117
|
+
'dbms.connector.http.address' => "0.0.0.0:#{port}",
|
118
|
+
'dbms.connector.https.address' => "localhost:#{port - 1}")
|
119
|
+
else
|
120
|
+
modify_config_file('org.neo4j.server.webserver.https.enabled' => false,
|
121
|
+
'org.neo4j.server.webserver.port' => port,
|
122
|
+
'org.neo4j.server.webserver.https.port' => port - 1)
|
123
|
+
end
|
116
124
|
end
|
117
125
|
|
118
126
|
# END MAIN COMMANDS
|
@@ -120,11 +128,12 @@ module Neo4j
|
|
120
128
|
def modify_config_file(properties)
|
121
129
|
contents = File.read(property_configuration_path)
|
122
130
|
|
123
|
-
File.open(property_configuration_path, 'w')
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
131
|
+
File.open(property_configuration_path, 'w') { |file| file << modify_config_contents(contents, properties) }
|
132
|
+
end
|
133
|
+
|
134
|
+
def modify_config_contents(contents, properties)
|
135
|
+
properties.inject(contents) do |r, (property, value)|
|
136
|
+
r.gsub(/^\s*(#\s*)?#{property}\s*=\s*(.+)/, "#{property}=#{value}")
|
128
137
|
end
|
129
138
|
end
|
130
139
|
|
@@ -159,7 +168,11 @@ module Neo4j
|
|
159
168
|
end
|
160
169
|
|
161
170
|
def property_configuration_path
|
162
|
-
|
171
|
+
if server_version >= '3.0.0'
|
172
|
+
@path.join('conf', 'neo4j.conf')
|
173
|
+
else
|
174
|
+
@path.join('conf', 'neo4j-server.properties')
|
175
|
+
end
|
163
176
|
end
|
164
177
|
|
165
178
|
def validate_is_system_admin!
|
@@ -194,6 +207,11 @@ module Neo4j
|
|
194
207
|
|
195
208
|
NEO4J_VERSIONS_URL = 'https://raw.githubusercontent.com/neo4jrb/neo4j-rake_tasks/master/neo4j_versions.yml'
|
196
209
|
|
210
|
+
def server_version
|
211
|
+
kernel_jar_path = Dir.glob(@path.join('lib/neo4j-kernel-*.jar'))[0]
|
212
|
+
kernel_jar_path.match(/neo4j-kernel-([\d\.]+)\.jar$/)[1]
|
213
|
+
end
|
214
|
+
|
197
215
|
def neo4j_versions
|
198
216
|
require 'open-uri'
|
199
217
|
require 'yaml'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j-rake_tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Underwood
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored
|