lib/ronin/gen/generators/repository.rb in ronin-gen-1.1.0.rc1 vs lib/ronin/gen/generators/repository.rb in ronin-gen-1.1.0.rc2

- old
+ new

@@ -1,7 +1,7 @@ # -# Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com) +# Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com) # # This file is part of Ronin Gen. # # Ronin Gen is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -59,10 +59,19 @@ :default => [] parameter :tests, :type => true parameter :docs, :type => true + parameter :svn, :type => true, + :description => 'Create a SVN repository' + + parameter :git, :type => true, + :description => 'Create a Git repository' + + parameter :hg, :type => true, + :description => 'Create a Hg repository' + # # Sets up the repository generator. # def setup @title ||= File.basename(@path).gsub(/[_\s]+/,' ').capitalize @@ -94,9 +103,17 @@ if tests? cp '.rspec' mkdir 'spec' cp File.join('spec','spec_helper.rb') + end + + if svn? + run 'svnadmin', 'create', @path + elsif git? + run 'git', 'init' + elsif hg? + run 'hg', 'init' end end end end