thunderbird 0.3.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: b00596eb313f59ff0067a1cdbc9f3c177d955c8c3d53dfc25ca997852063f108
4
- data.tar.gz: a1d8a4616d516454cb2e3b7ce61661285ba9f09073f1b9b5c38a6710a3fda46c
3
+ metadata.gz: b0a36f18150baeaca38257b5960f587109627efc496984dc106600d378213956
4
+ data.tar.gz: 7617ad0f5425c70529507944aad50db6e68395f2296dbc0357824ad6484e0acb
5
5
  SHA512:
6
- metadata.gz: cfee0f4a65980836566ef8935dfa9c1bf055d8315f909a76ca3a3a1686afe021988600a0d9613ddf546b28587d12aef88107d68612b48d5e3dc2464859e79866
7
- data.tar.gz: 960916c4437ab68df3893816abba8b734bab5237f98190543278bd65af93fbc2730b0b985e90752fc19207cd9476c3d034be0bb450c90a7739dcaf90c416b3ed
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
@@ -3,8 +3,8 @@
3
3
  class Thunderbird
4
4
  module Version
5
5
  MAJOR = 0
6
- MINOR = 3
7
- REVISION = 0
6
+ MINOR = 4
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,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thunderbird
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Yates
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-13 00:00:00.000000000 Z
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
@@ -24,7 +38,7 @@ dependencies:
24
38
  - - ">="
25
39
  - !ruby/object:Gem::Version
26
40
  version: '0'
27
- description:
41
+ description:
28
42
  email:
29
43
  - joe.g.yates@gmail.com
30
44
  executables: []
@@ -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
@@ -50,7 +65,7 @@ metadata:
50
65
  source_code_uri: https://github.com/joeyates/thunderbird
51
66
  changelog_uri: https://github.com/joeyates/thunderbird/blob/main/CHANGELOG.md
52
67
  rubygems_mfa_required: 'true'
53
- post_install_message:
68
+ post_install_message:
54
69
  rdoc_options: []
55
70
  require_paths:
56
71
  - lib
@@ -65,8 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
80
  - !ruby/object:Gem::Version
66
81
  version: '0'
67
82
  requirements: []
68
- rubygems_version: 3.3.7
69
- signing_key:
83
+ rubygems_version: 3.5.3
84
+ signing_key:
70
85
  specification_version: 4
71
86
  summary: Conveniences for interacting with Mozilla Thunderbird
72
87
  test_files: []