embulk-input-google_analytics 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/embulk-input-google_analytics.gemspec +1 -1
- data/lib/embulk/input/google_analytics/client.rb +1 -0
- data/lib/embulk/input/google_analytics/plugin.rb +3 -1
- data/test/embulk/input/google_analytics/test_client.rb +5 -1
- data/test/embulk/input/google_analytics/test_plugin.rb +4 -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: 45cf305036e0b44cbd5f8dc0327280406b9f541b
|
4
|
+
data.tar.gz: 357797127e74378167f8ef27cf0e10d2a5c4223e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5417ea74d3e6a700a0f42edc4558ca7a4fe5e56024aa79f9c49c8122c96acbb7519697805fed62d8fde13989a176dd00dc35bee3337fd9549b3b746bf42ae30
|
7
|
+
data.tar.gz: 6fec758e1ee78ca9e4055060bca8caef42ac3be47d97ef0623d7790135c40bf945627618ac92507a16da029a4760043db7cdec41a91507ec390a9dbec7ddf8a9
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 0.1.4 - 2016-08-19
|
2
|
+
* Always add `view_id` into records [#9](https://github.com/treasure-data/embulk-input-google_analytics/pull/9)
|
3
|
+
|
1
4
|
## 0.1.3 - 2016-08-15
|
2
5
|
* Use net/http to avoid TLS error [#8](https://github.com/treasure-data/embulk-input-google_analytics/pull/8)
|
3
6
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
spec.name = "embulk-input-google_analytics"
|
4
|
-
spec.version = "0.1.
|
4
|
+
spec.version = "0.1.4"
|
5
5
|
spec.authors = ["uu59"]
|
6
6
|
spec.summary = "Google Analytics input plugin for Embulk"
|
7
7
|
spec.description = "Loads records from Google Analytics."
|
@@ -36,6 +36,8 @@ module Embulk
|
|
36
36
|
Column.new(nil, canonicalize_column_name(col_name), col_type)
|
37
37
|
end
|
38
38
|
|
39
|
+
columns << Column.new(nil, "view_id", :string)
|
40
|
+
|
39
41
|
resume(task, columns, 1, &control)
|
40
42
|
end
|
41
43
|
|
@@ -81,7 +83,7 @@ module Embulk
|
|
81
83
|
|
82
84
|
def run
|
83
85
|
client = Client.new(task, preview?)
|
84
|
-
columns = self.class.columns_from_task(task)
|
86
|
+
columns = self.class.columns_from_task(task) + ["view_id"]
|
85
87
|
|
86
88
|
last_record_time = task["last_record_time"] ? Time.parse(task["last_record_time"]) : nil
|
87
89
|
|
@@ -271,7 +271,8 @@ module Embulk
|
|
271
271
|
sub_test_case "each_report_row" do
|
272
272
|
setup do
|
273
273
|
conf = valid_config["in"]
|
274
|
-
@
|
274
|
+
@task = task(embulk_config(conf))
|
275
|
+
@client = Client.new(@task)
|
275
276
|
stub(@client).get_profile { {timezone: "Asia/Tokyo"} }
|
276
277
|
@logger = Logger.new(File::NULL)
|
277
278
|
stub(Embulk).logger { @logger }
|
@@ -290,18 +291,21 @@ module Embulk
|
|
290
291
|
"ga:browser" => "curl",
|
291
292
|
"ga:visits" => "1",
|
292
293
|
"ga:pageviews" => "1",
|
294
|
+
"view_id" => @task["view_id"],
|
293
295
|
},
|
294
296
|
{
|
295
297
|
"ga:dateHour" => @client.time_parse_with_profile_timezone("2016060121"),
|
296
298
|
"ga:browser" => "curl",
|
297
299
|
"ga:visits" => "2",
|
298
300
|
"ga:pageviews" => "2",
|
301
|
+
"view_id" => @task["view_id"],
|
299
302
|
},
|
300
303
|
{
|
301
304
|
"ga:dateHour" => @client.time_parse_with_profile_timezone("2016060122"),
|
302
305
|
"ga:browser" => "curl",
|
303
306
|
"ga:visits" => "3",
|
304
307
|
"ga:pageviews" => "3",
|
308
|
+
"view_id" => @task["view_id"],
|
305
309
|
},
|
306
310
|
]
|
307
311
|
assert_equal expected, fetched_rows
|
@@ -40,6 +40,7 @@ module Embulk
|
|
40
40
|
Embulk::Column.new(nil, "browser", :string),
|
41
41
|
Embulk::Column.new(nil, "visits", :long),
|
42
42
|
Embulk::Column.new(nil, "pageviews", :long),
|
43
|
+
Embulk::Column.new(nil, "view_id", :string),
|
43
44
|
]
|
44
45
|
mock(Plugin).resume(anything, columns, 1)
|
45
46
|
Plugin.transaction(embulk_config(valid_config["in"]))
|
@@ -115,6 +116,7 @@ module Embulk
|
|
115
116
|
Column.new(nil, "ctr", :double),
|
116
117
|
Column.new(nil, "visits", :long),
|
117
118
|
Column.new(nil, "items_per_purchase", :double),
|
119
|
+
Column.new(nil, "view_id", :string),
|
118
120
|
]
|
119
121
|
|
120
122
|
mock(Plugin).resume(anything, expected_columns, anything)
|
@@ -152,7 +154,7 @@ module Embulk
|
|
152
154
|
end
|
153
155
|
end
|
154
156
|
|
155
|
-
mock(@page_builder).add([time, "wget", 3, 4])
|
157
|
+
mock(@page_builder).add([time, "wget", 3, 4, nil]) # nil for view_id
|
156
158
|
mock(@page_builder).finish
|
157
159
|
@plugin.run
|
158
160
|
end
|
@@ -209,7 +211,7 @@ module Embulk
|
|
209
211
|
end
|
210
212
|
end
|
211
213
|
|
212
|
-
mock(@page_builder).add([time, "wget", 3, 4])
|
214
|
+
mock(@page_builder).add([time, "wget", 3, 4, nil]) # nil for view_id
|
213
215
|
mock(@page_builder).finish
|
214
216
|
@plugin.run
|
215
217
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-google_analytics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- uu59
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|