blastr 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,7 +1,6 @@
1
1
  == 0.0.17 2009-02-21
2
2
 
3
3
  * Removed replacement of non-ascii characters in commit messages.
4
-
5
4
  == 0.0.16 2009-02-21
6
5
 
7
6
  * Added support for HTTP-based, SSH-based, Rsync-based, and file system-based Git URLs.
data/Manifest.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  History.txt
2
2
  Manifest.txt
3
3
  PostInstall.txt
4
- README.rdoc
4
+ README.txt
5
5
  Rakefile
6
6
  bin/blastr
7
7
  config/website.yml
@@ -1,7 +1,6 @@
1
1
  = Blastr, the audible commit radiator
2
2
 
3
- See the project website at Rubyforge[http://rubyforge.org/projects/blastr/]
4
- to file a bug report or submit a feature request.
3
+ * http://rubyforge.org/projects/blastr/
5
4
 
6
5
  == DESCRIPTION:
7
6
 
@@ -10,6 +9,9 @@ announcements out of the commit messages. It currently supports Subversion,
10
9
  Git, and Mercurial on Linux and OS X, possibly on other UNIX-like operating
11
10
  systems as well.
12
11
 
12
+ See the project website at Rubyforge[http://rubyforge.org/projects/blastr/]
13
+ to file a bug report or submit a feature request.
14
+
13
15
  === FEATURES:
14
16
 
15
17
  Blastr can observe a "branch" (identified by a URL) by polling the
@@ -122,3 +124,4 @@ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
122
124
  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
123
125
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
124
126
  POSSIBILITY OF SUCH DAMAGE.
127
+
data/Rakefile CHANGED
@@ -1,30 +1,19 @@
1
- %w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
1
+ require 'rubygems'
2
+ require 'hoe'
3
+ $:.unshift(File.dirname(__FILE__) + "/lib")
2
4
  require File.dirname(__FILE__) + '/lib/blastr'
3
5
 
4
- # Generate all the Rake tasks
5
- # Run 'rake -T' to see list of generated tasks (from gem root directory)
6
- $hoe = Hoe.new('blastr', Blastr::VERSION) do |p|
7
- p.developer('Lasse Koskela', 'lasse.koskela@gmail.com')
8
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
9
- #p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
10
- p.rubyforge_name = p.name
11
- p.extra_deps = [
6
+ Hoe.spec 'blastr' do
7
+ name = "blastr"
8
+ developer('Lasse Koskela', 'lasse.koskela@gmail.com')
9
+ description = "Blastr observes a version control repository for commits and makes audible announcements out of the commit messages."
10
+ summary = "Blastr is an audible commit radiator"
11
+ url = "http://github.com/lkoskela/blastr"
12
+ clean_globs = ['test/output/*.png', '**/.DS_Store', 'tmp', '*.log']
13
+ changes = paragraphs_of('History.txt', 0..1).join("\n\n")
14
+ remote_rdoc_dir = '' # Release to root
15
+ rsync_args = '-av --delete --ignore-errors'
16
+ extra_deps = [
12
17
  ['git','>= 1.0.5'],
13
18
  ]
14
- #p.extra_dev_deps = [
15
- # ['newgem', ">= #{::Newgem::VERSION}"]
16
- #]
17
- p.clean_globs |= %w[**/.DS_Store tmp *.log]
18
- path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
19
- #p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
20
- p.remote_rdoc_dir = '' # Release to root
21
- p.rsync_args = '-av --delete --ignore-errors'
22
- p.bin_files = 'announce-svn-commits'
23
- #puts "Methods on p:\n #{p.methods.sort.join(', ')}"
24
19
  end
25
-
26
- require 'newgem/tasks' # load /tasks/*.rake
27
- Dir['tasks/**/*.rake'].each { |t| load t }
28
-
29
- # TODO - want other tests/tasks run by default? Add them to the list
30
- # task :default => [:spec, :features]
data/lib/blastr.rb CHANGED
@@ -6,8 +6,8 @@ module Blastr
6
6
  require 'tts/tts.rb'
7
7
  require 'people/people.rb'
8
8
 
9
- VERSION = '0.0.17'
10
- COPYRIGHT = 'Copyright (c) 2009, Lasse Koskela. All Rights Reserved.'
9
+ VERSION = '0.0.18'
10
+ COPYRIGHT = "Copyright (c) 2009-#{Time.now.year}, Lasse Koskela. All Rights Reserved."
11
11
  puts "Blastr #{VERSION}\n#{COPYRIGHT}\n"
12
12
 
13
13
  def self.trap_and_exit(signal)
@@ -96,5 +96,4 @@ EOS
96
96
  temp_file.unlink
97
97
  temp_dir
98
98
  end
99
-
100
99
  end
data/lib/tts/tts.rb CHANGED
@@ -9,7 +9,7 @@ module Blastr
9
9
  end
10
10
 
11
11
  def binary
12
- %x[which #{@name}].strip
12
+ %x[#{locate_which_binary} #{@name}].strip
13
13
  end
14
14
 
15
15
  def available?
@@ -19,6 +19,14 @@ module Blastr
19
19
  def speak(msg)
20
20
  %x[#{binary} "#{msg}"]
21
21
  end
22
+
23
+ private
24
+ def locate_which_binary
25
+ @path_to_which_command ||= ['/bin/which', '/usr/bin/which'].find do |path|
26
+ File.exists? path
27
+ end
28
+ @path_to_which_command ||= 'which'
29
+ end
22
30
  end
23
31
 
24
32
  class Say < TTSImplementation
@@ -45,8 +53,31 @@ module Blastr
45
53
  end
46
54
 
47
55
  def TTS::speak(msg)
48
- resolve_tts_system.speak(msg.gsub(/"/u, '\"').gsub(/'/u, '\''))
56
+ msg.gsub!(/"/u, '\"')
57
+ msg.gsub!(/'/u, '\'')
58
+ resolve_tts_system.speak(normalize_for_speech(msg))
49
59
  end
50
60
 
61
+ private
62
+ def TTS::normalize_for_speech(msg)
63
+ msg = omit_url_scheme("git", msg)
64
+ msg = omit_url_scheme("http", msg)
65
+ msg = omit_url_scheme("https", msg)
66
+ msg.gsub!(/(.*?)([^\w\(\)])(.?)/, '\1 \2 \3').squeeze!(" ")
67
+ words = msg.split(/\s/).collect do |word|
68
+ camel_case_word = /[A-Z][a-z0-9_]+/
69
+ if word =~ camel_case_word
70
+ word = word.scan(camel_case_word)
71
+ end
72
+ word
73
+ end
74
+ words.flatten.join(' ')
75
+ end
76
+
77
+ def TTS::omit_url_scheme(scheme, msg)
78
+ return nil if msg.nil?
79
+ msg.gsub!(/\b#{scheme}:\/\/([^\s]+)/, '(path omitted)')
80
+ msg
81
+ end
51
82
  end
52
83
  end
@@ -1,7 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/test_helper.rb'
2
2
 
3
3
  class TestGitLogEntry < Test::Unit::TestCase
4
-
5
4
  COMMIT_HASH = "db4ace1c9ba6add9a2b08c153367e2b379f8fb4c"
6
5
  COMMIT_DATE = Time.now
7
6
  COMMIT_AUTHOR = "johndoe"
data/test/test_tts.rb CHANGED
@@ -1,9 +1,37 @@
1
- require File.dirname(__FILE__) + '/test_helper.rb'
2
-
3
- class TestTTSImplementation < Test::Unit::TestCase
4
-
5
- def test_availability_depends_on_binary_existing_in_PATH
6
- assert Blastr::TTS::TTSImplementation.new("nosuchbinaryexists").available? == false
7
- assert Blastr::TTS::TTSImplementation.new("echo").available? == true
8
- end
9
- end
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+ require 'mocha'
3
+
4
+ class TestTTSImplementation < Test::Unit::TestCase
5
+ def test_availability_depends_on_binary_existing_in_PATH
6
+ assert Blastr::TTS::TTSImplementation.new("nosuchbinaryexists").available? == false
7
+ assert Blastr::TTS::TTSImplementation.new("ruby").available? == true
8
+ end
9
+ end
10
+
11
+ class TestCamelCaseSpelling < Test::Unit::TestCase
12
+ def setup
13
+ @tts = mock()
14
+ Blastr::TTS.stubs(:resolve_tts_system).returns(@tts)
15
+ end
16
+
17
+ def test_spelling_out_camel_case_words
18
+ @tts.expects(:speak).with("this is Camel Case")
19
+ Blastr::TTS.speak("this is CamelCase")
20
+ end
21
+
22
+ def test_camel_case_words_ending_with_special_character
23
+ @tts.expects(:speak).with("is this Camel Case ?")
24
+ Blastr::TTS.speak("is this CamelCase?")
25
+ end
26
+
27
+ def test_git_urls_are_not_spoken_out
28
+ @tts.expects(:speak).with("Merge X from (path omitted) into Y")
29
+ Blastr::TTS.speak("Merge X from git://github.com/lassekoskela/blastr into Y")
30
+ end
31
+
32
+ def test_http_urls_are_not_spoken_out
33
+ @tts.expects(:speak).with("Merge X from (path omitted) into Y").times(2)
34
+ Blastr::TTS.speak("Merge X from http://repo.com/svn/path into Y")
35
+ Blastr::TTS.speak("Merge X from https://repo.com/svn/file.txt into Y")
36
+ end
37
+ end
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.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lasse Koskela
@@ -9,18 +9,28 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-21 00:00:00 +02:00
12
+ date: 2010-02-19 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: git
17
- type: :runtime
16
+ name: rubyforge
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 2.0.3
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: gemcutter
27
+ type: :development
18
28
  version_requirement:
19
29
  version_requirements: !ruby/object:Gem::Requirement
20
30
  requirements:
21
31
  - - ">="
22
32
  - !ruby/object:Gem::Version
23
- version: 1.0.5
33
+ version: 0.3.0
24
34
  version:
25
35
  - !ruby/object:Gem::Dependency
26
36
  name: hoe
@@ -30,9 +40,16 @@ dependencies:
30
40
  requirements:
31
41
  - - ">="
32
42
  - !ruby/object:Gem::Version
33
- version: 1.8.0
43
+ version: 2.5.0
34
44
  version:
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.
45
+ description: |-
46
+ Blastr observes a version control repository for commits and makes audible
47
+ announcements out of the commit messages. It currently supports Subversion,
48
+ Git, and Mercurial on Linux and OS X, possibly on other UNIX-like operating
49
+ systems as well.
50
+
51
+ See the project website at Rubyforge[http://rubyforge.org/projects/blastr/]
52
+ to file a bug report or submit a feature request.
36
53
  email:
37
54
  - lasse.koskela@gmail.com
38
55
  executables:
@@ -43,12 +60,12 @@ extra_rdoc_files:
43
60
  - History.txt
44
61
  - Manifest.txt
45
62
  - PostInstall.txt
46
- - README.rdoc
63
+ - README.txt
47
64
  files:
48
65
  - History.txt
49
66
  - Manifest.txt
50
67
  - PostInstall.txt
51
- - README.rdoc
68
+ - README.txt
52
69
  - Rakefile
53
70
  - bin/blastr
54
71
  - config/website.yml
@@ -75,11 +92,13 @@ files:
75
92
  - test/test_tts.rb
76
93
  - website/index.html
77
94
  has_rdoc: true
78
- homepage: See the project website at Rubyforge[http://rubyforge.org/projects/blastr/]
95
+ homepage: http://rubyforge.org/projects/blastr/
96
+ licenses: []
97
+
79
98
  post_install_message:
80
99
  rdoc_options:
81
100
  - --main
82
- - README.rdoc
101
+ - README.txt
83
102
  require_paths:
84
103
  - lib
85
104
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -97,9 +116,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
116
  requirements: []
98
117
 
99
118
  rubyforge_project: blastr
100
- rubygems_version: 1.2.0
119
+ rubygems_version: 1.3.5
101
120
  signing_key:
102
- specification_version: 2
121
+ specification_version: 3
103
122
  summary: Blastr observes a version control repository for commits and makes audible announcements out of the commit messages
104
123
  test_files:
105
124
  - test/test_blastr.rb