netguru-growlmessages 0.2
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/README +0 -0
- data/growlmessages.gemspec +16 -0
- data/lib/growlmessages/growlmessages.rb +20 -0
- metadata +57 -0
data/README
ADDED
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "growlmessages"
|
3
|
+
s.version = "0.2"
|
4
|
+
s.date = "2008-11-04"
|
5
|
+
s.summary = "Command 'growl' for executing growlnotify"
|
6
|
+
s.email = "bartosz.pietrzak@gmail.com"
|
7
|
+
s.homepage = "http://champagnesupernova.net/bartosz"
|
8
|
+
s.description = "GrowlMessages is a Ruby on Rails plugin that gives you the opportunity to send your debug output to Growl."
|
9
|
+
s.has_rdoc = true
|
10
|
+
s.authors = ["Bartosz Pietrzak"]
|
11
|
+
s.files = ["README",
|
12
|
+
"growlmessages.gemspec",
|
13
|
+
"lib/growlmessages/growlmessages.rb"]
|
14
|
+
s.rdoc_options = ["--main", "README"]
|
15
|
+
s.require_paths << 'lib'
|
16
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Kernel
|
2
|
+
# Displays a message using Growl notification system's
|
3
|
+
# "growlnotify" command. Options:
|
4
|
+
#
|
5
|
+
# * +sticky+ - if true, the message won't disappear until clicked
|
6
|
+
# * +wait+ - if true, rails app will wait until message disappears
|
7
|
+
def growl(msg="Message from rails!", *args)
|
8
|
+
return false unless RAILS_ENV == 'development'
|
9
|
+
options = args.extract_options!
|
10
|
+
flags = String.new
|
11
|
+
flags << " -w" if options[:wait]
|
12
|
+
flags << " -s" if options[:sticky]
|
13
|
+
system_command = system 'growlnotify -m "' + Time.now.to_formatted_s("%H:%M") + "\n" + msg + '" --image "'+File.dirname(__FILE__) +'/../rails.png" -n "rails" '+flags+''
|
14
|
+
begin
|
15
|
+
system system_command
|
16
|
+
rescue => error
|
17
|
+
system 'growlnotify -m "GrowlMessages error: ' + error + '" --image "'+File.dirname(__FILE__) +'/../rails.png" -n "rails"'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: netguru-growlmessages
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: "0.2"
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bartosz Pietrzak
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-11-04 00:00:00 -08:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: GrowlMessages is a Ruby on Rails plugin that gives you the opportunity to send your debug output to Growl.
|
17
|
+
email: bartosz.pietrzak@gmail.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- README
|
26
|
+
- growlmessages.gemspec
|
27
|
+
- lib/growlmessages/growlmessages.rb
|
28
|
+
has_rdoc: true
|
29
|
+
homepage: http://champagnesupernova.net/bartosz
|
30
|
+
post_install_message:
|
31
|
+
rdoc_options:
|
32
|
+
- --main
|
33
|
+
- README
|
34
|
+
require_paths:
|
35
|
+
- lib
|
36
|
+
- lib
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: "0"
|
42
|
+
version:
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: "0"
|
48
|
+
version:
|
49
|
+
requirements: []
|
50
|
+
|
51
|
+
rubyforge_project:
|
52
|
+
rubygems_version: 1.2.0
|
53
|
+
signing_key:
|
54
|
+
specification_version: 2
|
55
|
+
summary: Command 'growl' for executing growlnotify
|
56
|
+
test_files: []
|
57
|
+
|