git-notifier 0.1 → 0.2.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.
- data/.gitignore +1 -0
- data/History.txt +2 -0
- data/README.rdoc +44 -0
- data/Rakefile +14 -0
- data/VERSION +1 -0
- data/bin/git-notifier +7 -4
- data/git-notifier.gemspec +44 -0
- metadata +18 -12
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pkg/
|
data/History.txt
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
== git-notifier
|
2
|
+
|
3
|
+
git-notifier is a gem for Mac Os that allows you to watch one or more git repositories and receive a growl notification when a change is committed
|
4
|
+
|
5
|
+
== Usage
|
6
|
+
|
7
|
+
Usage: git-notifier start|stop|add|clear|status
|
8
|
+
|
9
|
+
Start the notifier:
|
10
|
+
git-notifier start
|
11
|
+
|
12
|
+
Stop the notifier:
|
13
|
+
git-notifier stop
|
14
|
+
|
15
|
+
Add a repository to the watch list:
|
16
|
+
git-notifier add <repo_uri> <branch>
|
17
|
+
Example: git-notifier add git@github.com:marcocampana/git-notifier.git master
|
18
|
+
|
19
|
+
Remove all watched repositories from the watch list:
|
20
|
+
git-notifier clear
|
21
|
+
|
22
|
+
Show all the watched repositories:
|
23
|
+
git-notifier status
|
24
|
+
|
25
|
+
== Install
|
26
|
+
|
27
|
+
sudo gem install git-notifier --source http://gemcutter.org
|
28
|
+
|
29
|
+
== Warning
|
30
|
+
|
31
|
+
To appear
|
32
|
+
|
33
|
+
== Author
|
34
|
+
|
35
|
+
Marco Campana <m.campana@gmail.com>
|
36
|
+
website: http://xterm.it/
|
37
|
+
|
38
|
+
== LICENSE:
|
39
|
+
|
40
|
+
Released under the same license as Ruby. No Support. No Warranty.
|
41
|
+
|
42
|
+
== Copyright
|
43
|
+
|
44
|
+
Copyright (c) 2009 Marco Campana.
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
begin
|
2
|
+
require 'jeweler'
|
3
|
+
Jeweler::Tasks.new do |gemspec|
|
4
|
+
gemspec.name = "git-notifier"
|
5
|
+
gemspec.summary = "Watch one or more git repositories and receive a growl notification when a change is committed"
|
6
|
+
gemspec.description = "git-notifier is a gem for Mac Os that allows you to watch one or more git repositories and receive a growl notification when a change is committed"
|
7
|
+
gemspec.email = "m.campana@gmail.com"
|
8
|
+
gemspec.homepage = "http://github.com/marcocampana/git-notifier"
|
9
|
+
gemspec.authors = ["Marco Campana"]
|
10
|
+
end
|
11
|
+
Jeweler::GemcutterTasks.new
|
12
|
+
rescue LoadError
|
13
|
+
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
14
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.2.0
|
data/bin/git-notifier
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
|
2
3
|
# TODO
|
3
4
|
# 1) Error handling with notifications
|
4
5
|
# 4) check dependencies at startup
|
@@ -102,7 +103,8 @@ def demonize
|
|
102
103
|
Daemons.run_proc('git-notifier', :dir_mode => :normal, :dir => '/var/tmp/', :monitor => false) do
|
103
104
|
g = Growl.new "localhost", "ruby-growl", ["git-notifier"]
|
104
105
|
# g.notify "git-notifier", "GIT Notifier", "Start watching\nrepo: #{ARGV[0]}\nbranch: #{@@branch}"
|
105
|
-
|
106
|
+
# TODO this welcome message needs to be prettier
|
107
|
+
g.notify("git-notifier", "GIT Notifier", "Start notifier")
|
106
108
|
|
107
109
|
loop do
|
108
110
|
# TODO store available_repoes in a variable if adding while running doesn't work
|
@@ -119,15 +121,16 @@ def demonize
|
|
119
121
|
|
120
122
|
notification_lines = git_log_output.split( "\n" )
|
121
123
|
sha1 = notification_lines[0]
|
122
|
-
author = notification_lines[1]
|
124
|
+
author = notification_lines[1] #FIXME when merging the second line is 'Merge: fe3f3' and Author is the third line
|
123
125
|
date = notification_lines[2]
|
124
126
|
body = notification_lines[3 .. notification_lines.size - 1].to_s.gsub( /\t/, '')
|
125
127
|
# TODO truncate commit sha1 and author name stripping off email
|
126
128
|
|
127
|
-
|
129
|
+
# TODO put the name of the repo as title
|
130
|
+
g.notify("git-notifier", sha1 + date, author + "\n" + body, 0, true)
|
128
131
|
end
|
129
132
|
# TODO increase sleep time
|
130
|
-
sleep(
|
133
|
+
sleep(60)
|
131
134
|
end
|
132
135
|
end
|
133
136
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{git-notifier}
|
8
|
+
s.version = "0.2.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Marco Campana"]
|
12
|
+
s.date = %q{2009-10-18}
|
13
|
+
s.default_executable = %q{git-notifier}
|
14
|
+
s.description = %q{git-notifier is a gem for Mac Os that allows you to watch one or more git repositories and receive a growl notification when a change is committed}
|
15
|
+
s.email = %q{m.campana@gmail.com}
|
16
|
+
s.executables = ["git-notifier"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"README.rdoc"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".gitignore",
|
22
|
+
"History.txt",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"bin/git-notifier",
|
27
|
+
"git-notifier.gemspec"
|
28
|
+
]
|
29
|
+
s.homepage = %q{http://github.com/marcocampana/git-notifier}
|
30
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
31
|
+
s.require_paths = ["lib"]
|
32
|
+
s.rubygems_version = %q{1.3.3}
|
33
|
+
s.summary = %q{Watch one or more git repositories and receive a growl notification when a change is committed}
|
34
|
+
|
35
|
+
if s.respond_to? :specification_version then
|
36
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
37
|
+
s.specification_version = 3
|
38
|
+
|
39
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
40
|
+
else
|
41
|
+
end
|
42
|
+
else
|
43
|
+
end
|
44
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Campana
|
@@ -9,27 +9,33 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
13
|
-
default_executable:
|
12
|
+
date: 2009-10-18 00:00:00 +01:00
|
13
|
+
default_executable: git-notifier
|
14
14
|
dependencies: []
|
15
15
|
|
16
|
-
description:
|
16
|
+
description: git-notifier is a gem for Mac Os that allows you to watch one or more git repositories and receive a growl notification when a change is committed
|
17
17
|
email: m.campana@gmail.com
|
18
18
|
executables:
|
19
19
|
- git-notifier
|
20
20
|
extensions: []
|
21
21
|
|
22
|
-
extra_rdoc_files:
|
23
|
-
|
24
|
-
files:
|
25
|
-
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.rdoc
|
24
|
+
files:
|
25
|
+
- .gitignore
|
26
|
+
- History.txt
|
27
|
+
- README.rdoc
|
28
|
+
- Rakefile
|
29
|
+
- VERSION
|
30
|
+
- bin/git-notifier
|
31
|
+
- git-notifier.gemspec
|
26
32
|
has_rdoc: true
|
27
33
|
homepage: http://github.com/marcocampana/git-notifier
|
28
34
|
licenses: []
|
29
35
|
|
30
36
|
post_install_message:
|
31
|
-
rdoc_options:
|
32
|
-
|
37
|
+
rdoc_options:
|
38
|
+
- --charset=UTF-8
|
33
39
|
require_paths:
|
34
40
|
- lib
|
35
41
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -46,10 +52,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
46
52
|
version:
|
47
53
|
requirements: []
|
48
54
|
|
49
|
-
rubyforge_project:
|
55
|
+
rubyforge_project:
|
50
56
|
rubygems_version: 1.3.3
|
51
57
|
signing_key:
|
52
58
|
specification_version: 3
|
53
|
-
summary:
|
59
|
+
summary: Watch one or more git repositories and receive a growl notification when a change is committed
|
54
60
|
test_files: []
|
55
61
|
|