subtrigger 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
@@ -71,7 +71,14 @@ module Subtrigger
71
71
  # <tt>group1/project3/trunk</tt> and <tt>project3</tt>.
72
72
  def changed_projects #:yields: full_path, project_path
73
73
  (@dirs_changed ||= look_at('dirs-changed')).split("\n").each do |dir|
74
- yield dir, $1 if dir =~ /([\w\-\.]+)\/(?:trunk|branches|tags)/
74
+ if dir =~ /([\w\-\.]+)\/(trunk|branches|tags)/
75
+ project_name = $1
76
+ top_level_dir = case dir
77
+ when /^(.*\/trunk)/: $1
78
+ when /^(.*\/(?:tags|branches)\/\w+)/: $1
79
+ end
80
+ yield top_level_dir, project_name
81
+ end
75
82
  end
76
83
  end
77
84
 
data/lib/subtrigger.rb CHANGED
@@ -50,9 +50,34 @@ $:.unshift File.dirname(__FILE__)
50
50
  # puts "#{repo.author} comitted bar!"
51
51
  # }.run(*ARGV)
52
52
  #
53
+ # === Command Line Usage
54
+ #
55
+ # There is a command-line tool available for running Subtrigger. It simply
56
+ # requires the Subtrigger library and calls +run+. Most of the time, you'll
57
+ # want to write your own script and <tt>require 'subtrigger'</tt> yourself.
58
+ #
59
+ # You can run <tt>subtrigger -v</tt> to see the currently installed version
60
+ # of Subtrigger.
61
+ #
62
+ # === Configuration
63
+ #
64
+ # Since subversion usually calls its hooks in an empty environment (even
65
+ # without a $PATH) you might need to make some settings manually:
66
+ #
67
+ # Subtrigger.svn = '/path/to/svn'
68
+ # Subtrigger.sendmail = '/path/to/sendmail'
69
+ # Subtrigger.svn_args = ''
70
+ #
71
+ # The <tt>svn_args</tt> setting is a string appended to every +svn+ command.
72
+ # This allows you to, for example, set a custom username and password. You
73
+ # might also want to apply the <tt>--non-interactive</tt> argument. For
74
+ # example:
75
+ #
76
+ # Subtrigger.svn_args = '--username my_name --password secret --non-interactive'
77
+ #
53
78
  # Make sure your gems are installed and the correct permissions are set. Note
54
- # that Subversion runs its hooks in an empty environment, with no PATH set,
55
- # and you will also see no output.
79
+ # that Subversion hooks generate no output, so run your hooks manually for
80
+ # testing purposes.
56
81
  module Subtrigger
57
82
  attr_accessor :svn, :sendmail, :svn_args
58
83
 
data/subtrigger.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{subtrigger}
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Arjan van der Gaag"]
@@ -35,9 +35,17 @@ class TestRepository < Test::Unit::TestCase
35
35
  end
36
36
 
37
37
  should 'yield changed directories' do
38
- @r.expects(:look_at).with('dirs-changed').returns("www.project1.com/trunk\nsub/www.project2.com/tags/v1")
38
+ lines = <<-EOS
39
+ www.project1.com/trunk
40
+ www.project2.com/trunk/inc
41
+ sub/www.project2.com/tags/v1
42
+ sub/www.project2.com/tags/v1/test
43
+ EOS
44
+ @r.expects(:look_at).with('dirs-changed').returns(lines)
39
45
  yieldings = [
40
46
  ['www.project1.com/trunk', 'www.project1.com'],
47
+ ['www.project2.com/trunk', 'www.project2.com'],
48
+ ['sub/www.project2.com/tags/v1', 'www.project2.com'],
41
49
  ['sub/www.project2.com/tags/v1', 'www.project2.com']
42
50
  ]
43
51
  i = 0
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 3
9
- version: 0.2.3
8
+ - 4
9
+ version: 0.2.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Arjan van der Gaag