repertoire-faceting 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/INSTALL +18 -15
- data/ext/Makefile +1 -1
- data/ext/bytea/faceting_bytea.control +1 -1
- data/ext/signature/faceting.control +1 -1
- data/ext/varbit/faceting_varbit.control +1 -1
- data/lib/repertoire-faceting/model.rb +5 -0
- data/lib/repertoire-faceting/relation/calculations.rb +1 -1
- data/lib/repertoire-faceting/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d47f7e14757f6e2c1523e8745047d327fef7dba
|
4
|
+
data.tar.gz: 5bb0a9262e5da3c7583b5648f6989a0590117f27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 813572362a9d495466ae77a379b4691c94d7c18746c5f93d3327da903f6623aca3dd0338a1aacf17b30651f284b0caabd4fe6b3c253d65df55f4c1a9ec2f4338
|
7
|
+
data.tar.gz: 174cb320c4cd198c06cc05b02e2258f8a57ba4576e46c44f1bdfe482f6de3be2d252cfb75753e13c7c5dcccf143bd53aebf8110e6882d1cec0fe85b854bbdbe6
|
data/INSTALL
CHANGED
@@ -7,7 +7,7 @@ N.B. Repertoire Faceting requires Postgres 9.3+, Rails 3.2+, Ruby 2.0.0+, and J
|
|
7
7
|
(You need a working Rails app, with a model, controller, and a partial to show the model)
|
8
8
|
|
9
9
|
{ in Gemfile }
|
10
|
-
gem 'repertoire-faceting'
|
10
|
+
gem 'repertoire-faceting' [ 1 ]
|
11
11
|
|
12
12
|
{ install native bitset extensions }
|
13
13
|
$ bundle install
|
@@ -15,38 +15,41 @@ N.B. Repertoire Faceting requires Postgres 9.3+, Rails 3.2+, Ruby 2.0.0+, and J
|
|
15
15
|
|
16
16
|
{ in ./app/models/some_model.rb }
|
17
17
|
class SomeModel
|
18
|
-
include Repertoire::Faceting::Model
|
19
|
-
facet :some_column
|
18
|
+
include Repertoire::Faceting::Model [ 2 ]
|
19
|
+
facet :some_column [ 3 ]
|
20
20
|
end
|
21
21
|
|
22
22
|
{ in ./app/controllers/some_controller]
|
23
23
|
class SomeController
|
24
|
-
include Repertoire::Faceting::Controller
|
25
|
-
def base; return SomeModel; end
|
24
|
+
include Repertoire::Faceting::Controller [ 4 ]
|
25
|
+
def base; return SomeModel; end [ 5 ]
|
26
26
|
end
|
27
27
|
|
28
28
|
{ in ./config/routes.rb }
|
29
29
|
SomeApp::Application.routes.draw do
|
30
|
-
faceting_for :some_model
|
30
|
+
faceting_for :some_model [ 6 ]
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
|
33
|
+
{ in ./app/assets/javascripts/application.js }
|
34
|
+
//= require rep.faceting [ 7 ]
|
35
|
+
|
36
|
+
{ in ./app/assets/stylesheets/application.css} [ 8 ]
|
37
|
+
*= require rep.faceting
|
35
38
|
|
36
39
|
{ in ./app/views/some_controller/index.html.erb }
|
37
40
|
<script language="javascript">
|
38
41
|
$().ready(function() {
|
39
|
-
$('#paintings').facet_context();
|
40
|
-
$('.facet').facet();
|
41
|
-
$('#results').results();
|
42
|
+
$('#paintings').facet_context(); [ 9 ]
|
43
|
+
$('.facet').facet(); [ 10 ]
|
44
|
+
$('#results').results(); [ 11 ]
|
42
45
|
});
|
43
46
|
</script>
|
44
|
-
<div id='paintings'>
|
45
|
-
<div id='genre' class='facet'></div>
|
46
|
-
<div id='results'></div>
|
47
|
+
<div id='paintings'> [ 12 ]
|
48
|
+
<div id='genre' class='facet'></div> [ 13 ]
|
49
|
+
<div id='results'></div> [ 14 ]
|
47
50
|
</div>
|
48
51
|
|
49
|
-
... that's a complete faceted browser in only
|
52
|
+
... that's a complete faceted browser in only 14 new lines of code in your app!
|
50
53
|
|
51
54
|
Additionally, you may wish to index the facets. At the console or in a migration:
|
52
55
|
|
data/ext/Makefile
CHANGED
@@ -7,7 +7,7 @@ module Repertoire
|
|
7
7
|
|
8
8
|
# Construct and execute a count over the specified facet.
|
9
9
|
def count(name = nil, options = {})
|
10
|
-
if name.present? && @klass.facet?(name)
|
10
|
+
if name.present? && @klass.respond_to?(:facet?) && @klass.facet?(name)
|
11
11
|
name = name.to_sym
|
12
12
|
parent = @klass.facets[name]
|
13
13
|
facet = parent.merge(self)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: repertoire-faceting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher York
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|