thunderbird 0.2.1 → 0.3.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: 15259f38aecc30a09db01eb75a1920f3fffa56f7a4031f85d2fbd4e5a4908304
4
- data.tar.gz: 65a256624ca2093e15c2afec842b1fa213a78b3f42643e98eb16de5e27539ce5
3
+ metadata.gz: b00596eb313f59ff0067a1cdbc9f3c177d955c8c3d53dfc25ca997852063f108
4
+ data.tar.gz: a1d8a4616d516454cb2e3b7ce61661285ba9f09073f1b9b5c38a6710a3fda46c
5
5
  SHA512:
6
- metadata.gz: dfaebe8b631f430f3f8bcfe71a9b0cfee67f31f3e2ff4eb76cda45125afd2aabc6b937320c2eae9e1888caf5be6cd6e4ef91c797c8a7ae077f772eed10253a43
7
- data.tar.gz: a53bc319ba224150676a5f0322b8c853b7c5e3f1cde1578cf4a9e208693ea85eb29f3d1075e3da8ad99dbd8630eb4691fd0b7afbee457b2b85e7076e03444426
6
+ metadata.gz: cfee0f4a65980836566ef8935dfa9c1bf055d8315f909a76ca3a3a1686afe021988600a0d9613ddf546b28587d12aef88107d68612b48d5e3dc2464859e79866
7
+ data.tar.gz: 960916c4437ab68df3893816abba8b734bab5237f98190543278bd65af93fbc2730b0b985e90752fc19207cd9476c3d034be0bb450c90a7739dcaf90c416b3ed
@@ -9,7 +9,7 @@ class Thunderbird
9
9
  attr_reader :entries
10
10
 
11
11
  # entries are lines from profile.ini
12
- def initialize(title, entries)
12
+ def initialize(title:, entries:)
13
13
  @title = title
14
14
  @entries = entries
15
15
  end
@@ -1,15 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "thunderbird/profile"
4
3
  require "thunderbird/subdirectory"
5
4
 
6
5
  class Thunderbird
7
6
  # A local folder is a file containing emails
7
+ # It is not a "live" folder that is sync-able with an online account
8
8
  class LocalFolder
9
9
  attr_reader :path
10
10
  attr_reader :profile
11
11
 
12
- def initialize(profile, path)
12
+ def initialize(profile:, path:)
13
13
  @profile = profile
14
14
  @path = path
15
15
  end
@@ -51,7 +51,7 @@ class Thunderbird
51
51
  def subdirectory
52
52
  return nil if !in_subdirectory?
53
53
 
54
- Subdirectory.new(profile, subdirectory_path)
54
+ Subdirectory.new(path: subdirectory_path, root: profile.local_folders_path)
55
55
  end
56
56
 
57
57
  def path_elements
@@ -9,7 +9,7 @@ class Thunderbird
9
9
  attr_reader :entries
10
10
 
11
11
  # entries are lines from profile.ini
12
- def initialize(title, entries)
12
+ def initialize(title:, entries:)
13
13
  @title = title
14
14
  @entries = entries
15
15
  end
@@ -10,19 +10,19 @@ class Thunderbird
10
10
  def profile_for_path(path)
11
11
  title, entries = blocks.find { |_name, entries| entries[:Path] == path }
12
12
 
13
- Thunderbird::Profile.new(title, entries) if title
13
+ Thunderbird::Profile.new(title: title, entries: entries) if title
14
14
  end
15
15
 
16
16
  def profile(name)
17
17
  title, entries = blocks.find { |_name, entries| entries[:Name] == name }
18
18
 
19
- Thunderbird::Profile.new(title, entries) if title
19
+ Thunderbird::Profile.new(title: title, entries: entries) if title
20
20
  end
21
21
 
22
22
  def installs
23
23
  @installs ||= begin
24
24
  pairs = blocks.filter { |name, _entries| name.start_with?("Install") }
25
- pairs.map { |title, entries| Thunderbird::Install.new(title, entries) }
25
+ pairs.map { |title, entries| Thunderbird::Install.new(title: title, entries: entries) }
26
26
  end
27
27
  end
28
28
 
