embulk-decoder-commons-compress 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd62d7f31311b2fcf3e2091f0d43becd2ad31cab
4
- data.tar.gz: d793da61a35a2604dd0fc20cacdbcade5121b420
3
+ metadata.gz: 47b9aa18792d34a7a3797a6d62d6a2fb2b53cd05
4
+ data.tar.gz: 0bc509836d83388502cc224d51a88abb4f3e8832
5
5
  SHA512:
6
- metadata.gz: 6ea9c164aefef4d425a433026ffb39d96923ca6732ac98e5c3cf7a8ccab11b5492e6c38a200da066dc8d827d3514592cb683b8fc2c0f7a8a946b5629faa460f2
7
- data.tar.gz: a8f86138f61245b4a60423b736131f7a460e989ef04bb03df1e26c3a4bcbdecbec45a926fc1fd38c8ba3c6cc2c7d9230e65e8fda721eca222c49ed6885aed941
6
+ metadata.gz: 39d37955797132ed222662abeddb0c7c03a3d455970107576c03291b9320f706ae6fd85cd2c5b163bb92ed26624231f13d24dcddfb213474759e5ff2337107a8
7
+ data.tar.gz: 8693b5648dd1975257d6be8269d82ac69e259150542e7e03d5764bc8c41cf24c1564ff65d7d051c8d9d344baa9fdb4277dab462f619027115d42d3c53586e5e5
data/build.gradle CHANGED
@@ -16,12 +16,12 @@ configurations {
16
16
  provided
17
17
  }
18
18
 
19
- version = "0.3.0"
19
+ version = "0.3.1"
20
20
 
21
21
  dependencies {
22
- compile "org.embulk:embulk-core:0.4.6"
22
+ compile "org.embulk:embulk-core:0.7.0"
23
23
  compile "org.apache.commons:commons-compress:1.9"
24
- provided "org.embulk:embulk-core:0.4.6"
24
+ provided "org.embulk:embulk-core:0.7.0"
25
25
  // compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
26
26
  testCompile "org.jmockit:jmockit:1.15"
27
27
  testCompile "junit:junit:4.+"
@@ -44,7 +44,7 @@ task gemspec << { file("build/gemspec").write($/
44
44
  Gem::Specification.new do |spec|
45
45
  spec.name = "${project.name}"
46
46
  spec.version = "${project.version}"
47
- spec.authors = ["Hiroki Ata"]
47
+ spec.authors = ["hata"]
48
48
  spec.summary = %[Commons Compress decoder plugin for Embulk]
49
49
  spec.description = %[Commons Compress decoder plugin is an Embulk plugin that decodes files using Apache Commons Compress library. It is read by any file input plugins. Search the file input plugins by 'embulk-input file' keywords.]
50
50
  spec.email = ["hiroki.ata@gmail.com"]
@@ -28,7 +28,6 @@ import org.embulk.config.ConfigDefault;
28
28
  import org.embulk.config.ConfigSource;
29
29
  import org.embulk.config.DataSource;
30
30
  import org.embulk.config.TaskSource;
31
- import org.embulk.exec.PooledBufferAllocator;
32
31
  import org.embulk.spi.Buffer;
33
32
  import org.embulk.spi.BufferAllocator;
34
33
  import org.embulk.spi.DecoderPlugin;
@@ -97,7 +96,7 @@ public class TestCommonsCompressDecoderPlugin
97
96
  task.getFormat(); result = "tar";
98
97
  input.nextFile(); result = true; result = false;
99
98
  input.poll(); result = getResourceAsBuffer("sample_0.tar");
100
- task.getBufferAllocator(); result = new PooledBufferAllocator();
99
+ task.getBufferAllocator(); result = newBufferAllocator();
101
100
  }};
102
101
 
103
102
  CommonsCompressDecoderPlugin plugin = new CommonsCompressDecoderPlugin();
@@ -121,7 +120,7 @@ public class TestCommonsCompressDecoderPlugin
121
120
  task.getFormat(); result = "tar";
122
121
  input.nextFile(); result = true; result = false;
123
122
  input.poll(); result = getResourceAsBuffer("sample_1.tar");
124
- task.getBufferAllocator(); result = new PooledBufferAllocator();
123
+ task.getBufferAllocator(); result = newBufferAllocator();
125
124
  }};
126
125
 
127
126
  CommonsCompressDecoderPlugin plugin = new CommonsCompressDecoderPlugin();
@@ -146,7 +145,7 @@ public class TestCommonsCompressDecoderPlugin
146
145
  task.getFormat(); result = "tar";
