thunderbird 0.4.0 → 0.5.0

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: c9de1d62e6bcb753d69ccdaf75abaafd4da62f6884be11e943978d5df2f8bff6
4
+ data.tar.gz: aa85b96e26ad2fbd6b313666481294474c6b630a15fcb420f7684b2a2675edc2
5
5
  SHA512:
6
- metadata.gz: 14e071b1459bf2e0c346baee3b2b202966d50cbce11682c71fdb81cf05833365bc584c4fbdb8921bb5b72dc836f8f6e4136ef07c69d09396afbfe7596ad5f620
7
- data.tar.gz: b92fc48bd369623b1dd4e177c98af0ffd93b9e3293e8fffb2ebc9822da55e32ffd706a639d93a40391163cf8b25b3fdfe4229b081ac919ae5164c167944b12fc
6
+ metadata.gz: f4e34e2f49857ad4bde4e80047ccad4c34773aa50d0407ce102eb894380158820eb59b054e0309135cf9bf0269c29679d6ff3350fe68c56041bf55a6fe38a6f0
7
+ data.tar.gz: d799f2e2b83e4cdb48939b613052f3b6f488df1eab44de23a72585d40b7cbfa8c21eae0c7c5aba228a8d41dfa0086cc3387297add6ce51793ee68d8887698e21
@@ -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(index_path)
15
+ data = parser.data(content)
16
+ messages = data.tables[MESSAGE_NAMESPACE]["1"]
17
+ File.open(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,7 +3,7 @@
3
3
  class Thunderbird
4
4
  module Version
5
5
  MAJOR = 0
6
- MINOR = 4
6
+ MINOR = 5
7
7
  REVISION = 0
8
8
  PRE = nil
9
9
  VERSION = [MAJOR, MINOR, REVISION, PRE].compact.map(&:to_s).join(".")
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.2.0"
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.4.0
4
+ version: 0.5.0
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-22 00:00:00.000000000 Z
11
+ date: 2024-03-30 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.2.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.2.0
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
@@ -66,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
81
  version: '0'
67
82
  requirements: []
68
83
  rubygems_version: 3.5.3
69
- signing_key:
84
+ signing_key:
70
85
  specification_version: 4
71
86
  summary: Conveniences for interacting with Mozilla Thunderbird
72
87
  test_files: []