grid-plugin-osx-notifier 0.0.1

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.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm --create ruby-1.9.2-p0@grid-plugin-osx-notifier
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in gridcli.gemspec
4
+ gemspec
data/README.markdown ADDED
@@ -0,0 +1,9 @@
1
+ = grid-plugin-osx-notifier
2
+
3
+ The Grid is a command line social network that is fast, modular, and simple.
4
+
5
+ This is a gem that notifies you of new messages using the OSX notification center.
6
+
7
+ To install (after installing the grid - aka the gridcli gem):
8
+ grid plugin install osx-notifier
9
+
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+
4
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,23 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+ require "grid-plugin-osx-notifier"
3
+ require 'rake'
4
+ require 'date'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "grid-plugin-osx-notifier"
8
+ s.date = Date.today.to_s
9
+ s.version = Grid::Plugin::OSXNotifier::VERSION
10
+ s.authors = ["Brian Muller"]
11
+ s.email = ["bamuller@gmail.com"]
12
+ s.homepage = ""
13
+ s.summary = "A grid module that sends a notification when there are new messages."
14
+ s.description = "A grid module that sends a notification when there are new messages."
15
+
16
+ s.rubyforge_project = "grid-plugin-osx-notifier"
17
+
18
+ s.files = `git ls-files`.split("\n")
19
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+ s.require_paths = ["lib"]
21
+ s.add_dependency("gridcli", ">= 0.1.0")
22
+ s.add_dependency("terminal-notifier", ">= 1.4.2")
23
+ end
@@ -0,0 +1,33 @@
1
+ require 'gridcli'
2
+ require 'terminal-notifier'
3
+
4
+ module Grid
5
+ module Plugin
6
+ module OSXNotifier
7
+ VERSION = "0.0.1"
8
+ end
9
+ end
10
+ end
11
+
12
+ GridCLI.hooker.register(:after_update) { |posts|
13
+ return posts if posts.length == 0
14
+
15
+ title = "The Grid"
16
+ if posts.length == 1
17
+ subtitle = "You have a new message."
18
+ else
19
+ subtitle = "You have #{posts.length} new messages."
20
+ end
21
+
22
+ senders = posts.map { |p|
23
+ p.send(p.known_attributes.first).from_username
24
+ }.uniq
25
+
26
+ if senders.length > 3
27
+ senders = senders.slice(0, 3) + ["and others"]
28
+ end
29
+
30
+ msg = "From " + senders.join(", ")
31
+ TerminalNotifier.notify(msg, :title => title, :subtitle => subtitle)
32
+ posts
33
+ }
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: grid-plugin-osx-notifier
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Brian Muller
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2012-10-05 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: gridcli
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.1.0
24
+ type: :runtime
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: terminal-notifier
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 1.4.2
35
+ type: :runtime
36
+ version_requirements: *id002
37
+ description: A grid module that sends a notification when there are new messages.
38
+ email:
39
+ - bamuller@gmail.com
40
+ executables: []
41
+
42
+ extensions: []
43
+
44
+ extra_rdoc_files: []
45
+
46
+ files:
47
+ - .gitignore
48
+ - .rvmrc
49
+ - Gemfile
50
+ - README.markdown
51
+ - Rakefile
52
+ - grid-plugin-osx-notifier.gemspec
53
+ - lib/grid-plugin-osx-notifier.rb
54
+ homepage: ""
55
+ licenses: []
56
+
57
+ post_install_message:
58
+ rdoc_options: []
59
+
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
+ requirements: []
75
+
76
+ rubyforge_project: grid-plugin-osx-notifier
77
+ rubygems_version: 1.8.24
78
+ signing_key:
79
+ specification_version: 3
80
+ summary: A grid module that sends a notification when there are new messages.
81
+ test_files: []
82
+