Permalink
Browse files

updated

  • Loading branch information...
1 parent 0daf924 commit 85d4f856867ca4566d90c1500c5351a97b500fff @maxdemarzi committed Apr 20, 2013
Showing with 38 additions and 36 deletions.
  1. +30 −33 Gemfile.lock
  2. +8 −3 neoflix.rb
View
@@ -1,53 +1,50 @@
GEM
remote: http://rubygems.org/
specs:
- addressable (2.2.8)
- crack (0.1.8)
+ addressable (2.3.4)
deepopenstruct (0.1.2)
- excon (0.14.0)
- haml (3.1.6)
- heroku (2.27.3)
- heroku-api (~> 0.2.5)
+ excon (0.20.1)
+ haml (4.0.2)
+ tilt
+ heroku (2.37.2)
+ heroku-api (~> 0.3.7)
launchy (>= 0.3.2)
- netrc (~> 0.7.4)
+ netrc (~> 0.7.7)
rest-client (~> 1.6.1)
rubyzip
- heroku-api (0.2.5)
- excon (~> 0.14.0)
- httparty (0.8.1)
- multi_json
- multi_xml
- json (1.7.3)
- launchy (2.1.0)
- addressable (~> 2.2.6)
- mime-types (1.18)
- multi_json (1.3.6)
- multi_xml (0.5.1)
- neography (0.0.26)
- crack (= 0.1.8)
- httparty (= 0.8.1)
- json
- os
+ heroku-api (0.3.9)
+ excon (~> 0.20.1)
+ httpclient (2.3.3)
+ json (1.7.7)
+ launchy (2.3.0)
+ addressable (~> 2.3)
+ mime-types (1.22)
+ multi_json (1.7.2)
+ neography (1.0.9)
+ httpclient (>= 2.3.3)
+ json (>= 1.6.0)
+ multi_json (>= 1.3.2)
+ os (>= 0.9.6)
rake (>= 0.8.7)
- rubyzip
- netrc (0.7.4)
+ rubyzip (>= 0.9.7)
+ netrc (0.7.7)
os (0.9.6)
- rack (1.4.1)
- rack-protection (1.2.0)
+ rack (1.5.2)
+ rack-protection (1.5.0)
rack
- rake (0.9.2.2)
+ rake (10.0.4)
rest-client (1.6.7)
mime-types (>= 1.16)
ruby-tmdb (0.2.1)
addressable
deepopenstruct (>= 0.1.2)
json
rubyzip (0.9.9)
- sinatra (1.3.2)
- rack (~> 1.3, >= 1.3.6)
- rack-protection (~> 1.2)
- tilt (~> 1.3, >= 1.3.3)
- tilt (1.3.3)
+ sinatra (1.4.2)
+ rack (~> 1.5, >= 1.5.2)
+ rack-protection (~> 1.4)
+ tilt (~> 1.3, >= 1.3.4)
+ tilt (1.3.7)
PLATFORMS
ruby
View
@@ -11,8 +11,13 @@
neo = Neography::Rest.new(ENV['NEO4J_URL'] || "http://localhost:7474")
def create_graph(neo)
- return if neo.execute_script("g.idx('vertices')[[type:'Movie']].count();").to_i > 0
-
+ begin
+ neo.execute_script("g.idx('vertices')[[type:'Movie']].count();").to_i > 0
+ return
+ rescue
+ puts "Creating Database"
+ end
+
if neo.execute_script("g.indices;").empty?
neo.execute_script("g.createAutomaticIndex('vertices', Vertex.class, null);")
neo.execute_script("AutomaticIndexHelper.reIndexElements(g, g.idx('vertices'), g.V);") if neo.execute_script("g.V.count();").to_i > 0
@@ -55,7 +60,7 @@ def ratedEdge = g.addEdge(g.idx(Tokens.T.v)[[userId:components[0].toInteger()]].
g.stopTransaction(TransactionalGraph.Conclusion.SUCCESS);")
- rescue Timeout::Error
+ rescue
puts "Creating the graph is going to take some time, watch it on #{ENV['NEO4J_URL'] || "http://localhost:7474"}"
end
end

0 comments on commit 85d4f85

Please sign in to comment.