embulk-filter-woothee 0.2.2 → 0.2.3

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: 0e0f77ef080cf37f82f2b5e3da9fd99965d4e375
4
- data.tar.gz: 86e16cbeedce578f3703c20cac9b4db7558410e1
3
+ metadata.gz: 29b01b60845eb6e721d785cf6e3f7ba92e8417bf
4
+ data.tar.gz: bbfc3a3bc6f53d60229bbcbe81e95806938a0198
5
5
  SHA512:
6
- metadata.gz: b6af3deadae077225e9f44519653041293e947572612f5322e847d7297c94a890a0ae4a8d0a7037b64883d8fb58e6c722dde7a521502dd40f2c62d9373c90bdc
7
- data.tar.gz: 50319ad8b1ed1ea352a5a7091f6d5457642fb1c374d7fda0e633992eeabc333975ea620ee0d3d5c0085023d9967fcb98bad6de28520cdc23c16b63e3e0498888
6
+ metadata.gz: 98ede3ff4cf315d83298117354d6ae000565abf5720de0ddaf14546988ba8bf8900fdfe62c45dd77f8112152fc01c5f8c0833a55b90b14e98acfd7f5897cf83e
7
+ data.tar.gz: 8e450339dfa94cf18e80c33e50b963a15484526b7ce09c0f1d8aa2d41d624401ff52b7d651707deb0acb065679eb7268057b31f08e3bcd3f3dd76b44bcfcab6a
data/build.gradle CHANGED
@@ -13,14 +13,14 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.2.2"
16
+ version = "0.2.3"
17
17
 
18
18
  sourceCompatibility = 1.7
19
19
  targetCompatibility = 1.7
20
20
 
21
21
  dependencies {
22
- compile "org.embulk:embulk-core:0.7.1"
23
- provided "org.embulk:embulk-core:0.7.1"
22
+ compile "org.embulk:embulk-core:0.7.5"
23
+ provided "org.embulk:embulk-core:0.7.5"
24
24
  compile 'is.tagomor.woothee:woothee-java:1.2.0'
25
25
  testCompile "junit:junit:4.+"
26
26
  }
@@ -108,39 +108,37 @@ public class WootheeFilterPlugin implements FilterPlugin
108
108
 
109
109
  return new PageOutput() {
110
110
  private PageReader reader = new PageReader(inputSchema);
111
+ private PageBuilder builder = new PageBuilder(Exec.getBufferAllocator(), outputSchema, output);
111
112
 
112
113
  @Override
113
114
  public void finish() {
114
- output.finish();
115
+ builder.finish();
115
116
  }
116
117
 
117
118
  @Override
118
119
  public void close() {
119
- output.close();
120
+ builder.close();
120
121
  }
121
122
 
122
123
  @Override
123
124
  public void add(Page page) {
124
125
  reader.setPage(page);
125
126
 
126
- try (final PageBuilder builder = new PageBuilder(Exec.getBufferAllocator(), outputSchema, output)) {
127
- while (reader.nextRecord()) {
128
- String userAgentString = reader.isNull(keyNameColumn) ? null : reader.getString(keyNameColumn);
129
- Map<String, String> ua = Classifier.parse(userAgentString);
130
- setValue(builder, ua);
131
- if (task.getFilterCategories().isPresent()) {
132
- if (task.getFilterCategories().orNull().contains(ua.get("category"))) {
133
- builder.addRecord();
134
- }
135
- } else if (task.getDropCategories().isPresent()) {
136
- if (!task.getDropCategories().orNull().contains(ua.get("category"))) {
137
- builder.addRecord();
138
- }
139
- } else {
127
+ while (reader.nextRecord()) {
128
+ String userAgentString = reader.isNull(keyNameColumn) ? null : reader.getString(keyNameColumn);
129
+ Map<String, String> ua = Classifier.parse(userAgentString);
130
+ setValue(builder, ua);
131
+ if (task.getFilterCategories().isPresent()) {
132
+ if (task.getFilterCategories().orNull().contains(ua.get("category"))) {
140
133
  builder.addRecord();
141
134
  }
135
+ } else if (task.getDropCategories().isPresent()) {
136
+ if (!task.getDropCategories().orNull().contains(ua.get("category"))) {
137
+ builder.addRecord();
138
+ }
139
+ } else {
140
+ builder.addRecord();
142
141
  }
143
- builder.finish();
144
142
  }
145
143
  }
146
144
 
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-filter-woothee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - toyama0919
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-24 00:00:00.000000000 Z
11
+ date: 2015-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- requirement: !ruby/object:Gem::Requirement
14
+ name: bundler
15
+ version_requirements: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - ~>
17
18
  - !ruby/object:Gem::Version
18
19
  version: '1.0'
19
- name: bundler
20
- prerelease: false
21
- type: :development
22
- version_requirements: !ruby/object:Gem::Requirement
20
+ requirement: !ruby/object:Gem::Requirement
23
21
  requirements:
24
22
  - - ~>
25
23
  - !ruby/object:Gem::Version
26
24
  version: '1.0'
25
+ prerelease: false
26
+ type: :development
27
27
  - !ruby/object:Gem::Dependency
28
- requirement: !ruby/object:Gem::Requirement
28
+ name: rake
29
+ version_requirements: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: '10.0'
33
- name: rake
34
- prerelease: false
35
- type: :development
36
- version_requirements: !ruby/object:Gem::Requirement
34
+ requirement: !ruby/object:Gem::Requirement
37
35
  requirements:
38
36
  - - '>='
39
37
  - !ruby/object:Gem::Version
40
38
  version: '10.0'
39
+ prerelease: false
40
+ type: :development
41
41
  description: Woothee filter plugin for Embulk
42
42
  email:
43
43
  - toyama0919@gmail.com
@@ -57,7 +57,7 @@ files:
57
57
  - lib/embulk/filter/woothee.rb
58
58
  - src/main/java/org/embulk/filter/WootheeFilterPlugin.java
59
59
  - src/test/java/org/embulk/filter/TestWootheeFilterPlugin.java
60
- - classpath/embulk-filter-woothee-0.2.2.jar
60
+ - classpath/embulk-filter-woothee-0.2.3.jar
61
61
  - classpath/woothee-java-1.2.0.jar
62
62
  homepage: https://github.com/toyama0919/embulk-filter-woothee
63
63
  licenses: