pullbox 0.1.9 → 0.1.10

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: 87d2b40cfd8b7a1181675f57462fa4f890be85459ba6d9263877078d287545b1
4
- data.tar.gz: 0eadb9f720a6705c246cfd934e713f83438f19ac6ccb7e3adc4f972cf160d191
3
+ metadata.gz: 456138ab8b2e062b29f4237c05b9ec10ea0d00fc27da401dd3709615234d7c4a
4
+ data.tar.gz: 5acc4af815c96bc117720517965eaeeadb647292a74db4c88680c9399f4b643f
5
5
  SHA512:
6
- metadata.gz: 5f692094c2dce32ac9cb7f49628d8ee8add36649b55e5a31ff960a1b66973c3b6bb3565e93b4bcc8bf554a9bd8ff1b702cf8eb65353c5edd9a014b303a432c1d
7
- data.tar.gz: 7af4e33fd4eb976a6923660a4ed4b166653f7f6e73a4c91bae80f0cdbb3e47f214d7b30d508e68a0fb83021a2615d258cfb44741631b82abc1c7be59371756d8
6
+ metadata.gz: 5ec811becfaadee439f23804ff230f80280a1f486d43f4a368ad8b19214825f22f00fe10e60e866bb569e86d1e535f77f70bbc6ef58e79354ce8b2c06fd9d76b
7
+ data.tar.gz: eca174a172baec3e5603b84db56ac28203b8fad390e9ddcc4dc6c9b1f52ecf1bb1c19e84a84b2c0309bdecad9263cac28cdf1548cc7f30860f55b0f98d067f55
data/Gemfile CHANGED
@@ -8,3 +8,5 @@ gemspec
8
8
  gem "rake", "~> 13.0"
9
9
 
10
10
  gem "minitest", "~> 5.0"
11
+
12
+ gem "thor", "~> 1.2"
data/Gemfile.lock ADDED
@@ -0,0 +1,29 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ pullbox (0.1.9)
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
+ plist (3.7.0)
15
+ racc (1.6.2)
16
+ rake (13.0.6)
17
+ thor (1.2.2)
18
+
19
+ PLATFORMS
20
+ arm64-darwin-22
21
+
22
+ DEPENDENCIES
23
+ minitest (~> 5.0)
24
+ pullbox!
25
+ rake (~> 13.0)
26
+ thor (~> 1.2)
27
+
28
+ BUNDLED WITH
29
+ 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
- $ bundle add pullbox
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
- $ gem install pullbox
15
+ ```bash
16
+ gem install pullbox
17
+ ```
14
18
 
15
19
  ## Usage
16
20
 
17
- Includes a executable `mailmate_beta` which checks and installs MailMate prerelease automatically for you.
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pullbox
4
- VERSION = "0.1.9"
4
+ VERSION = "0.1.10"
5
5
  end
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.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - PuLLi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-19 00:00:00.000000000 Z
11
+ date: 2023-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -43,21 +43,22 @@ description: Enables you to write ruby code for AppleScript, DEVONthink and Mail
43
43
  email:
44
44
  - the@pulli.dev
45
45
  executables:
46
- - mailmate_beta
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/mailmate_beta
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
- - pullbox.gemspec
61
62
  - sig/pullbox.rbs
62
63
  homepage: https://github.com/the-pulli/pullbox
63
64
  licenses:
@@ -83,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
84
  - !ruby/object:Gem::Version
84
85
  version: '0'
85
86
  requirements: []
86
- rubygems_version: 3.4.7
87
+ rubygems_version: 3.4.10
87
88
  signing_key:
88
89
  specification_version: 4
89
90
  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
data/pullbox.gemspec DELETED
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/pullbox/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "pullbox"
7
- spec.version = Pullbox::VERSION
8
- spec.authors = ["PuLLi"]
9
- spec.email = ["the@pulli.dev"]
10
-
11
- spec.summary = "Just a small toolbox for AppleScript, DEVONthink and MailMate"
12
- spec.description = "Enables you to write ruby code for AppleScript, DEVONthink and MailMate features."
13
- spec.homepage = "https://github.com/the-pulli/pullbox"
14
- spec.license = "MIT"
15
- spec.required_ruby_version = ">= 2.6.0"
16
-
17
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
-
19
- spec.metadata["homepage_uri"] = spec.homepage
20
- spec.metadata["source_code_uri"] = "https://github.com/the-pulli/pullbox"
21
- spec.metadata["changelog_uri"] = "https://github.com/the-pulli/pullbox/blob/main/CHANGELOG.md"
22
-
23
- # Specify which files should be added to the gem when it is released.
24
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
- spec.files = Dir.chdir(__dir__) do
26
- `git ls-files -z`.split("\x0").reject do |f|
27
- (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
28
- end
29
- end
30
- spec.bindir = "exe"
31
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
- spec.require_paths = ["lib"]
33
-
34
- # Uncomment to register a new dependency of your gem
35
- spec.add_dependency "nokogiri", "~> 1.12"
36
- spec.add_dependency "plist", "~> 3.6"
37
-
38
- # For more information and examples about making a new gem, check out our
39
- # guide at: https://bundler.io/guides/creating_gem.html
40
- spec.metadata["rubygems_mfa_required"] = "true"
41
- end