147
146
  input.nextFile(); result = true; result = false;
148
147
  input.poll(); result = getResourceAsBuffer("samples.tar");
149
- task.getBufferAllocator(); result = new PooledBufferAllocator();
148
+ task.getBufferAllocator(); result = newBufferAllocator();
150
149
  }};
151
150
 
152
151
  CommonsCompressDecoderPlugin plugin = new CommonsCompressDecoderPlugin();
@@ -174,7 +173,7 @@ public class TestCommonsCompressDecoderPlugin
174
173
  task.getFormat(); result = "zip";
175
174
  input.nextFile(); result = true; result = true; result = false; // two files.
176
175
  input.poll(); result = getResourceAsBuffer("samples.zip"); result = getResourceAsBuffer("samples.zip");
177
- task.getBufferAllocator(); result = new PooledBufferAllocator();
176
+ task.getBufferAllocator(); result = newBufferAllocator();
178
177
  }};
179
178
 
180
179
  CommonsCompressDecoderPlugin plugin = new CommonsCompressDecoderPlugin();
@@ -196,7 +195,7 @@ public class TestCommonsCompressDecoderPlugin
196
195
  task.getFormat(); result = "";
197
196
  input.nextFile(); result = true; result = false;
198
197
  input.poll(); result = getResourceAsBuffer("sample_1.tar");
199
- task.getBufferAllocator(); result = new PooledBufferAllocator();
198
+ task.getBufferAllocator(); result = newBufferAllocator();
200
199
  }};
201
200
 
202
201
  CommonsCompressDecoderPlugin plugin = new CommonsCompressDecoderPlugin();
@@ -218,7 +217,7 @@ public class TestCommonsCompressDecoderPlugin
218
217
  task.getFormat(); result = "";
219
218
  input.nextFile(); result = true; result = false;
220
219
  input.poll(); result = getResourceAsBuffer("sample_1.csv"); // This is not an archive.
221
- task.getBufferAllocator(); result = new PooledBufferAllocator();
220
+ task.getBufferAllocator(); result = newBufferAllocator();
222
221
  }};
223
222
 
224
223
  CommonsCompressDecoderPlugin plugin = new CommonsCompressDecoderPlugin();
@@ -234,7 +233,7 @@ public class TestCommonsCompressDecoderPlugin
234
233
  task.getFormat(); result = "tar";
235
234
  input.nextFile(); result = true; result = false;
236
235
  input.poll(); result = getResourceAsBuffer("samples.zip"); // This is not tar file.
237
- task.getBufferAllocator(); result = new PooledBufferAllocator();
236
+ task.getBufferAllocator(); result = newBufferAllocator();
238
237
  }};
239
238
 
240
239
  CommonsCompressDecoderPlugin plugin = new CommonsCompressDecoderPlugin();
@@ -301,7 +300,7 @@ public class TestCommonsCompressDecoderPlugin
301
300
  task.getFormat(); result = "tgz";
302
301
  input.nextFile(); result = true; result = false;
303
302
  input.poll(); result = getResourceAsBuffer("samples.tgz");
304
- task.getBufferAllocator(); result = new PooledBufferAllocator();
303
+ task.getBufferAllocator(); result = newBufferAllocator();
305
304
  }};
306
305
 
307
306
  CommonsCompressDecoderPlugin plugin = new CommonsCompressDecoderPlugin();
@@ -323,7 +322,7 @@ public class TestCommonsCompressDecoderPlugin
323
322
  task.getFormat(); result = "tar.gz";
324
323
  input.nextFile(); result = true; result = false;
325
324
  input.poll(); result = getResourceAsBuffer("samples.tar.gz");
326
- task.getBufferAllocator(); result = new PooledBufferAllocator();
325
+ task.getBufferAllocator(); result = newBufferAllocator();
327
326
  }};
328
327
 
329
328
  CommonsCompressDecoderPlugin plugin = new CommonsCompressDecoderPlugin();
@@ -346,7 +345,7 @@ public class TestCommonsCompressDecoderPlugin
346
345
  task.getFormat(); result = "tar.bz2";
347
346
  input.nextFile(); result = true; result = false;
348
347
  input.poll(); result = getResourceAsBuffer("samples.tar.bz2");
349
- task.getBufferAllocator(); result = new PooledBufferAllocator();
348
+ task.getBufferAllocator(); result = newBufferAllocator();
350
349
  }};
351
350
 
