pullbox 0.1.1 → 0.1.2
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/lib/pullbox/applescript.rb +22 -4
- 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: c2f534754efeeb67e20f795dc0c6593f5f7c378bc5493d0d05a53c04cc7b4207
|
4
|
+
data.tar.gz: 888cbe6a7966336d76da1d273c69f98580bef9eae2d7c6218acf79417b9b3984
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a04bd17a33c23f78d18a4c5132b89ea46ecc9548bd3ca1ed702febcc5ca35a01768b4c3174e6d599b8599936b8989209780a27789e496c942cce40b5a519b36c
|
7
|
+
data.tar.gz: d251bc033b8301038517c2fb7f93e6ff8a6631099e6efaabf811918909f800e9c3167442e3df8f6d1e80eb14bba0c424daa6688c71cf1de45d25fa4040eac05b
|
data/lib/pullbox/applescript.rb
CHANGED
@@ -13,11 +13,11 @@ module Pullbox
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.display_notification(message, title)
|
16
|
-
|
16
|
+
applescript = <<~APS.strip
|
17
17
|
#{intro}
|
18
18
|
display notification "#{message}" with title "#{title}"
|
19
19
|
APS
|
20
|
-
system "osascript -e '#{
|
20
|
+
system "osascript -e '#{applescript}'"
|
21
21
|
end
|
22
22
|
|
23
23
|
def self.display_dialog(message, title, defaults = {})
|
@@ -26,7 +26,7 @@ module Pullbox
|
|
26
26
|
buttons = 'buttons {"'
|
27
27
|
buttons << defaults[:buttons].join('", "')
|
28
28
|
buttons << "\"} default button \"#{defaults[:buttons].last}\""
|
29
|
-
|
29
|
+
applescript = <<~APS.strip
|
30
30
|
#{intro}
|
31
31
|
try
|
32
32
|
return text returned of (display dialog "#{message}"#{buttons}#{answer} with title "#{title}")
|
@@ -36,11 +36,29 @@ module Pullbox
|
|
36
36
|
end if
|
37
37
|
end try
|
38
38
|
APS
|
39
|
-
answer = `osascript -e '#{
|
39
|
+
answer = `osascript -e '#{applescript}'`.strip
|
40
40
|
|
41
41
|
exit! if answer == ""
|
42
42
|
|
43
43
|
answer
|
44
44
|
end
|
45
|
+
|
46
|
+
def self.export_playlist(name, to, format = :xml)
|
47
|
+
allowed_formats = {
|
48
|
+
m3u: "M3U",
|
49
|
+
m3u8: "M3U8",
|
50
|
+
plain_text: "plain text",
|
51
|
+
unicode_text: "Unicode text",
|
52
|
+
xml: "XML"
|
53
|
+
}
|
54
|
+
raise ArgumentError, "Export format not supported" unless allowed_formats.keys.include? format
|
55
|
+
|
56
|
+
format = allowed_formats[format]
|
57
|
+
applescript = <<~APS.strip
|
58
|
+
#{intro}
|
59
|
+
tell application "Music" to export playlist "#{name}" as #{format} to "#{to}"
|
60
|
+
APS
|
61
|
+
system "osascript -e '#{applescript}'"
|
62
|
+
end
|
45
63
|
end
|
46
64
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PuLLi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plist
|
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
|
-
rubygems_version: 3.
|
72
|
+
rubygems_version: 3.4.1
|
73
73
|
signing_key:
|
74
74
|
specification_version: 4
|
75
75
|
summary: Just a small toolbox for AppleScript, DEVONthink and MailMate
|