ohloh_scm 2.2.3 → 2.2.4

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: 01aee4685daafad8c1d67aaf29980d436e8a9f90
4
- data.tar.gz: 5b4e1b06ab670dec334adcda280ec20964f2bbe8
3
+ metadata.gz: fe066288b332c9dd10ec78dd83a5939c6e7d33ae
4
+ data.tar.gz: 943728f5598a66f587ec1f1d62da2ac5880170df
5
5
  SHA512:
6
- metadata.gz: 641c9907527a60ddcbbcc34451a3f8088a242d9c67a2766cad1f6deae4a6db40ad25e9382aae50f70879e26be14feb7c0c34b7ce9192323115fc7f9c0cdbe592
7
- data.tar.gz: 2e018d289cced44e09b5ffc5773d0a689968087cee77414a6f375f8a9ae104ea332c53c0d9ac7f809e97ab98c71f4c3a103eac2a6043eb1672efe27e5f907402
6
+ metadata.gz: bbfd34de0a9ba9a7d4b2d2d3500bbc1d92fc2f17e895c081ffa717287d0ad3f947990956233210f5b88ef477e62eb76e9aaf5833b7d345a149644083f4992aca
7
+ data.tar.gz: 01cc2c61d974a275a0a0f819cd2dd0cc0372bac4d7da063274a57048c596524b5080a4693e22a70ceb38ab41d88b0823bdb1ef5d8dfea7fd771bd55863719c9f
data/.ruby-version CHANGED
@@ -1,2 +1,2 @@
1
- 2.0.0-p648
1
+ 2.0.0-p645
2
2
 
@@ -1,5 +1,6 @@
1
1
  sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu precise svn18" >> /etc/apt/sources.list.d/subversion18.list'
2
2
  sudo wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add -
3
+ sudo apt-add-repository -y ppa:git-core/ppa
3
4
  sudo apt-get update
4
- sudo apt-get install -y subversion cvs bzr mercurial
5
+ sudo apt-get install -y git subversion cvs bzr mercurial
5
6
  sudo ln -s /usr/bin/cvs /usr/bin/cvsnt
@@ -42,8 +42,11 @@ module OhlohScm::Adapters
42
42
  def tags
43
43
  tag_strings = run("cd '#{url}' && bzr tags").split(/\n/)
44
44
  tag_strings.map do |tag_string|
45
- tag_string.split(/\s+/)
46
- end
45
+ tag_name, rev = tag_string.split(/\s+/)
46
+ next if rev == '?' || tag_name == '....'
47
+ time_string = run("cd '#{ url }' && bzr log -r #{ rev } | grep 'timestamp:' | sed 's/timestamp://'")
48
+ [tag_name, rev, Time.parse(time_string)]
49
+ end.compact
47
50
  end
48
51
  end
49
52
  end
@@ -76,11 +76,12 @@ module OhlohScm::Adapters
76
76
 
77
77
  def tags
78
78
  return [] if no_tags?
79
- tag_strings = run("cd #{url} && git show-ref --tags").split(/\n/)
79
+ tag_strings = run("cd #{url} && git tag --format='%(creatordate:iso-strict) %(objectname) %(refname)'").split(/\n/)
80
80
  tag_strings.map do |tag_string|
81
- commit_hash, tag_path = tag_string.split(/\s/)
81
+ timestamp_string, commit_hash, tag_path = tag_string.split(/\s/)
82
+ timestamp = Time.parse(timestamp_string)
82
83
  tag_name = tag_path.gsub('refs/tags/', '')
83
- [tag_name, commit_hash]
84
+ [tag_name, commit_hash, timestamp]
84
85
  end
85
86
  end
86
87
  end
@@ -23,8 +23,9 @@ module OhlohScm::Adapters
23
23
  tag_strings = run("cd '#{path}' && hg tags").split(/\n/)
24
24
  tag_strings.map do |tag_string|
25
25
  tag_name, rev_number_and_hash = tag_string.split(/\s+/)
26
- rev_number = rev_number_and_hash.slice(/\A\d+/)
27
- [tag_name, rev_number]
26
+ rev = rev_number_and_hash.slice(/\A\d+/)
27
+ time_string = run("cd '#{ path }' && hg log -r #{ rev } | grep 'date:' | sed 's/date://'")
28
+ [tag_name, rev, Time.parse(time_string)]
28
29
  end
29
30
  end
30
31
  end
@@ -146,7 +146,9 @@ module OhlohScm::Adapters
146
146
  def tags
