git-trac 0.0.20071102
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/README +24 -0
- data/Rakefile +109 -0
- data/bin/git-trac +12 -0
- data/lib/git/trac.rb +15 -0
- data/lib/git/trac/attachment.rb +103 -0
- data/lib/git/trac/repository.rb +229 -0
- data/lib/git/trac/runner.rb +303 -0
- data/lib/git/trac/ticket.rb +183 -0
- data/setup.rb +1585 -0
- data/test/execution_test.rb +40 -0
- data/test/execution_test.rb~ +40 -0
- metadata +64 -0
| @@ -0,0 +1,40 @@ | |
| 1 | 
            +
            require 'fileutils'
         | 
| 2 | 
            +
            require 'tempfile'
         | 
| 3 | 
            +
            require 'test/unit'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            $: << File.join(File.dirname(File.dirname(__FILE__)),'lib')
         | 
| 6 | 
            +
            require 'git/trac'
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            class ExecutionTest < Test::Unit::TestCase
         | 
| 9 | 
            +
             | 
| 10 | 
            +
              def create_empty_repository(directory = nil)
         | 
| 11 | 
            +
                if directory.nil?
         | 
| 12 | 
            +
                  file = Tempfile.new("git-trac-test")
         | 
| 13 | 
            +
                  directory = file.path
         | 
| 14 | 
            +
                  file.unlink
         | 
| 15 | 
            +
                end
         | 
| 16 | 
            +
                at_exit { FileUtils.rm_rf(directory) }
         | 
| 17 | 
            +
                FileUtils.mkdir_p(directory)
         | 
| 18 | 
            +
                Dir.chdir(directory) do
         | 
| 19 | 
            +
                  `git-init`
         | 
| 20 | 
            +
                end
         | 
| 21 | 
            +
                FileUtils.touch(File.join(directory,".gitignore"))
         | 
| 22 | 
            +
                repo = Git::Trac::Repository.new(directory)
         | 
| 23 | 
            +
                repo.exec("git-add",".gitignore")
         | 
| 24 | 
            +
                repo.exec("git-commit","-m","Initial revision")
         | 
| 25 | 
            +
                repo
         | 
| 26 | 
            +
              end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
              def setup
         | 
| 29 | 
            +
                @repo = create_empty_repository
         | 
| 30 | 
            +
              end
         | 
| 31 | 
            +
             | 
| 32 | 
            +
              def test_rev_parse
         | 
| 33 | 
            +
                assert_match(/^[0-9a-f]{40}$/, @repo.rev_parse("HEAD"))
         | 
| 34 | 
            +
              end
         | 
| 35 | 
            +
             | 
| 36 | 
            +
              def test_stderr_should_raise
         | 
| 37 | 
            +
                assert_nothing_raised                   { @repo.exec("git-diff","HEAD") }
         | 
| 38 | 
            +
                assert_raise(Git::Trac::ExecutionError) { @repo.exec("git-diff","TAIL") }
         | 
| 39 | 
            +
              end
         | 
| 40 | 
            +
            end
         | 
| @@ -0,0 +1,40 @@ | |
| 1 | 
            +
            require 'fileutils'
         | 
| 2 | 
            +
            require 'tempfile'
         | 
| 3 | 
            +
            require 'test/unit'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            $: << File.join(File.dirname(File.dirname(__FILE__)),'lib')
         | 
| 6 | 
            +
            require 'git/trac'
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            class ExecutionTest < Test::Unit::TestCase
         | 
| 9 | 
            +
             | 
| 10 | 
            +
              def create_empty_repository(directory = nil)
         | 
| 11 | 
            +
                if directory.nil?
         | 
| 12 | 
            +
                  file = Tempfile.new("git-trac-test")
         | 
| 13 | 
            +
                  directory = file.path
         | 
| 14 | 
            +
                  file.unlink
         | 
| 15 | 
            +
                end
         | 
| 16 | 
            +
                at_exit { FileUtils.rm_rf(directory) }
         | 
| 17 | 
            +
                FileUtils.mkdir_p(directory)
         | 
| 18 | 
            +
                Dir.chdir(directory) do
         | 
| 19 | 
            +
                  `git-init`
         | 
| 20 | 
            +
                end
         | 
| 21 | 
            +
                FileUtils.touch(File.join(directory,".gitignore"))
         | 
| 22 | 
            +
                repo = Git::Trac::Repository.new(directory)
         | 
| 23 | 
            +
                repo.exec("git-add",".gitignore")
         | 
| 24 | 
            +
                repo.exec("git-commit","-m","Initial revision")
         | 
| 25 | 
            +
                repo
         | 
| 26 | 
            +
              end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
              def setup
         | 
| 29 | 
            +
                @repo = create_empty_repository
         | 
