neo4j-rake_tasks 0.2.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a529fc1235caa1df510a21fd88548b0650f45ba8
4
- data.tar.gz: c574b34b68e8d32a3059f0ad1fac348bd542e9ec
3
+ metadata.gz: f49243dad640d3474b999e8c645c9bd9c60c2cba
4
+ data.tar.gz: 78738a943de6f3a0974f16deb5cc08570a9d1d1b
5
5
  SHA512:
6
- metadata.gz: acc45ca7b255cb3d35728e8814414c44430d895bb7bf4196667f7ffbe14b6189e8f98a4c9171bf7b7ce6f344f019c59a69b2895beb80edcb6c84c941b1f599d9
7
- data.tar.gz: 2d9a7ca964cbf1de017c75a1c17ffd96c18e7e796143872471a872d9c2c97369fcbb2d1547c1feb5b2a6991407e5385a10a8446258690ac436d0231d038f794e
6
+ metadata.gz: b45237730eab1a69e1a7b3663ac21d12176caf07032c9975325be5c8d3f4eec53d2eec7c906e9fa79addcaadb0039b9298559c1826f6ef098d90907b4abbd0a3
7
+ data.tar.gz: 90c39ca72851a2a687af9b9b5d1f93969f15281432e85106f3c54c14baf7914aafdc3d559ecf3a8843614330c4f5a0bde3187af433b9a6dfa2194dc78c54aacf
@@ -72,6 +72,15 @@ namespace :neo4j do
72
72
  server_manager.console
73
73
  end
74
74
 
75
+ desc 'Open Neo4j REPL Shell'
76
+ task :shell, :environment do |_, args|
77
+ args.with_defaults(environment: :development)
78
+
79
+ puts "Starting Neo4j shell in #{args[:environment]}..."
80
+ server_manager = server_manager(args[:environment])
81
+ server_manager.shell
82
+ end
83
+
75
84
  desc 'Configure Server, e.g. rake neo4j:config[development,8888]'
76
85
  task :config, :environment, :port do |_, args|
77
86
  args.with_defaults(environment: :development)
@@ -5,8 +5,6 @@ module Neo4j
5
5
  module RakeTasks
6
6
  # Represents and manages a server installation at a specific path
7
7
  class ServerManager
8
- BASE_INSTALL_DIR = Pathname.new('db/neo4j')
9
-
10
8
  def initialize(path)
11
9
  @path = Pathname.new(path)
12
10
  FileUtils.mkdir_p(@path)
@@ -42,6 +40,16 @@ module Neo4j
42
40
  system_or_fail(neo4j_command_path(:console))
43
41
  end
44
42
 
43
+ def shell
44
+ not_started = !@path.join('data/neo4j-service.pid').exist?
45
+
46
+ start if not_started
47
+
48
+ system_or_fail(neo4j_shell_binary_path.to_s)
49
+
50
+ stop if not_started
51
+ end
52
+
45
53
  def info
46
54
  validate_is_system_admin!
47
55
 
@@ -139,6 +147,10 @@ module Neo4j
139
147
  neo4j_binary_path.to_s + " #{command}"
140
148
  end
141
149
 
150
+ def neo4j_shell_binary_path
151
+ binary_command_path(neo4j_shell_binary_filename)
152
+ end
153
+
142
154
  def property_configuration_path
143
155
  @path.join('conf', 'neo4j-server.properties')
144
156
  end
@@ -8,6 +8,10 @@ module Neo4j
8
8
  'neo4j'
9
9
  end
10
10
 
11
+ def neo4j_shell_binary_filename
12
+ 'neo4j-shell'
13
+ end
14
+
11
15
  protected
12
16
 
13
17
  def extract!(zip_path)
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module RakeTasks
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
@@ -8,6 +8,10 @@ module Neo4j
8
8
  'Neo4j.bat'
9
9
  end
10
10
 
11
+ def neo4j_shell_binary_filename
12
+ 'Neo4jShell.bat'
13
+ end
14
+
11
15
  def install
12
16
  super
13
17
 
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.2.0
4
+ version: 0.3.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: 2015-09-26 00:00:00.000000000 Z
11
+ date: 2015-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored