neo4j-rake_tasks 0.4.4 → 0.5.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: c9561b90cd8ce47363551014583ac80f218bcd49
4
- data.tar.gz: f3450f532e3fb82219979100e9da5d51b656b784
3
+ metadata.gz: 9fce042842aabac57204740ae7abbbd7563ebb0f
4
+ data.tar.gz: 47861a40fffd416dcc861544a07a5279e9a51be8
5
5
  SHA512:
6
- metadata.gz: b151176bde6725936ae52c3f9c4f01781074932bd0368b3c196269e01e4dd705b544a1890ddfdaaafed04af9823eeca528e86a7cecaa52fc7f5161ad311b6bb3
7
- data.tar.gz: d4e158423e870304e54a9a175b460ae65b4f1accd2a8686ca13e8dba7e97d25292315db8f977c7cdd72a2d19681a01ea81e8f3209f3e721f4bb5843541173f60
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
- modify_config_file('org.neo4j.server.webserver.https.enabled' => false,
114
- 'org.neo4j.server.webserver.port' => port,
115
- 'org.neo4j.server.webserver.https.port' => port - 1)
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') do |file|
124
- result = properties.inject(contents) do |r, (property, value)|
125
- r.gsub(/#{property}\s*=\s*(.+)/, "#{property}=#{value}")
126
- end
127
- file << result
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
- @path.join('conf', 'neo4j-server.properties')
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'
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module RakeTasks
3
- VERSION = '0.4.4'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  end
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.4
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-04-29 00:00:00.000000000 Z
11
+ date: 2016-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored