motomike-bnr_tools 0.0.2
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/VERSION.yml +4 -0
- data/bin/taggit +29 -0
- data/lib/bnr_tools.rb +6 -0
- data/lib/bnr_tools/changeset.rb +60 -0
- data/lib/bnr_tools/digg_module.rb +103 -0
- data/lib/bnr_tools/mergeinator.rb +129 -0
- data/lib/bnr_tools/svn_commands.rb +264 -0
- data/lib/bnr_tools/svn_xml.rb +316 -0
- data/lib/bnr_tools/ticket.rb +52 -0
- data/lib/bnr_tools/trollop.rb +714 -0
- data/lib/bnr_tools/version_number.rb +138 -0
- data/lib/highline.rb +744 -0
- data/lib/highline/color_scheme.rb +120 -0
- data/lib/highline/import.rb +43 -0
- data/lib/highline/menu.rb +395 -0
- data/lib/highline/question.rb +462 -0
- data/lib/highline/system_extensions.rb +125 -0
- data/lib/open4.rb +393 -0
- data/test/bnr_tools_test.rb +47 -0
- data/test/test_helper.rb +85 -0
- metadata +75 -0
@@ -0,0 +1,47 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper'
|
2
|
+
require 'bnr_tools/ticket'
|
3
|
+
require 'bnr_tools/changeset'
|
4
|
+
|
5
|
+
class BnrToolsTest < Test::Unit::TestCase
|
6
|
+
context "A Ticket" do
|
7
|
+
setup do
|
8
|
+
@ticket_number = rand(100000)
|
9
|
+
@ticket = Ticket.new(@ticket_number)
|
10
|
+
end
|
11
|
+
|
12
|
+
should "return the reference number it was initialized with" do
|
13
|
+
assert_equal @ticket_number, @ticket.referenceNumber
|
14
|
+
end
|
15
|
+
|
16
|
+
should "by default, represent itself in a simple, trac-compatible format" do
|
17
|
+
assert_equal "##{@ticket_number}", @ticket.to_s
|
18
|
+
end
|
19
|
+
|
20
|
+
context "with a Changeset" do
|
21
|
+
setup do
|
22
|
+
@changeset_number = rand(10000)
|
23
|
+
@changeset = Changeset.new(@changeset_number)
|
24
|
+
@ticket.addChangeset(@changeset)
|
25
|
+
end
|
26
|
+
|
27
|
+
should "by default, represent itself in a simple, trac-compatible format" do
|
28
|
+
assert_equal "##{@ticket_number} (r#{@changeset_number})", @ticket.to_s
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context "A Pathological Changeset" do
|
34
|
+
setup do
|
35
|
+
@changeset_number = 27724 # I just happen to know that particular changeset is pathological - touches on build/trunk LOLz/trunk and LOLcat/trunk
|
36
|
+
@changeset = Changeset.new(@changeset_number)
|
37
|
+
end
|
38
|
+
|
39
|
+
should "return the changeset number it was initialized with" do
|
40
|
+
assert_equal @changeset_number, @changeset.revision
|
41
|
+
end
|
42
|
+
|
43
|
+
should "touch the App_PermaLink module" do
|
44
|
+
assert @changeset.affectedModules.include?("App_PermaLink")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'test/unit'
|
3
|
+
require 'shoulda'
|
4
|
+
require 'mocha'
|
5
|
+
|
6
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
7
|
+
require 'bnr_tools'
|
8
|
+
|
9
|
+
|
10
|
+
#class TestSvnCommands < Test::Unit::TestCase
|
11
|
+
# require 'svn_commands'
|
12
|
+
# def setup
|
13
|
+
# end
|
14
|
+
#
|
15
|
+
# def tearDown
|
16
|
+
# end
|
17
|
+
#
|
18
|
+
# def test_ls
|
19
|
+
# l = SvnCommands::Ls.new("build/trunk")
|
20
|
+
# assert( ! l.entries.empty? )
|
21
|
+
# l.entries.each { |entry|
|
22
|
+
# assert(entry.kind_of?(SvnXml::Entry))
|
23
|
+
# }
|
24
|
+
# end
|
25
|
+
#
|
26
|
+
# def test_log
|
27
|
+
# l = SvnCommands::Log.new("build/trunk","--stop-on-copy")
|
28
|
+
# assert( ! l.entries.empty? )
|
29
|
+
# l.entries.each { |entry|
|
30
|
+
# assert(entry.kind_of?(SvnXml::LogEntry))
|
31
|
+
# #puts entry.msg + "\n#{"-"*80}\n\n"
|
32
|
+
# }
|
33
|
+
# end
|
34
|
+
#end
|
35
|
+
#
|
36
|
+
#class TestSvnXmlInfo < Test::Unit::TestCase
|
37
|
+
# require 'svn_xml'
|
38
|
+
# attr_accessor :repo_path
|
39
|
+
# def setup
|
40
|
+
# @repo_path = "svn+ssh://svn.digg.internal/repository"
|
41
|
+
# end
|
42
|
+
#
|
43
|
+
# def tearDown
|
44
|
+
# end
|
45
|
+
#
|
46
|
+
# def test_info
|
47
|
+
# out = `svn info --xml #{repo_path}/modcat/trunk`
|
48
|
+
# assert($? == 0)
|
49
|
+
# parsed = REXML::Document.new(out)
|
50
|
+
# info = SvnXml::Info.new(parsed.elements["info"])
|
51
|
+
# puts info
|
52
|
+
# assert( ! info.entries.empty?)
|
53
|
+
# info.entries.each { |entry|
|
54
|
+
# assert(entry.kind_of?(SvnXml::Entry))
|
55
|
+
# assert(["dir","file"].include?(entry.kind))
|
56
|
+
# assert(entry.repository.root.downcase == repo_path)
|
57
|
+
# }
|
58
|
+
# end
|
59
|
+
#
|
60
|
+
# def test_ls
|
61
|
+
# out = `svn ls --xml #{repo_path}/modcat/trunk`
|
62
|
+
# assert($? == 0)
|
63
|
+
# parsed = REXML::Document.new(out)
|
64
|
+
# lists = SvnXml::Lists.new(parsed.elements["lists"])
|
65
|
+
# assert( ! lists.empty?)
|
66
|
+
# lists.each { |list|
|
67
|
+
# assert(list.path === "svn+ssh://svn.digg.internal/repository/modcat/trunk")
|
68
|
+
# }
|
69
|
+
# lists.each_entry { |entry|
|
70
|
+
# assert(entry.kind_of?(SvnXml::Entry))
|
71
|
+
# assert(["dir","file"].include?(entry.kind))
|
72
|
+
# }
|
73
|
+
# end
|
74
|
+
#
|
75
|
+
# def test_log
|
76
|
+
# out = `svn log --xml --stop-on-copy #{repo_path}/modcat/branches/facebook`
|
77
|
+
# assert($? == 0)
|
78
|
+
# parsed = REXML::Document.new(out)
|
79
|
+
# log = SvnXml::Log.new(parsed.elements["log"])
|
80
|
+
# assert ( ! log.empty? )
|
81
|
+
# log.each { |logentry|
|
82
|
+
# assert(logentry.kind_of?(SvnXml::LogEntry))
|
83
|
+
# }
|
84
|
+
# end
|
85
|
+
#end
|
metadata
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: motomike-bnr_tools
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mike Ashmore
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-02-26 00:00:00 -08:00
|
13
|
+
default_executable: taggit
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Tools to help with tagging, for as long as we're stuck using SVN
|
17
|
+
email: mashmore@digg.com
|
18
|
+
executables:
|
19
|
+
- taggit
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- VERSION.yml
|
26
|
+
- bin/taggit
|
27
|
+
- lib/bnr_tools
|
28
|
+
- lib/bnr_tools/changeset.rb
|
29
|
+
- lib/bnr_tools/digg_module.rb
|
30
|
+
- lib/bnr_tools/mergeinator.rb
|
31
|
+
- lib/bnr_tools/svn_commands.rb
|
32
|
+
- lib/bnr_tools/svn_xml.rb
|
33
|
+
- lib/bnr_tools/ticket.rb
|
34
|
+
- lib/bnr_tools/trollop.rb
|
35
|
+
- lib/bnr_tools/version_number.rb
|
36
|
+
- lib/bnr_tools.rb
|
37
|
+
- lib/highline
|
38
|
+
- lib/highline/color_scheme.rb
|
39
|
+
- lib/highline/import.rb
|
40
|
+
- lib/highline/menu.rb
|
41
|
+
- lib/highline/question.rb
|
42
|
+
- lib/highline/system_extensions.rb
|
43
|
+
- lib/highline.rb
|
44
|
+
- lib/open4.rb
|
45
|
+
- test/bnr_tools_test.rb
|
46
|
+
- test/test_helper.rb
|
47
|
+
has_rdoc: true
|
48
|
+
homepage: http://github.com/motomike/bnr_tools
|
49
|
+
post_install_message:
|
50
|
+
rdoc_options:
|
51
|
+
- --inline-source
|
52
|
+
- --charset=UTF-8
|
53
|
+
require_paths:
|
54
|
+
- lib
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: "0"
|
60
|
+
version:
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: "0"
|
66
|
+
version:
|
67
|
+
requirements: []
|
68
|
+
|
69
|
+
rubyforge_project:
|
70
|
+
rubygems_version: 1.2.0
|
71
|
+
signing_key:
|
72
|
+
specification_version: 2
|
73
|
+
summary: Tools to help with tagging, for as long as we're stuck using SVN
|
74
|
+
test_files: []
|
75
|
+
|