blastr 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/README.rdoc +63 -20
- data/Rakefile +3 -3
- data/lib/blastr.rb +19 -2
- data/lib/scm/git.rb +12 -5
- data/lib/scm/hg.rb +2 -0
- data/lib/scm/svn.rb +2 -2
- metadata +4 -14
data/History.txt
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== 0.0.12 2009-01-19
|
2
|
+
|
3
|
+
* Removed extra_dev_deps from newgem configuration (should fix the implicit
|
4
|
+
dependencies not being found during "sudo gem install").
|
5
|
+
* The software version and a copyright statement is now printed out when
|
6
|
+
starting Blastr.
|
7
|
+
|
1
8
|
== 0.0.11 2009-01-19
|
2
9
|
|
3
10
|
* Fix for the 0.0.10 release, which is broken thanks to my still being new
|
data/README.rdoc
CHANGED
@@ -1,13 +1,18 @@
|
|
1
|
-
=
|
1
|
+
= Blastr, the audible commit radiator
|
2
|
+
|
3
|
+
== DESCRIPTION:
|
2
4
|
|
3
5
|
Blastr observes a version control repository for commits and makes audible
|
4
|
-
announcements out of the commit messages. It currently supports Subversion
|
5
|
-
and
|
6
|
+
announcements out of the commit messages. It currently supports Subversion,
|
7
|
+
Git, and Mercurial on Linux and OS X, possibly on other UNIX-like operating
|
8
|
+
systems as well.
|
6
9
|
|
7
|
-
|
10
|
+
=== FEATURES:
|
8
11
|
|
9
|
-
Blastr
|
10
|
-
|
12
|
+
Blastr can observe a single "branch" (identified by a URL) by polling the
|
13
|
+
repository for a commit log. Any new commits will be announced. When
|
14
|
+
starting Blastr, it can be told to start observing from a given revision
|
15
|
+
or let it figure out the latest revision and start from that.
|
11
16
|
|
12
17
|
The supported version control systems include:
|
13
18
|
|
@@ -20,7 +25,7 @@ The supported operating systems (for running Blastr) include:
|
|
20
25
|
* Mac OS X
|
21
26
|
* Linux (requires the eSpeak[http://espeak.sourceforge.net/] or Festival[http://www.cstr.ed.ac.uk/projects/festival/] text-to-speech utility)
|
22
27
|
|
23
|
-
|
28
|
+
=== SYNOPSIS:
|
24
29
|
|
25
30
|
Subversion:
|
26
31
|
|
@@ -40,11 +45,11 @@ Mercurial:
|
|
40
45
|
|
41
46
|
blastr hg:http://hg.serpentine.com/tutorial/hello 2
|
42
47
|
|
43
|
-
|
48
|
+
=== REQUIREMENTS:
|
44
49
|
|
45
50
|
Blastr depends on the git[http://git.rubyforge.org/] gem (>= 1.0.5).
|
46
51
|
This dependency should be installed automatically when you install
|
47
|
-
Blastr
|
52
|
+
Blastr.
|
48
53
|
|
49
54
|
Blastr also depends on the standard command line client for the source
|
50
55
|
repository in question being in the user's PATH. For example, in order
|
@@ -52,27 +57,65 @@ to observe a Subversion repository the "svn" executable needs to be in
|
|
52
57
|
PATH. For Git, the "git" executable needs to be in PATH. For Mercurial,
|
53
58
|
"hg" needs to be in PATH.
|
54
59
|
|
55
|
-
|
60
|
+
Furthermore, Blastr needs a text-to-speech utility for making those
|
61
|
+
commit messages audible. On Mac OS X Blastr uses the built-in "say"
|
62
|
+
utility so Mac users don't need to worry about this. On Linux, Blastr
|
63
|
+
can utilize Festival[http://www.cstr.ed.ac.uk/projects/festival/] and
|
64
|
+
eSpeak[http://espeak.sourceforge.net/].
|
65
|
+
|
66
|
+
=== INSTALL:
|
67
|
+
|
68
|
+
First, install Blastr and its gem dependencies:
|
56
69
|
|
57
70
|
sudo gem install blastr
|
58
71
|
|
59
|
-
|
72
|
+
Then, download and install your chosen version control system's toolset
|
73
|
+
and make sure it's on your PATH when running Blastr.
|
74
|
+
|
75
|
+
Then, if applicable, download and install a text-to-speech utility for
|
76
|
+
your platform.
|
60
77
|
|
61
|
-
|
78
|
+
=== KNOWN PROBLEMS AND GOTCHAS:
|
79
|
+
|
80
|
+
* Blastr currently does a full clone operation on every poll for
|
81
|
+
source repositories that don't support a purely remote operation (like
|
82
|
+
"svn log [URL]"). This may take a while if your repository is big.
|
83
|
+
* Blastr doesn't treat non-ASCII characters in commit messages too well.
|
62
84
|
In other words, the developers make no promises whatsoever regarding
|
63
85
|
Blastr's behavior when encountering weird Norwegian scribble.
|
86
|
+
* Some folks might want to monitor multiple repositories or multiple
|
87
|
+
paths or branches within a repository at the same time. Currently,
|
88
|
+
this is technically possible by running to instances of Blastr in
|
89
|
+
parallel but every now and then those two instances will speak over
|
90
|
+
each other (i.e. all you can hear is cacophony).
|
64
91
|
|
65
|
-
|
92
|
+
=== LICENSE:
|
66
93
|
|
67
94
|
(The BSD License)
|
68
95
|
|
69
96
|
Copyright (c) 2009, Lasse Koskela
|
70
97
|
All rights reserved.
|
71
98
|
|
72
|
-
Redistribution and use in source and binary forms, with or without
|
73
|
-
|
74
|
-
|
75
|
-
* Redistributions
|
76
|
-
|
77
|
-
|
78
|
-
|
99
|
+
Redistribution and use in source and binary forms, with or without
|
100
|
+
modification, are permitted provided that the following conditions are met:
|
101
|
+
|
102
|
+
* Redistributions of source code must retain the above copyright notice,
|
103
|
+
this list of conditions and the following disclaimer.
|
104
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
105
|
+
this list of conditions and the following disclaimer in the documentation
|
106
|
+
and/or other materials provided with the distribution.
|
107
|
+
* Neither the name of this software nor the names of its contributors may
|
108
|
+
be used to endorse or promote products derived from this software without
|
109
|
+
specific prior written permission.
|
110
|
+
|
111
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
112
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
113
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
114
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
115
|
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
116
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
117
|
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
118
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
119
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
120
|
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
121
|
+
POSSIBILITY OF SUCH DAMAGE.
|
data/Rakefile
CHANGED
@@ -11,9 +11,9 @@ $hoe = Hoe.new('blastr', Blastr::VERSION) do |p|
|
|
11
11
|
p.extra_deps = [
|
12
12
|
['git','>= 1.0.5'],
|
13
13
|
]
|
14
|
-
p.extra_dev_deps = [
|
15
|
-
|
16
|
-
]
|
14
|
+
#p.extra_dev_deps = [
|
15
|
+
# ['newgem', ">= #{::Newgem::VERSION}"]
|
16
|
+
#]
|
17
17
|
p.clean_globs |= %w[**/.DS_Store tmp *.log]
|
18
18
|
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
|
19
19
|
#p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
|
data/lib/blastr.rb
CHANGED
@@ -6,8 +6,24 @@ module Blastr
|
|
6
6
|
require 'tts/tts.rb'
|
7
7
|
require 'people/people.rb'
|
8
8
|
|
9
|
-
VERSION = '0.0.
|
9
|
+
VERSION = '0.0.12'
|
10
|
+
COPYRIGHT = 'Copyright (c) 2009, Lasse Koskela. All Rights Reserved.'
|
11
|
+
puts "Blastr #{VERSION}\n#{COPYRIGHT}\n"
|
10
12
|
|
13
|
+
def self.trap_and_exit(signal)
|
14
|
+
trap(signal) {
|
15
|
+
puts ""
|
16
|
+
exit 0
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.delete_at_exit(file_or_directory)
|
21
|
+
at_exit do
|
22
|
+
puts "Cleaning up leftovers: #{temp_dir}" if File.directory?(temp_dir) if $DEBUG
|
23
|
+
FileUtils.remove_dir(temp_dir, :force => true)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
11
27
|
class UsageError < ArgumentError
|
12
28
|
|
13
29
|
USAGE_TEXT = <<EOS
|
@@ -39,13 +55,14 @@ EOS
|
|
39
55
|
|
40
56
|
class Process
|
41
57
|
def initialize(args)
|
58
|
+
Blastr::trap_and_exit("INT")
|
42
59
|
validate(args)
|
43
60
|
scm_url = args[0]
|
44
61
|
@scm = Blastr::SourceControl.implementation_for(scm_url)
|
45
62
|
@since_revision = @scm.as_revision(args[1]) if args.size > 1
|
46
63
|
@since_revision = @scm.latest_revision unless args.size > 1
|
47
64
|
end
|
48
|
-
|
65
|
+
|
49
66
|
def run
|
50
67
|
puts "Polling #{@scm.name} commits since revision #{@since_revision}..."
|
51
68
|
while true
|
data/lib/scm/git.rb
CHANGED
@@ -45,10 +45,12 @@ module Blastr::SourceControl
|
|
45
45
|
def as_revision(arg)
|
46
46
|
raise "Invalid revision: #{arg}" unless arg =~ /^(HEAD(~\d+)?)|([\d\w:-]+)$/
|
47
47
|
obj = nil
|
48
|
+
revision = nil
|
48
49
|
with_clone do |clone|
|
49
50
|
obj = clone.object(arg.to_s)
|
51
|
+
revision = GitRevision.new(obj.sha, obj.date)
|
50
52
|
end
|
51
|
-
|
53
|
+
revision
|
52
54
|
end
|
53
55
|
|
54
56
|
def latest_revision
|
@@ -69,11 +71,16 @@ module Blastr::SourceControl
|
|
69
71
|
|
70
72
|
private
|
71
73
|
def with_clone
|
72
|
-
|
73
|
-
|
74
|
-
|
74
|
+
temp_dir = Blastr::temp_dir
|
75
|
+
Blastr::delete_at_exit(temp_dir)
|
76
|
+
begin
|
77
|
+
clone = ::Git.clone(@git_url, temp_dir)
|
78
|
+
clone.chdir do
|
79
|
+
yield clone
|
80
|
+
end
|
81
|
+
ensure
|
82
|
+
FileUtils.rm_rf(temp_dir, :secure => true)
|
75
83
|
end
|
76
|
-
FileUtils.remove_dir(clone.dir, :force => true)
|
77
84
|
end
|
78
85
|
end
|
79
86
|
|
data/lib/scm/hg.rb
CHANGED
data/lib/scm/svn.rb
CHANGED
@@ -58,11 +58,11 @@ module Blastr::SourceControl
|
|
58
58
|
private
|
59
59
|
def svn_log(since_revision = as_revision("1"))
|
60
60
|
temp_file = Tempfile.new("svn.log").path
|
61
|
+
Blastr::delete_at_exit(temp_file)
|
61
62
|
begin
|
62
63
|
revision = "#{since_revision}:#{as_revision('HEAD')}"
|
63
64
|
revision = as_revision("HEAD") if since_revision.to_s == as_revision("HEAD").to_s
|
64
|
-
|
65
|
-
system(cmd)
|
65
|
+
%x[svn log #{@svn_url} -r #{revision} > #{temp_file}]
|
66
66
|
return content_of(temp_file)
|
67
67
|
ensure
|
68
68
|
FileUtils.remove_file(temp_file)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blastr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lasse Koskela
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-01-
|
12
|
+
date: 2009-01-19 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -22,16 +22,6 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 1.0.5
|
24
24
|
version:
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: newgem
|
27
|
-
type: :development
|
28
|
-
version_requirement:
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.2.3
|
34
|
-
version:
|
35
25
|
- !ruby/object:Gem::Dependency
|
36
26
|
name: hoe
|
37
27
|
type: :development
|
@@ -42,7 +32,7 @@ dependencies:
|
|
42
32
|
- !ruby/object:Gem::Version
|
43
33
|
version: 1.8.0
|
44
34
|
version:
|
45
|
-
description: Blastr observes a version control repository for commits and makes audible announcements out of the commit messages. It currently supports Subversion and
|
35
|
+
description: Blastr observes a version control repository for commits and makes audible announcements out of the commit messages. It currently supports Subversion, Git, and Mercurial on Linux and OS X, possibly on other UNIX-like operating systems as well.
|
46
36
|
email:
|
47
37
|
- lasse.koskela@gmail.com
|
48
38
|
executables:
|
@@ -82,7 +72,7 @@ files:
|
|
82
72
|
- test/test_tts.rb
|
83
73
|
- website/index.html
|
84
74
|
has_rdoc: true
|
85
|
-
homepage:
|
75
|
+
homepage:
|
86
76
|
post_install_message:
|
87
77
|
rdoc_options:
|
88
78
|
- --main
|