Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

+ Cedar Stack

  • Loading branch information...
commit 4d7e4273b10a495b238f6782cb3b8e9519d031cc 1 parent 17b2d07
@floere authored
View
9 .gitignore
@@ -1,7 +1,2 @@
-.sass-cache
-server/log/*.log
-server/log/search.log
-server/tmp/pids/unicorn.pid
-server/log/unicorn.stderr.log
-server/log/unicorn.stdout.log
-data/gems.csv
+log/*.log
+data/Marshal.*
View
2  Procfile
@@ -0,0 +1,2 @@
+web: cd server; bundle exec rake start
+server: cd client; bundle exec unicorn -p 80
View
7 client/app.rb
@@ -10,12 +10,7 @@
# Sets up two query instances.
#
-if ENV['RACK_ENV'] == 'production'
- puts "Running Gemsearch on production"
- GemSearch = Picky::Client.new :host => 'gemsearch-server.heroku.com', :port => 80, :path => '/gems'
-else
- GemSearch = Picky::Client.new :host => 'localhost', :port => 8080, :path => '/gems'
-end
+GemSearch = Picky::Client.new :host => 'localhost', :port => 8080, :path => '/gems'
set :static, true
set :public, File.dirname(__FILE__)
View
20,519 client/data/gems.csv
0 additions, 20,519 deletions not shown
View
16 client/gem.rb
@@ -9,31 +9,31 @@
# * dependencies
#
class AGem
-
+
@@gems_mapping = {}
-
+
# Load the books on startup.
#
- file_name = File.expand_path 'data/gems.csv', File.dirname(__FILE__)
+ file_name = File.expand_path '../data/gems.csv', File.dirname(__FILE__)
CSV.open(file_name, 'r:utf-8').each do |row|
@@gems_mapping[row.shift.to_i] = row
end
-
+
# Find uses a lookup table.
#
def self.find ids, _ = {}
ids.map { |id| new(id, *@@gems_mapping[id]) }
end
-
+
attr_reader :id
-
+
def initialize id, name, versions, authors, dependencies, summary
@id, @name, @versions = id, name, versions
@authors = authors.split(/\|/).join(', ')
@dependencies = dependencies.split(/\|/).join(', ')
@summary = summary
end
-
+
# "Rendering" ;)
#
# Note: This is just an example. Please do not render in the model.
@@ -44,5 +44,5 @@ def to_s
summary = "<p class='summary'>#{@summary}</p>"
"<li class='gem'><p><a href='http://rubygems.org/gems/#{@name}'>#{@name}</a><p>#{summary}<p></p>#{dependencies}#{authors}</li>"
end
-
+
end
View
0  server/data/gems.csv → data/gems.csv
File renamed without changes
View
0  server/script/get_data → script/get_data
File renamed without changes
View
0  server/script/csvify_data → script/preprocess_data
File renamed without changes
View
4 script/update
@@ -0,0 +1,4 @@
+script/get_data
+script/preprocess_data
+cd server; rake index
+cd server; PICKY_ENV=production rake index
View
2  server/app/application.rb
@@ -27,7 +27,7 @@ class PickySearch < Application
# See http://github.com/floere/picky/wiki/Sources-Configuration#sources
#
gems = Index::Memory.new :gems do
- source Sources::CSV.new(:name, :versions, :author, :dependencies, :summary, file: 'data/gems.csv')
+ source Sources::CSV.new(:name, :versions, :author, :dependencies, :summary, file: '../data/gems.csv')
category :name,
similarity: Similarity::DoubleMetaphone.new(2),
View
BIN  server/data/Marshal.4.8.Z
Binary file not shown
View
1  server/script/copy_to_client
@@ -1 +0,0 @@
-cp data/gems.csv ../client/data/gems.csv
View
5 server/script/update
@@ -1,5 +0,0 @@
-script/get_data
-script/csvify_data
-script/copy_to_client
-rake index
-PICKY_ENV=production rake index
Please sign in to comment.
Something went wrong with that request. Please try again.