147
147
  tag_strings = `svn ls -v #{ base_path}/tags`.split(/\n/)
148
148
  tag_strings.map do |tag_string|
149
- tag_string.split(' ').values_at(-1, 0).map { |v| v.chomp('/') }
149
+ date_string = tag_string.split(' ').values_at(-4, -3, -2).join(' ')
150
+ folder_and_rev = tag_string.split(' ').values_at(-1, 0).map { |v| v.chomp('/') }
151
+ folder_and_rev << Time.parse(date_string)
150
152
  end[1..-1]
151
153
  end
152
154
 
@@ -1,5 +1,5 @@
1
1
  module OhlohScm
2
2
  module Version
3
- STRING = '2.2.3'
3
+ STRING = '2.2.4'
4
4
  end
5
5
  end
@@ -36,7 +36,24 @@ module OhlohScm::Adapters
36
36
 
37
37
  def test_tags
38
38
  with_bzr_repository('bzr') do |bzr|
39
- assert_equal bzr.tags, [['v1.0.0', '5'], ['v2.0.0','7']]
39
+ time_1 = Time.parse('2009-02-04 00:25:40 +0000')
40
+ time_2 = Time.parse('2011-12-22 18:37:33 +0000')
41
+ monkey_patch_run_method_to_match_tag_patterns
42
+ assert_equal [['v1.0.0', '5', time_1], ['v2.0.0','7', time_2]], bzr.tags
43
+ end
44
+ end
45
+
46
+ private
47
+
48
+ def monkey_patch_run_method_to_match_tag_patterns
49
+ original_method = AbstractAdapter.method(:run)
50
+ AbstractAdapter.send :define_method, :run do |command|
51
+ if command =~ /bzr tags/
52
+ # The output of `bzr tags` sometimes has tags referring to ? while sometimes has dotted separators.
53
+ "0.11-1.1 ?\n0.14-1 ?\n....\n#{ original_method.call(command) }"
54
+ else
55
+ original_method.call(command)
56
+ end
40
57
  end
41
58
  end
42
59
  end
@@ -47,8 +47,8 @@ module OhlohScm::Adapters
47
47
 
48
48
  def test_tags
49
49
  with_git_repository('git') do |git|
50
- assert_equal git.tags, [['v1.0.0', 'f6e5a894ac4173f8f2a200f2c36df38a1e61121a'],
51
- ['v2.1.0', '1df547800dcd168e589bb9b26b4039bff3a7f7e4']]
50
+ assert_equal git.tags, [['v1.0.0', 'f6e5a894ac4173f8f2a200f2c36df38a1e61121a', Time.parse('2016-07-31T07:58:30+05:30')],
51
+ ['v2.1.0', '1df547800dcd168e589bb9b26b4039bff3a7f7e4', Time.parse('2006-07-14T16:07:15-07:00')]]
52
52
  end
53
53
  end
54
54
 
@@ -39,7 +39,8 @@ module OhlohScm::Adapters
39
39
 
40
40
  def test_tags
41
41
  with_hg_repository('hg') do |hg|
42
- assert_equal hg.tags, [['tip', '5']]
42
+ time = Time.parse('Fri Jul 22 18:00:18 2016 +0530')
43
+ assert_equal [['tip', '5', time]], hg.tags
43
44
  end
44
45
  end
45
46
  end
@@ -111,7 +111,9 @@ module OhlohScm::Adapters
111
111
  mkdir -p #{ source_scm.root.gsub(/^file:../, '') }/db/transactions
112
112
  svn copy trunk tags/2.0 && svn commit -m 'v2.0' && svn update"
113
113
 
114
- assert_equal([['2.0', '6']], source_scm.tags)
114
+ assert_equal(['2.0', '6'], source_scm.tags.first[0..1])
115
+ # Avoid millisecond comparision.
116
+ assert_equal(Time.now.strftime('%F %R'), source_scm.tags.first[-1].strftime('%F %R'))
115
117
  end
116
118
  end
117
119
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohloh_scm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - BlackDuck Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-26 00:00:00.000000000 Z
11
+ date: 2016-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: posix-spawn
@@ -602,7 +602,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
602
602
  version: '0'
603
603
  requirements: []
604
604
  rubyforge_project:
605
- rubygems_version: 2.0.14.1
605
+ rubygems_version: 2.4.8
606
606
  signing_key:
607
607
  specification_version: 4
608
608
  summary: Source Control Management