neo4j-rake_tasks 0.7.1 → 0.7.2

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: f4d1b6c4bc29cd84a9e571c95d908a86a2718267
4
- data.tar.gz: 43647c52d7105b98d28e420f4f7e9e037f20133d
3
+ metadata.gz: 37fa19c17f8499ddc7191355745ac5431e71b18b
4
+ data.tar.gz: a1edc9a3b7200044229706bb1d68f44f129c9a50
5
5
  SHA512:
6
- metadata.gz: 14b391feedd026a6c21b11b7e54c674c5c8856fba5f8251080ef6e9e042a0dafff2ce0d8454f09fbc78327c2b40cd326db1038b04dc0dc5fd9133f5f501b5adc
7
- data.tar.gz: ff11765ca8119a7ad722a5264d5d38ae2e9092ee84b8eb8b50b554a4199904959fcebd05545d165f5a5bd9a30ff541868232ad9b2617054c4449d84ffa308879
6
+ metadata.gz: 6ef7d48f7bc0de5fc367759885394a78b13407ddac91954d5b062417d2fe56a62832dffa704832802ab725dac1a54eca2657bece5843b935fe19013f0c8c6358
7
+ data.tar.gz: 961e16b84b77a70a2d0dc69c3b9247cfe18716c2ab9331423047e9ebe4c1dfe0a1d1f7845ae5cab12de6d661dc46d602c654ec7db0640c129b797ab9b9db3b8f
@@ -1,4 +1,5 @@
1
1
  require 'pathname'
2
+ require 'ostruct'
2
3
 
3
4
  module Neo4j
4
5
  module RakeTasks
@@ -172,17 +173,16 @@ module Neo4j
172
173
 
173
174
  def print_indexes_or_constraints(type)
174
175
  url = File.join(server_url, "db/data/schema/#{type}")
175
- data = JSON.load(open(url).read)
176
+ data = JSON.load(open(url).read).map(&OpenStruct.method(:new))
176
177
  if data.empty?
177
178
  puts "No #{type.to_s.pluralize} found"
178
179
  return
179
180
  end
180
- data.sort_by {|i| i['label'] }.chunk do |value|
181
- value['label']
182
- end.each do |label, indexes|
183
- puts "\e[36m#{label}\e[0m"
184
- indexes.each do |value|
185
- puts ' ' + value['property_keys'].join(', ')
181
+ criteria = -> (i) { i.label || i.relationshipType }
182
+ data.sort_by(&criteria).chunk(&criteria).each do |label_or_type, rows|
183
+ puts "\e[36m#{label_or_type}\e[0m"
184
+ rows.each do |row|
185
+ puts " #{row.type + ': ' if row.type}#{row.property_keys.join(', ')}"
186
186
  end
187
187
  end
188
188
  end
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module RakeTasks
3
- VERSION = '0.7.1'
3
+ VERSION = '0.7.2'
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.7.1
4
+ version: 0.7.2
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-07-02 00:00:00.000000000 Z
11
+ date: 2016-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored