pullbox 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +3 -0
- data/exe/mailmate_beta +11 -6
- data/lib/pullbox/applescript.rb +28 -1
- data/lib/pullbox/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43456b6e946feae054b5b8656385d84b955d07439d1437e5c75a2afd82c5e93f
|
4
|
+
data.tar.gz: 6dd4b7ee156586b3663ca6a955c82ab7b85f692b2cb71aa52f58f6acdb9af215
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0905793cceaa9222fc9dc273aab4a4c620b563969c9933f9fbde85fc437c3183beee837b116a98e779077b56c796e729667d2271ebe66676bbc1e6ca53338b4a'
|
7
|
+
data.tar.gz: ae6d24c1bb6c4383c8ea077c611b6f860e25ba74740a1215ffca9c0dd67f92e58183801cdccc62f458dbfc3990221c237c1e5e891e6f6b337818f64df9322c3c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.1.8] - 2023-03-19
|
4
|
+
|
5
|
+
- `mailmate_beta` improved. Now downloads and installs beta releasess automatically.
|
6
|
+
|
7
|
+
## [0.1.7] - 2023-02-08
|
8
|
+
|
9
|
+
- Remove debug output
|
10
|
+
|
3
11
|
## [0.1.6] - 2023-02-08
|
4
12
|
|
5
13
|
- Fix issue with regex in `mailmate_beta`
|
data/README.md
CHANGED
@@ -14,6 +14,9 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
14
14
|
|
15
15
|
## Usage
|
16
16
|
|
17
|
+
Includes a executable `mailmate_beta` which checks and installs MailMate prerelease automatically for you.
|
18
|
+
For the AppleScript and DEVONthink functions available check the corresponding source code.
|
19
|
+
|
17
20
|
## Contributing
|
18
21
|
|
19
22
|
Bug reports and pull requests are welcome on GitHub at https://github.com/the-pulli/pullbox.
|
data/exe/mailmate_beta
CHANGED
@@ -6,7 +6,7 @@ require "nokogiri"
|
|
6
6
|
require "plist"
|
7
7
|
require_relative "../lib/pullbox/applescript"
|
8
8
|
|
9
|
-
mailmate = "
|
9
|
+
mailmate = "#{Pullbox::AppleScript.applications_folder}MailMate.app/Contents/Info.plist"
|
10
10
|
raise "MailMate not installed." unless File.exist? mailmate
|
11
11
|
|
12
12
|
result = Plist.parse_xml(mailmate)
|
@@ -18,11 +18,16 @@ long_version = result["CFBundleGetInfoString"]
|
|
18
18
|
version = long_version.match(regexp1)
|
19
19
|
|
20
20
|
doc = Nokogiri::HTML(Net::HTTP.get(URI("https://updates.mailmate-app.com/archives/")))
|
21
|
-
doc.xpath("
|
22
|
-
|
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
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
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")
|
27
32
|
end
|
28
33
|
end
|
data/lib/pullbox/applescript.rb
CHANGED
@@ -27,7 +27,7 @@ module Pullbox
|
|
27
27
|
cancel_button = defaults[:buttons].first
|
28
28
|
buttons = 'buttons {"'
|
29
29
|
button_construct = buttons.dup
|
30
|
-
|
30
|
+
button_construct << defaults[:buttons].join('", "')
|
31
31
|
button_construct << "\"} default button \"#{default_button}\" cancel button \"#{cancel_button}\""
|
32
32
|
applescript = <<~APS.strip
|
33
33
|
#{intro}
|
@@ -68,5 +68,32 @@ module Pullbox
|
|
68
68
|
APS
|
69
69
|
system "osascript -e '#{applescript}'"
|
70
70
|
end
|
71
|
+
|
72
|
+
def self.applications_folder
|
73
|
+
applescript = <<-APS.strip
|
74
|
+
#{intro}
|
75
|
+
|
76
|
+
set theApplicationsFolder to path to applications folder
|
77
|
+
return (POSIX path) of theApplicationsFolder
|
78
|
+
APS
|
79
|
+
`osascript -e '#{applescript}'`.strip
|
80
|
+
end
|
81
|
+
|
82
|
+
def self.move_app(name, app_path)
|
83
|
+
applescript = <<-APS.strip
|
84
|
+
#{intro}
|
85
|
+
|
86
|
+
set theApplicationsFolder to path to applications folder
|
87
|
+
try
|
88
|
+
tell application "#{name}" to quit
|
89
|
+
on error errMsg
|
90
|
+
end try
|
91
|
+
delay 3
|
92
|
+
tell application "Finder"
|
93
|
+
set theResult to move (POSIX file "#{app_path}") as alias to theApplicationsFolder with replacing
|
94
|
+
end tell
|
95
|
+
APS
|
96
|
+
system "osascript -e '#{applescript}'"
|
97
|
+
end
|
71
98
|
end
|
72
99
|
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.8
|
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-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
|
-
rubygems_version: 3.4.
|
86
|
+
rubygems_version: 3.4.7
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: Just a small toolbox for AppleScript, DEVONthink and MailMate
|