neo4j-rake_tasks 0.0.1 → 0.0.3

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: a36e3c667d7f1b40f9526dd076b09dfa1aa6a6a2
4
- data.tar.gz: da8d4c5c79274aebda5815c50bb939ad87c736c1
3
+ metadata.gz: 813e3add744338a40c6f5376ce4fd0d4b60e1793
4
+ data.tar.gz: 6cc22ba45fe7a998eb0735bf81c547a17292263b
5
5
  SHA512:
6
- metadata.gz: a0ab371f9a010d47ac0605762e9a51213d537c3ee3753889e46b6e1aebcf1107ef148bfa0f207e18f8724e349ca7e51fce4604cf0a79ba135ed63d95065a5b18
7
- data.tar.gz: 471d988bd3e75502292633428c7f517619b31a4f43d1f596c1e0f1cbc463d2cdba7066a8417005da023e1e1aece862305af39c4698cd36b5f9d4428f5cafc798
6
+ metadata.gz: 1660b4eb3a372b63a37566a862b7ff5af25f97a1837bd2cde07f066342718901e49c77d278b3fc6227a62b2953e9eef4e591da5e1be6e7494a826c64f31b9226
7
+ data.tar.gz: 626b3a6195d4646ea54aa3cbdcf5e63edbd18c75b9212c7d1cfd7efec1112eaaf297baaeedfa69f50519e5eb403d955626925672aea8242cce237b0a9a215cec
data/Gemfile CHANGED
@@ -2,6 +2,10 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
+ group 'development', 'test' do
6
+ gem 'pry'
7
+ end
8
+
5
9
  group 'test' do
6
10
  gem 'coveralls', require: false
7
11
  gem 'simplecov-html', require: false
@@ -9,4 +13,5 @@ group 'test' do
9
13
  gem 'rspec'
10
14
  gem 'rspec-its'
11
15
  gem 'guard-rspec', require: false
16
+ gem 'neo4j-core'
12
17
  end
@@ -5,23 +5,20 @@ require 'httparty'
5
5
  require 'zip'
6
6
  require 'httparty'
7
7
  require 'pathname'
8
- require File.expand_path('../config_server', __FILE__)
9
8
  require File.expand_path('../windows_server_manager', __FILE__)
10
9
  require File.expand_path('../starnix_server_manager', __FILE__)
11
10
 
12
11
  namespace :neo4j do
13
- BASE_INSTALL_DIR = Pathname.new('db/neo4j')
14
-
15
12
  def server_path(environment)
16
- BASE_INSTALL_DIR.join((environment || :development).to_s)
13
+ Pathname.new('db/neo4j').join(environment.to_s)
17
14
  end
18
15
 
19
16
  def server_manager_class
20
- ::Neo4j::Tasks::ServerManager.class_for_os
17
+ ::Neo4j::RakeTasks::ServerManager.class_for_os
21
18
  end
22
19
 
23
- def server_manager(environment, path)
24
- ::Neo4j::Tasks::ServerManager.new_for_os(environment, path)
20
+ def server_manager(environment)
21
+ ::Neo4j::RakeTasks::ServerManager.new_for_os(server_path(environment))
25
22
  end
26
23
 
27
24
  def edition_supports_auth?(edition_string)
@@ -30,9 +27,11 @@ namespace :neo4j do
30
27
 
31
28
  desc 'Install Neo4j with auth disabled in v2.2+'
32
29
  task :install, :edition, :environment do |_, args|
30
+ args.with_defaults(edition: 'community-latest', environment: 'development')
31
+
33
32
  puts "Install Neo4j (#{args[:environment]} environment)..."
34
33
 
35
- server_manager = server_manager(server_path(args[:environment]))
34
+ server_manager = server_manager(args[:environment])
36
35
  server_manager.install(args[:edition])
37
36
  if edition_supports_auth?(args[:edition])
38
37
  server_manage.config_auth_enabeled!(false)
@@ -47,64 +46,82 @@ namespace :neo4j do
47
46
 
48
47
  desc 'Start the Neo4j Server'
49
48
  task :start, :environment do |_, args|
49
+ args.with_defaults(environment: :development)
50
+
50
51
  puts "Starting Neo4j in #{args[:environment]}..."
51
- server_manager = server_manager(server_path(args[:environment]))
52
+ server_manager = server_manager(args[:environment])
52
53
  server_manager.start
53
54
  end
54
55
 
55
56
  desc 'Start the Neo4j Server asynchronously'
56
57
  task :start_no_wait, :environment do |_, args|
58
+ args.with_defaults(environment: :development)
59
+
57
60
  puts "Starting Neo4j (no wait) in #{args[:environment]}..."
58
- server_manager = server_manager(server_path(args[:environment]))
61
+ server_manager = server_manager(args[:environment])
59
62
  server_manager.start(false)
60
63
  end
61
64
 
62
65
  desc 'Configure Server, e.g. rake neo4j:config[development,8888]'
63
66
  task :config, :environment, :port do |_, args|
67
+ args.with_defaults(environment: :development)
68
+
64
69
  puts "Config Neo4j in #{args[:environment]}"
