hubeye 0.2.8 → 0.3.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/Rakefile +1 -0
- data/VERSION.rb +2 -2
- data/lib/hooks/executer.rb +7 -8
- data/lib/hooks/git_hooks.rb +1 -2
- data/lib/log/logger.rb +2 -1
- data/lib/notification/finder.rb +2 -17
- data/lib/notification/gnomenotify.rb +1 -0
- data/lib/notification/growl.rb +1 -0
- data/test/config_parser.rb +0 -1
- data/test/environment.rb +1 -2
- data/test/notification.rb +2 -2
- data/test/runner.rb +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
data/VERSION.rb
CHANGED
data/lib/hooks/executer.rb
CHANGED
|
@@ -10,17 +10,15 @@ module Hooks
|
|
|
10
10
|
dir = opts[:directory]
|
|
11
11
|
repo = opts[:repo]
|
|
12
12
|
begin
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
commands.each do |cmd|
|
|
14
|
+
if dir
|
|
15
|
+
Dir.chdir(File.expand_path(dir)) do
|
|
16
|
+
::Kernel.system cmd
|
|
17
|
+
end
|
|
18
|
+
else
|
|
17
19
|
::Kernel.system cmd
|
|
18
20
|
end
|
|
19
|
-
else
|
|
20
|
-
::Kernel.system cmd
|
|
21
21
|
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
22
|
rescue ArgumentError
|
|
25
23
|
raise NoHookError.new "There aren't any hook commands for the repository #{repo}"
|
|
26
24
|
end
|
|
@@ -28,3 +26,4 @@ module Hooks
|
|
|
28
26
|
|
|
29
27
|
end
|
|
30
28
|
end
|
|
29
|
+
|
data/lib/hooks/git_hooks.rb
CHANGED
data/lib/log/logger.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
module Log
|
|
2
2
|
class Logger
|
|
3
|
+
|
|
3
4
|
LOG_DIR = File.join(ENV['HOME'], '.hubeye', 'log')
|
|
4
5
|
|
|
5
6
|
def self.log(msg)
|
|
@@ -17,7 +18,6 @@ module Log
|
|
|
17
18
|
|
|
18
19
|
# If {include_terminal: true}, log to the terminal too (make sure that the
|
|
19
20
|
# process is not daemonized). Always log to the logfile.
|
|
20
|
-
|
|
21
21
|
def self.log_change(repo_name, commit_msg, committer, options={})
|
|
22
22
|
opts = {:include_terminal => false}.merge options
|
|
23
23
|
change_msg = <<-MSG
|
|
@@ -35,3 +35,4 @@ module Log
|
|
|
35
35
|
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
|
+
|
data/lib/notification/finder.rb
CHANGED
|
@@ -5,39 +5,26 @@ module Notification
|
|
|
5
5
|
CHANGE_ICON_PATH = (File.join(ROOTDIR, "images", CHANGE_ICON))
|
|
6
6
|
|
|
7
7
|
class Finder
|
|
8
|
-
|
|
9
8
|
def self.find_notify
|
|
10
9
|
if RUBY_PLATFORM =~ /mswin/
|
|
11
10
|
return
|
|
12
11
|
elsif RUBY_PLATFORM =~ /linux/
|
|
13
12
|
libnotify = system('locate libnotify-bin > /dev/null')
|
|
14
|
-
|
|
15
|
-
if libnotify && LibCheck.autotest
|
|
13
|
+
if libnotify
|
|
16
14
|
require_relative "gnomenotify"
|
|
17
15
|
return "libnotify"
|
|
18
16
|
elsif LibCheck.autotest_notification
|
|
19
17
|
require_relative "growl"
|
|
20
18
|
return "growl"
|
|
21
|
-
else
|
|
22
|
-
return
|
|
23
19
|
end
|
|
24
|
-
|
|
25
|
-
elsif RUBY_PLATFORM =~ /darwin/i
|
|
26
|
-
|
|
27
|
-
if LibCheck.autotest_notification
|
|
20
|
+
elsif RUBY_PLATFORM =~ /darwin/i and LibCheck.autotest_notification
|
|
28
21
|
require_relative "growl"
|
|
29
22
|
return "growl"
|
|
30
|
-
else
|
|
31
|
-
return
|
|
32
|
-
end
|
|
33
|
-
|
|
34
23
|
end
|
|
35
24
|
end
|
|
36
|
-
|
|
37
25
|
end
|
|
38
26
|
|
|
39
27
|
class LibCheck
|
|
40
|
-
|
|
41
28
|
class << self
|
|
42
29
|
def autotest
|
|
43
30
|
begin
|
|
@@ -54,7 +41,6 @@ module Notification
|
|
|
54
41
|
end
|
|
55
42
|
end
|
|
56
43
|
|
|
57
|
-
|
|
58
44
|
def autotest_notification
|
|
59
45
|
begin
|
|
60
46
|
require 'autotest_notification'
|
|
@@ -70,7 +56,6 @@ module Notification
|
|
|
70
56
|
end
|
|
71
57
|
end
|
|
72
58
|
end
|
|
73
|
-
|
|
74
59
|
end
|
|
75
60
|
|
|
76
61
|
end # end module
|
data/lib/notification/growl.rb
CHANGED
data/test/config_parser.rb
CHANGED
data/test/environment.rb
CHANGED
data/test/notification.rb
CHANGED
|
@@ -2,13 +2,13 @@ class NotifyTests < Test::Unit::TestCase
|
|
|
2
2
|
|
|
3
3
|
def test_libnotify_on_linux
|
|
4
4
|
if RUBY_PLATFORM =~ /linux/i
|
|
5
|
-
|
|
5
|
+
assert_equal "libnotify", Notification::Finder.find_notify
|
|
6
6
|
end
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
def test_growl_returns_on_darwin
|
|
10
10
|
if RUBY_PLATFORM =~ /darwin/i
|
|
11
|
-
|
|
11
|
+
assert_equal "growl", Notification::Finder.find_notify
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
data/test/runner.rb
CHANGED
|
@@ -8,7 +8,7 @@ require 'test/unit'
|
|
|
8
8
|
|
|
9
9
|
# test files
|
|
10
10
|
require_relative 'environment'
|
|
11
|
-
require File.join(File.expand_path(File.dirname(__FILE__) + '/..'), "lib/notification/
|
|
11
|
+
require File.join(File.expand_path(File.dirname(__FILE__) + '/..'), "lib/notification/finder")
|
|
12
12
|
require_relative "notification"
|
|
13
13
|
require Environment::LIBDIR + '/config/parser'
|
|
14
14
|
require_relative "config_parser"
|