duwanis-burble 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README.markdown +44 -0
- data/lib/burble.rb +53 -0
- data/lib/burble/growl-sender.rb +11 -0
- data/lib/burble/mumbles-sender.rb +8 -0
- data/lib/burble/snarl-sender.rb +11 -0
- metadata +81 -0
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2008 Tommy Morgan
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# Burble - Tell the Whole Tulgey Wood
|
2
|
+
*And, as in uffish thought he stood,*
|
3
|
+
*The Jabberwock, with eyes of flame,*
|
4
|
+
*Came whiffling through the tulgey wood,*
|
5
|
+
*And burbled as it came!*
|
6
|
+
**Lewis Carroll**
|
7
|
+
*(from Through the Looking-Glass and What Alice Found There, 1872)*
|
8
|
+
|
9
|
+
Want to growl, but don't want to alienate non-mac users?
|
10
|
+
Burble's the answer!
|
11
|
+
Use Burble to post your notifications. If the user has any of the supported
|
12
|
+
notification frameworks installed, Burble will automatically locate it and
|
13
|
+
utilize that framework for you!
|
14
|
+
|
15
|
+
Vorpal.
|
16
|
+
|
17
|
+
# Requirements
|
18
|
+
The gem requires ruby-snarl and ruby-growl.
|
19
|
+
I'd really rather only require these guys if your OS does...
|
20
|
+
But sadly, a single gemspec file can only do so much. And OS-specific dependencies
|
21
|
+
is not one of those things.
|
22
|
+
|
23
|
+
# Install
|
24
|
+
|
25
|
+
`sudo gem install duwanis-burble --source=http://gems.github.com`
|
26
|
+
|
27
|
+
# Brillig!
|
28
|
+
|
29
|
+
`require 'rubygems'`
|
30
|
+
`require 'burble'`
|
31
|
+
|
32
|
+
`Burble.send(title,text)`
|
33
|
+
|
34
|
+
It's that easy.
|
35
|
+
|
36
|
+
# Supported Frameworks
|
37
|
+
|
38
|
+
Kind of skimpy currently, but I'll work on it.
|
39
|
+
|
40
|
+
Linux: ![mumbles](http://www.mumbles-project.org/)
|
41
|
+
OSX: ![growl](http://growl.info/)
|
42
|
+
Windows: ![snarl](http://www.fullphat.net/)
|
43
|
+
|
44
|
+
Any and all suggestions are welcome.
|
data/lib/burble.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
$:.unshift(Pathname(__FILE__).dirname.expand_path)
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
|
6
|
+
class Burble
|
7
|
+
class << self
|
8
|
+
|
9
|
+
def send(title, text)
|
10
|
+
raise "No sender found!" unless SENDER
|
11
|
+
raise "Invalid sender!" unless SENDER.respond_to?("send")
|
12
|
+
|
13
|
+
SENDER.send(title, text)
|
14
|
+
end
|
15
|
+
|
16
|
+
##
|
17
|
+
#send? behaves just the same as send, except that it won't raise any
|
18
|
+
#errors. This should be used when burbling would be nice, but it's ok
|
19
|
+
#if the host machine doesn't have any systems installed that support it.
|
20
|
+
def send?(title, text)
|
21
|
+
begin
|
22
|
+
send(title, text)
|
23
|
+
rescue
|
24
|
+
#do nothing
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
case PLATFORM
|
32
|
+
when /linux/
|
33
|
+
if `which mumbles-send` != ""
|
34
|
+
require 'burble/mumbles-sender'
|
35
|
+
Burble::SENDER = Burble::Mumbles_Sender.new
|
36
|
+
end
|
37
|
+
when /darwin/
|
38
|
+
if `which growl` != ""
|
39
|
+
require 'burble/growl-sender'
|
40
|
+
Burble::SENDER = Burble::Growl_Sender.new
|
41
|
+
end
|
42
|
+
when /win32/
|
43
|
+
require 'win32/registry'
|
44
|
+
begin
|
45
|
+
Win32::Registry::HKEY_LOCAL_MACHINE.open('Software\Microsoft\Windows\CurrentVersion\App Paths\Snarl.exe')
|
46
|
+
require 'burble/snarl-sender'
|
47
|
+
Burble::SENDER = Burble::Snarl_Sender.new
|
48
|
+
rescue
|
49
|
+
#snarl is not installed - check for any other windows platforms
|
50
|
+
end
|
51
|
+
else
|
52
|
+
puts "Operating system is not linux, osx, or win32. Sure you want to use burble?"
|
53
|
+
end
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: duwanis-burble
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tommy Morgan
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-06-19 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: ruby-snarl
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: "0"
|
23
|
+
version:
|
24
|
+
- !ruby/object:Gem::Dependency
|
25
|
+
name: ruby-growl
|
26
|
+
version_requirement:
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: "0"
|
32
|
+
version:
|
33
|
+
description: Burble allows you to send notifications to whatever growl-like service is installed on the target machine.
|
34
|
+
email: tommy.morgan@gmail.com
|
35
|
+
executables: []
|
36
|
+
|
37
|
+
extensions: []
|
38
|
+
|
39
|
+
extra_rdoc_files: []
|
40
|
+
|
41
|
+
files:
|
42
|
+
- lib/burble.rb
|
43
|
+
- LICENSE
|
44
|
+
- README.markdown
|
45
|
+
- lib/burble/mumbles-sender.rb
|
46
|
+
- lib/burble/growl-sender.rb
|
47
|
+
- lib/burble/snarl-sender.rb
|
48
|
+
has_rdoc: true
|
49
|
+
homepage: http://github.com/duwanis/burble
|
50
|
+
post_install_message:
|
51
|
+
rdoc_options:
|
52
|
+
- --title
|
53
|
+
- Burble - tell the whole tulgey wood
|
54
|
+
- --main
|
55
|
+
- README.textile
|
56
|
+
- --line-numbers
|
57
|
+
- README.textile
|
58
|
+
- lib
|
59
|
+
require_paths:
|
60
|
+
- lib
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: "0"
|
66
|
+
version:
|
67
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: "0"
|
72
|
+
version:
|
73
|
+
requirements: []
|
74
|
+
|
75
|
+
rubyforge_project:
|
76
|
+
rubygems_version: 1.0.1
|
77
|
+
signing_key:
|
78
|
+
specification_version: 2
|
79
|
+
summary: A library to facilitate cross-platform growl-like notifications.
|
80
|
+
test_files: []
|
81
|
+
|