rakegrowl 0.1.0

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.
Files changed (5) hide show
  1. data/LICENSE +23 -0
  2. data/README.md +30 -0
  3. data/lib/growl.rb +19 -0
  4. data/lib/rakegrowl.rb +7 -0
  5. metadata +68 -0
data/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ Copyright (c) 2010 Sergio Gil
2
+
3
+ Permission is hereby granted, free of charge, to any
4
+ person obtaining a copy of this software and associated
5
+ documentation files (the "Software"), to deal in the
6
+ Software without restriction, including without limitation
7
+ the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the
9
+ Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice
13
+ shall be included in all copies or substantial portions of
14
+ the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
17
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19
+ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
20
+ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # rakegrowl
2
+
3
+ Do you recognize this situation? You run a `rake` task (for example, `rake spec`), which you know it's going to take some time (e.g. 3 or 4 minutes). You say _"Great moment to check what's going on on Twitter"_. 10 minutes and 3 tabs with blog posts later, you realize you were actually waiting for a task to finish, a task which finished long before. Bye, bye, productivity!!
4
+
5
+ **rakegrowl** tells you when your rake tasks end via [Growl](http://growl.info/).
6
+
7
+ ## Installation
8
+
9
+ You need to have [Growl](http://growl.info/) and `growlnotify` installed to get the notifications. In any case, **rakegrowl** is harmless if there is no Growl.
10
+
11
+ To install **rakegrowl**, which is packaged as a gem, you need to run:
12
+
13
+ sudo gem sources -a http://gemcutter.org # [if you haven't done it already]
14
+ sudo gem install rakegrowl
15
+
16
+ ## Setup
17
+
18
+ Add this **at the end** of your `Rakefile`:
19
+
20
+ require "rakegrowl"
21
+
22
+ From now on, whenever you run a `rake` task, you'll get a notification when it finishes.
23
+
24
+ ## Rails
25
+
26
+ If you install your gem using Rails' gem mechanism, you won't need to require anything in your `Rakefile` to get notifications **for the tasks which load the enviroment** (which are the main ones anyway).
27
+
28
+ ## Copyright & Licensing
29
+
30
+ Copyright (c) 2009 Sergio Gil. MIT license, see LICENSE for details.
data/lib/growl.rb ADDED
@@ -0,0 +1,19 @@
1
+ module Growl
2
+
3
+ class << self
4
+
5
+ def growlnotify
6
+ `which growlnotify`.chomp
7
+ end
8
+
9
+ def exists?
10
+ !growlnotify.empty?
11
+ end
12
+
13
+ def notify(title, message)
14
+ Kernel.system("#{growlnotify} -t \"#{title}\" -m \"#{message}\"") if exists?
15
+ end
16
+
17
+ end
18
+
19
+ end
data/lib/rakegrowl.rb ADDED
@@ -0,0 +1,7 @@
1
+ if Growl.exists?
2
+ Rake::Task.tasks.each do |task|
3
+ task.enhance do
4
+ Growl.notify "Rake", "Task #{task.name} finished" if Rake.application.top_level_tasks.include?(task.name)
5
+ end
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rakegrowl
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - "Sergio Gil P\xC3\xA9rez de la Manga"
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-01-19 00:00:00 +01:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rspec
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ description:
26
+ email: sgilperez@gmail.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - README.md
33
+ files:
34
+ - LICENSE
35
+ - README.md
36
+ - lib/growl.rb
37
+ - lib/rakegrowl.rb
38
+ has_rdoc: true
39
+ homepage: http://github.com/porras/rakegrowl
40
+ licenses: []
41
+
42
+ post_install_message:
43
+ rdoc_options:
44
+ - --main
45
+ - README.md
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: "0"
53
+ version:
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: "0"
59
+ version:
60
+ requirements: []
61
+
62
+ rubyforge_project:
63
+ rubygems_version: 1.3.5
64
+ signing_key:
65
+ specification_version: 3
66
+ summary: Get Growled when your long running rake tasks finish
67
+ test_files: []
68
+