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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4a76fddb7621545c6aeb062398bf7de210aad2b03955794666995ca8cf4224c
4
- data.tar.gz: 5488489e33b6493785974cd658d48288c2defe71d6acd63addb6fab27b8be873
3
+ metadata.gz: b0a36f18150baeaca38257b5960f587109627efc496984dc106600d378213956
4
+ data.tar.gz: 7617ad0f5425c70529507944aad50db6e68395f2296dbc0357824ad6484e0acb
5
5
  SHA512:
6
- metadata.gz: 14e071b1459bf2e0c346baee3b2b202966d50cbce11682c71fdb81cf05833365bc584c4fbdb8921bb5b72dc836f8f6e4136ef07c69d09396afbfe7596ad5f620
7
- data.tar.gz: b92fc48bd369623b1dd4e177c98af0ffd93b9e3293e8fffb2ebc9822da55e32ffd706a639d93a40391163cf8b25b3fdfe4229b081ac919ae5164c167944b12fc
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
@@ -4,7 +4,7 @@ class Thunderbird
4
4
  module Version
5
5
  MAJOR = 0
6
6
  MINOR = 4
7
- REVISION = 0
7
+ REVISION = 1
8
8
  PRE = nil
9
9
  VERSION = [MAJOR, MINOR, REVISION, PRE].compact.map(&:to_s).join(".")
10
10
  end
data/thunderbird.gemspec CHANGED
@@ -25,5 +25,6 @@ Gem::Specification.new do |spec|
25
25
  spec.executables = []
26
26
  spec.require_paths = ["lib"]
27
27
 
28
+ spec.add_runtime_dependency "mork-parser", "~> 0.1.1"
28
29
  spec.add_runtime_dependency "os"
29
30
  end
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.0
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