compendium 1.1.3.3 → 1.1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YThkODFkMDI0MDhhNjY4MzE4MWVhODA4ZTkxOGQ3MDg2YzM4YmQzYQ==
4
+ ZTRmMzFjMzFhMTA3YjVjNDMwYjM0NzQwYjFhMWMxMDNlZjdlZGQ0ZQ==
5
5
  data.tar.gz: !binary |-
6
- N2M4NGEyMWUyZTA4MmM1NmMxZTQ5N2JlMTk4NDg3NDVmZTc4ZjM2OA==
6
+ MWEzM2NiMjk2ZjhiNGE5YmIwNjkzNjY0MTRkMDI1YWU3OGE1NWE3Ng==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTFmMTE3YWFlMGI4YjM1YTY5MzQ1ODY0NWJkNThkMGZjMTQ0MGMwYjY5NzM1
10
- MDc0OWU2MDlmZGE5YzNlOTNhYjJiMDk2ZTY3NjA5Njc2NjU0YmRhNjE4OGE3
11
- MjBjNGJmMmViOTI5MTVlODI5N2YyZTM1NTFkNGJiNjIwYzRhN2U=
9
+ MWRlMjMxNTlkNDg4ZTUxMmRhZjBhZjJlZjVmNDJlZTRkMmVkY2Y1Nzg3YzM0
10
+ YzI2YTY0NGYzODdmOGFkNmI1NTBmMDVmNzBjZTI3ODBiMDdlMzJiZDk3OWZk
11
+ NDhjMjk2NDlmZTdkOTJkMTc3NWJjZGE1ZTcxZGQ0N2RkODNiODE=
12
12
  data.tar.gz: !binary |-
13
- ZDdjZmJiNDJhNDllZjQxMzc0YWQ4MWQ2NTY1NzBkOGVmY2M3ZmViOWZhZjM0
14
- YmIxYzk0NzQ1NjAyNThjZDFjMzAyNzcxMTQyYzM3MzhkOGRkN2VhYWFlMDdh
15
- YjlkMGRlZjNjODkzYTAwYmYwMTcwNGJiODQ1ZWNhNmYwYjZlZjc=
13
+ ZGMzNzk4NGVhMDU0NjU1MDVjNGYyYzM2ZjIyMWZjOTc5MzgwMDEyNWEzYzcz
14
+ NTgwZGQ2OTA0YTMwNDZhYTAyYWNlMWQ1MGYzZDM0ZWQ3YTRmODE0MzAzMDUy
15
+ MzNlYjQ0NDNiZGJlMDViOTQ0NDRmNDcwMDc5MTJiNWMzYTk0NzY=
@@ -24,6 +24,7 @@ module Compendium
24
24
  def initialize_clone(*)
25
25
  super
26
26
  @metrics = @metrics.clone
27
+ @filters = @filters.clone
27
28
  end
28
29
 
29
30
  def run(params, context = self)
@@ -1,3 +1,3 @@
1
1
  module Compendium
2
- VERSION = "1.1.3.3"
2
+ VERSION = "1.1.3.4"
3
3
  end
data/spec/report_spec.rb CHANGED
@@ -264,4 +264,36 @@ describe Compendium::Report do
264
264
  end
265
265
  end
266
266
  end
267
+
268
+ describe '.filter' do
269
+ let(:filter_proc) { -> * {} }
270
+
271
+ let(:report_class) do
272
+ Class.new(described_class) do
273
+ query :main_query
274
+ end
275
+ end
276
+
277
+ let(:subclass1) do
278
+ k = Class.new(report_class)
279
+ k.filter(:main_query, &filter_proc)
280
+ k
281
+ end
282
+
283
+ let(:subclass2) { Class.new(report_class) }
284
+ let(:subclass3) { Class.new(subclass1) }
285
+
286
+ it 'should add filters to the specified query' do
287
+ subclass1.main_query.filters.should include filter_proc
288
+ end
289
+
290
+ it 'should add filters by inheritence' do
291
+ subclass3.main_query.filters.should include filter_proc
292
+ end
293
+
294
+ it 'should not bleed filters from a subclass into other subclasses' do
295
+ subclass1
296
+ subclass2.main_query.filters.should be_empty
297
+ end
298
+ end
267
299
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compendium
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3.3
4
+ version: 1.1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Vandersluis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-22 00:00:00.000000000 Z
11
+ date: 2015-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  type: :runtime