thunderbird 0.1.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: 06e03c762e9bef79479708b14604743fe03e509a742ecb60abb5302a2fd16788
4
- data.tar.gz: 76d815453006b03948af39ac113ad07db3783d16904a39f71ee00c53fff2d44d
3
+ metadata.gz: b00596eb313f59ff0067a1cdbc9f3c177d955c8c3d53dfc25ca997852063f108
4
+ data.tar.gz: a1d8a4616d516454cb2e3b7ce61661285ba9f09073f1b9b5c38a6710a3fda46c
5
5
  SHA512:
6
- metadata.gz: a61253e0d2559831f38f39d83fe5fa091846930f8b6ca6a6fe5317bb1aeada74e2cb3a480c39a604c85e648801a95904fcb6aeb9c9b896049214c76db5771b74
7
- data.tar.gz: 4a5b2825eef339f31e2b9d33ced437e38430711478286d2eb081415648dab451fe547ffa159b97bcdfbe32b16b198b281d9b0e9bff4767bdb32539da9267c566
6
+ metadata.gz: cfee0f4a65980836566ef8935dfa9c1bf055d8315f909a76ca3a3a1686afe021988600a0d9613ddf546b28587d12aef88107d68612b48d5e3dc2464859e79866
7
+ data.tar.gz: 960916c4437ab68df3893816abba8b734bab5237f98190543278bd65af93fbc2730b0b985e90752fc19207cd9476c3d034be0bb450c90a7739dcaf90c416b3ed
@@ -9,13 +9,13 @@ 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
16
16
 
17
17
  def default
18
- Thunderbird::Profiles.new.profile_for_path(entries[:Default])
18
+ Profiles.new.profile_for_path(entries[:Default])
19
19
  end
20
20
  end
21
21
  end
@@ -1,21 +1,21 @@
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
16
16
 
17
17
  def set_up
18
- return if path_elements.empty?
18
+ return false if path_elements.empty?
19
19
 
20
20
  return true if !in_subdirectory?
21
21
 
@@ -26,7 +26,7 @@ class Thunderbird
26
26
  if in_subdirectory?
27
27
  File.join(subdirectory.full_path, folder_name)
28
28
  else
29
- folder_name
29
+ path
30
30
  end
31
31
  end
32
32
 
@@ -35,7 +35,7 @@ class Thunderbird
35
35
  end
36
36
 
37
37
  def msf_path
38
- "#{path}.msf"
38
+ "#{full_path}.msf"
39
39
  end
40
40
 
41
41
  def msf_exists?
@@ -51,7 +51,7 @@ class Thunderbird
51
51
  def subdirectory
52
52
  return nil if !in_subdirectory?
53
53
 
54
- Thunderbird::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 = 1
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/lib/thunderbird.rb CHANGED
@@ -1,7 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "os"
4
- require_relative "thunderbird/version"
4
+
5
+ # Require all files so they get counted in coverage
6
+ Dir.chdir(__dir__) do
7
+ glob = File.join("**", "*.rb")
8
+ Dir[glob].sort.each { |f| require_relative f }
9
+ end
5
10
 
6
11
  # Root information
