stickynotifications 0.0.3 → 0.0.4
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/bin/stickynotifications +2 -0
- data/lib/stickynotifications/version.rb +3 -1
- data/lib/stickynotifications.rb +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6a227cb7d63bb6692127472222098ad3cd6927a
|
4
|
+
data.tar.gz: 3386c989ab211cbd45cd17881c1f5e5db5d3a428
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58df8d847f9e9e449e00cb2f0c8cd6b9b585f18064d762b4b063cb3c7a1b280e3d8cd34d76fda0850b325684dc87d17076be94a9bd922f54d3d171b79b6efda6
|
7
|
+
data.tar.gz: aae1cb77168dcee49c97b1f0d6f1612e4a148f2f9307d9d7c3aea0e9c433325e7145bf169761bb82740b98fb9b95615b81f82f73a910b07a84f99851bd4e4c03
|
data/bin/stickynotifications
CHANGED
data/lib/stickynotifications.rb
CHANGED
@@ -2,13 +2,22 @@ require "stickynotifications/version"
|
|
2
2
|
require 'uri'
|
3
3
|
require 'thor'
|
4
4
|
|
5
|
+
# @author "Brandon Pittman"
|
6
|
+
# All logic for StickyNotifications
|
5
7
|
class StickyNotifications < Thor
|
8
|
+
|
6
9
|
desc "new TEXT", "create new Sticky Notification with TEXT"
|
10
|
+
# Creates a new Sticky Notification
|
11
|
+
# @param sticky_text [String] the text of the Sticky Notification
|
7
12
|
def new(sticky_text)
|
8
13
|
%x{open "sticky-notifications://note?message=#{escape_string(sticky_text)}"}
|
9
14
|
end
|
10
15
|
|
11
16
|
no_commands do
|
17
|
+
# Escapes the Sticky Notification text for URLs. URI produces %20 for
|
18
|
+
# spaces instead of CGI's +.
|
19
|
+
# @param string_to_escape [String] the text to be escaped
|
20
|
+
# @return [String] parsed URL
|
12
21
|
def escape_string(string_to_escape)
|
13
22
|
URI.escape(string_to_escape)
|
14
23
|
end
|