Permalink
Browse files

- Broken test project

  • Loading branch information...
1 parent 2dc8eb6 commit 8c0906fc8649866bbf077c08bf863088e0e54ba1 @floere committed Dec 3, 2012
Showing with 0 additions and 7,993 deletions.
  1. +0 −31 statistics/test_project/Gemfile
  2. +0 −83 statistics/test_project/Gemfile.lock
  3. +0 −11 statistics/test_project/Rakefile
  4. +0 −134 statistics/test_project/app.rb
  5. +0 −16 statistics/test_project/config.ru
  6. +0 −540 statistics/test_project/data/development/library.csv
  7. +0 −540 statistics/test_project/data/production/library.csv
  8. +0 −540 statistics/test_project/data/test/library.csv
  9. BIN statistics/test_project/images/picky.png
  10. +0 −1 statistics/test_project/index/development/books/author_exact_configuration.memory.json
  11. +0 −1 statistics/test_project/index/development/books/author_exact_inverted.memory.json
  12. +0 −1 statistics/test_project/index/development/books/author_exact_realtime.memory.json
  13. +0 −1 statistics/test_project/index/development/books/author_exact_weights.memory.json
  14. +0 −1 statistics/test_project/index/development/books/author_partial_configuration.memory.json
  15. +0 −1 statistics/test_project/index/development/books/author_partial_inverted.memory.json
  16. +0 −1 statistics/test_project/index/development/books/author_partial_realtime.memory.json
  17. +0 −1 statistics/test_project/index/development/books/author_partial_weights.memory.json
  18. +0 −1,388 statistics/test_project/index/development/books/prepared_author_index.prepared.txt
  19. +0 −3,342 statistics/test_project/index/development/books/prepared_title_index.prepared.txt
  20. +0 −540 statistics/test_project/index/development/books/prepared_year_index.prepared.txt
  21. +0 −1 statistics/test_project/index/development/books/title_exact_configuration.memory.json
  22. +0 −1 statistics/test_project/index/development/books/title_exact_inverted.memory.json
  23. +0 −1 statistics/test_project/index/development/books/title_exact_realtime.memory.json
  24. BIN statistics/test_project/index/development/books/title_exact_similarity.memory.dump
  25. +0 −1 statistics/test_project/index/development/books/title_exact_weights.memory.json
  26. +0 −1 statistics/test_project/index/development/books/title_partial_configuration.memory.json
  27. +0 −1 statistics/test_project/index/development/books/title_partial_inverted.memory.json
  28. +0 −1 statistics/test_project/index/development/books/title_partial_realtime.memory.json
  29. +0 −1 statistics/test_project/index/development/books/title_partial_weights.memory.json
  30. +0 −1 statistics/test_project/index/development/books/year_exact_configuration.memory.json
  31. +0 −1 statistics/test_project/index/development/books/year_exact_inverted.memory.json
  32. +0 −1 statistics/test_project/index/development/books/year_exact_realtime.memory.json
  33. +0 −1 statistics/test_project/index/development/books/year_exact_weights.memory.json
  34. +0 −6 statistics/test_project/javascripts/history.adapter.jquery.min.js
  35. +0 −6 statistics/test_project/javascripts/history.min.js
  36. +0 −16 statistics/test_project/javascripts/jquery-1.5.0.min.js
  37. +0 −19 statistics/test_project/javascripts/picky.min.js
  38. 0 statistics/test_project/log/README
  39. +0 −24 statistics/test_project/logging.rb
  40. +0 −28 statistics/test_project/spec/integration_spec.rb
  41. +0 −6 statistics/test_project/spec/spec_helper.rb
  42. +0 −86 statistics/test_project/stylesheets/application.css
  43. BIN statistics/test_project/stylesheets/images/background.png
  44. +0 −10 statistics/test_project/stylesheets/images/cancel.svg
  45. +0 −277 statistics/test_project/stylesheets/picky.css
  46. +0 −1 statistics/test_project/tmp/pids/README
  47. +0 −17 statistics/test_project/unicorn.rb
  48. +0 −312 statistics/test_project/views/search.haml
