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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea371944eac7d4d47ece3f3932696e6c786e66115a022916361e828edb673228
4
- data.tar.gz: dd9f473f57cfa7996e8f16a3d31198f15867c6a6417b7e10ebfeb2cb4ea81e38
3
+ metadata.gz: c2f534754efeeb67e20f795dc0c6593f5f7c378bc5493d0d05a53c04cc7b4207
4
+ data.tar.gz: 888cbe6a7966336d76da1d273c69f98580bef9eae2d7c6218acf79417b9b3984
5
5
  SHA512:
6
- metadata.gz: c269ed5af6653c5a57bcc9436386872b00596ec25a9c4d421c7dbc7f34ff116519ae93b15646151116bfc9fd71eba5d7ad237e21ded430836b91b258790f66ad
7
- data.tar.gz: a30b0cde3a70d4f99eeb5f63ab22923733899b8e5ec7ce9bf3ed4be3be4be15a33654ca94ed149b369f6ad8101dd44c7cb66f57728088308fb325917425032a7
6
+ metadata.gz: a04bd17a33c23f78d18a4c5132b89ea46ecc9548bd3ca1ed702febcc5ca35a01768b4c3174e6d599b8599936b8989209780a27789e496c942cce40b5a519b36c
7
+ data.tar.gz: d251bc033b8301038517c2fb7f93e6ff8a6631099e6efaabf811918909f800e9c3167442e3df8f6d1e80eb14bba0c424daa6688c71cf1de45d25fa4040eac05b
@@ -13,11 +13,11 @@ module Pullbox
13
13
  end
14
14
 
15
15
  def self.display_notification(message, title)
16
- apple_script = <<~APS.strip
16
+ applescript = <<~APS.strip
17
17
  #{intro}
18
18
  display notification "#{message}" with title "#{title}"
19
19
  APS
20
- system "osascript -e '#{apple_script}'"
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
- apple_script = <<~APS.strip
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 '#{apple_script}'`.strip
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pullbox
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
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.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: 2022-12-26 00:00:00.000000000 Z
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.3.26
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