Class: Bob::Test::SvnRepo
- Inherits:
-
AbstractSCMRepo
- Object
- AbstractSCMRepo
- Bob::Test::SvnRepo
- Defined in:
- lib/bob/test/scm/svn.rb
Instance Attribute Summary collapse
-
#remote ⇒ Object
readonly
Returns the value of attribute remote.
Attributes inherited from AbstractSCMRepo
Class Method Summary collapse
Instance Method Summary collapse
- #commits ⇒ Object
- #create ⇒ Object
-
#initialize(name, base_dir = Bob.directory) ⇒ SvnRepo
constructor
A new instance of SvnRepo.
Methods inherited from AbstractSCMRepo
#add_commit, #add_failing_commit, #add_successful_commit, #head
Constructor Details
#initialize(name, base_dir = Bob.directory) ⇒ SvnRepo
Returns a new instance of SvnRepo.
12 13 14 15 16 17 |
# File 'lib/bob/test/scm/svn.rb', line 12 def initialize(name, base_dir=Bob.directory) super @path = base_dir.join("svn-#{name}") @remote = SvnRepo.server_root.join(name.to_s) end |
Instance Attribute Details
#remote ⇒ Object (readonly)
Returns the value of attribute remote.
10 11 12 |
# File 'lib/bob/test/scm/svn.rb', line 10 def remote @remote end |
Class Method Details
Instance Method Details
#commits ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/bob/test/scm/svn.rb', line 30 def commits Dir.chdir(path) do doc = Hpricot::XML(`svn log --xml`) (doc/:log/:logentry).inject([]) { |commits, commit| commits << { "identifier" => commit["revision"], "message" => commit.at("msg").inner_html, "committed_at" => Time.parse(commit.at("date").inner_html) } }.reverse end end |
#create ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/bob/test/scm/svn.rb', line 19 def create create_remote run "svn checkout file://#{remote} #{path}" add_commit("First commit") do run "echo 'just a test repo' >> README" add "README" end end |