@@ -1,31 +0,0 @@
-source :rubygems
-
-# Gems required by the Picky client.
-#
-gem 'picky-client', '~> 4.0'
-gem 'i18n'
-gem 'activesupport', :require => 'active_support/core_ext'
-gem 'sinatra'
-gem 'haml'
-
-# Gems required by the Picky server.
-#
-gem 'picky', '~> 4.0'
-gem 'rake'
-gem 'rack'
-gem 'rack_fast_escape', '2009.06.24' # Optional.
-gem 'text'
-gem 'multi_json'
-
-# Optional.
-#
-gem 'yajl-ruby', :require => 'yajl'
-gem 'activerecord', '~> 3.0', :require => 'active_record'
-
-# Required by your project.
-#
-gem 'unicorn'
-
-group :test do
- gem 'rspec'
-end
@@ -1,83 +0,0 @@
-GEM
- remote: http://rubygems.org/
- specs:
- activemodel (3.2.6)
- activesupport (= 3.2.6)
- builder (~> 3.0.0)
- activerecord (3.2.6)
- activemodel (= 3.2.6)
- activesupport (= 3.2.6)
- arel (~> 3.0.2)
- tzinfo (~> 0.3.29)
- activesupport (3.2.6)
- i18n (~> 0.6)
- multi_json (~> 1.0)
- arel (3.0.2)
- builder (3.0.0)
- cod (0.5.0)
- diff-lcs (1.1.3)
- haml (3.1.6)
- i18n (0.6.0)
- kgio (2.7.4)
- multi_json (1.3.6)
- picky (4.5.1)
- activesupport (~> 3.0)
- multi_json
- procrastinate (~> 0.4)
- rack_fast_escape
- text
- picky-client (4.5.1)
- activesupport (>= 3.0.0)
- yajl-ruby (>= 0.7.8)
- procrastinate (0.4.1)
- cod (~> 0.4)
- state_machine (~> 0.9.4)
- rack (1.4.1)
- rack-protection (1.2.0)
- rack
- rack_fast_escape (2009.06.24)
- url_escape
- raindrops (0.10.0)
- rake (0.9.2.2)
- rspec (2.10.0)
- rspec-core (~> 2.10.0)
- rspec-expectations (~> 2.10.0)
- rspec-mocks (~> 2.10.0)
- rspec-core (2.10.1)
- rspec-expectations (2.10.0)
- diff-lcs (~> 1.1.3)
- rspec-mocks (2.10.1)
- sinatra (1.3.2)
- rack (~> 1.3, >= 1.3.6)
- rack-protection (~> 1.2)
- tilt (~> 1.3, >= 1.3.3)
- state_machine (0.9.4)
- text (1.2.1)
- tilt (1.3.3)
- tzinfo (0.3.33)
- unicorn (4.3.1)
- kgio (~> 2.6)
- rack
- raindrops (~> 0.7)
- url_escape (2009.06.24)
- yajl-ruby (1.1.0)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- activerecord (~> 3.0)
- activesupport
- haml
- i18n
- multi_json
- picky (~> 4.0)
- picky-client (~> 4.0)
- rack
- rack_fast_escape (= 2009.06.24)
- rake
- rspec
- sinatra
- text
- unicorn
- yajl-ruby
@@ -1,11 +0,0 @@
-require 'picky/tasks'
-require 'picky-client/tasks'
-
-# Pass in location of your javascript files, default is "javascripts".
-#
-Picky::Tasks::Javascripts.new
-
-require 'rspec'
-require 'rspec/core/rake_task'
-
-RSpec::Core::RakeTask.new :spec
@@ -1,134 +0,0 @@
-# encoding: utf-8
-#
-require 'sinatra/base'
-require 'i18n'
-require 'haml'
-require 'csv'
-require 'picky'
-require 'picky-client'
-
-require File.expand_path '../../../generators/prototypes/shared/both/book', __FILE__
-require File.expand_path '../logging', __FILE__
-
-# This app shows how to integrate the Picky server directly
-# inside a web app. However, if you really need performance
-# and easy caching, this is not recommended.
-#
-class StatisticsBookSearch < Sinatra::Application
-
- # We do this so we don't have to type
- # Picky:: in front of everything.
- #
- include Picky
-
-
- # Server.
- #
-
- # Data source.
- #
- class Books
-
- def initialize
- @csv = CSV.new File.open(File.expand_path("../data/#{PICKY_ENVIRONMENT}/library.csv", __FILE__))
- end
-
- def each
- instance = Struct.new :id, :title, :author, :year
- @csv.each do |row|
- yield instance.new *row[0..3]
- end
- end
-
- end
-
- # Define an index.
- #
- books_index = Index.new :books do
- source { Books.new }
- indexing removes_characters: /[^a-z0-9\s\/\-\_\:\"\&\.]/i,
- stopwords: /\b(and|the|of|it|in|for)\b/i,
- splits_text_on: /[\s\/\-\_\:\"\&\.]/
- category :title,
- similarity: Similarity::DoubleMetaphone.new(3),
- partial: Partial::Substring.new(from: 1) # Default is from: -3.
- category :author, partial: Partial::Substring.new(from: 1)
- category :year, partial: Partial::None.new
- end
-
- # Index and load on USR1 signal.
- #
- Signal.trap('USR1') do
- books_index.reindex # kill -USR1 <pid>
- end
-
- # Define a search over the books index.
- #
- books = Search.new books_index do
- searching substitutes_characters_with: CharacterSubstituters::WestEuropean.new, # Normalizes special user input, Ä -> Ae, ñ -> n etc.
- removes_characters: /[^\p{L}\p{N}\s\/\-\_\&\.\"\~\*\:\,]/i, # Picky needs control chars *"~:, to pass through.
- stopwords: /\b(and|the|of|it|in|for)\b/i,
- splits_text_on: /[\s\/\-\&]+/
-
- boost [:title, :author] => +3,
- [:title] => +1
- end
-
-
- # Client.
- #
-
- set :static, true
- set :public, File.dirname(__FILE__)
- set :views, File.expand_path('../views', __FILE__)
- set :haml, :format => :html5
-
- # Root, the search page.
- #
- get '/' do
- @query = params[:q]
-
- haml :'/search'
- end
-
- # Renders the results into the json.
- #
- # You get the results from the (local) picky server and then
- # populate the result hash with rendered models.
- #
- get '/search/full' do
- results = books.search params[:query], params[:ids] || 20, params[:offset] || 0
- AppLogger.info results
- results = results.to_hash
- results.extend Picky::Convenience
- results.populate_with Book do |book|
- book.to_s
- end
-
- #
- # Or, to populate with the model instances, use:
- # results.populate_with Book
- #
- # Then to render:
- # rendered_entries = results.entries.map do |book| (render each book here) end
- #
-
- Yajl::Encoder.encode results
- end
-
- # Updates the search count while the user is typing.
- #
- get '/search/live' do
- results = books.search params[:query], params[:ids] || 20, params[:offset] || 0
- results.to_json
- end
-
- helpers do
-
- def js path
- "<script src='javascripts/#{path}.js' type='text/javascript'></script>"
- end
-
- end
-
-end
@@ -1,16 +0,0 @@
-# Load application.
-#
-require File.expand_path '../app', __FILE__
-
-# Load all indexes.
-#
-Picky::Indexes.load
-
-# Use Harakiri middleware to kill unicorn child after X requests.
-#
-# See http://vimeo.com/12614970 for more info.
-#
-# Rack::Harakiri.after = 1000
-# use Rack::Harakiri
-
-run StatisticsBookSearch
Oops, something went wrong.

0 comments on commit 8c0906f

Please sign in to comment.