thunderbird 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/thunderbird/mbox.rb +39 -0
- data/lib/thunderbird/version.rb +1 -1
- data/thunderbird.gemspec +1 -0
- metadata +16 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0a36f18150baeaca38257b5960f587109627efc496984dc106600d378213956
|
4
|
+
data.tar.gz: 7617ad0f5425c70529507944aad50db6e68395f2296dbc0357824ad6484e0acb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86bfecfb40f78d1291bbf7da3e88497936fc0c2ed73aa7fa26d16838acc13303477a703f65ed117cd6e10b9ee2bac699eb427e9169ea29ad290bae4b0a6cdced
|
7
|
+
data.tar.gz: 68259a791aee48238e634eb5a00d49e1ca88d3df718d886b5cf59c9e78145538b51499a4a1ad5e5f0e06ee73bddd3f3e0b6c2d2e50dde5e0a51e2dd850cc0414
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "mork/parser"
|
4
|
+
|
5
|
+
class Thunderbird
|
6
|
+
class Mbox
|
7
|
+
attr_reader :path
|
8
|
+
|
9
|
+
def initialize(path:)
|
10
|
+
@path = path
|
11
|
+
end
|
12
|
+
|
13
|
+
def each(&block)
|
14
|
+
content = File.read(path)
|
15
|
+
data = parser.data(content)
|
16
|
+
messages = data.tables[MESSAGE_NAMESPACE]["1"]
|
17
|
+
File.open(index_path) do |file|
|
18
|
+
messages.each do |id, message_info|
|
19
|
+
message_size = message_info["offlineMsgSize"]
|
20
|
+
length = message_size.to_i(16)
|
21
|
+
message = file.read(length)
|
22
|
+
block.call(id, message)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
MESSAGE_NAMESPACE = "ns:msg:db:row:scope:msgs:all"
|
30
|
+
|
31
|
+
def parser
|
32
|
+
@parser ||= Mork::Parser.new
|
33
|
+
end
|
34
|
+
|
35
|
+
def index_path
|
36
|
+
"#{path}.msf"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/thunderbird/version.rb
CHANGED
data/thunderbird.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thunderbird
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Yates
|
@@ -10,6 +10,20 @@ bindir: exe
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2024-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mork-parser
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.1
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: os
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -36,6 +50,7 @@ files:
|
|
36
50
|
- lib/thunderbird.rb
|
37
51
|
- lib/thunderbird/install.rb
|
38
52
|
- lib/thunderbird/local_folder.rb
|
53
|
+
- lib/thunderbird/mbox.rb
|
39
54
|
- lib/thunderbird/profile.rb
|
40
55
|
- lib/thunderbird/profiles.rb
|
41
56
|
- lib/thunderbird/subdirectory.rb
|