Permalink
Browse files

Last commit before machine change

  • Loading branch information...
1 parent 385b6a7 commit c6e44b76a65b6f544f2428e128872400c2c4ea86 coutud committed Oct 3, 2012
Showing with 2,376 additions and 153 deletions.
  1. +2 −0 .gitignore
  2. 0 .yardoc/checksums
  3. BIN .yardoc/objects/root.dat
  4. BIN .yardoc/proxy_types
  5. +9 −2 Gemfile
  6. +105 −68 Gemfile.lock
  7. +0 −23 app/controllers/main_controller.rb
  8. +24 −0 app/controllers/search_controller.rb
  9. +2 −0 app/helpers/search_helper.rb
  10. +3 −0 app/models/element.rb
  11. +2 −2 app/models/parser.rb
  12. +2 −0 app/models/parser/basic_file.rb
  13. +1 −1 app/views/elements/show.html.haml
  14. +7 −5 app/views/layouts/application.html.haml
  15. +0 −26 app/views/main/_search_results.html.haml
  16. +32 −0 app/views/search/_search_results.html.haml
  17. +19 −0 app/views/search/_view_details.html.haml
  18. +9 −0 app/views/search/_view_list.html.haml
  19. +12 −0 app/views/search/_view_tree.html.haml
  20. 0 app/views/{main/search.html.haml → search/index.html.haml}
  21. +2 −0 config/environments/development.rb
  22. +2 −2 config/routes.rb
  23. +81 −0 doc/_index.html
  24. +36 −0 doc/class_list.html
  25. +1 −0 doc/css/common.css
  26. +53 −0 doc/css/full_list.css
  27. +307 −0 doc/css/style.css
  28. +38 −0 doc/file_list.html
  29. +13 −0 doc/frames.html
  30. +202 −0 doc/js/app.js
  31. +149 −0 doc/js/full_list.js
  32. +154 −0 doc/js/jquery.js
  33. +35 −0 doc/method_list.html
  34. +45 −0 fields.readme
  35. +3 −0 launchers.readme
  36. +1 −1 lib/parser/image/std_image_parser.rb
  37. +346 −0 lib/tasks/freebase.rake
  38. +27 −1 lib/tasks/solr.rake
  39. +275 −0 public/stylesheets/sass/default.css
  40. +34 −22 public/stylesheets/sass/default.scss
  41. +211 −0 script/import_freebase.rb
  42. +106 −0 script/import_freebase.sh
  43. +14 −0 script/test_progress.rb
  44. +8 −0 test/functional/search_controller_test.rb
  45. +4 −0 test/unit/helpers/search_helper_test.rb
