legato 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9077eb3bf7200ccae8aaa176ae3199c983501ca
4
- data.tar.gz: efd2b61790708f18b5be1bf612ae3267b99de0bd
3
+ metadata.gz: 4d2378f43a51af8784a18791483c114fdcfcaaff
4
+ data.tar.gz: e395bbd3c4bda622d04ce876454959feb1d3d9ed
5
5
  SHA512:
6
- metadata.gz: d90896b83ec99911d48a493cd990c731f5a6e05a11551162510ac2956339c343a0262730e065dddcc0690fbcefcdd024a8228c45e4c146c6055d85ba481ce0c0
7
- data.tar.gz: 88fd641061a3b056833dba164ee8c7b22a9318c9b6fd922b687626f82f6f26da61c8cf85237ebb4f941200edba58b1f1eda96221f3028c4934744719dc978c7a
6
+ metadata.gz: 4f7614523c21e385d4ea0157d620c54af0b1e35643fc13ab5cf924570a5c7ba8d995a82a56859ed9ca67b82c5db7f74e0698b5f2085019792a802b2bf4c6b7dd
7
+ data.tar.gz: 2eb7085a97a99d5ad21471b376641beb16e9b8927af25ef4f9b1a410a1a5f3de98a247f05f1e4b00f8a6974cc5cf1e4bbde174f7b737547a2546f0426a66026d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## Legato 0.6.2 ##
2
+
3
+ * Add `filters` and `segment_filters` to query duplicating
4
+
5
+ *Tony Pitale*
6
+
1
7
  ## Legato 0.6.1 ##
2
8
 
3
9
  * Fix bug in `Query` where calling `results` did not retain previous basic options
data/lib/legato/model.rb CHANGED
@@ -87,7 +87,7 @@ module Legato
87
87
  # to Google Analytics which returns the result data
88
88
  def results(profile, options = {})
89
89
  # TODO: making tracking scope configurable when results are querried. not sure how to do this.
90
- Query.new(self).results(profile, options)
90
+ Query.new(self).apply_options(options.merge(:profile => profile))
91
91
  end
92
92
 
93
93
  # Builds a `query` and sets the `realtime` property
data/lib/legato/query.rb CHANGED
@@ -45,14 +45,14 @@ module Legato
45
45
  attr_accessor :tracking_scope
46
46
 
47
47
  def self.from_query(query)
48
- new(query.parent_klass, query.tracking_scope)
48
+ new(query.parent_klass, query.tracking_scope, query.filters, query.segment_filters)
49
49
  end
50
50
 
51
- def initialize(klass, tracking_scope = "ga")
51
+ def initialize(klass, tracking_scope = "ga", filters = FilterSet.new, segment_filters = FilterSet.new)
52
52
  @loaded = false
53
53
  @parent_klass = klass
54
- self.filters = FilterSet.new
55
- self.segment_filters = FilterSet.new
54
+ self.filters = filters
55
+ self.segment_filters = segment_filters
56
56
  self.start_date = Time.now - MONTH
57
57
  self.end_date = Time.now
58
58
  self.tracking_scope = tracking_scope
@@ -99,6 +99,10 @@ module Legato
99
99
  options[:sort] = options.delete(:sort)
100
100
  end
101
101
 
102
+ if options.has_key?(:profile)
103
+ self.profile = options.delete(:profile)
104
+ end
105
+
102
106
  apply_basic_options(options)
103
107
  # apply_filter_options(options[:filters])
104
108
 
@@ -1,3 +1,3 @@
1
1
  module Legato
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
@@ -116,13 +116,13 @@ describe "Legato::Model" do
116
116
  it 'has results' do
117
117
  options = {}
118
118
  profile = stub
119
- query = stub(:results => "a query")
119
+ query = stub(:apply_options => "a query")
120
120
  Legato::Query.stubs(:new).returns(query)
121
121
 
122
122
  @model.results(profile, options).should == "a query"
123
123
 
124
124
  Legato::Query.should have_received(:new).with(@model)
125
- query.should have_received(:results).with(profile, options)
125
+ query.should have_received(:apply_options).with(options.merge(:profile => profile))
126
126
  end
127
127
 
128
128
  it 'has a query with realtime set' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Pitale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-02 00:00:00.000000000 Z
11
+ date: 2015-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake