terminal-notifier 1.8.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.markdown +5 -5
  3. data/lib/terminal-notifier.rb +39 -8
  4. data/vendor/terminal-notifier/LICENSE.md +9 -0
  5. data/vendor/terminal-notifier/README.markdown +256 -0
  6. data/vendor/terminal-notifier/Ruby/Gemfile +2 -0
  7. data/vendor/terminal-notifier/Ruby/Gemfile.lock +23 -0
  8. data/vendor/terminal-notifier/Ruby/LICENSE +24 -0
  9. data/vendor/terminal-notifier/Ruby/README.markdown +48 -0
  10. data/vendor/terminal-notifier/Ruby/Rakefile +48 -0
  11. data/vendor/terminal-notifier/Ruby/bin/terminal-notifier +13 -0
  12. data/vendor/terminal-notifier/Ruby/lib/terminal-notifier.rb +124 -0
  13. data/vendor/terminal-notifier/Ruby/spec/terminal-notifier_spec.rb +79 -0
  14. data/vendor/terminal-notifier/Ruby/terminal-notifier.gemspec +26 -0
  15. data/vendor/terminal-notifier/Terminal Notifier.xcodeproj/project.pbxproj +315 -0
  16. data/vendor/terminal-notifier/Terminal Notifier.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  17. data/vendor/terminal-notifier/Terminal Notifier.xcodeproj/project.xcworkspace/xcshareddata/Terminal Notifier.xccheckout +41 -0
  18. data/vendor/terminal-notifier/Terminal Notifier.xcodeproj/xcshareddata/xcschemes/Terminal Notifier.xcscheme +140 -0
  19. data/vendor/terminal-notifier/Terminal Notifier/AppDelegate.h +4 -0
  20. data/vendor/terminal-notifier/Terminal Notifier/AppDelegate.m +382 -0
  21. data/vendor/terminal-notifier/Terminal Notifier/Terminal Notifier-Info.plist +43 -0
  22. data/vendor/terminal-notifier/Terminal Notifier/Terminal Notifier-Prefix.pch +7 -0
  23. data/vendor/terminal-notifier/Terminal Notifier/en.lproj/Credits.rtf +29 -0
  24. data/vendor/terminal-notifier/Terminal Notifier/en.lproj/InfoPlist.strings +2 -0
  25. data/vendor/terminal-notifier/Terminal Notifier/en.lproj/MainMenu.xib +3387 -0
  26. data/vendor/terminal-notifier/Terminal Notifier/main.m +6 -0
  27. data/vendor/terminal-notifier/Terminal.icns +0 -0
  28. data/vendor/terminal-notifier/assets/Example_1.png +0 -0
  29. data/vendor/terminal-notifier/assets/Example_2.png +0 -0
  30. data/vendor/terminal-notifier/assets/Example_3.png +0 -0
  31. data/vendor/terminal-notifier/assets/Example_4.png +0 -0
  32. data/vendor/terminal-notifier/assets/Example_5.png +0 -0
  33. data/vendor/terminal-notifier/assets/System_prefs.png +0 -0
  34. data/vendor/terminal-notifier/terminal-notifier.app/Contents/Info.plist +63 -0
  35. data/vendor/terminal-notifier/terminal-notifier.app/Contents/MacOS/terminal-notifier +0 -0
  36. data/vendor/terminal-notifier/terminal-notifier.app/Contents/PkgInfo +1 -0
  37. data/vendor/terminal-notifier/terminal-notifier.app/Contents/Resources/Terminal.icns +0 -0
  38. data/vendor/terminal-notifier/terminal-notifier.app/Contents/Resources/en.lproj/Credits.rtf +29 -0
  39. data/vendor/terminal-notifier/terminal-notifier.app/Contents/Resources/en.lproj/InfoPlist.strings +0 -0
  40. data/vendor/terminal-notifier/terminal-notifier.app/Contents/Resources/en.lproj/MainMenu.nib +0 -0
  41. metadata +42 -4
  42. data/vendor/terminal-notifier +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fae5b013616ebd7f4511c2949c3cffb6475d9cb4
4
- data.tar.gz: e5b4e8c7cea64c8ab937ed72ea12ee81bb73050f
3
+ metadata.gz: fef9492e8e3563546fe5358647649031585b01fa
4
+ data.tar.gz: 9c9604dd1f3fd959e691e7c7e67d05da5ec13001
5
5
  SHA512:
6
- metadata.gz: 403cdb78cf741009db3a64815369001835082ea8690c71138f7723b8a904e3f0fcf6b38babdb1b777418db87deb2af975a08e5547d22bd7ad26b4975f8fe700e
7
- data.tar.gz: eb4d72aa0ab3fac697c6b5d0900c4eca016c579986356733df4e34beaacde75734f081a53c8332f930445a80c0027c2adb759662858002a4fd440f35d61e9fd8
6
+ metadata.gz: 1a6d520de804fc3c57f5b95f1e4889ab5e6e087a4888190f24fe8ad8a100482c6101bf1eb705e3732c4df0b861927132e0f3ff1d6ef44b859ca7952caddf5bd7
7
+ data.tar.gz: 696b031ece86bfd7948c990279745f044cae51a31509fe36f56699b4c5f9713fcd2385947cbf08eb5f4f2bc909c820b6379e1a5d607178fb3a3f636c7aca6401
@@ -2,7 +2,7 @@
2
2
 
3
3
  A simple Ruby wrapper around the [`terminal-notifier`][HOMEPAGE] command-line
4
4
  tool, which allows you to send User Notifications to the Notification Center on
5
- Mac OS X 10.10, or higher.
5
+ macOS 10.10, or higher.
6
6
 
7
7
 
8
8
  ## Installation
@@ -22,7 +22,7 @@ Examples are:
22
22
  TerminalNotifier.notify('Hello World')
23
23
  TerminalNotifier.notify('Hello World', :title => 'Ruby', :subtitle => 'Programming Language')
24
24
  TerminalNotifier.notify('Hello World', :activate => 'com.apple.Safari')
25
- TerminalNotifier.notify('Hello World', :open => 'http://twitter.com/alloy')
25
+ TerminalNotifier.notify('Hello World', :open => 'http://twitter.com/julienXX')
26
26
  TerminalNotifier.notify('Hello World', :execute => 'say "OMG"')
27
27
  TerminalNotifier.notify('Hello World', :group => Process.pid)
28
28
  TerminalNotifier.notify('Hello World', :sender => 'com.apple.Safari')
@@ -43,6 +43,6 @@ copyright of Apple.
43
43
 
44
44
  See [LICENSE][LICENSE] for details.
45
45
 
46
- [HOMEPAGE]: https://github.com/alloy/terminal-notifier
47
- [README]: https://github.com/alloy/terminal-notifier/blob/master/README.markdown
48
- [LICENSE]: https://github.com/alloy/terminal-notifier/blob/master/Ruby/LICENSE
46
+ [HOMEPAGE]: https://github.com/julienXX/terminal-notifier
47
+ [README]: https://github.com/julienXX/terminal-notifier/blob/master/README.markdown
48
+ [LICENSE]: https://github.com/julienXX/terminal-notifier/blob/master/Ruby/LICENSE
@@ -3,10 +3,10 @@ require 'shellwords'
3
3
  require 'rbconfig'
4
4
 
5
5
  module TerminalNotifier
6
- BIN_PATH = File.expand_path('../../vendor/terminal-notifier', __FILE__)
6
+ BIN_PATH = File.expand_path('../../vendor/terminal-notifier/terminal-notifier.app/Contents/MacOS/terminal-notifier', __FILE__)
7
7
 
8
8
  class UnsupportedPlatformError < StandardError; end
9
- # Returns wether or not the current platform is Mac OS X 10.10, or higher.
9
+ # Returns wether or not the current platform is macOS 10.10, or higher.
10
10
  def self.available?
11
11
  @available ||= (/darwin|mac os/ =~ RbConfig::CONFIG['host_os']) && Gem::Version.new(version) > Gem::Version.new('10.10')
12
12
  end
@@ -27,16 +27,47 @@ module TerminalNotifier
27
27
  end
28
28
  result
29
29
  else
30
- STDERR.print "terminal-notifier is only supported on Mac OS X 10.10, or higher."
30
+ STDERR.print "terminal-notifier is only supported on macOS 10.10, or higher."
31
31
  end
32
32
  end
33
33
 
34
+ # Cleans up the result of a notification, making it easier to work it
35
+ #
36
+ # The result of a notification is downcased, then groups of 1 or more
37
+ # non-word characters are replaced with an underscore, before being
38
+ # symbolised.
39
+ #
40
+ # If the reply option was given, then instead of going through the
41
+ # above process, the result is returned with no changes as a string.
42
+ #
43
+ # If the always_string param is set to true, a the result is returned
44
+ # with no changes as a string, like above.
45
+ #
46
+ # Examples are:
47
+ #
48
+ # notify_result('Test', {}) #=> :test
49
+ # notify_result('No, sir', {}) #=> :no_sir
50
+ # notify_result('@timeout', {}) #=> :_timeout
51
+ # notify_result('@closeaction', {}) #=> :_closeaction
52
+ # notify_result('I like pie', {reply: true}) #=> 'I like pie'
53
+ # notify_result('I do not like pie', {'reply' => true}) #=> 'I do not like pie'
54
+ # notify_result('@timeout', {'reply' => true}) #=> '@timeout'
55
+ # notify_result('I may like pie', {}) #=> :i_may_like_pie
56
+ def notify_result(result, options, always_string = false)
57
+ if options[:reply] || options['reply'] || always_string
58
+ result
59
+ else
60
+ result.length == 0 || result.downcase.gsub(/\W+/,'_').to_sym
61
+ end
62
+ end
63
+ module_function :notify_result
64
+
34
65
  # Sends a User Notification and returns whether or not it was a success.
35
66
  #
36
67
  # The available options are `:title`, `:group`, `:activate`, `:open`,
37
68
  # `:execute`, `:sender`, and `:sound`. For a description of each option see:
38
69
  #
39
- # https://github.com/alloy/terminal-notifier/blob/master/README.markdown
70
+ # https://github.com/julienXX/terminal-notifier/blob/master/README.markdown
40
71
  #
41
72
  # Examples are:
42
73
  #
@@ -44,15 +75,15 @@ module TerminalNotifier
44
75
  # TerminalNotifier.notify('Hello World', :title => 'Ruby')
45
76
  # TerminalNotifier.notify('Hello World', :group => Process.pid)
46
77
  # TerminalNotifier.notify('Hello World', :activate => 'com.apple.Safari')
47
- # TerminalNotifier.notify('Hello World', :open => 'http://twitter.com/alloy')
78
+ # TerminalNotifier.notify('Hello World', :open => 'http://twitter.com/julienXX')
48
79
  # TerminalNotifier.notify('Hello World', :execute => 'say "OMG"')
49
80
  # TerminalNotifier.notify('Hello World', :sender => 'com.apple.Safari')
50
81
  # TerminalNotifier.notify('Hello World', :sound => 'default')
51
82
  #
52
83
  # Raises if not supported on the current platform.
53
- def notify(message, options = {}, verbose = false)
54
- TerminalNotifier.execute(verbose, options.merge(:message => message))
55
- $? && $?.success?
84
+ def notify(message, options = {}, verbose = false, always_string = false)
85
+ result = TerminalNotifier.execute(verbose, options.merge(:message => message))
86
+ $? && $?.success? && notify_result(result, options, always_string)
56
87
  end
57
88
  module_function :notify
58
89
 
@@ -0,0 +1,9 @@
1
+ All the works are available under the MIT license. Except for ‘Terminal.icns’, which is a copy of Apple’s Terminal.app icon and as such is copyright of Apple.
2
+
3
+ Copyright (C) 2012-2016 Eloy Durán eloy.de.enige@gmail.com, Julien Blanchard julien@sideburns.eu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,256 @@
1
+ # terminal-notifier
2
+
3
+ terminal-notifier is a command-line tool to send macOS User Notifications,
4
+ which are available on macOS 10.10 and higher.
5
+
6
+
7
+ ## News
8
+
9
+ [alerter](https://github.com/vjeantet/alerter) features were merged in terminal-notifier 1.7. This led to some issues and even more issues in the 1.8 release. We decided with [Valère Jeantet](https://github.com/vjeantet) to rollback this merge.
10
+
11
+ From now on terminal-notifier won't have the sticky notification feature nor the actions buttons. If you need them please use [alerter](https://github.com/vjeantet/alerter). I also want to follow [semver](http://semver.org) hence this latest version starts at 2.0.0.
12
+
13
+ Sticking to two smaller specialized tools will hopefully make them easier to maintain and less error prone.
14
+
15
+
16
+ ## Caveats
17
+
18
+ * It is currently packaged as an application bundle, because `NSUserNotification`
19
+ does not work from a ‘Foundation tool’. [radar://11956694](radar://11956694)
20
+
21
+ * If you intend to package terminal-notifier with your app to distribute it on the Mac App Store, please use 1.5.2; version 1.6.0+ uses a private method override, which is not allowed in the App Store Guidelines.
22
+
23
+ * If you're using macOS < 10.10 you should use terminal-notifier 1.6.3.
24
+
25
+ * If you're looking for sticky notifications or more actions on a notification please use [alerter](https://github.com/vjeantet/alerter)
26
+
27
+ ## Download
28
+
29
+ Prebuilt binaries are available from the
30
+ [releases section](https://github.com/julienXX/terminal-notifier/releases).
31
+
32
+ Or if you want to use this from
33
+ [Ruby](https://github.com/julienXX/terminal-notifier/tree/master/Ruby), you can
34
+ install it through RubyGems:
35
+
36
+ ```
37
+ $ [sudo] gem install terminal-notifier
38
+ ```
39
+
40
+ You can also install it via [Homebrew](https://github.com/mxcl/homebrew):
41
+ ```
42
+ $ brew install terminal-notifier
43
+ ```
44
+
45
+ ## Usage
46
+
47
+ ```
48
+ $ ./terminal-notifier.app/Contents/MacOS/terminal-notifier -[message|group|list] [VALUE|ID|ID] [options]
49
+ ```
50
+
51
+ In order to use terminal-notifier, you have to call the binary _inside_ the
52
+ application bundle.
53
+
54
+ The Ruby gem, which wraps this tool, _does_ have a bin wrapper. If installed
55
+ you can simply do:
56
+
57
+ ```
58
+ $ terminal-notifier -[message|group|list] [VALUE|ID|ID] [options]
59
+ ```
60
+
61
+ This will obviously be a bit slower than using the tool without the wrapper.
62
+
63
+
64
+ ### Example Uses
65
+
66
+ Display piped data with a sound:
67
+ ```
68
+ $ echo 'Piped Message Data!' | terminal-notifier -sound default
69
+ ```
70
+
71
+ ![Example 1](assets/Example_1.png)
72
+
73
+ Use a custom icon:
74
+ ```
75
+ $ terminal-notifier -title ProjectX -subtitle "new tag detected" -message "Finished" -appIcon http://vjeantet.fr/images/logo.png
76
+ ```
77
+
78
+ ![Example 3](assets/Example_3.png)
79
+
80
+ Open an URL when the notification is clicked:
81
+ ```
82
+ $ terminal-notifier -title '💰' -message 'Check your Apple stock!' -open 'http://finance.yahoo.com/q?s=AAPL'
83
+ ```
84
+
85
+ ![Example 4](assets/Example_4.png)
86
+
87
+ Open an app when the notification is clicked:
88
+ ```
89
+ $ terminal-notifier -group 'address-book-sync' -title 'Address Book Sync' -subtitle 'Finished' -message 'Imported 42 contacts.' -activate 'com.apple.AddressBook'
90
+ ```
91
+
92
+ ![Example 5](assets/Example_5.png)
93
+
94
+
95
+ ### Options
96
+
97
+ At a minimum, you must specify either the `-message` , the `-remove`, or the
98
+ `-list` option.
99
+
100
+ -------------------------------------------------------------------------------
101
+
102
+ `-message VALUE` **[required]**
103
+
104
+ The message body of the notification.
105
+
106
+ If you pipe data into terminal-notifier, you can omit this option,
107
+ and the piped data will become the message body instead.
108
+
109
+ -------------------------------------------------------------------------------
110
+
111
+ `-title VALUE`
112
+
113
+ The title of the notification. This defaults to ‘Terminal’.
114
+
115
+ -------------------------------------------------------------------------------
116
+
117
+ `-subtitle VALUE`
118
+
119
+ The subtitle of the notification.
120
+
121
+ -------------------------------------------------------------------------------
122
+
123
+ `-sound NAME`
124
+
125
+ Play the `NAME` sound when the notification appears.
126
+ Sound names are listed in Sound Preferences.
127
+
128
+ Use the special `NAME` “default” for the default notification sound.
129
+
130
+ -------------------------------------------------------------------------------
131
+
132
+ `-group ID`
133
+
134
+ Specifies the notification’s ‘group’. For any ‘group’, only _one_
135
+ notification will ever be shown, replacing previously posted notifications.
136
+
137
+ A notification can be explicitly removed with the `-remove` option (see
138
+ below).
139
+
140
+ Example group IDs:
141
+
142
+ * The sender’s name (to scope the notifications by tool).
143
+ * The sender’s process ID (to scope the notifications by a unique process).
144
+ * The current working directory (to scope notifications by project).
145
+
146
+ -------------------------------------------------------------------------------
147
+
148
+ `-remove ID` **[required]**
149
+
150
+ Remove a previous notification from the `ID` ‘group’, if one exists.
151
+
152
+ Use the special `ID` “ALL” to remove all messages.
153
+
154
+ -------------------------------------------------------------------------------
155
+
156
+ `-list ID` **[required]**
157
+
158
+ Lists details about the specified ‘group’ `ID`.
159
+
160
+ Use the special `ID` “ALL” to list details about all currently active messages.
161
+
162
+ The output of this command is tab-separated, which makes it easy to parse.
163
+
164
+ -------------------------------------------------------------------------------
165
+
166
+ `-activate ID`
167
+
168
+ Activate the application specified by `ID` when the user clicks the
169
+ notification.
170
+
171
+ You can find the bundle identifier (`CFBundleIdentifier`) of an application in its `Info.plist` file
172
+ _inside_ the application bundle.
173
+
174
+ Examples application IDs are:
175
+
176
+ * `com.apple.Terminal` to activate Terminal.app
177
+ * `com.apple.Safari` to activate Safari.app
178
+
179
+ -------------------------------------------------------------------------------
180
+
181
+ `-sender ID`
182
+
183
+ Fakes the sender application of the notification. This uses the specified
184
+ application’s icon, and will launch it when the notification is clicked.
185
+
186
+ Using this option fakes the sender application, so that the notification system
187
+ will launch that application when the notification is clicked. Because of this
188
+ it is important to note that you cannot combine this with options like
189
+ `-execute` and `-activate` which depend on the sender of the notification to be
190
+ ‘terminal-notifier’ to perform its work.
191
+
192
+ For information on the `ID`, see the `-activate` option.
193
+
194
+ -------------------------------------------------------------------------------
195
+
196
+ `-appIcon PATH`
197
+
198
+ Specify an image `PATH` to display instead of the application icon.
199
+
200
+ **WARNING: This option is subject to change, since it relies on a private method.**
201
+
202
+ -------------------------------------------------------------------------------
203
+
204
+ `-contentImage PATH`
205
+
206
+ Specify an image `PATH` to attach inside of the notification.
207
+
208
+ **WARNING: This option is subject to change since it relies on a private method.**
209
+
210
+ -------------------------------------------------------------------------------
211
+
212
+ `-open URL`
213
+
214
+ Open `URL` when the user clicks the notification. This can be a web or file URL,
215
+ or any custom URL scheme.
216
+
217
+ -------------------------------------------------------------------------------
218
+
219
+ `-execute COMMAND`
220
+
221
+ Run the shell command `COMMAND` when the user clicks the notification.
222
+
223
+ -------------------------------------------------------------------------------
224
+
225
+ `-ignoreDnD`
226
+
227
+ Ignore Do Not Disturb settings and unconditionally show the notification.
228
+
229
+ **WARNING: This option is subject to change since it relies on a private method.**
230
+
231
+ ## License
232
+
233
+ All the works are available under the MIT license. **Except** for
234
+ ‘Terminal.icns’, which is a copy of Apple’s Terminal.app icon and as such is
235
+ copyright of Apple.
236
+
237
+ Copyright (C) 2012-2017 Eloy Durán <eloy.de.enige@gmail.com>, Julien Blanchard
238
+ <julien@sideburns.eu>
239
+
240
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
241
+ this software and associated documentation files (the "Software"), to deal in
242
+ the Software without restriction, including without limitation the rights to
243
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
244
+ of the Software, and to permit persons to whom the Software is furnished to do
245
+ so, subject to the following conditions:
246
+
247
+ The above copyright notice and this permission notice shall be included in all
248
+ copies or substantial portions of the Software.
249
+
250
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
251
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
252
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
253
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
254
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
255
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
256
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -0,0 +1,23 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ terminal-notifier (1.5.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ bacon (1.1.0)
10
+ metaclass (0.0.1)
11
+ mocha (0.11.4)
12
+ metaclass (~> 0.0.1)
13
+ mocha-on-bacon (0.2.0)
14
+ mocha (>= 0.9.8)
15
+
16
+ PLATFORMS
17
+ ruby
18
+
19
+ DEPENDENCIES
20
+ bacon
21
+ mocha
22
+ mocha-on-bacon
23
+ terminal-notifier!
@@ -0,0 +1,24 @@
1
+ All the works are available under the MIT license. **Except** for
2
+ ‘Terminal.icns’, which is a copy of Apple’s Terminal.app icon and as such is
3
+ copyright of Apple.
4
+
5
+ Copyright (C) 2012-2013 Eloy Durán <eloy.de.enige@gmail.com>, Julien Blanchard
6
+ <julien@sideburns.eu>
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
9
+ this software and associated documentation files (the "Software"), to deal in
10
+ the Software without restriction, including without limitation the rights to
11
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12
+ of the Software, and to permit persons to whom the Software is furnished to do
13
+ so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
@@ -0,0 +1,48 @@
1
+ # TerminalNotifier
2
+
3
+ A simple Ruby wrapper around the [`terminal-notifier`][HOMEPAGE] command-line
4
+ tool, which allows you to send User Notifications to the Notification Center on
5
+ macOS 10.10, or higher.
6
+
7
+
8
+ ## Installation
9
+
10
+ ```
11
+ $ gem install terminal-notifier
12
+ ```
13
+
14
+
15
+ ## Usage
16
+
17
+ For full information on all the options, see the tool’s [README][README].
18
+
19
+ Examples are:
20
+
21
+ ```ruby
22
+ TerminalNotifier.notify('Hello World')
23
+ TerminalNotifier.notify('Hello World', :title => 'Ruby', :subtitle => 'Programming Language')
24
+ TerminalNotifier.notify('Hello World', :activate => 'com.apple.Safari')
25
+ TerminalNotifier.notify('Hello World', :open => 'http://twitter.com/julienXX')
26
+ TerminalNotifier.notify('Hello World', :execute => 'say "OMG"')
27
+ TerminalNotifier.notify('Hello World', :group => Process.pid)
28
+ TerminalNotifier.notify('Hello World', :sender => 'com.apple.Safari')
29
+ TerminalNotifier.notify('Hello World', :sound => 'default')
30
+
31
+ TerminalNotifier.remove(Process.pid)
32
+
33
+ TerminalNotifier.list(Process.pid)
34
+ TerminalNotifier.list
35
+ ```
36
+
37
+
38
+ ## License
39
+
40
+ All the works are available under the MIT license. **Except** for
41
+ ‘Terminal.icns’, which is a copy of Apple’s Terminal.app icon and as such is
42
+ copyright of Apple.
43
+
44
+ See [LICENSE][LICENSE] for details.
45
+
46
+ [HOMEPAGE]: https://github.com/julienXX/terminal-notifier
47
+ [README]: https://github.com/julienXX/terminal-notifier/blob/master/README.markdown
48
+ [LICENSE]: https://github.com/julienXX/terminal-notifier/blob/master/Ruby/LICENSE