stickynotifications 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4aeb62d61d9df1ebc0d647e1ae510f552a3b7ab6
4
- data.tar.gz: 1de94278d7c9266a6249e4b553d1a6d64e61322d
3
+ metadata.gz: 3a1d060a62120a5a5feb5da9eafe1c7cfefc7458
4
+ data.tar.gz: 640421395afa8565082062129e00b7dd1a53456c
5
5
  SHA512:
6
- metadata.gz: 33035d1ed873e4399b72ddf65cb438ed9986f8ad89662105e5e85540a7dd96c4800abc0beb536ca95fd8d8cf6df6171b8c3ec1be677927b108087258390c70fa
7
- data.tar.gz: 06e0bf14986cb7104aee9ba819f71f4639044a5190a0194132c10adb4782b769284d6401841f7d3a1102f6103150d62100539296c7855934af5f9a2750a45b3b
6
+ metadata.gz: a7aa4dfd9f4d3cb643925c3134c91bc8d652d3b78c8cf4af3e7520737cb7d1113a21df208af59368c03422316221e45387f1e3cd876c38e7bee7c8c556546cbf
7
+ data.tar.gz: 94a3ed8c93db51175e4b655cc1b3b233b8ae301ee5c15ff79f2fe976911811ad646554c13e377f27e569bb30c0a6506f7dc7f64c85e53dd756af4ddcf1056334
@@ -0,0 +1,7 @@
1
+ # Change Log
2
+
3
+ ## 0.0.6 --- 2014-12-16
4
+
5
+ ### Added
6
+
7
+ - `--title` option for new Sticky Notifications
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Stickynotifications
2
2
 
3
- TODO: Write a gem description
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
- TODO: Write usage instructions here
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/[my-github-username]/stickynotifications/fork )
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
- desc "new TEXT", "create new Sticky Notification with TEXT"
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 text of the Sticky Notification
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
- def create(text)
8
- %x{open "sticky-notifications://note?message=#{escape_string(text)}"}
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 escape_string(string_to_escape)
20
+ def escape(string_to_escape)
16
21
  URI.escape(string_to_escape)
17
22
  end
18
23
  end
@@ -1,5 +1,5 @@
1
- # Sets version for RubyGems
1
+ # Namespace for stickynotifications
2
2
  module Stickynotifications
3
3
  # Sets version for RubyGems
4
- VERSION = "0.0.5"
4
+ VERSION = '0.0.6'
5
5
  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.5
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-10-23 00:00:00.000000000 Z
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.2
112
+ rubygems_version: 2.4.5
112
113
  signing_key:
113
114
  specification_version: 4
114
115
  summary: A gem for creating Sticky Notifications.