mbox_header_scraper 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/mbox_header_scraper/mail.rb +1 -1
- data/lib/mbox_header_scraper/scraper.rb +6 -2
- data/lib/mbox_header_scraper/version.rb +1 -1
- 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: 571ffc1de1d8b9eddb747fccfd8236ded016f6e3
|
4
|
+
data.tar.gz: ee30ac56960fdaf9f4e8ad03fa5e96dabfee2680
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e208c4676849490b7ac4431ec3dae096521d726751ded5e5b57e36d713bc86bd95cad3a576ca3daffbe72b3956063d9ff7542ad1601fe18991c40b36b2cfea5f
|
7
|
+
data.tar.gz: 3b43e79c6fdfdf63cd90dcf3f01139a9e942c44e854ac99e15df9a43376a92842e9fc8b424bf19475ec6bba643014b2d0ccd7e0ce82e6f16889e8106028e3654
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# MboxHeaderScraper
|
2
2
|
|
3
|
-
[![Circle CI](https://circleci.com/gh/tamano/mbox_header_scraper.svg?style=svg)](https://circleci.com/gh/tamano/mbox_header_scraper) [![Code Climate](https://codeclimate.com/github/tamano/mbox_header_scraper/badges/gpa.svg)](https://codeclimate.com/github/tamano/mbox_header_scraper) [![Test Coverage](https://codeclimate.com/github/tamano/mbox_header_scraper/badges/coverage.svg)](https://codeclimate.com/github/tamano/mbox_header_scraper)
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/mbox_header_scraper.svg)](http://badge.fury.io/rb/mbox_header_scraper) [![Circle CI](https://circleci.com/gh/tamano/mbox_header_scraper.svg?style=svg)](https://circleci.com/gh/tamano/mbox_header_scraper) [![Code Climate](https://codeclimate.com/github/tamano/mbox_header_scraper/badges/gpa.svg)](https://codeclimate.com/github/tamano/mbox_header_scraper) [![Test Coverage](https://codeclimate.com/github/tamano/mbox_header_scraper/badges/coverage.svg)](https://codeclimate.com/github/tamano/mbox_header_scraper)
|
4
4
|
|
5
5
|
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/mbox_header_scraper`. To experiment with that code, run `bin/console` for an interactive prompt.
|
6
6
|
|
@@ -13,14 +13,18 @@ class MboxHeaderScraper::Scraper
|
|
13
13
|
end
|
14
14
|
|
15
15
|
IO.foreach(in_file) do |line|
|
16
|
-
|
16
|
+
# encode to convert invalid charcter
|
17
|
+
enc_line = line.encode('UTF-16BE', 'UTF-8',
|
18
|
+
invalid: :replace, undef: :replace, replace: '?').encode('UTF-8')
|
19
|
+
|
20
|
+
if /^From / =~ enc_line && !tmp.closed?
|
17
21
|
tmp.close(false)
|
18
22
|
result_file.write(single_mail_to_tsv(tmp, options))
|
19
23
|
tmp.delete
|
20
24
|
end
|
21
25
|
|
22
26
|
tmp = Tempfile.open('mbox_header_scraper_tmp') if tmp.closed?
|
23
|
-
tmp.write(
|
27
|
+
tmp.write(enc_line)
|
24
28
|
end
|
25
29
|
|
26
30
|
tmp.close(false)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mbox_header_scraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuya TAMANO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|