pullbox 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +32 -0
- data/README.md +7 -3
- data/exe/mailmate +14 -0
- data/lib/pullbox/mailmate.rb +38 -0
- data/lib/pullbox/version.rb +1 -1
- metadata +7 -5
- data/exe/mailmate_beta +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3994c7b8b3c96b07b780a6a6abb024f1883b73711d4b0ce61e530c055a4a7b3c
|
4
|
+
data.tar.gz: adc3780652febf823d3df7f990b327acd8a94a6174a5a65f82ac34e064d24c80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42f064ff9174cd2225137459a6f1c85512d2c5186005c0c02cdb21179509c8513e2bb953238f00374ee9e774668c25e91de206319be70802ed34ce4e5c77f053
|
7
|
+
data.tar.gz: fcd1a1da129516d03e45f49b9af99fdf30016c8d49030b2615a3eb66b1dd15970e46c925eef1440646a6983c56586ddf3769b924863d5c29a4586b73a8cc26ac
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
pullbox (0.1.10)
|
5
|
+
nokogiri (~> 1.12)
|
6
|
+
plist (~> 3.6)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
minitest (5.18.0)
|
12
|
+
nokogiri (1.14.2-arm64-darwin)
|
13
|
+
racc (~> 1.4)
|
14
|
+
nokogiri (1.14.2-x86_64-linux)
|
15
|
+
racc (~> 1.4)
|
16
|
+
plist (3.7.0)
|
17
|
+
racc (1.6.2)
|
18
|
+
rake (13.0.6)
|
19
|
+
thor (1.2.2)
|
20
|
+
|
21
|
+
PLATFORMS
|
22
|
+
arm64-darwin-22
|
23
|
+
x86_64-linux
|
24
|
+
|
25
|
+
DEPENDENCIES
|
26
|
+
minitest (~> 5.0)
|
27
|
+
pullbox!
|
28
|
+
rake (~> 13.0)
|
29
|
+
thor (~> 1.2)
|
30
|
+
|
31
|
+
BUNDLED WITH
|
32
|
+
2.4.10
|
data/README.md
CHANGED
@@ -6,15 +6,19 @@
|
|
6
6
|
|
7
7
|
Install the gem and add to the application's Gemfile by executing:
|
8
8
|
|
9
|
-
|
9
|
+
```bash
|
10
|
+
bundle add pullbox
|
11
|
+
```
|
10
12
|
|
11
13
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
12
14
|
|
13
|
-
|
15
|
+
```bash
|
16
|
+
gem install pullbox
|
17
|
+
```
|
14
18
|
|
15
19
|
## Usage
|
16
20
|
|
17
|
-
Includes a executable `
|
21
|
+
Includes a executable `mailmate`. Use it via `mailmate beta` to check if the current MailMate prerelease is installed and if not it installs it automatically for you.
|
18
22
|
For the AppleScript and DEVONthink functions available check the corresponding source code.
|
19
23
|
|
20
24
|
## Contributing
|
data/exe/mailmate
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "thor"
|
5
|
+
require_relative "../lib/pullbox/mailmate"
|
6
|
+
|
7
|
+
class MailMateCLI < Thor
|
8
|
+
desc "beta", "Updates MailMate to the latest beta release"
|
9
|
+
def beta
|
10
|
+
Pullbox::MailMate.beta_release
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
MailMateCLI.start(ARGV)
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "net/http"
|
4
|
+
require "nokogiri"
|
5
|
+
require "plist"
|
6
|
+
require_relative "applescript"
|
7
|
+
|
8
|
+
module Pullbox
|
9
|
+
class MailMate
|
10
|
+
def self.beta_release
|
11
|
+
mailmate = "#{Pullbox::AppleScript.applications_folder}MailMate.app/Contents/Info.plist"
|
12
|
+
raise "MailMate not installed." unless File.exist? mailmate
|
13
|
+
|
14
|
+
result = Plist.parse_xml(mailmate)
|
15
|
+
raise "MailMate not properly installed." if result.nil?
|
16
|
+
|
17
|
+
regexp1 = /\(r(?<number>\d+)\)/i
|
18
|
+
regexp2 = /(?<number>\d+)/
|
19
|
+
long_version = result["CFBundleGetInfoString"]
|
20
|
+
version = long_version.match(regexp1)
|
21
|
+
|
22
|
+
doc = Nokogiri::HTML(Net::HTTP.get(URI("https://updates.mailmate-app.com/archives/")))
|
23
|
+
doc.xpath("/html/body/table/tr[position() = (last() - 1)]/td[2]/a/@href").each do |current_release|
|
24
|
+
beta_version = current_release.value.match(regexp2)
|
25
|
+
|
26
|
+
if beta_version[:number].to_i > version[:number].to_i
|
27
|
+
response = Net::HTTP.get(URI("https://updates.mailmate-app.com/archives/#{current_release.value}"))
|
28
|
+
File.write(current_release.value, response)
|
29
|
+
system "tar -xjf #{current_release.value}"
|
30
|
+
system "rm #{current_release.value}"
|
31
|
+
path = "#{Dir.pwd}/MailMate.app"
|
32
|
+
Pullbox::AppleScript.move_app("MailMate", path)
|
33
|
+
Pullbox::AppleScript.display_notification("MailMate updated to version: #{beta_version[:number]}", "MailMate Updater")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/pullbox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pullbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PuLLi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -43,19 +43,21 @@ description: Enables you to write ruby code for AppleScript, DEVONthink and Mail
|
|
43
43
|
email:
|
44
44
|
- the@pulli.dev
|
45
45
|
executables:
|
46
|
-
-
|
46
|
+
- mailmate
|
47
47
|
extensions: []
|
48
48
|
extra_rdoc_files: []
|
49
49
|
files:
|
50
50
|
- CHANGELOG.md
|
51
51
|
- Gemfile
|
52
|
+
- Gemfile.lock
|
52
53
|
- LICENSE.txt
|
53
54
|
- README.md
|
54
55
|
- Rakefile
|
55
|
-
- exe/
|
56
|
+
- exe/mailmate
|
56
57
|
- lib/pullbox.rb
|
57
58
|
- lib/pullbox/applescript.rb
|
58
59
|
- lib/pullbox/devonthink.rb
|
60
|
+
- lib/pullbox/mailmate.rb
|
59
61
|
- lib/pullbox/version.rb
|
60
62
|
- pullbox.gemspec
|
61
63
|
- sig/pullbox.rbs
|
@@ -83,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
85
|
- !ruby/object:Gem::Version
|
84
86
|
version: '0'
|
85
87
|
requirements: []
|
86
|
-
rubygems_version: 3.4.
|
88
|
+
rubygems_version: 3.4.10
|
87
89
|
signing_key:
|
88
90
|
specification_version: 4
|
89
91
|
summary: Just a small toolbox for AppleScript, DEVONthink and MailMate
|
data/exe/mailmate_beta
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require "net/http"
|
5
|
-
require "nokogiri"
|
6
|
-
require "plist"
|
7
|
-
require_relative "../lib/pullbox/applescript"
|
8
|
-
|
9
|
-
mailmate = "#{Pullbox::AppleScript.applications_folder}MailMate.app/Contents/Info.plist"
|
10
|
-
raise "MailMate not installed." unless File.exist? mailmate
|
11
|
-
|
12
|
-
result = Plist.parse_xml(mailmate)
|
13
|
-
raise "MailMate not properly installed." if result.nil?
|
14
|
-
|
15
|
-
regexp1 = /\(r(?<number>\d+)\)/i
|
16
|
-
regexp2 = /(?<number>\d+)/
|
17
|
-
long_version = result["CFBundleGetInfoString"]
|
18
|
-
version = long_version.match(regexp1)
|
19
|
-
|
20
|
-
doc = Nokogiri::HTML(Net::HTTP.get(URI("https://updates.mailmate-app.com/archives/")))
|
21
|
-
doc.xpath("/html/body/table/tr[position() = (last() - 1)]/td[2]/a/@href").each do |current_release|
|
22
|
-
beta_version = current_release.value.match(regexp2)
|
23
|
-
|
24
|
-
if beta_version[:number].to_i > version[:number].to_i
|
25
|
-
response = Net::HTTP.get(URI("https://updates.mailmate-app.com/archives/#{current_release.value}"))
|
26
|
-
File.write(current_release.value, response)
|
27
|
-
system "tar -xjf #{current_release.value}"
|
28
|
-
system "rm #{current_release.value}"
|
29
|
-
path = Dir.pwd + "/MailMate.app"
|
30
|
-
Pullbox::AppleScript.move_app("MailMate", path)
|
31
|
-
Pullbox::AppleScript.display_notification("MailMate updated to version: #{beta_version[:number]}", "MailMate Updater")
|
32
|
-
end
|
33
|
-
end
|