View
@@ -9,3 +9,5 @@ log
public/stylesheets/default.css
.sass-cache/
+db/solr
+tmpdata
View
No changes.
Binary file not shown.
View
Binary file not shown.
View
@@ -15,8 +15,6 @@ gem "will_paginate", "~> 3.0.pre2"
# Deploy with Capistrano
# gem 'capistrano'
-# To use debugger
-# gem 'ruby-debug'
# Bundle the extra gems:
gem "mongoid", "2.0.0.beta.17"
@@ -47,7 +45,16 @@ group :test do
gem "rspec-rails", ">= 2.0.0.beta.20"
end
group :development do
+ # To use debugger
+ gem 'ruby-debug19'
+
+ gem 'ansi'
gem 'rb-inotify'
+
+ # Needed for freebase import
+ gem 'bzip2-ruby'
+ gem 'em-http-request'
+
gem "wirble"
gem "rdoc"
end
View
@@ -5,7 +5,7 @@ GIT
shared-mime-info (0.1)
PATH
- remote: /home/wam/Dev/forks/sunspot_mongoid
+ remote: ~/Dev/forks/sunspot_mongoid
specs:
sunspot_mongoid (0.3.2)
mongoid
@@ -16,54 +16,68 @@ GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
- actionmailer (3.0.0)
- actionpack (= 3.0.0)
- mail (~> 2.2.5)
- actionpack (3.0.0)
- activemodel (= 3.0.0)
- activesupport (= 3.0.0)
+ actionmailer (3.0.3)
+ actionpack (= 3.0.3)
+ mail (~> 2.2.9)
+ actionpack (3.0.3)
+ activemodel (= 3.0.3)
+ activesupport (= 3.0.3)
builder (~> 2.1.2)
erubis (~> 2.6.6)
- i18n (~> 0.4.1)
+ i18n (~> 0.4)
rack (~> 1.2.1)
- rack-mount (~> 0.6.12)
- rack-test (~> 0.5.4)
+ rack-mount (~> 0.6.13)
+ rack-test (~> 0.5.6)
tzinfo (~> 0.3.23)
- activemodel (3.0.0)
- activesupport (= 3.0.0)
+ activemodel (3.0.3)
+ activesupport (= 3.0.3)
builder (~> 2.1.2)
- i18n (~> 0.4.1)
- activerecord (3.0.0)
- activemodel (= 3.0.0)
- activesupport (= 3.0.0)
- arel (~> 1.0.0)
+ i18n (~> 0.4)
+ activerecord (3.0.3)
+ activemodel (= 3.0.3)
+ activesupport (= 3.0.3)
+ arel (~> 2.0.2)
tzinfo (~> 0.3.23)
- activeresource (3.0.0)
- activemodel (= 3.0.0)
- activesupport (= 3.0.0)
- activesupport (3.0.0)
- arel (1.0.1)
- activesupport (~> 3.0.0)
- awesome_print (0.2.1)
+ activeresource (3.0.3)
+ activemodel (= 3.0.3)
+ activesupport (= 3.0.3)
+ activesupport (3.0.3)
+ addressable (2.2.3)
+ ansi (1.2.2)
+ archive-tar-minitar (0.5.2)
+ arel (2.0.7)
+ awesome_print (0.3.1)
bson (1.0.4)
bson_ext (1.0.4)
builder (2.1.2)
+ bzip2-ruby (0.2.7)
+ columnize (0.3.2)
diff-lcs (1.1.2)
+ em-http-request (0.3.0)
+ addressable (>= 2.0.0)
+ escape_utils
+ eventmachine (>= 0.12.9)
erubis (2.6.6)
abstract (>= 1.0.0)
escape (0.0.4)
- ffi (0.6.3)
+ escape_utils (0.1.9)
+ eventmachine (0.12.10)
+ ffi (1.0.5)
rake (>= 0.8.7)
- haml (3.0.18)
- hpricot (0.8.2)
- i18n (0.4.1)
- jquery-rails (0.2.4)
+ haml (3.0.25)
+ hpricot (0.8.3)
+ i18n (0.5.0)
+ jquery-rails (0.2.6)
rails (~> 3.0)
- json (1.4.6)
- mail (2.2.5)
+ thor (~> 0.14.4)
+ json (1.5.0)
+ linecache19 (0.5.11)
+ ruby_core_source (>= 0.1.4)
+ mail (2.2.14)
activesupport (>= 2.3.6)
- mime-types
- treetop (>= 1.4.5)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
mime-types (1.16)
mongo (1.0.7)
bson (>= 1.0.4)
@@ -73,29 +87,31 @@ GEM
mongo (= 1.0.7)
tzinfo (~> 0.3.22)
will_paginate (~> 3.0.pre)
+ nokogiri (1.4.4)
polyglot (0.3.1)
+ pr_geohash (1.0.0)
rack (1.2.1)
rack-mount (0.6.13)
rack (>= 1.0.0)
- rack-test (0.5.4)
+ rack-test (0.5.7)
rack (>= 1.0)
- rails (3.0.0)
- actionmailer (= 3.0.0)
- actionpack (= 3.0.0)
- activerecord (= 3.0.0)
- activeresource (= 3.0.0)
- activesupport (= 3.0.0)
- bundler (~> 1.0.0)
- railties (= 3.0.0)
- railties (3.0.0)
- actionpack (= 3.0.0)
- activesupport (= 3.0.0)
- rake (>= 0.8.4)
- thor (~> 0.14.0)
+ rails (3.0.3)
+ actionmailer (= 3.0.3)
+ actionpack (= 3.0.3)
+ activerecord (= 3.0.3)
+ activeresource (= 3.0.3)
+ activesupport (= 3.0.3)
+ bundler (~> 1.0)
+ railties (= 3.0.3)
+ railties (3.0.3)
+ actionpack (= 3.0.3)
+ activesupport (= 3.0.3)
+ rake (>= 0.8.7)
+ thor (~> 0.14.4)
rake (0.8.7)
- rb-inotify (0.8.1)
+ rb-inotify (0.8.4)
ffi (>= 0.5.0)
- rdoc (2.5.11)
+ rdoc (3.4)
resque-mongo (1.9.8.1)
json (>= 1.1.0)
mongo (>= 1.0.0)
@@ -104,29 +120,46 @@ GEM
rmagick (2.13.1)
rsolr (0.12.1)
builder (>= 2.1.2)
- rspec (2.0.0.beta.20)
- rspec-core (= 2.0.0.beta.20)
- rspec-expectations (= 2.0.0.beta.20)
- rspec-mocks (= 2.0.0.beta.20)
- rspec-core (2.0.0.beta.20)
- rspec-expectations (2.0.0.beta.20)
- diff-lcs (>= 1.1.2)
- rspec-mocks (2.0.0.beta.20)
- rspec-rails (2.0.0.beta.20)
- rspec (= 2.0.0.beta.20)
+ rspec (2.4.0)
+ rspec-core (~> 2.4.0)
+ rspec-expectations (~> 2.4.0)
+ rspec-mocks (~> 2.4.0)
+ rspec-core (2.4.0)
+ rspec-expectations (2.4.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.4.0)
+ rspec-rails (2.4.1)
+ actionpack (~> 3.0)
+ activesupport (~> 3.0)
+ railties (~> 3.0)
+ rspec (~> 2.4.0)
+ ruby-debug-base19 (0.11.24)
+ columnize (>= 0.3.1)
+ linecache19 (>= 0.5.11)
+ ruby_core_source (>= 0.1.4)
+ ruby-debug19 (0.11.6)
+ columnize (>= 0.3.1)
+ linecache19 (>= 0.5.11)
+ ruby-debug-base19 (>= 0.11.19)
ruby-mp3info (0.6.13)
- sinatra (1.0)
- rack (>= 1.0)
- sunspot (1.1.0)
+ ruby_core_source (0.1.4)
+ archive-tar-minitar (>= 0.5.2)
+ sinatra (1.1.2)
+ rack (~> 1.1)
+ tilt (~> 1.2)
+ sunspot (1.2.1)
escape (= 0.0.4)
+ pr_geohash (~> 1.0)
rsolr (= 0.12.1)
- sunspot_rails (1.1.0)
- sunspot (= 1.1.0)
- thor (0.14.0)
- treetop (1.4.8)
+ sunspot_rails (1.2.1)
+ nokogiri
+ sunspot (= 1.2.1)
+ thor (0.14.6)
+ tilt (1.2.2)
+ treetop (1.4.9)
polyglot (>= 0.3.1)
- tzinfo (0.3.23)
- vegas (0.1.7)
+ tzinfo (0.3.24)
+ vegas (0.1.8)
rack (>= 1.0.0)
will_paginate (3.0.pre2)
wirble (0.1.3)
@@ -135,8 +168,11 @@ PLATFORMS
ruby
DEPENDENCIES
+ ansi
awesome_print
bson_ext (= 1.0.4)
+ bzip2-ruby
+ em-http-request
haml
hpricot
jquery-rails
@@ -148,6 +184,7 @@ DEPENDENCIES
rmagick
rspec
rspec-rails (>= 2.0.0.beta.20)
+ ruby-debug19
ruby-mp3info
shared-mime-info!
sunspot
@@ -1,27 +1,4 @@
class MainController < ApplicationController
def index
end
-
- def search
- @query = params[:q]
-
- if @query.blank?
- render :text=>""
- return
- end
-
- @search = Sunspot.search(Element) do
- keywords params[:q] do
- highlight
- end
- facet :media
- if params[:media]
- with(:media, params[:media])
- end
- end
-
- if request.xhr?
- render :partial=>'search_results', :locals=>{:search=>@search, :query=>@query}
- end
- end
end
@@ -0,0 +1,24 @@
+class SearchController < ApplicationController
+ def index
+ @query = params[:q]
+
+ if @query.blank?
+ render :text=>""
+ return
+ end
+
+ @search = Sunspot.search(Element) do
+ keywords params[:q] do
+ highlight
+ end
+ facet :media
+ if params[:media]
+ with(:media, params[:media])
+ end
+ end
+
+ if request.xhr?
+ render :partial=>'search_results', :locals=>{:search=>@search, :query=>@query}
+ end
+ end
+end
@@ -0,0 +1,2 @@
+module SearchHelper
+end
@@ -73,6 +73,9 @@ def mime_type
self[:mime_type] && self[:mime_type].split('/').first
end
+
+ # TODO: Add size index
+
# dynamic_text :custom_fields do
# self[:indexed_fields] = (self[:indexed_fields] || []).uniq
# h = self[:indexed_fields].inject({}) do |hash, field|
@@ -5,7 +5,7 @@ class Parser
# Priority to be used for the parser
# Smaller numbers get called before high numbers
#
- field :priority, :type=>Integer
+ field :priority, :type=>Integer, :default=>100
#
# Limit to only files with these mime_types.
# This gives a hint to the analyze worker but doesn't ensure that your parser will only
@@ -27,7 +27,7 @@ def self.all_for_mime_type(mime_type)
all
else
any_in(
- :mime_types => [ Regexp.new(mime_type || ""), nil ]
+ :mime_types => mime_type.split("/").inject([]) {|a,e| a.empty? ? [e] : a << a.last + "/" + e} << nil
)
end
end
@@ -5,6 +5,8 @@
# Define fields :
# size : integer, size of the field in bytes
# mime_type : string, magic-guessed mime_type
+# mtime : last modification time for the file
+# content_hash : a sha1 digest of the size and the first 50k of file content
#
#
require 'digest/sha1'
@@ -8,5 +8,5 @@
%li= link_to child.name, child
%h2 Attributes
-%p= ap @element.attributes
+%p= ap @element.attributes.reject{|k,v| k.to_s.start_with?("blob/")}
%p= link_to @element.col, collection_url(@element.col)
@@ -19,7 +19,7 @@
%h1
Loox
%sup 0.0a
- %h2 I can tell your disk is a mess by the way it is.
+ %h2 I can tell your disk is a mess because of the way it is.
#menu
= render :partial => 'layouts/menu'
- if content_for?(:search)
@@ -75,7 +75,9 @@
/ Normal content area end
.divider1
#footer
- .left © 2010 Loox
- .right
- Design by
- %a{:href => "http://www.nodethirtythree.com/"} NodeThirtyThree Design
+ .left
+ © 2010 Loox
+ = link_to "Resque", resque_url
+ .right
+ Design by
+ %a{:href => "http://www.nodethirtythree.com/"} NodeThirtyThree Design
Oops, something went wrong.

0 comments on commit c6e44b7

Please sign in to comment.