[rubygem-capillary/f19] Initial package import (rhbz #1016370)

Ken Dreyer ktdreyer at fedoraproject.org
Thu Oct 10 22:16:42 UTC 2013


commit a0a0c110d54350ff40c968c7fc53e5d74c2bafa2
Author: Ken Dreyer <ktdreyer at ktdreyer.com>
Date:   Thu Oct 10 16:13:40 2013 -0600

    Initial package import (rhbz #1016370)

 .gitignore                             |    1 +
 rubygem-capillary-no-minishoulda.patch |  678 ++++++++++++++++++++++++++++++++
 rubygem-capillary.spec                 |  127 ++++++
 sources                                |    1 +
 4 files changed, 807 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..fd9f9bf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/capillary-1.0.3.gem
diff --git a/rubygem-capillary-no-minishoulda.patch b/rubygem-capillary-no-minishoulda.patch
new file mode 100644
index 0000000..0bdbeb0
--- /dev/null
+++ b/rubygem-capillary-no-minishoulda.patch
@@ -0,0 +1,678 @@
+commit 6fdd45a34285514dc26f6ed269d0baf3c4ff6d50
+Author: Ken Dreyer <ktdreyer at ktdreyer.com>
+Date:   Mon Oct 7 16:32:06 2013 -0600
+
+    remove mini_shoulda
+    
+    This gem is deprecated upstream. Remove it, and replace it with plain
+    MiniTest::Spec functions.
+
+diff --git a/Gemfile.lock b/Gemfile.lock
+index 2751185..92025bf 100644
+--- a/Gemfile.lock
++++ b/Gemfile.lock
+@@ -8,8 +8,6 @@ GEM
+   remote: http://rubygems.org/
+   specs:
+     json (1.8.0)
+-    mini_shoulda (0.3.0)
+-      minitest (~> 2.1.0)
+     minitest (2.1.0)
+     rake (0.9.6)
+ 
+@@ -18,6 +16,5 @@ PLATFORMS
+ 
+ DEPENDENCIES
+   capillary!
+-  mini_shoulda (~> 0.3)
+   minitest (~> 2.0)
+   rake
+diff --git a/test/capillary/commit_test.rb b/test/capillary/commit_test.rb
+index 98d80d4..75302aa 100644
+--- a/test/capillary/commit_test.rb
++++ b/test/capillary/commit_test.rb
+@@ -20,41 +20,41 @@ require "test_helper"
+ require "capillary/commit"
+ 
+ class CommitTest < MiniTest::Spec
+-  context "Parsing a commit line" do
+-    setup do
++  describe "Parsing a commit line" do
++    before do
+       git_line = fixture("first_commit.txt")
+       @commit = Capillary::Commit.parse(git_line)
+     end
+ 
+-    should "extract the commit sha" do
++    it "extracts the commit sha" do
+       assert_equal "a7cf78bfff06d52b5b0aa021508b44c00cad067a", @commit.id
+     end
+ 
+-    should "extract parent(s)" do
++    it "extracts parent(s)" do
+       assert_equal(["db75ad82d678d51b29709d26af64d4a85b6f8071"], @commit.parent_ids)
+     end
+ 
+-    should "extract the commit time" do
++    it "extracts the commit time" do
+       assert_equal(Time.parse("2011-07-13 07:55:47 +0200"), @commit.committed_at)
+     end
+ 
+-    should "extract the committer email" do
++    it "extracts the committer email" do
+       assert_equal "chris at example.com", @commit.committer_email
+     end
+ 
+-    should "extract the commit message" do
++    it "extracts the commit message" do
+       assert_equal "And this is commit 10 Merge branch 'topic'", @commit.message
+     end
+ 
+-    should "include specified heads" do
++    it "includes specified heads" do
+       assert_equal(["master","refactor"], @commit.refs.heads)
+     end
+ 
+-    should "include specified tags" do
++    it "includes specified tags" do
+       assert_equal(["v2.0.0"], @commit.refs.tags)
+     end
+ 
+-    should "convert commit to JSON" do
++    it "converts commit to JSON" do
+       assert_equal JSON.parse(@commit.to_json), {
+         "id" => "a7cf78bfff06d52b5b0aa021508b44c00cad067a",
+         "parentIds" => ["db75ad82d678d51b29709d26af64d4a85b6f8071"],
+@@ -66,7 +66,7 @@ class CommitTest < MiniTest::Spec
+       }
+     end
+ 
+-    should "remove HTML tags from output" do
++    it "removes HTML tags from output" do
+       @commit.message = '<script>hello</script>'
+       assert_equal "scripthello/script", @commit.message
+     end
+diff --git a/test/capillary/log_parser_test.rb b/test/capillary/log_parser_test.rb
+index 4f78b1a..eb41779 100644
+--- a/test/capillary/log_parser_test.rb
++++ b/test/capillary/log_parser_test.rb
+@@ -46,8 +46,8 @@ class LogParserTest < MiniTest::Spec
+ 
+   # * a7cf78bfff06d52b5b0aa021508b44c00cad067a
+   # * db75ad82d678d51b29709d26af64d4a85b6f8071
+-  context "A linear graph" do
+-    setup do
++  describe "A linear graph" do
++    before do
+       first_line = Capillary::Commit.parse(fixture("first_commit.txt"))
+       second_line = Capillary::Commit.parse(fixture("parent_commit.txt"))
+       @log_parser = Capillary::LogParser.new
+@@ -55,22 +55,22 @@ class LogParserTest < MiniTest::Spec
+       @log_parser << second_line
+     end
+ 
+-    should "have one branch" do
++    it "has one branch" do
+       assert_equal 1, @log_parser.branches.size
+     end
+ 
+-    should "index the commits correctly" do
++    it "indexes the commits correctly" do
+       branch = @log_parser.branches.first
+       ids = branch.map { |commit| commit.seq_id }
+       assert_equal([0, 1], ids)
+     end
+ 
+-    should "collect the shas in correct order" do
++    it "collects the shas in correct order" do
+       shas = @log_parser.branches.first.map { |commit| commit.id }
+       assert_equal(["a7cf78bfff06d52b5b0aa021508b44c00cad067a","db75ad82d678d51b29709d26af64d4a85b6f8071"], shas)
+     end
+ 
+-    should "render JSON" do
++    it "renders JSON" do
+       result = JSON.parse(@log_parser.to_json)
+       assert_equal(1, result.size)
+       commits = result.first
+@@ -83,8 +83,8 @@ class LogParserTest < MiniTest::Spec
+   # | *
+   # * |
+   # | |
+-  context "Two merged branches" do
+-    setup do
++  describe "Two merged branches" do
++    before do
+       fixtures = fixture("two_merged_branches.txt").split("\n")
+       @lines = [Capillary::Commit.parse(fixtures[0]),
+                 Capillary::Commit.parse(fixtures[1]),
+@@ -96,21 +96,21 @@ class LogParserTest < MiniTest::Spec
+       @log_parser << @lines[2]
+     end
+ 
+-    should "have two branches" do
++    it "has two branches" do
+       assert_equal 2, @log_parser.branches.size
+     end
+ 
+-    should "have two commits in the first branch" do
++    it "has two commits in the first branch" do
+       first_branch = @log_parser.branches.first
+       assert_equal 2, first_branch.size
+     end
+ 
+-    should "have two commits in the second branch" do
++    it "has two commits in the second branch" do
+       last_branch = @log_parser.branches.last
+       assert_equal 2, last_branch.size
+     end
+ 
+-    should "put the right commits in the right branch" do
++    it "puts the right commits in the right branch" do
+       branches = @log_parser.branches
+ 
+       assert_equal @lines[0].id, branches[0][0].id
+@@ -120,7 +120,7 @@ class LogParserTest < MiniTest::Spec
+       assert_equal @lines[1].id, branches[1][1].id
+     end
+ 
+-    should "render JSON" do
++    it "renders JSON" do
+       result = JSON.parse(@log_parser.to_json)
+       assert_equal(2, result.size)
+       assert_equal(2, result.first.size)
+@@ -134,8 +134,8 @@ class LogParserTest < MiniTest::Spec
+   # | 0
+   # |/
+   # 0
+-  context "sequence ids" do
+-    should "use same sequence id for merge commit in all affected branches" do
++  describe "sequence ids" do
++    it "uses same sequence id for merge commit in all affected branches" do
+       fixtures = fixture("simple_graph_no_ff.txt").split("\n")
+       log = Capillary::LogParser.new
+       fixtures.reject { |f| f.strip == "" }.each { |f| log << f }
+@@ -173,36 +173,36 @@ class LogParserTest < MiniTest::Spec
+   # | | |/
+   # | | 0
+   # | | |
+-  context "Complex graph merged with --no-ff" do
+-    setup do
++  describe "Complex graph merged with --no-ff" do
++    before do
+       load_fixture("complex_graph_no_ff.txt")
+     end
+ 
+-    should "have four branches" do
++    it "has four branches" do
+       assert_equal 4, @log_parser.branches.size
+     end
+ 
+-    should "have one commit in the first branch" do
++    it "has one commit in the first branch" do
+       branch = @log_parser.branches.first
+       assert_equal 1, branch.size
+     end
+ 
+-    should "have five commits in the second branch" do
++    it "has five commits in the second branch" do
+       branch = @log_parser.branches[1]
+       assert_equal 5, branch.size
+     end
+ 
+-    should "have four commits in the third branch" do
++    it "has four commits in the third branch" do
+       branch = @log_parser.branches[2]
+       assert_equal 4, branch.size
+     end
+ 
+-    should "have four commits in the fourth branch" do
++    it "has four commits in the fourth branch" do
+       branch = @log_parser.branches[3]
+       assert_equal 4, branch.size
+     end
+ 
+-    should "put the right commits in the right branch" do
++    it "puts the right commits in the right branch" do
+       branches = @log_parser.branches
+ 
+       assert_equal @lines[0].id, branches[0][0].id
+@@ -211,7 +211,7 @@ class LogParserTest < MiniTest::Spec
+       assert_equal @lines[3].id, branches[3][0].id
+     end
+ 
+-    should "render JSON" do
++    it "renders JSON" do
+       result = JSON.parse(@log_parser.to_json)
+ 
+       assert_equal(4, result.size)
+@@ -244,32 +244,32 @@ class LogParserTest < MiniTest::Spec
+   # |/
+   # 0
+   # |
+-  context "Complex graph merged with --no-ff" do
+-    setup do
++  describe "Complex graph merged with --no-ff" do
++    before do
+       load_fixture("complex_graph.txt")
+     end
+ 
+-    should "have three branches" do
++    it "has three branches" do
+       assert_equal 3, @log_parser.branches.size
+     end
+ 
+-    should "have five commits in the first branch" do
++    it "has five commits in the first branch" do
+       assert_equal 5, @log_parser.branches.first.size
+     end
+ 
+-    should "have seven commits in the second branch" do
++    it "has seven commits in the second branch" do
+       assert_equal 7, @log_parser.branches[1].size
+     end
+ 
+-    should "have three commits in the third branch" do
++    it "has three commits in the third branch" do
+       assert_equal 4, @log_parser.branches[2].size
+     end
+ 
+-    should "not create more seq_id's than there are commits" do
++    it "does not create more seq_id's than there are commits" do
+       assert_equal [0, 1, 2, 3, 10], @log_parser.branches.first.collect { |c| c.seq_id }
+     end
+ 
+-    should "not represent same commit under different seq_id's" do
++    it "does not represent same commit under different seq_id's" do
+       assert_equal [2, 4, 5, 6, 7, 9, 10], @log_parser.branches[1].collect { |c| c.seq_id }
+       assert_equal [5, 8, 9, 10], @log_parser.branches[2].collect { |c| c.seq_id }
+     end
+@@ -295,12 +295,12 @@ class LogParserTest < MiniTest::Spec
+   # | |
+   # | 0
+   # | |
+-  context "Parsing log --graph output" do
+-    setup do
++  describe "Parsing log --graph output" do
++    before do
+       load_fixture("log_graph.txt")
+     end
+ 
+-    should "have two branches" do
++    it "has two branches" do
+       assert_equal 2, @log_parser.branches.length
+     end
+   end
+@@ -345,30 +345,30 @@ class LogParserTest < MiniTest::Spec
+   # |
+   # 0
+   # |
+-  context "Two branches forked from same commit" do
+-    setup do
++  describe "Two branches forked from same commit" do
++    before do
+       load_fixture("double_fork.txt")
+     end
+ 
+-    should "have three branches" do
++    it "has three branches" do
+       assert_equal 3, branches.length
+     end
+ 
+-    should "have six commits in the first branch" do
++    it "has six commits in the first branch" do
+       commits = @log_parser.branches[0].collect { |c| c.id[0...7] }
+ 
+       assert_equal 6, commits.length
+       assert_equal %w[0f54800 5bdf304 2477a17 ea4d6ce fdc39f6 9002b5b], commits
+     end
+ 
+-    should "have eleven commits in the second branch" do
++    it "has eleven commits in the second branch" do
+       commits = @log_parser.branches[1].collect { |c| c.id[0...7] }
+ 
+       assert_equal 11, commits.length
+       assert_equal %w[2477a17 13c727b bd73540 6fb3997 9266f54 a5f9deb 1551dfe 16d2ac1 1e69972 fdc39f6 9002b5b], commits
+     end
+ 
+-    should "have nine commits in the third branch" do
++    it "has nine commits in the third branch" do
+       commits = @log_parser.branches[2].collect { |c| c.id[0...7] }
+ 
+       assert_equal 9, commits.length
+@@ -380,23 +380,23 @@ class LogParserTest < MiniTest::Spec
+   # |\
+   # | 0
+   # | |
+-  context "Two dangling branches" do
+-    setup do
++  describe "Two dangling branches" do
++    before do
+       parse_log <<-GIT
+ ca2d07e0172565c9e0f18d41e49b70d7d75fced6§3370cb3615b3368be97c0f39b86f5dc2f9fa3650 c4e7446e2a98f1bf28da51fc57bb42b532222942§Tue May 10 12:47:08 2011 +0200§christian at gitorious.org§§Merge branch 'merge-requests/2230'§
+ c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60f8§Tue May 10 12:41:19 2011 +0200§christian at gitorious.org§§Merge commit 'refs/merge-requests/2230' of gitorious.org:gitorious/mainline into merge-requests/2230§
+       GIT
+     end
+ 
+-    should "have two branches" do
++    it "has two branches" do
+       assert_equal 2, branches.length
+     end
+ 
+-    should "have one commit in first branch" do
++    it "has one commit in first branch" do
+       assert_equal %w[ca2d07e], commits_for_branch(0)
+     end
+ 
+-    should "have two commits in second branch" do
++    it "has two commits in second branch" do
+       assert_equal %w[ca2d07e c4e7446], commits_for_branch(1)
+     end
+   end
+@@ -407,8 +407,8 @@ c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60
+   # |\
+   # | 0
+   # | |
+-  context "Two dangling branches with leading commit" do
+-    setup do
++  describe "Two dangling branches with leading commit" do
++    before do
+       parse_log <<-GIT
+ 1f2b8a4e3f61ffedf9908e28b280de8c6bf38a16§ca2d07e0172565c9e0f18d41e49b70d7d75fced6§Tue May 10 13:04:10 2011 +0200§christian at gitorious.org§§Some commit§
+ ca2d07e0172565c9e0f18d41e49b70d7d75fced6§3370cb3615b3368be97c0f39b86f5dc2f9fa3650 c4e7446e2a98f1bf28da51fc57bb42b532222942§Tue May 10 12:47:08 2011 +0200§christian at gitorious.org§§Merge branch 'merge-requests/2230'§
+@@ -416,15 +416,15 @@ c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60
+       GIT
+     end
+ 
+-    should "have two branches" do
++    it "has two branches" do
+       assert_equal 2, branches.length
+     end
+ 
+-    should "have two commits in first branch" do
++    it "has two commits in first branch" do
+       assert_equal %w[1f2b8a4 ca2d07e], commits_for_branch(0)
+     end
+ 
+-    should "have two commits in second branch" do
++    it "has two commits in second branch" do
+       assert_equal %w[ca2d07e c4e7446], commits_for_branch(1)
+     end
+   end
+@@ -435,8 +435,8 @@ c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60
+   # | |\
+   # | | 0
+   # | | |
+-  context "Three dangling branches" do
+-    setup do
++  describe "Three dangling branches" do
++    before do
+       parse_log <<-GIT
+ 1f2b8a4e3f61ffedf9908e28b280de8c6bf38a16§ca2d07e0172565c9e0f18d41e49b70d7d75fced6 275932ab0995a11fcebeb0af7f19a7b8df5dea3f§Tue May 10 13:04:10 2011 +0200§christian at gitorious.org§§Some commit§
+ ca2d07e0172565c9e0f18d41e49b70d7d75fced6§3370cb3615b3368be97c0f39b86f5dc2f9fa3650 c4e7446e2a98f1bf28da51fc57bb42b532222942§Tue May 10 12:47:08 2011 +0200§christian at gitorious.org§§Merge branch 'merge-requests/2230'§
+@@ -444,19 +444,19 @@ c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60
+       GIT
+     end
+ 
+-    should "have three branches" do
++    it "has three branches" do
+       assert_equal 3, branches.length
+     end
+ 
+-    should "have two commits in first branch" do
++    it "has two commits in first branch" do
+       assert_equal %w[1f2b8a4 ca2d07e], commits_for_branch(0)
+     end
+ 
+-    should "have one commit in second branch" do
++    it "has one commit in second branch" do
+       assert_equal %w[1f2b8a4], commits_for_branch(1)
+     end
+ 
+-    should "have two commits in third branch" do
++    it "has two commits in third branch" do
+       assert_equal %w[ca2d07e c4e7446], commits_for_branch(2)
+     end
+   end
+@@ -472,8 +472,8 @@ c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60
+   # |\  |
+   # | 0 |
+   # | | |
+-  context "Three dangling branches with closed branch" do
+-    setup do
++  describe "Three dangling branches with closed branch" do
++    before do
+       parse_log <<-GIT
+ 0000000000000000000000000000000000000000§1111111111111111111111111111111111111111 3333333333333333333333333333333333333333§Tue May 10 13:00:00 2011 +0200§christian at gitorious.org§§Message§
+ 1111111111111111111111111111111111111111§4444444444444444444444444444444444444444 2222222222222222222222222222222222222222§Tue May 10 12:00:00 2011 +0200§christian at gitorious.org§§Message§
+@@ -484,23 +484,23 @@ c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60
+       GIT
+     end
+ 
+-    should "have four branches" do
++    it "has four branches" do
+       assert_equal 4, branches.length
+     end
+ 
+-    should "have three commits in first branch" do
++    it "has three commits in first branch" do
+       assert_equal %w[0000000 1111111 4444444], commits_for_branch(0)
+     end
+ 
+-    should "two commits in second branch" do
++    it "has two commits in second branch" do
+       assert_equal %w[0000000 3333333], commits_for_branch(1)
+     end
+ 
+-    should "have three commits in third branch" do
++    it "has three commits in third branch" do
+       assert_equal %w[1111111 2222222 4444444], commits_for_branch(2)
+     end
+ 
+-    should "have two commits in fourth branch" do
++    it "has two commits in fourth branch" do
+       assert_equal %w[4444444 5555555], commits_for_branch(3)
+     end
+   end
+@@ -509,27 +509,27 @@ c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60
+   # |\
+   # | 0
+   # | |\
+-  context "two commits with two parents" do
+-    setup do
++  describe "two commits with two parents" do
++    before do
+       parse_log <<-GIT
+ ca2d07e0172565c9e0f18d41e49b70d7d75fced6§3370cb3615b3368be97c0f39b86f5dc2f9fa3650 c4e7446e2a98f1bf28da51fc57bb42b532222942§Tue May 10 12:47:08 2011 +0200§christian at gitorious.org§§Merge branch 'merge-requests/2230'§
+ c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60f8 c1e52fba9e7c88f1146bb6df1f8b58dff006f45e§Tue May 10 12:41:19 2011 +0200§christian at gitorious.org§§Merge commit 'refs/merge-requests/2230' of gitorious.org:gitorious/mainline into merge-requests/2230§
+       GIT
+     end
+ 
+-    should "have three branches" do
++    it "has three branches" do
+       assert_equal 3, branches.length
+     end
+ 
+-    should "have one commit in the first branch" do
++    it "has one commit in the first branch" do
+       assert_equal %w[ca2d07e], commits_for_branch(0)
+     end
+ 
+-    should "have two commits in the second branch" do
++    it "has two commits in the second branch" do
+       assert_equal %w[ca2d07e c4e7446], commits_for_branch(1)
+     end
+ 
+-    should "have three commits in the third branch" do
++    it "has three commits in the third branch" do
+       assert_equal %w[c4e7446], commits_for_branch(2)
+     end
+   end
+@@ -544,8 +544,8 @@ c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60
+   # |      \        |       # |\  |
+   # |       c4e7446-|-      # | 0-|
+   # |       |       | \     # | | |\
+-  context "Three branches from four dangling branches" do
+-    setup do
++  describe "Three branches from four dangling branches" do
++    before do
+       parse_log <<-GIT
+ 1f2b8a4e3f61ffedf9908e28b280de8c6bf38a16§ca2d07e0172565c9e0f18d41e49b70d7d75fced6 a2f271b1aa55e52ba848779c62a6fa02cbc5ea0c§Tue May 10 13:04:10 2011 +0200§christian at gitorious.org§§Merge branch 'merge-requests/147'§
+ a2f271b1aa55e52ba848779c62a6fa02cbc5ea0c§ca2d07e0172565c9e0f18d41e49b70d7d75fced6 3ec0ec68ac9ae2db3f222dfe1842cd2c6812cf97§Tue May 10 12:50:35 2011 +0200§christian at gitorious.org§§Merge commit 'refs/merge-requests/147' of gitorious.org:gitorious/mainline into merge-requests/147§
+@@ -555,27 +555,27 @@ c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60
+       GIT
+     end
+ 
+-    should "have five branches" do
++    it "has five branches" do
+       assert_equal 5, branches.length
+     end
+ 
+-    should "have two commits in first branch" do
++    it "has two commits in first branch" do
+       assert_equal %w[1f2b8a4 ca2d07e], commits_for_branch(0)
+     end
+ 
+-    should "have three commits in second branch" do
++    it "has three commits in second branch" do
+       assert_equal %w[1f2b8a4 a2f271b ca2d07e], commits_for_branch(1)
+     end
+ 
+-    should "have two commits in third branch" do
++    it "has two commits in third branch" do
+       assert_equal %w[a2f271b 3ec0ec6], commits_for_branch(2)
+     end
+ 
+-    should "have two commits in fourth branch" do
++    it "has two commits in fourth branch" do
+       assert_equal %w[ca2d07e c4e7446], commits_for_branch(3)
+     end
+ 
+-    should "have one commit in fifth branch" do
++    it "has one commit in fifth branch" do
+       assert_equal %w[c4e7446], commits_for_branch(4)
+     end
+   end
+@@ -600,53 +600,53 @@ c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60
+   # |      \        |       |
+   # |       c4e7446-|-------|------
+   # |       |       |       |      \
+-  context "Four dangling branches" do
+-    setup do
++  describe "Four dangling branches" do
++    before do
+       load_fixture("4x_dangling_branches.txt")
+     end
+ 
+-    should "have seven branches" do
++    it "has seven branches" do
+       assert_equal 7, branches.length
+     end
+ 
+-    should "have 3 commits in the first branch" do
++    it "has 3 commits in the first branch" do
+       assert_equal %w[44c5c1d 1f2b8a4 ca2d07e], commits_for_branch(0)
+     end
+ 
+-    should "have 3 commits in the second branch" do
++    it "has 3 commits in the second branch" do
+       assert_equal %w[44c5c1d e81d019 1f2b8a4 ca2d07e], commits_for_branch(1)
+     end
+ 
+-    should "have 2 commits in the third branch" do
++    it "has 2 commits in the third branch" do
+       assert_equal %w[e81d019 bbbd502], commits_for_branch(2)
+     end
+ 
+-    should "have 5 commits in the fourth branch" do
++    it "has 5 commits in the fourth branch" do
+       assert_equal %w[1f2b8a4 275932a 7487183 a2f271b ca2d07e], commits_for_branch(3)
+     end
+ 
+-    should "have 2 commits in the fifth branch" do
++    it "has 2 commits in the fifth branch" do
+       assert_equal %w[a2f271b 3ec0ec6], commits_for_branch(4)
+     end
+ 
+-    should "have 2 commits in the sixth branch" do
++    it "has 2 commits in the sixth branch" do
+       assert_equal %w[ca2d07e c4e7446], commits_for_branch(5)
+     end
+   end
+ 
+-  context "Streaming parser" do
+-    setup do
++  describe "Streaming parser" do
++    before do
+       @lines = fixture("complex_graph_no_ff.txt").split("\n")
+       @log = Capillary::LogParser.new
+     end
+ 
+-    should "add parsed line" do
++    it "adds parsed line" do
+       @log << Capillary::Commit.parse(@lines[0])
+ 
+       assert_equal 2, @log.branches.length
+     end
+ 
+-    should "add raw line" do
++    it "adds raw line" do
+       @log << @lines[0]
+ 
+       assert_equal 2, @log.branches.length
+diff --git a/test/capillary/ref_collection_test.rb b/test/capillary/ref_collection_test.rb
+index 886f72c..82ac91f 100644
+--- a/test/capillary/ref_collection_test.rb
++++ b/test/capillary/ref_collection_test.rb
+@@ -20,8 +20,8 @@ require "test_helper"
+ require "capillary/ref_collection"
+ 
+ class RefCollectionTest < MiniTest::Spec
+-  context "Parsing refs" do
+-    should "ignore HEAD" do
++  describe "Parsing refs" do
++    it "ignores HEAD" do
+       refs = Capillary::RefCollection.parse("HEAD")
+ 
+       refute refs.to_hash.key?(nil)
+@@ -29,25 +29,25 @@ class RefCollectionTest < MiniTest::Spec
+       assert_equal [], refs.tags
+     end
+ 
+-    should "find heads" do
++    it "finds heads" do
+       refs = Capillary::RefCollection.parse("(HEAD, refs/heads/master)")
+ 
+       assert_equal ["master"], refs.heads
+     end
+ 
+-    should "find tags" do
++    it "finds tags" do
+       refs = Capillary::RefCollection.parse("(HEAD, refs/heads/master, refs/tags/v2.0.0)")
+ 
+       assert_equal ["v2.0.0"], refs.tags
+     end
+ 
+-    should "find remotes" do
++    it "finds remotes" do
+       refs = Capillary::RefCollection.parse("(HEAD, refs/heads/master, refs/tags/v2.0.0, refs/remotes/origin/branch)")
+ 
+       assert_equal({ "origin" => ["branch"] }, refs.remotes)
+     end
+ 
+-    should "find merge requests" do
++    it "finds merge requests" do
+       refs = Capillary::RefCollection.parse("(HEAD, refs/merge-requests/1304)")
+ 
+       assert_equal ["1304"], refs.merge_requests
+diff --git a/test/test_helper.rb b/test/test_helper.rb
+index 5fc9f7d..19b69d0 100644
+--- a/test/test_helper.rb
++++ b/test/test_helper.rb
+@@ -1,7 +1,6 @@
+ require "rubygems"
+ require "bundler/setup"
+ require "minitest/autorun"
+-require "mini_shoulda"
+ 
+ module Fixtures
+   def fixture(filename)
diff --git a/rubygem-capillary.spec b/rubygem-capillary.spec
new file mode 100644
index 0000000..507a5b1
--- /dev/null
+++ b/rubygem-capillary.spec
@@ -0,0 +1,127 @@
+%global gem_name capillary
+
+Name: rubygem-%{gem_name}
+Version: 1.0.3
+Release: 3%{?dist}
+Summary: Generate a JSON payload from Git log output
+Group: Development/Languages
+License: AGPLv3+
+URL: http://gitorious.org/capillary
+Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
+# Remove dependency on mini_shoulda gem.
+# Submitted upstream at:
+# https://gitorious.org/capillary/capillary_rb/merge_requests/8
+Patch0: rubygem-capillary-no-minishoulda.patch
+Requires: ruby(release)
+Requires: ruby(rubygems)
+Requires: rubygem(json)
+BuildRequires: ruby(release)
+BuildRequires: rubygems-devel
+BuildRequires: rubygem(minitest)
+BuildArch: noarch
+Provides: rubygem(%{gem_name}) = %{version}
+
+# The ruby(release) package already provides a usable Ruby interpreter.
+# Filter the extra /usr/bin/ruby requirement here.
+%global __requires_exclude ^/usr/bin/ruby$
+
+%description
+Capillary works in conjunction with capillary.js, which outputs a beautiful
+graphical representation of your repository history.
+
+%package doc
+Summary: Documentation for %{name}
+Group: Documentation
+Requires: %{name} = %{version}-%{release}
+BuildArch: noarch
+
+%description doc
+Documentation for %{name}
+
+%prep
+gem unpack %{SOURCE0}
+
+%setup -q -D -T -n  %{gem_name}-%{version}
+
+gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
+
+# Fix shebang
+sed -i -e 's|#!/usr/bin/env ruby|#!/usr/bin/ruby|' bin/%{gem_name}
+
+# Remove dependency on mini_shoulda gem
+%patch0 -p 1
+# We're dynamically assembling the gemspec file, so we have to remove
+# mini_shoulda with sed, instead of a patch.
+sed -e '\|mini_shoulda|d' -i %{gem_name}.gemspec
+
+# Remove dependency on bundler
+sed -e '\|require "bundler/setup"|d' -i test/test_helper.rb
+
+%build
+# Create the gem as gem install only works on a gem file
+gem build %{gem_name}.gemspec
+
+%gem_install
+
+# Remove unnecessary files
+pushd .%{gem_instdir}/
+  rm %{gem_name}.gemspec
+  rm Gemfile
+  rm Gemfile.lock
+  rm Rakefile
+popd
+
+%install
+mkdir -p %{buildroot}%{gem_dir}
+cp -pa .%{gem_dir}/* \
+        %{buildroot}%{gem_dir}/
+
+mkdir -p %{buildroot}%{_bindir}
+cp -pa .%{_bindir}/* \
+        %{buildroot}%{_bindir}/
+
+find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
+
+%check
+pushd .%{gem_instdir}
+  testrb -Ilib:test test/capillary/*_test.rb
+popd
+
+%files
+%dir %{gem_instdir}
+%doc %{gem_instdir}/LICENSE
+%doc %{gem_instdir}/README
+%{_bindir}/capillary
+%{gem_instdir}/bin
+%{gem_libdir}
+%exclude %{gem_cache}
+%{gem_spec}
+
+%files doc
+%doc %{gem_docdir}
+%exclude %{gem_instdir}/test
+
+%changelog
+* Wed Oct 09 2013 Ken Dreyer <ktdreyer at ktdreyer.com> - 1.0.3-3
+- Adjust mini_shoulda gemspec removal regex to remove during %%prep
+
+* Tue Oct 08 2013 Ken Dreyer <ktdreyer at ktdreyer.com> - 1.0.3-2
+- Remove mini_shoulda from installed gemspec
+- Add "test" directory to load-path during %%check
+- Move README to main package
+- Do not ship Gemfile, Gemfile.lock, Rakefile, or tests
+- Remove /usr/bin/env and /usr/bin/ruby from auto-requirements
+
+* Mon Oct 07 2013 Ken Dreyer <ktdreyer at ktdreyer.com> - 1.0.3-1
+- Update to capillary 1.0.3
+- Drop License file, since upstream ships their own
+- Drop EL6 support
+
+* Sat Feb 16 2013 Ken Dreyer <ktdreyer at ktdreyer.com> - 1.0.2-1
+- Update to capillary 1.0.2
+- Remove upsteamed patch for reading test fixtures as utf-8
+- Update license to AGPLv3+
+- RHEL 6 compatibility
+
+* Thu Aug 09 2012 Ken Dreyer <ktdreyer at ktdreyer.com> - 1.0.1-1
+- Initial package, created by gem2rpm 0.8.1
diff --git a/sources b/sources
index e69de29..868c1ae 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+b4c2b136b1a57bde19a80cc9b235595c  capillary-1.0.3.gem


More information about the scm-commits mailing list