stickynotifications 0.0.5 → 0.0.6
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/CHANGELOG.md +7 -0
- data/README.md +3 -3
- data/lib/stickynotifications/cli.rb +15 -4
- data/lib/stickynotifications/note.rb +8 -3
- data/lib/stickynotifications/version.rb +2 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a1d060a62120a5a5feb5da9eafe1c7cfefc7458
|
4
|
+
data.tar.gz: 640421395afa8565082062129e00b7dd1a53456c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7aa4dfd9f4d3cb643925c3134c91bc8d652d3b78c8cf4af3e7520737cb7d1113a21df208af59368c03422316221e45387f1e3cd876c38e7bee7c8c556546cbf
|
7
|
+
data.tar.gz: 94a3ed8c93db51175e4b655cc1b3b233b8ae301ee5c15ff79f2fe976911811ad646554c13e377f27e569bb30c0a6506f7dc7f64c85e53dd756af4ddcf1056334
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Stickynotifications
|
2
2
|
|
3
|
-
|
3
|
+
A gem for interacting with Sticky Notifications.app on OS X.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -20,11 +20,11 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
`stickynotifications new "Message to create" --title "Title for my Sticky Notification"`
|
24
24
|
|
25
25
|
## Contributing
|
26
26
|
|
27
|
-
1. Fork it ( https://github.com/
|
27
|
+
1. Fork it ( https://github.com/brandonpittman/stickynotifications/fork )
|
28
28
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
29
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
30
|
4. Push to the branch (`git push origin my-new-feature`)
|
@@ -1,15 +1,26 @@
|
|
1
1
|
require 'thor'
|
2
2
|
require 'stickynotifications/note'
|
3
3
|
|
4
|
+
# @author "Brandon Pittman"
|
4
5
|
module StickyNotifications
|
6
|
+
# @author "Brandon Pittman"
|
7
|
+
# Inherits from Thor in order to create CLI
|
5
8
|
class Cli < Thor
|
6
|
-
|
7
|
-
|
9
|
+
desc 'new TEXT [-t TITLE]',
|
10
|
+
'create new Sticky Notification with TEXT [and TITLE]'
|
8
11
|
# Creates a new Sticky Notification
|
9
|
-
# @param text [String] the
|
12
|
+
# @param text [String] the message of the Sticky Notification
|
13
|
+
# @option title [String] optional title for Sticky Notification
|
14
|
+
# @example stickynotifications new
|
15
|
+
# stickynotifications new "This is the text of my sticky notification!"
|
16
|
+
option :title,
|
17
|
+
aliases: :t,
|
18
|
+
type: :string,
|
19
|
+
default: 'Reminder',
|
20
|
+
banner: 'Optional title for new Sticky Notification.'
|
10
21
|
def new(text)
|
11
22
|
note = StickyNotifications::Note.new
|
12
|
-
note.create(text)
|
23
|
+
note.create(text, options[:title])
|
13
24
|
end
|
14
25
|
end
|
15
26
|
end
|
@@ -1,18 +1,23 @@
|
|
1
1
|
require 'uri'
|
2
2
|
|
3
3
|
module StickyNotifications
|
4
|
+
# Responsible for initiating note creation.
|
4
5
|
class Note
|
5
6
|
# @param text [String] text to be used as reminder
|
6
7
|
# @return [Nil]
|
7
|
-
|
8
|
-
|
8
|
+
# Calls Sticky Notifications URL scheme in order to
|
9
|
+
# initiate creation of sticky notification.
|
10
|
+
def create(message_text, title_text)
|
11
|
+
message = escape(message_text)
|
12
|
+
title = escape(title_text)
|
13
|
+
`open "sticky-notifications://note?title=#{title}&message=#{message}"`
|
9
14
|
end
|
10
15
|
|
11
16
|
# Escapes the Sticky Notification text for URLs. URI produces %20 for
|
12
17
|
# spaces instead of CGI's +.
|
13
18
|
# @param string_to_escape [String] the text to be escaped
|
14
19
|
# @return [String] parsed URL
|
15
|
-
def
|
20
|
+
def escape(string_to_escape)
|
16
21
|
URI.escape(string_to_escape)
|
17
22
|
end
|
18
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stickynotifications
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- brandonpittman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -76,6 +76,7 @@ extra_rdoc_files: []
|
|
76
76
|
files:
|
77
77
|
- ".gitignore"
|
78
78
|
- ".travis.yml"
|
79
|
+
- CHANGELOG.md
|
79
80
|
- Gemfile
|
80
81
|
- LICENSE.txt
|
81
82
|
- README.md
|
@@ -108,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
109
|
version: '0'
|
109
110
|
requirements: []
|
110
111
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.4.
|
112
|
+
rubygems_version: 2.4.5
|
112
113
|
signing_key:
|
113
114
|
specification_version: 4
|
114
115
|
summary: A gem for creating Sticky Notifications.
|