legato 0.6.1 → 0.6.2
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/legato/model.rb +1 -1
- data/lib/legato/query.rb +8 -4
- data/lib/legato/version.rb +1 -1
- data/spec/lib/legato/model_spec.rb +2 -2
- 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: 4d2378f43a51af8784a18791483c114fdcfcaaff
         | 
| 4 | 
            +
              data.tar.gz: e395bbd3c4bda622d04ce876454959feb1d3d9ed
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 4f7614523c21e385d4ea0157d620c54af0b1e35643fc13ab5cf924570a5c7ba8d995a82a56859ed9ca67b82c5db7f74e0698b5f2085019792a802b2bf4c6b7dd
         | 
| 7 | 
            +
              data.tar.gz: 2eb7085a97a99d5ad21471b376641beb16e9b8927af25ef4f9b1a410a1a5f3de98a247f05f1e4b00f8a6974cc5cf1e4bbde174f7b737547a2546f0426a66026d
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        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). | 
| 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 =  | 
| 55 | 
            -
                  self.segment_filters =  | 
| 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 |  | 
    
        data/lib/legato/version.rb
    CHANGED
    
    
| @@ -116,13 +116,13 @@ describe "Legato::Model" do | |
| 116 116 | 
             
                it 'has results' do
         | 
| 117 117 | 
             
                  options = {}
         | 
| 118 118 | 
             
                  profile = stub
         | 
| 119 | 
            -
                  query = stub(: | 
| 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(: | 
| 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. | 
| 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- | 
| 11 | 
            +
            date: 2015-10-05 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rake
         |