| 30 | 
            +
              end
         | 
| 31 | 
            +
             | 
| 32 | 
            +
              def test_rev_parse
         | 
| 33 | 
            +
                assert_match(/^[0-9a-f]{40}$/, @repo.rev_parse("HEAD"))
         | 
| 34 | 
            +
              end
         | 
| 35 | 
            +
             | 
| 36 | 
            +
              def test_stderr_should_raise
         | 
| 37 | 
            +
                assert_nothing_raised                   {@repo.exec("git-diff","HEAD")}
         | 
| 38 | 
            +
                assert_raise(Git::Trac::ExecutionError) {@repo.exec("git-diff","TAIL")}
         | 
| 39 | 
            +
              end
         | 
| 40 | 
            +
            end
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,64 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification 
         | 
| 2 | 
            +
            rubygems_version: 0.9.0
         | 
| 3 | 
            +
            specification_version: 1
         | 
| 4 | 
            +
            name: git-trac
         | 
| 5 | 
            +
            version: !ruby/object:Gem::Version 
         | 
| 6 | 
            +
              version: 0.0.20071102
         | 
| 7 | 
            +
            date: 2007-11-02 00:00:00 -05:00
         | 
| 8 | 
            +
            summary: Interact with trac from a git repository pulled from svn
         | 
| 9 | 
            +
            require_paths: 
         | 
| 10 | 
            +
            - lib
         | 
| 11 | 
            +
            email: ruby@tpope.info
         | 
| 12 | 
            +
            homepage: http://git-trac.rubyforge.org
         | 
| 13 | 
            +
            rubyforge_project: git-trac
         | 
| 14 | 
            +
            description: git-trac takes the repetition out of working with trac and git-svn.  Among other features is the ability to easily attach a patch to a ticket and to pull all patches from a ticket and turn them into git branches.  Created for (but not limited to) work on the Ruby on Rails core.
         | 
| 15 | 
            +
            autorequire: 
         | 
| 16 | 
            +
            default_executable: git-trac
         | 
| 17 | 
            +
            bindir: bin
         | 
| 18 | 
            +
            has_rdoc: true
         | 
| 19 | 
            +
            required_ruby_version: !ruby/object:Gem::Version::Requirement 
         | 
| 20 | 
            +
              requirements: 
         | 
| 21 | 
            +
              - - ">"
         | 
| 22 | 
            +
                - !ruby/object:Gem::Version 
         | 
| 23 | 
            +
                  version: 0.0.0
         | 
| 24 | 
            +
              version: 
         | 
| 25 | 
            +
            platform: ruby
         | 
| 26 | 
            +
            signing_key: 
         | 
| 27 | 
            +
            cert_chain: 
         | 
| 28 | 
            +
            post_install_message: 
         | 
| 29 | 
            +
            authors: 
         | 
| 30 | 
            +
            - Tim Pope
         | 
| 31 | 
            +
            files: 
         | 
| 32 | 
            +
            - Rakefile
         | 
| 33 | 
            +
            - README
         | 
| 34 | 
            +
            - setup.rb
         | 
| 35 | 
            +
            - bin/git-trac
         | 
| 36 | 
            +
            - lib/git/trac.rb
         | 
| 37 | 
            +
            - lib/git/trac/attachment.rb
         | 
| 38 | 
            +
            - lib/git/trac/repository.rb
         | 
| 39 | 
            +
            - lib/git/trac/runner.rb
         | 
| 40 | 
            +
            - lib/git/trac/ticket.rb
         | 
| 41 | 
            +
            - test/execution_test.rb
         | 
| 42 | 
            +
            - test/execution_test.rb~
         | 
| 43 | 
            +
            test_files: []
         | 
| 44 | 
            +
             | 
| 45 | 
            +
            rdoc_options: []
         | 
| 46 | 
            +
             | 
| 47 | 
            +
            extra_rdoc_files: []
         | 
| 48 | 
            +
             | 
| 49 | 
            +
            executables: 
         | 
| 50 | 
            +
            - git-trac
         | 
| 51 | 
            +
            extensions: []
         | 
| 52 | 
            +
             | 
| 53 | 
            +
            requirements: []
         | 
| 54 | 
            +
             | 
| 55 | 
            +
            dependencies: 
         | 
| 56 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 57 | 
            +
              name: mechanize
         | 
| 58 | 
            +
              version_requirement: 
         | 
| 59 | 
            +
              version_requirements: !ruby/object:Gem::Version::Requirement 
         | 
| 60 | 
            +
                requirements: 
         | 
| 61 | 
            +
                - - ">="
         | 
| 62 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 63 | 
            +
                    version: 0.6.8
         | 
| 64 | 
            +
                version: 
         |