352
351
  CommonsCompressDecoderPlugin plugin = new CommonsCompressDecoderPlugin();
@@ -369,7 +368,7 @@ public class TestCommonsCompressDecoderPlugin
369
368
  task.getFormat(); result = "tar.Z";
370
369
  input.nextFile(); result = true; result = false;
371
370
  input.poll(); result = getResourceAsBuffer("samples.tar.Z");
372
- task.getBufferAllocator(); result = new PooledBufferAllocator();
371
+ task.getBufferAllocator(); result = newBufferAllocator();
373
372
  }};
374
373
 
375
374
  CommonsCompressDecoderPlugin plugin = new CommonsCompressDecoderPlugin();
@@ -452,6 +451,10 @@ public class TestCommonsCompressDecoderPlugin
452
451
  return new ByteArrayInputStream(bout.toByteArray());
453
452
  }
454
453
 
454
+ private BufferAllocator newBufferAllocator() {
455
+ return new MockBufferAllocator();
456
+ }
457
+
455
458
  private class MockTaskSource implements TaskSource {
456
459
  private final String format;
457
460
 
@@ -531,6 +534,19 @@ public class TestCommonsCompressDecoderPlugin
531
534
  public TaskSource setNested(String arg0, DataSource arg1) {
532
535
  return null;
533
536
  }
537
+
538
+ public boolean has(String arg0) {
539
+ return false;
540
+ }
541
+
542
+ public TaskSource getNestedOrGetEmpty(String arg0) {
543
+ return null;
544
+ }
545
+
546
+ @Override
547
+ public TaskSource remove(String arg0) {
548
+ return null;
549
+ }
534
550
 
535
551
  }
536
552
 
@@ -557,17 +573,15 @@ public class TestCommonsCompressDecoderPlugin
557
573
 
558
574
  @Override
559
575
  public BufferAllocator getBufferAllocator() {
560
- return new PooledBufferAllocator();
576
+ return newBufferAllocator();
561
577
  }
562
578
  }
563
579
 
564
580
  private class MockFileInput implements FileInput {
565
581
  Buffer buffer;
566
- int pos;
567
582
 
568
583
  MockFileInput(Buffer buffer) {
569
584
  this.buffer = buffer;
570
- pos = -1;
571
585
  }
572
586
 
573
587
  @Override
@@ -590,4 +604,16 @@ public class TestCommonsCompressDecoderPlugin
590
604
  }
591
605
  }
592
606
  }
607
+
608
+ private class MockBufferAllocator implements BufferAllocator {
609
+ @Override
610
+ public Buffer allocate() {
611
+ return allocate(8192);
612
+ }
613
+
614
+ @Override
615
+ public Buffer allocate(int size) {
616
+ return Buffer.allocate(size);
617
+ }
618
+ }
593
619
  }
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-decoder-commons-compress
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
- - Hiroki Ata
7
+ - hata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-02 00:00:00.000000000 Z
11
+ date: 2015-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
14
  requirement: !ruby/object:Gem::Requirement
21
15
  requirements:
22
16
  - - ~>
23
17
  - !ruby/object:Gem::Version
24
18
  version: '1.0'
19
+ name: bundler
25
20
  prerelease: false
26
21
  type: :development
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
22
  version_requirements: !ruby/object:Gem::Requirement
30
23
  requirements:
31
- - - '>='
24
+ - - ~>
32
25
  - !ruby/object:Gem::Version
33
- version: '10.0'
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
34
28
  requirement: !ruby/object:Gem::Requirement
35
29
  requirements:
36
30
  - - '>='
37
31
  - !ruby/object:Gem::Version
38
32
  version: '10.0'
33
+ name: rake
39
34
  prerelease: false
40
35
  type: :development
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
41
  description: Commons Compress decoder plugin is an Embulk plugin that decodes files using Apache Commons Compress library. It is read by any file input plugins. Search the file input plugins by 'embulk-input file' keywords.
42
42
  email:
43
43
  - hiroki.ata@gmail.com
@@ -78,7 +78,7 @@ files:
78
78
  - src/test/resources/org/embulk/decoder/samples.tgz
79
79
  - src/test/resources/org/embulk/decoder/samples.zip
80
80
  - classpath/commons-compress-1.9.jar
81
- - classpath/embulk-decoder-commons-compress-0.3.0.jar
81
+ - classpath/embulk-decoder-commons-compress-0.3.1.jar
82
82
  homepage: https://github.com/hata/embulk-decoder-commons-compress
83
83
  licenses:
84
84
  - MIT