65
70
 
66
- server_manager = server_manager(server_path(args[:environment]))
71
+ server_manager = server_manager(args[:environment])
67
72
  server_manager.config_port!(args[:port].to_i)
68
73
  end
69
74
 
70
75
  desc 'Stop the Neo4j Server'
71
76
  task :stop, :environment do |_, args|
77
+ args.with_defaults(environment: :development)
78
+
72
79
  puts "Stopping Neo4j in #{args[:environment]}..."
73
80
 
74
- server_manager = server_manager(server_path(args[:environment]))
81
+ server_manager = server_manager(args[:environment])
75
82
  server_manager.stop
76
83
  end
77
84
 
78
85
  desc 'Get info the Neo4j Server'
79
86
  task :info, :environment do |_, args|
87
+ args.with_defaults(environment: :development)
88
+
80
89
  puts "Getting Neo4j info for #{args[:environment]}..."
81
90
 
82
- server_manager = server_manager(server_path(args[:environment]))
91
+ server_manager = server_manager(args[:environment])
83
92
  server_manager.info
84
93
  end
85
94
 
86
95
  desc 'Restart the Neo4j Server'
87
96
  task :restart, :environment do |_, args|
97
+ args.with_defaults(environment: :development)
98
+
88
99
  puts "Restarting Neo4j in #{args[:environment]}..."
89
100
 
90
- server_manager = server_manager(server_path(args[:environment]))
101
+ server_manager = server_manager(args[:environment])
91
102
  server_manager.restart
92
103
  end
93
104
 
94
105
  desc 'Reset the Neo4j Server'
95
106
  task :reset_yes_i_am_sure, :environment do |_, args|
96
- server_manager = server_manager(server_path(args[:environment]))
107
+ args.with_defaults(environment: :development)
108
+
109
+ server_manager = server_manager(args[:environment])
97
110
  server_manager.reset
98
111
  end
99
112
 
100
113
  desc 'Neo4j 2.2: Change connection password'
101
114
  task :change_password do |_, _args|
115
+ # Maybe we should take the environment as an arg and
116
+ # find the port in the config file?
102
117
  server_manager_class.change_password!
103
118
  end
104
119
 
105
120
  desc 'Neo4j 2.2: Enable Auth'
106
121
  task :enable_auth, :environment do |_, args|
107
- server_manager = server_manager(server_path(args[:environment]))
122
+ args.with_defaults(environment: :development)
123
+
124
+ server_manager = server_manager(args[:environment])
108
125
  server_manager.config_auth_enabeled!(true)
109
126
 
110
127
  puts 'Neo4j basic authentication enabled. Restart server to apply.'
@@ -112,7 +129,9 @@ namespace :neo4j do
112
129
 
113
130
  desc 'Neo4j 2.2: Disable Auth'
114
131
  task :disable_auth, :environment do |_, args|
115
- server_manager = server_manager(server_path(args[:environment]))
132
+ args.with_defaults(environment: :development)
133
+
134
+ server_manager = server_manager(args[:environment])
116
135
  server_manager.config_auth_enabeled!(false)
117
136
 
118
137
  puts 'Neo4j basic authentication disabled. Restart server to apply.'
@@ -2,6 +2,8 @@ require 'active_support/notifications'
2
2
  require 'rails/railtie'
3
3
 
4
4
  module Neo4j
5
+ # Rail tie-in to automatically load rake tasks in Rails
6
+ # when this gem is used
5
7
  class Railtie < ::Rails::Railtie
6
8
  rake_tasks do
7
9
  load 'neo4j/rake_tasks/neo4j_server.rake'
@@ -1,4 +1,5 @@
1
1
  require 'pathname'
2
+ require 'httparty'
2
3
 
3
4
  module Neo4j
4
5
  module RakeTasks
@@ -19,7 +20,7 @@ module Neo4j
19
20
 
20
21
  return false if neo4j_binary_path.exist?
21
22
 
22
- archive_path = download_neo4j(version) unless File.exist?(file_name)
23
+ archive_path = download_neo4j(version)
23
24
  extract!(archive_path)
24
25
 
25
26
  FileUtils.rm archive_path
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module RakeTasks
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
@@ -37,8 +37,12 @@ DESCRIPTION
37
37
  '--inline-source']
38
38
 
39
39
  s.add_dependency('colored')
40
+ s.add_dependency('httparty')
41
+ s.add_dependency('rake')
42
+ s.add_dependency('os')
43
+ s.add_dependency('zip')
40
44
 
41
- s.add_development_dependency('vcr')
45
+ # s.add_development_dependency('vcr')
42
46
  s.add_development_dependency('pry')
43
47
  s.add_development_dependency('simplecov')
44
48
  s.add_development_dependency('guard')
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.0.1
4
+ version: 0.0.3
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-07-09 00:00:00.000000000 Z
11
+ date: 2015-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored
@@ -25,13 +25,55 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: vcr
28
+ name: httparty
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
- type: :development
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: os
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: zip
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
35
77
  prerelease: false
36
78
  version_requirements: !ruby/object:Gem::Requirement
37
79
  requirements: