garb 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -32,7 +32,7 @@ module Garb
|
|
32
32
|
param.map do |k,v|
|
33
33
|
next unless k.is_a?(SymbolOperator)
|
34
34
|
"#{URI.encode(k.to_google_analytics, /[=<>]/)}#{CGI::escape(v.to_s)}"
|
35
|
-
end.join('
|
35
|
+
end.join('%3B') # Hash AND (no duplicate keys), escape char for ';' fixes oauth
|
36
36
|
end.join(',') # Array OR
|
37
37
|
|
38
38
|
value.empty? ? {} : {'filters' => value}
|
@@ -5,7 +5,7 @@ module Garb
|
|
5
5
|
include ProfileReports
|
6
6
|
|
7
7
|
attr_reader :session, :path
|
8
|
-
attr_reader :id, :title, :account_id, :web_property_id
|
8
|
+
attr_reader :id, :table_id, :title, :account_id, :web_property_id
|
9
9
|
|
10
10
|
def self.all(session = Session, path = '/accounts/~all/webproperties/~all/profiles')
|
11
11
|
feed = Feed.new(session, path)
|
@@ -23,10 +23,11 @@ module Garb
|
|
23
23
|
def initialize(entry, session)
|
24
24
|
@session = session
|
25
25
|
@path = Garb.parse_link(entry, "self").gsub(Feed::BASE_URL, '')
|
26
|
-
@title = entry['title'].gsub('Google Analytics Profile ', '')
|
27
26
|
|
28
27
|
properties = Garb.parse_properties(entry)
|
29
28
|
@id = properties['profile_id']
|
29
|
+
@table_id = properties['table_id']
|
30
|
+
@title = properties['profile_name']
|
30
31
|
@account_id = properties['account_id']
|
31
32
|
@web_property_id = properties['web_property_id']
|
32
33
|
end
|
data/lib/garb/version.rb
CHANGED
data/lib/support.rb
CHANGED
@@ -17,18 +17,19 @@ class SymbolOperator
|
|
17
17
|
:does_not_contain => '!~',
|
18
18
|
:substring => '=@',
|
19
19
|
:not_substring => '!@',
|
20
|
-
:desc => '-'
|
20
|
+
:desc => '-',
|
21
|
+
:descending => '-'
|
21
22
|
}
|
22
23
|
|
23
24
|
target = Garb.to_google_analytics(@field)
|
24
25
|
operator = operators[@operator]
|
25
26
|
|
26
|
-
|
27
|
+
[:desc, :descending].include?(@operator) ? "#{operator}#{target}" : "#{target}#{operator}"
|
27
28
|
end
|
28
29
|
end
|
29
30
|
|
30
31
|
class Symbol
|
31
|
-
[:eql, :not_eql, :gt, :gte, :lt, :lte, :desc,
|
32
|
+
[:eql, :not_eql, :gt, :gte, :lt, :lte, :desc, :descending,
|
32
33
|
:matches, :does_not_match, :contains, :does_not_contain,
|
33
34
|
:substring, :not_substring].each do |operator|
|
34
35
|
|
@@ -42,7 +42,7 @@ module Garb
|
|
42
42
|
end
|
43
43
|
|
44
44
|
params = ['ga:city%3D%3DNew+York+City', 'ga:state%3D%3DNew+York']
|
45
|
-
assert_equal params, @filter_parameters.to_params['filters'].split('
|
45
|
+
assert_equal params, @filter_parameters.to_params['filters'].split('%3B').sort
|
46
46
|
end
|
47
47
|
|
48
48
|
should "properly encode operators" do
|
@@ -23,12 +23,12 @@ module Garb
|
|
23
23
|
context "A Profile" do
|
24
24
|
setup do
|
25
25
|
entry = {
|
26
|
-
"title" => "Google Analytics Profile example.com",
|
27
26
|
"link" => [{"rel" => "self", "href" => Feed::BASE_URL+"/accounts/1189765/webproperties/UA-1189765-1/profiles/98765"}],
|
28
27
|
"dxp:property" => [
|
29
28
|
{"name" => "ga:profileId", "value" => "98765"},
|
30
29
|
{"name" => "ga:accountId", "value" => "1189765"},
|
31
|
-
{"name" => "ga:webPropertyId", "value" => 'UA-1189765-1'}
|
30
|
+
{"name" => "ga:webPropertyId", "value" => 'UA-1189765-1'},
|
31
|
+
{"name" => "ga:profileName", "value" => "example.com"}
|
32
32
|
]
|
33
33
|
}
|
34
34
|
@profile = Profile.new(entry, Session)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: garb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 4
|
10
|
+
version: 0.8.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tony Pitale
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-11 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|