codespicuous 0.0.5 → 0.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32369c66cbcbd810e9205237576757eca230612a
4
- data.tar.gz: 1ba22aea1525014e6eefcba42caee9318d6645ed
3
+ metadata.gz: ec7510457ef28f2fd25293319ce4133539d0c48a
4
+ data.tar.gz: c1834d532ca831750a5857d2c6fec75fc158ab5a
5
5
  SHA512:
6
- metadata.gz: e913239d16e84541c593216c0c31e44825b52422082b188e00143658488be1822ec35a57ddf7df965c1360a994763a069cd4e7c22346e46599482056be6b97dc
7
- data.tar.gz: 139729759092fc037bb447161b651d915dbd0b5fca9306e44ad40b03459c9e5865457e982767386ad01812049362c6320e74ead0696e7a6fb24202e609ff9c88
6
+ metadata.gz: e89bf3bce4e16ebcf4b660224d97bedd1993cfb89ec202cdaeff38360b51ec9d159ec6f0ef570c91735ef4234d634071cce3b7e6a0afb95b7faecdddd0810671
7
+ data.tar.gz: 3e8af2b1578c5a23ee32c3ed80fc8634819f66a60df139cd3c6d660f3a4238d0e9ffd9b8b3ced2c80de1cc46b19be6415e734fd98a58e2a5ddc9abf4637cb417
@@ -6,7 +6,14 @@ class SVNClient
6
6
  @repository = repository
7
7
  end
8
8
 
9
- def log_xml(from, to)
9
+ def log_xml
10
+ AttemptTo.attempt_to('svn log: "' + @repository + '"', 5) {
11
+ CommandRunner.run("svn log #{@repository} --xml --non-interactive ")
12
+ }
13
+ end
14
+
15
+
16
+ def log_xml_for_timeframe(from, to)
10
17
  AttemptTo.attempt_to('svn log: "' + @repository + '"', 5) {
11
18
  CommandRunner.run("svn log #{@repository} -r{#{from.strftime("%Y-%m-%d")}}:{#{to.strftime("%Y-%m-%d")}} --xml --non-interactive ")
12
19
  }
@@ -15,8 +15,7 @@ class SVNDataCollector
15
15
  else
16
16
  svn = SVNClient.new
17
17
  svn.repository(repository.url)
18
- now = DateTime.now
19
- svn.log_xml(now.prev_year, now)
18
+ svn.log_xml
20
19
  end
21
20
  end
22
21
 
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Codespicuous
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
@@ -1,7 +1,18 @@
1
1
 
2
2
  describe "Interface towards the command line svn" do
3
3
 
4
- it "Should be able to retrieve an xml log" do
4
+ it "Should be able to retrieve an xml log for entire repository" do
5
+ svn = SVNClient.new
6
+ xmllog = double(:xmllog)
7
+
8
+ expect(AttemptTo).to receive(:attempt_to).with('svn log: "Heh"', 5).and_yield
9
+ expect(CommandRunner).to receive(:run).with("svn log Heh --xml --non-interactive ").and_return(xmllog)
10
+
11
+ svn.repository("Heh")
12
+ expect(svn.log_xml).to eq(xmllog)
13
+ end
14
+
15
+ it "Should be able to retrieve an xml log for timeframe" do
5
16
  svn = SVNClient.new
6
17
  xmllog = double(:xmllog)
7
18
 
@@ -11,6 +22,6 @@ describe "Interface towards the command line svn" do
11
22
  expect(CommandRunner).to receive(:run).with("svn log Heh -r{1977-01-01}:{1978-01-01} --xml --non-interactive ").and_return(xmllog)
12
23
 
13
24
  svn.repository("Heh")
14
- expect(svn.log_xml(now.prev_year, now)).to eq(xmllog)
25
+ expect(svn.log_xml_for_timeframe(now.prev_year, now)).to eq(xmllog)
15
26
  end
16
27
  end
@@ -12,10 +12,9 @@ describe "Collecting data from SVN" do
12
12
  svnclient = double(:svnclient)
13
13
 
14
14
  expect(SVNClient).to receive(:new).and_return(svnclient)
15
- expect(DateTime).to receive(:now).and_return(DateTime.new(2001))
16
15
 
17
16
  expect(svnclient).to receive(:repository).with(@heh_repository.url)
18
- expect(svnclient).to receive(:log_xml).with(DateTime.new(2000), DateTime.new(2001)).and_return(@xmllog)
17
+ expect(svnclient).to receive(:log_xml).and_return(@xmllog)
19
18
 
20
19
  expect(subject.retrieve_svn_log_from(@heh_repository)).to eq @xmllog
21
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codespicuous
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bas Vodde