@@ -8,10 +8,10 @@ class Thunderbird
8
8
  # `path` is the UI path, it doesn't have the '.sbd' extensions
9
9
  # that are present in the real, file system path
10
10
  attr_reader :path
11
- attr_reader :profile
11
+ attr_reader :root
12
12
 
13
- def initialize(profile, path)
14
- @profile = profile
13
+ def initialize(root:, path:)
14
+ @root = root
15
15
  @path = path
16
16
  end
17
17
 
@@ -35,7 +35,7 @@ class Thunderbird
35
35
  # subdirectory relative path is 'Foo.sbd/Bar.sbd/Baz.sbd'
36
36
  def full_path
37
37
  relative_path = File.join(subdirectories)
38
- File.join(profile.local_folders_path, relative_path)
38
+ File.join(root, relative_path)
39
39
  end
40
40
 
41
41
  private
@@ -51,15 +51,15 @@ class Thunderbird
51
51
  def parent
52
52
  return nil if !sub_sub_directory?
53
53
 
54
- self.class.new(profile, File.join(path_elements[0..-2]))
54
+ self.class.new(root: root, path: File.join(path_elements[0..-2]))
55
55
  end
56
56
 
57
57
  # placeholder relative path is 'Foo.sbd/Bar.sbd/Baz'
58
58
  def placeholder
59
59
  @placeholder = begin
60
60
  relative_path = File.join(subdirectories[0..-2], path_elements[-1])
61
- path = File.join(profile.local_folders_path, relative_path)
62
- Thunderbird::SubdirectoryPlaceholder.new(path)
61
+ path = File.join(root, relative_path)
62
+ Thunderbird::SubdirectoryPlaceholder.new(path: path)
63
63
  end
64
64
  end
65
65
 
@@ -82,13 +82,22 @@ class Thunderbird
82
82
  def check
83
83
  case
84
84
  when exists? && !placeholder.exists?
85
- Kernel.puts "Can't set up folder '#{full_path}': '#{full_path}' exists, but '#{placeholder.path}' is missing"
85
+ Kernel.puts(
86
+ "Can't set up folder '#{full_path}': " \
87
+ "'#{full_path}' exists, but '#{placeholder.path}' is missing"
88
+ )
86
89
  false
87
90
  when placeholder.exists? && !placeholder.regular?
88
- Kernel.puts "Can't set up folder '#{full_path}': '#{placeholder.path}' exists, but it is not a regular file"
91
+ Kernel.puts(
92
+ "Can't set up folder '#{full_path}': " \
93
+ "'#{placeholder.path}' exists, but it is not a regular file"
94
+ )
89
95
  false
90
96
  when exists? && !directory?
91
- Kernel.puts "Can't set up folder '#{full_path}': '#{full_path}' exists, but it is not a directory"
97
+ Kernel.puts(
98
+ "Can't set up folder '#{full_path}': " \
99
+ "'#{full_path}' exists, but it is not a directory"
100
+ )
92
101
  false
93
102
  else
94
103
  true
@@ -6,7 +6,7 @@ class Thunderbird
6
6
  class SubdirectoryPlaceholder
7
7
  attr_reader :path
8
8
 
9
- def initialize(path)
9
+ def initialize(path:)
10
10
  @path = path
11
11
  end
12
12
 
@@ -3,8 +3,8 @@
3
3
  class Thunderbird
4
4
  module Version
5
5
  MAJOR = 0
6
- MINOR = 2
7
- REVISION = 1
6
+ MINOR = 3
7
+ REVISION = 0
8
8
  PRE = nil
9
9
  VERSION = [MAJOR, MINOR, REVISION, PRE].compact.map(&:to_s).join(".")
10
10
  end
data/thunderbird.gemspec CHANGED
@@ -11,18 +11,16 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = "Conveniences for interacting with Mozilla Thunderbird"
12
12
  spec.homepage = "https://github.com/joeyates/thunderbird"
13
13
  spec.license = "MIT"
14
- spec.required_ruby_version = ">= 2.5"
14
+ spec.required_ruby_version = ">= 2.7"
15
15
 
