-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update for Neo4J 3.x, neo4jrb 8.x, and neojrb-core 7.0.x #18
Merged
+581
−348
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f36c43c
Make rake task available outside gem
TyGuy 8e4632c
Make versions more flexible
TyGuy 47b77bd
Make version failure more helpful
TyGuy b8af182
Default to neo4j installed version so NEO4J_VERSION is not required
TyGuy 1d8e0c3
Update for newer version of neo4jrb and neo4jrb-core gems.
TyGuy a3dab0d
Match new procedure calls
TyGuy e1e38e1
Add ActiveNode methods and tests
TyGuy 726eb05
update rubocop and clean unused code
TyGuy 2fc2f5d
Address PR comments
TyGuy 1df8d25
Change ActiveNode methods to scopes
TyGuy b31d935
Fix bugs
TyGuy cec87d5
Update Readme
TyGuy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,13 @@ | |
.idea | ||
bin/ | ||
/db | ||
|
||
# shapfile stuff | ||
*.CPG | ||
*.dbf | ||
*.prj | ||
*.sbn | ||
*.sbx | ||
*.shp | ||
*.shp.xml | ||
*.shx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,11 @@ | ||
require 'bundler/gem_tasks' | ||
require 'neo4j' | ||
require 'neo4j/rake_tasks' | ||
require 'net/http' | ||
|
||
def system_or_fail(command) | ||
system(command) || exit(1) | ||
end | ||
require 'neo4jrb_spatial/rake_tasks' | ||
load 'neo4j/tasks/migration.rake' | ||
|
||
task 'spec' do | ||
system_or_fail('rspec spec') | ||
end | ||
|
||
namespace :neo4j_spatial do | ||
def match_version?(version, max_version) | ||
min_version = max_version.split('.')[0..-1].join('.') | ||
Gem::Version.new(version) <= Gem::Version.new(max_version) && | ||
Gem::Version.new(version) >= Gem::Version.new(min_version) | ||
end | ||
|
||
def matching_version(version) | ||
uri = 'https://raw.githubusercontent.com/neo4j-contrib/m2/master/releases/org/neo4j/neo4j-spatial/maven-metadata.xml' | ||
versions = Net::HTTP.get_response(URI.parse(uri)).body | ||
versions = versions.scan(/<version>([a-z\-0-9\.]+)<\/version>/) | ||
versions.map! { |e| e.first.split('-neo4j-') } | ||
versions.select { |e| match_version?(version, e.last) }.last | ||
end | ||
|
||
task 'install' do | ||
url = 'https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial' | ||
input_version = ENV['NEO4J_VERSION'] | ||
fail ArgumentError, 'Missing NEO4J_VERSION' unless input_version | ||
spatial_version, neo4j_version = *matching_version(input_version) | ||
if neo4j_version[0].to_i < 3 | ||
file_name = "neo4j-spatial-#{spatial_version}-neo4j-#{neo4j_version}-server-plugin.zip" | ||
system_or_fail("wget -O #{file_name} #{url}/#{spatial_version}-neo4j-#{neo4j_version}/#{file_name}?raw=true") | ||
system_or_fail("unzip #{file_name} -d ./db/neo4j/development/plugins") | ||
else | ||
file_name = "neo4j-spatial-#{spatial_version}-neo4j-#{neo4j_version}-server-plugin.jar" | ||
system_or_fail("wget -O #{file_name} #{url}/#{spatial_version}-neo4j-#{neo4j_version}/#{file_name}?raw=true") | ||
system_or_fail("mv #{file_name} ./db/neo4j/development/plugins") | ||
end | ||
end | ||
end | ||
|
||
task default: ['spec'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.2 just came out, BTW ;)