7
12
  class Thunderbird
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.1.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-06 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,181 +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/LineEndStringConcatenationIndentation:
16
- Enabled: true
17
-
18
- Layout/SpaceBeforeBrackets:
19
- Enabled: true
20
-
21
- Lint/AmbiguousAssignment:
22
- Enabled: true
23
-
24
- Lint/AmbiguousOperatorPrecedence:
25
- Enabled: true
26
-
27
- Lint/AmbiguousRange:
28
- Enabled: true
29
-
30
- Lint/DeprecatedConstants:
31
- Enabled: true
32
-
33
- Lint/DuplicateBranch:
34
- Enabled: true
35
-
36
- Lint/DuplicateRegexpCharacterClassElement:
37
- Enabled: true
38
-
39
- Lint/EmptyBlock:
40
- Enabled: true
41
-
42
- Lint/EmptyClass:
43
- Enabled: true
44
-
45
- Lint/EmptyInPattern:
46
- Enabled: true
47
-
48
- Lint/IncompatibleIoSelectWithFiberScheduler:
49
- Enabled: true
50
-
51
- Lint/LambdaWithoutLiteralBlock:
52
- Enabled: true
53
-
54
- Lint/NoReturnInBeginEndBlocks:
55
- Enabled: true
56
-
57
- Lint/NumberedParameterAssignment:
58
- Enabled: true
59
-
60
- Lint/OrAssignmentToConstant:
61
- Enabled: true
62
-
63
- Lint/RedundantDirGlobSort:
64
- Enabled: true
65
-
66
- Lint/RequireRelativeSelfPath:
67
- Enabled: true
68
-
69
- Lint/SymbolConversion:
70
- Enabled: true
71
-
72
- Lint/ToEnumArguments:
73
- Enabled: true
74
-
75
- Lint/TripleQuotes:
76
- Enabled: true
77
-
78
- Lint/UnexpectedBlockArity:
79
- Enabled: true
80
-
81
- Lint/UnmodifiedReduceAccumulator:
82
- Enabled: true
83
-
84
- Lint/UselessRuby2Keywords:
85
- Enabled: true
86
-
87
- Naming/BlockForwarding:
88
- Enabled: true
89
-
90
- Security/IoMethods:
91
- Enabled: true
92
-
93
- Style/AccessorGrouping:
94
- Enabled: true
95
- EnforcedStyle: separated
96
-
97
- Style/ArgumentsForwarding:
98
- Enabled: true
99
-
100
- Style/CollectionCompact:
101
- Enabled: true
102
-
103
- Style/DocumentDynamicEvalDefinition:
104
- Enabled: true
105
-
106
- Style/EmptyCaseCondition:
107
- Enabled: false
108
-
109
- Style/EndlessMethod:
110
- Enabled: true
111
-
112
- Style/FileRead:
113
- Enabled: true
114
-
115
- Style/FileWrite:
116
- Enabled: true
117
-
118
- Style/HashConversion:
119
- Enabled: true
120
-
121
- Style/HashExcept:
122
- Enabled: true
123
-
124
- Style/IfWithBooleanLiteralBranches:
125
- Enabled: true
126
-
127
- Style/InPatternThen:
128
- Enabled: true
129
-
130
- Style/MapToHash:
131
- Enabled: true
132
-
133
- Style/MultilineInPatternThen:
134
- Enabled: true
135
-
136
- Style/NegatedIf:
137
- Enabled: false
138
-
139
- Style/NegatedIfElseCondition:
140
- Enabled: true
141
-
142
- Style/NilLambda:
143
- Enabled: true
144
-
145
- Style/NumberedParameters:
146
- Enabled: true
147
-
148
- Style/NumberedParametersLimit:
149
- Enabled: true
150
-
151
- Style/OpenStructUse:
152
- Enabled: true
153
-
154
- Style/QuotedSymbols:
155
- Enabled: true
156
-
157
- Style/RedundantArgument:
158
- Enabled: true
159
-
160
- Style/RedundantSelfAssignmentBranch:
161
- Enabled: true
162
-
163
- Style/SelectByRegexp:
164
- Enabled: true
165
-
166
- Style/StringChars:
167
- Enabled: true
168
-
169
- Style/StringLiterals:
170
- Enabled: true
171
- EnforcedStyle: double_quotes
172
-
173
- Style/StringLiteralsInInterpolation:
174
- Enabled: true
175
- EnforcedStyle: double_quotes
176
-
177
- Style/SwapValues:
178
- Enabled: true
179
-
180
- Layout/LineLength:
181
- Max: 120
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
- # Specify your gem's dependencies in thunderbird.gemspec
6
- gemspec
7
-
8
- gem "rake", "~> 13.0"
9
-
10
- gem "rspec", "~> 3.0"
11
-
12
- gem "rubocop", "~> 1.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]