16
16
  spec.metadata["homepage_uri"] = spec.homepage
17
17
  spec.metadata["source_code_uri"] = "https://github.com/joeyates/thunderbird"
18
18
  spec.metadata["changelog_uri"] = "https://github.com/joeyates/thunderbird/blob/main/CHANGELOG.md"
19
19
  spec.metadata["rubygems_mfa_required"] = "true"
20
20
 
21
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
22
- `git ls-files -z`.split("\x0").reject do |f|
23
- (f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
24
- end
25
- end
21
+ spec.files = Dir.glob("lib/**/*.rb")
22
+ spec.files += ["thunderbird.gemspec"]
23
+ spec.files += %w(LICENSE.txt README.md)
26
24
  spec.bindir = "exe"
27
25
  spec.executables = []
28
26
  spec.require_paths = ["lib"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thunderbird
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Yates
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-10 00:00:00.000000000 Z
11
+ date: 2024-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: os
@@ -31,14 +31,8 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
- - ".rspec"
35
- - ".rubocop.yml"
36
- - ".rubocop_todo.yml"
37
- - CHANGELOG.md
38
- - Gemfile
39
34
  - LICENSE.txt
40
35
  - README.md
41
- - Rakefile
42
36
  - lib/thunderbird.rb
43
37
  - lib/thunderbird/install.rb
44
38
  - lib/thunderbird/local_folder.rb
@@ -64,14 +58,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
64
58
  requirements:
65
59
  - - ">="
66
60
  - !ruby/object:Gem::Version
67
- version: '2.5'
61
+ version: '2.7'
68
62
  required_rubygems_version: !ruby/object:Gem::Requirement
69
63
  requirements:
70
64
  - - ">="
71
65
  - !ruby/object:Gem::Version
72
66
  version: '0'
73
67
  requirements: []
74
- rubygems_version: 3.1.6
68
+ rubygems_version: 3.3.7
75
69
  signing_key:
76
70
  specification_version: 4
77
71
  summary: Conveniences for interacting with Mozilla Thunderbird
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,193 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- AllCops:
4
- TargetRubyVersion: 2.5
5
- Exclude:
6
- - "bin/stubs/*"
7
- - "vendor/**/*"
8
-
9
- Gemspec/DateAssignment:
10
- Enabled: true
11
-
12
- Gemspec/RequireMFA:
13
- Enabled: true
14
-
15
- Layout/DotPosition:
16
- Enabled: true
17
- EnforcedStyle: trailing
18
-
19
- Layout/LineEndStringConcatenationIndentation:
20
- Enabled: true
21
-
22
- Layout/SpaceBeforeBrackets:
23
- Enabled: true
24
-
25
- Layout/SpaceInsideHashLiteralBraces:
26
- Enabled: true
27
- EnforcedStyle: no_space
28
-
29
- Lint/AmbiguousAssignment:
30
- Enabled: true
31
-
32
- Lint/AmbiguousOperatorPrecedence:
33
- Enabled: true
34
-
35
- Lint/AmbiguousRange:
36
- Enabled: true
37
-
38
- Lint/DeprecatedConstants:
39
- Enabled: true
40
-
41
- Lint/DuplicateBranch:
42
- Enabled: true
43
-
44
- Lint/DuplicateRegexpCharacterClassElement:
45
- Enabled: true
46
-
47
- Lint/EmptyBlock:
48
- Enabled: true
49
-
50
- Lint/EmptyClass:
51
- Enabled: true
52
-
53
- Lint/EmptyInPattern:
54
- Enabled: true
55
-
56
- Lint/IncompatibleIoSelectWithFiberScheduler:
57
- Enabled: true
58
-
59
- Lint/LambdaWithoutLiteralBlock:
60
- Enabled: true
61
-
62
- Lint/NoReturnInBeginEndBlocks:
63
- Enabled: true
64
-
65
- Lint/NumberedParameterAssignment:
66
- Enabled: true
67
-
68
- Lint/OrAssignmentToConstant:
69
- Enabled: true
70
-
71
- Lint/RedundantDirGlobSort:
72
- Enabled: true
73
-
74
- Lint/RequireRelativeSelfPath:
75
- Enabled: true
76
-
77
- Lint/SymbolConversion:
78
- Enabled: true
79
-
80
- Lint/ToEnumArguments:
81
- Enabled: true
82
-
83
- Lint/TripleQuotes:
84
- Enabled: true
85
-
86
- Lint/UnexpectedBlockArity:
87
- Enabled: true
88
-
89
- Lint/UnmodifiedReduceAccumulator:
90
- Enabled: true
91
-
92
- Lint/UselessRuby2Keywords:
93
- Enabled: true
94
-
95
- Naming/BlockForwarding:
96
- Enabled: true
97
-
98
- Security/IoMethods:
99
- Enabled: true
100
-
101
- Style/AccessorGrouping:
102
- Enabled: true
103
- EnforcedStyle: separated
104
-
105
- Style/ArgumentsForwarding:
106
- Enabled: true
107
-
108
- Style/CollectionCompact:
109
- Enabled: true
110
-
111
- Style/DocumentDynamicEvalDefinition:
112
- Enabled: true
113
-
114
- Style/EmptyCaseCondition:
115
- Enabled: false
116
-
117
- Style/EndlessMethod:
118
- Enabled: true
119
-
120
- Style/FileRead:
121
- Enabled: true
122
-
123
- Style/FileWrite:
124
- Enabled: true
125
-
126
- Style/HashConversion:
127
- Enabled: true
128
-
129
- Style/HashExcept:
130
- Enabled: true
131
-
132
- Style/IfWithBooleanLiteralBranches:
133
- Enabled: true
134
-
135
- Style/InPatternThen:
136
- Enabled: true
137
-
138
- Style/MapToHash:
139
- Enabled: true
140
-
141
- Style/MultilineInPatternThen:
142
- Enabled: true
143
-
144
- Style/NegatedIf:
145
- Enabled: false
146
-
147
- Style/NegatedIfElseCondition:
148
- Enabled: true
149
-
150
- Style/NilLambda:
151
- Enabled: true
152
-
153
- Style/NumberedParameters:
154
- Enabled: true
155
-
156
- Style/NumberedParametersLimit:
157
- Enabled: true
158
-
159
- Style/OpenStructUse:
160
- Enabled: true
161
-
162
- Style/QuotedSymbols:
163
- Enabled: true
164
-
165
- Style/RedundantArgument:
166
- Enabled: true
167
-
168
- Style/RedundantSelfAssignmentBranch:
169
- Enabled: true
170
-
171
- Style/SelectByRegexp:
172
- Enabled: true
173
-
174
- Style/StringChars:
175
- Enabled: true
176
-
177
- Style/StringLiterals:
178
- Enabled: true
179
- EnforcedStyle: double_quotes
180
-
181
- Style/StringLiteralsInInterpolation:
182
- Enabled: true
183
- EnforcedStyle: double_quotes
184
-
185
- Style/SwapValues:
186
- Enabled: true
187
-
188
- Layout/LineLength:
189
- Max: 120
190
-
191
- Metrics/BlockLength:
192
- Exclude:
193
- - "spec/**/*"
data/.rubocop_todo.yml DELETED
@@ -1,17 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2022-02-06 20:52:48 UTC using RuboCop version 1.25.1.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 2
10
- # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
11
- Metrics/AbcSize:
12
- Max: 25
13
-
14
- # Offense count: 2
15
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
16
- Metrics/MethodLength:
17
- Max: 25
data/CHANGELOG.md DELETED
@@ -1,3 +0,0 @@
1
- ## [0.1.0] - 2022-02-06
2
-
3
- - Initial release
data/Gemfile DELETED
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec
6
-
7
- gem "aruba", "~> 2.0"
8
- gem "pry-byebug", "~> 3.9"
9
- gem "rake", "~> 13.0"
10
- gem "rspec", "~> 3.0"
11
- gem "rubocop", "~> 1.21"
12
- gem "simplecov", "~> 0.21"
data/Rakefile DELETED
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- require "rubocop/rake_task"
9
-
10
- RuboCop::RakeTask.new
11
-
12
- task default: %i[spec rubocop]