ohloh_scm 4.0.4 → 5.0.0

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.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +14 -3
  3. data/.ruby-version +1 -1
  4. data/Dockerfile +8 -8
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +48 -33
  7. data/lib/ohloh_scm/activity.rb +1 -1
  8. data/lib/ohloh_scm/bzr/activity.rb +12 -12
  9. data/lib/ohloh_scm/bzr/validation.rb +1 -1
  10. data/lib/ohloh_scm/commit.rb +2 -4
  11. data/lib/ohloh_scm/core.rb +2 -1
  12. data/lib/ohloh_scm/cvs/activity.rb +74 -60
  13. data/lib/ohloh_scm/cvs/scm.rb +12 -12
  14. data/lib/ohloh_scm/cvs/status.rb +1 -1
  15. data/lib/ohloh_scm/cvs/validation.rb +5 -5
  16. data/lib/ohloh_scm/diff.rb +1 -1
  17. data/lib/ohloh_scm/factory.rb +7 -1
  18. data/lib/ohloh_scm/git/activity.rb +111 -55
  19. data/lib/ohloh_scm/git/scm.rb +6 -8
  20. data/lib/ohloh_scm/git/status.rb +1 -1
  21. data/lib/ohloh_scm/git/validation.rb +1 -1
  22. data/lib/ohloh_scm/git_svn/activity.rb +5 -5
  23. data/lib/ohloh_scm/git_svn/scm.rb +5 -5
  24. data/lib/ohloh_scm/hg/activity.rb +13 -13
  25. data/lib/ohloh_scm/hg/scm.rb +3 -3
  26. data/lib/ohloh_scm/hg/validation.rb +1 -1
  27. data/lib/ohloh_scm/parser/branch_number.rb +7 -6
  28. data/lib/ohloh_scm/parser/bzr_xml_parser.rb +15 -15
  29. data/lib/ohloh_scm/parser/cvs_parser.rb +7 -6
  30. data/lib/ohloh_scm/parser/git_parser.rb +18 -15
  31. data/lib/ohloh_scm/parser/hg_parser.rb +8 -6
  32. data/lib/ohloh_scm/parser/svn_parser.rb +7 -6
  33. data/lib/ohloh_scm/py_bridge/hg_client.rb +1 -1
  34. data/lib/ohloh_scm/svn/activity.rb +17 -18
  35. data/lib/ohloh_scm/svn/scm.rb +4 -6
  36. data/lib/ohloh_scm/svn/validation.rb +2 -2
  37. data/lib/ohloh_scm/system.rb +1 -1
  38. data/lib/ohloh_scm/validation.rb +4 -6
  39. data/lib/ohloh_scm/version.rb +1 -1
  40. data/ohloh_scm.gemspec +5 -5
  41. data/security.md +30 -0
  42. data/spec/.rubocop.yml +2 -5
  43. data/spec/benchmarks/process_spawn_benchmark.rb +1 -1
  44. data/spec/helpers/assert_scm_attr_helper.rb +4 -4
  45. data/spec/helpers/generic_helper.rb +2 -2
  46. data/spec/helpers/repository_helper.rb +1 -1
  47. data/spec/ohloh_scm/activity_spec.rb +2 -2
  48. data/spec/ohloh_scm/bzr/activity_spec.rb +60 -60
  49. data/spec/ohloh_scm/bzr/validation_spec.rb +1 -1
  50. data/spec/ohloh_scm/cvs/activity_spec.rb +20 -21
  51. data/spec/ohloh_scm/cvs/scm_spec.rb +36 -36
  52. data/spec/ohloh_scm/cvs/validation_spec.rb +4 -4
  53. data/spec/ohloh_scm/factory_spec.rb +2 -2
  54. data/spec/ohloh_scm/git/activity_spec.rb +111 -110
  55. data/spec/ohloh_scm/git/scm_spec.rb +11 -11
  56. data/spec/ohloh_scm/git/status_spec.rb +3 -3
  57. data/spec/ohloh_scm/git/validation_spec.rb +7 -7
  58. data/spec/ohloh_scm/git_svn/activity_spec.rb +14 -14
  59. data/spec/ohloh_scm/git_svn/scm_spec.rb +1 -1
  60. data/spec/ohloh_scm/hg/activity_spec.rb +99 -99
  61. data/spec/ohloh_scm/hg/scm_spec.rb +5 -5
  62. data/spec/ohloh_scm/hg/validation_spec.rb +1 -1
  63. data/spec/ohloh_scm/parser/array_writer_spec.rb +7 -7
  64. data/spec/ohloh_scm/parser/branch_number_spec.rb +3 -3
  65. data/spec/ohloh_scm/parser/cvs_parser_spec.rb +31 -31
  66. data/spec/ohloh_scm/parser/git_parser_spec.rb +29 -32
  67. data/spec/ohloh_scm/parser/hg_parser_spec.rb +60 -60
  68. data/spec/ohloh_scm/svn/activity_spec.rb +11 -12
  69. data/spec/ohloh_scm/svn/scm_spec.rb +24 -24
  70. data/spec/ohloh_scm/svn/validation_spec.rb +6 -6
  71. data/spec/ohloh_scm/svn_parser_spec.rb +29 -29
  72. data/spec/ohloh_scm/system_spec.rb +5 -5
  73. data/spec/ohloh_scm/version_spec.rb +1 -1
  74. data/spec/string_encoder_spec.rb +4 -4
  75. metadata +8 -81
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe 'HgParser' do
4
4
  describe 'parser' do
5
5
  it 'must return an empty list for blank log' do
6
- OhlohScm::HgParser.parse('').must_be :empty?
6
+ assert_empty OhlohScm::HgParser.parse('')
7
7
  end
8
8
 
9
9
  it 'must parse log into commits' do
@@ -30,21 +30,21 @@ describe 'HgParser' do
30
30
  commits = OhlohScm::HgParser.parse(sample_log)
31
31
 
32
32
  assert commits
33
- commits.size.must_equal 2
34
-
35
- commits[0].token.must_match '655f04cf6ad708'
36
- commits[0].committer_name.must_equal 'Alex'
37
- commits[0].committer_email.must_equal 'alex@example.com'
38
- commits[0].message.must_equal "added makefile\n" # Note \n at end of comment
39
- commits[0].committer_date.to_i.must_equal Time.utc(2009, 1, 20, 19, 33, 17).to_i
40
- commits[0].diffs.size.must_equal 0
41
-
42
- commits[1].token.must_match '01101d8ef3ce'
43
- commits[1].committer_name.must_equal 'Robin Luckey'
44
- commits[1].committer_email.must_equal 'robin@ohloh.net'
45
- commits[1].message.must_equal "Initial Checkin\n" # Note \n at end of comment
46
- commits[1].committer_date.to_i.must_equal Time.utc(2009, 1, 20, 19, 32, 54).to_i
47
- commits[1].diffs.size.must_equal 0
33
+ assert_equal commits.size, 2
34
+
35
+ assert commits[0].token.match?('655f04cf6ad708')
36
+ assert_equal commits[0].committer_name, 'Alex'
37
+ assert_equal commits[0].committer_email, 'alex@example.com'
38
+ assert_equal commits[0].message, "added makefile\n" # Note \n at end of comment
39
+ assert_equal commits[0].committer_date.to_i, Time.utc(2009, 1, 20, 19, 33, 17).to_i
40
+ assert_equal commits[0].diffs.size, 0
41
+
42
+ assert commits[1].token.match?('01101d8ef3ce')
43
+ assert_equal commits[1].committer_name, 'Robin Luckey'
44
+ assert_equal commits[1].committer_email, 'robin@ohloh.net'
45
+ assert_equal commits[1].message, "Initial Checkin\n" # Note \n at end of comment
46
+ assert_equal commits[1].committer_date.to_i, Time.utc(2009, 1, 20, 19, 32, 54).to_i
47
+ assert_equal commits[1].diffs.size, 0
48
48
  end
49
49
 
50
50
  it 'must set committer_name to email and committer_email to NULL when name is not present' do
@@ -62,11 +62,11 @@ describe 'HgParser' do
62
62
  commits = OhlohScm::HgParser.parse(sample_log)
63
63
 
64
64
  assert commits
65
- commits.size.must_equal 1
65
+ assert_equal commits.size, 1
66
66
 
67
- commits[0].token.must_match '01101d8ef3ce'
68
- commits[0].committer_name.must_equal 'robin@ohloh.net'
69
- commits[0].committer_email.must_be_nil
67
+ assert commits[0].token.match?('01101d8ef3ce')
68
+ assert_equal commits[0].committer_name, 'robin@ohloh.net'
69
+ assert_nil commits[0].committer_email
70
70
  end
71
71
 
72
72
  # Sometimes the log does not include a summary
@@ -86,14 +86,14 @@ describe 'HgParser' do
86
86
  commits = OhlohScm::HgParser.parse(sample_log)
87
87
 
88
88
  assert commits
89
- commits.size.must_equal 2
90
-
91
- commits[0].token.must_match '655f04cf6ad708'
92
- commits[0].committer_name.must_equal 'Alex'
93
- commits[0].committer_email.must_equal 'alex@example.com'
94
- commits[0].message.must_be_nil
95
- commits[0].committer_date.to_i.must_equal Time.utc(2009, 1, 20, 19, 33, 17).to_i
96
- commits[0].diffs.size.must_equal 0
89
+ assert_equal commits.size, 2
90
+
91
+ assert commits[0].token.match?('655f04cf6ad708')
92
+ assert_equal commits[0].committer_name, 'Alex'
93
+ assert_equal commits[0].committer_email, 'alex@example.com'
94
+ assert_nil commits[0].message
95
+ assert_equal commits[0].committer_date.to_i, Time.utc(2009, 1, 20, 19, 33, 17).to_i
96
+ assert_equal commits[0].diffs.size, 0
97
97
  end
98
98
 
99
99
  it 'must parse verbose log into commits and diffs' do
@@ -126,22 +126,22 @@ describe 'HgParser' do
126
126
  commits = OhlohScm::HgParser.parse(sample_log)
127
127
 
128
128
  assert commits
129
- commits.size.must_equal 2
130
-
131
- commits[0].token.must_match '655f04cf6ad708'
132
- commits[0].committer_name.must_equal 'Alex'
133
- commits[0].committer_email.must_equal 'alex@example.com'
134
- commits[0].message.must_equal "Adding file foobar\n" # Note \n at end of comment
135
- commits[0].committer_date.to_i.must_equal Time.utc(2009, 1, 20, 19, 33, 17).to_i
136
- commits[0].diffs[0].path.must_equal 'foobar'
137
-
138
- commits[1].token.must_match '01101d8ef3ce'
139
- commits[1].committer_name.must_equal 'Robin Luckey'
140
- commits[1].committer_email.must_equal 'robin@ohloh.net'
141
- commits[1].message.must_equal "Initial Checkin\n" # Note \n at end of comment
142
- commits[1].committer_date.to_i.must_equal Time.utc(2009, 1, 20, 19, 32, 54).to_i
143
- commits[1].diffs.size.must_equal 1
144
- commits[1].diffs[0].path.must_equal 'helloworld.c'
129
+ assert_equal commits.size, 2
130
+
131
+ assert commits[0].token.match?('655f04cf6ad708')
132
+ assert_equal commits[0].committer_name, 'Alex'
133
+ assert_equal commits[0].committer_email, 'alex@example.com'
134
+ assert_equal commits[0].message, "Adding file foobar\n" # Note \n at end of comment
135
+ assert_equal commits[0].committer_date.to_i, Time.utc(2009, 1, 20, 19, 33, 17).to_i
136
+ assert_equal commits[0].diffs[0].path, 'foobar'
137
+
138
+ assert commits[1].token.match?('01101d8ef3ce')
139
+ assert_equal commits[1].committer_name, 'Robin Luckey'
140
+ assert_equal commits[1].committer_email, 'robin@ohloh.net'
141
+ assert_equal commits[1].message, "Initial Checkin\n" # Note \n at end of comment
142
+ assert_equal commits[1].committer_date.to_i, Time.utc(2009, 1, 20, 19, 32, 54).to_i
143
+ assert_equal commits[1].diffs.size, 1
144
+ assert_equal commits[1].diffs[0].path, 'helloworld.c'
145
145
  end
146
146
 
147
147
  it 'must parse log with the --style argument' do
@@ -161,33 +161,33 @@ describe 'HgParser' do
161
161
  protected
162
162
 
163
163
  def assert_styled_commits(commits, with_diffs = false)
164
- commits.size.must_equal 6
164
+ assert_equal commits.size, 6
165
165
 
166
- commits[1].token.must_equal '655f04cf6ad708ab58c7b941672dce09dd369a18'
167
- commits[1].committer_name.must_equal 'Alex'
168
- commits[1].committer_email.must_equal 'alex@example.com'
166
+ assert_equal commits[1].token, '655f04cf6ad708ab58c7b941672dce09dd369a18'
167
+ assert_equal commits[1].committer_name, 'Alex'
168
+ assert_equal commits[1].committer_email, 'alex@example.com'
169
169
  assert Time.utc(2009, 1, 20, 19, 34, 53) - commits[1].committer_date < 1 # Don't care about milliseconds
170
- commits[1].message.must_equal "Adding file two\n"
170
+ assert_equal commits[1].message, "Adding file two\n"
171
171
 
172
172
  if with_diffs
173
- commits[1].diffs.size.must_equal 1
174
- commits[1].diffs[0].action.must_equal 'A'
175
- commits[1].diffs[0].path.must_equal 'two'
173
+ assert_equal commits[1].diffs.size, 1
174
+ assert_equal commits[1].diffs[0].action, 'A'
175
+ assert_equal commits[1].diffs[0].path, 'two'
176
176
  else
177
- commits[1].diffs.must_equal []
177
+ assert_equal commits[1].diffs, []
178
178
  end
179
179
 
180
- commits[2].token.must_equal '75532c1e1f1de55c2271f6fd29d98efbe35397c4'
180
+ assert_equal commits[2].token, '75532c1e1f1de55c2271f6fd29d98efbe35397c4'
181
181
  assert Time.utc(2009, 1, 20, 19, 34, 4) - commits[2].committer_date < 1
182
182
 
183
183
  if with_diffs
184
- commits[3].diffs.size.must_equal 2
185
- commits[3].diffs[0].action.must_equal 'M'
186
- commits[3].diffs[0].path.must_equal 'helloworld.c'
187
- commits[3].diffs[1].action.must_equal 'A'
188
- commits[3].diffs[1].path.must_equal 'README'
184
+ assert_equal commits[3].diffs.size, 2
185
+ assert_equal commits[3].diffs[0].action, 'M'
186
+ assert_equal commits[3].diffs[0].path, 'helloworld.c'
187
+ assert_equal commits[3].diffs[1].action, 'A'
188
+ assert_equal commits[3].diffs[1].path, 'README'
189
189
  else
190
- commits[0].diffs.must_equal []
190
+ assert_equal commits[0].diffs, []
191
191
  end
192
192
  end
193
193
  end
@@ -3,14 +3,14 @@ require 'mocha'
3
3
 
4
4
  describe 'Svn::Activity' do
5
5
  describe 'cat' do
6
- let(:commit_1) { OhlohScm::Commit.new(token: 1) }
6
+ let(:commit1) { OhlohScm::Commit.new(token: 1) }
7
7
  let(:hello_diff) { OhlohScm::Diff.new(path: 'helloworld.c') }
8
8
 
9
9
  it 'must export data correctly' do
10
10
  with_svn_repository('svn') do |svn|
11
11
  tmpdir do |dir|
12
12
  svn.activity.export(dir)
13
- Dir.entries(dir).sort.must_equal %w[. .. branches tags trunk]
13
+ assert_equal Dir.entries(dir).sort, %w[. .. branches tags trunk]
14
14
  end
15
15
  end
16
16
  end
@@ -21,14 +21,14 @@ describe 'Svn::Activity' do
21
21
  tmpdir('oh_scm_out_dir_') do |dir|
22
22
  root_path = svn.activity.root
23
23
  folder_name = root_path.slice(/[^\/]+\/?\Z/)
24
- cmd = "cd #{svn_working_folder} && svn co #{root_path} && cd #{folder_name}"\
25
- " && mkdir -p #{root_path.gsub(/^file:../, '')}/db/transactions"\
26
- " && svn copy trunk tags/2.0 && svn commit -m 'v2.0' && svn update"
24
+ cmd = "cd #{svn_working_folder} && svn co #{root_path} && cd #{folder_name} " \
25
+ "&& mkdir -p #{root_path.gsub(/^file:../, '')}/db/transactions " \
26
+ "&& svn copy trunk tags/2.0 && svn commit -m 'v2.0' && svn update"
27
27
  svn.activity.send :run, cmd
28
28
 
29
29
  svn.activity.export_tag(dir, '2.0')
30
30
 
31
- Dir.entries(dir).sort.must_equal %w[. .. COPYING README helloworld.c makefile]
31
+ assert_equal Dir.entries(dir).sort, %w[. .. COPYING README helloworld.c makefile]
32
32
  end
33
33
  end
34
34
  end
@@ -39,15 +39,14 @@ describe 'Svn::Activity' do
39
39
  tmpdir do |svn_working_folder|
40
40
  root_path = svn.activity.root
41
41
  folder_name = root_path.slice(/[^\/]+\/?\Z/)
42
- cmd = "cd #{svn_working_folder} && svn co #{root_path} && cd #{folder_name}"\
43
- " && mkdir -p #{root_path.gsub(/^file:../, '')}/db/transactions"\
44
- " && svn copy trunk tags/2.0 && svn commit -m 'v2.0' && svn update"
42
+ cmd = "cd #{svn_working_folder} && svn co #{root_path} && cd #{folder_name} " \
43
+ "&& mkdir -p #{root_path.gsub(/^file:../, '')}/db/transactions " \
44
+ "&& svn copy trunk tags/2.0 && svn commit -m 'v2.0' && svn update"
45
45
  svn.activity.send :run, cmd
46
46
 
47
- svn.activity.tags.first[0..1].must_equal ['2.0', '6']
47
+ assert_equal svn.activity.tags.first[0..1], ['2.0', '6']
48
48
  # Avoid millisecond comparision.
49
- svn.activity.tags.first[-1].strftime('%F %R')
50
- .must_equal Time.now.utc.strftime('%F %R')
49
+ assert_equal svn.activity.tags.first[-1].strftime('%F %R'), Time.now.utc.strftime('%F %R')
51
50
  end
52
51
  end
53
52
  end
@@ -2,73 +2,73 @@ require 'spec_helper'
2
2
 
3
3
  describe 'Svn::Scm' do
4
4
  it 'must prefix file: to local path' do
5
- get_core(:svn, url: '').scm.send(:prefix_file_for_local_path, '').must_be_nil
6
- get_core(:svn, url: '/home/test').scm.send(:prefix_file_for_local_path, '/home/test')
7
- .must_equal 'file:///home/test'
5
+ assert_nil get_core(:svn, url: '').scm.send(:prefix_file_for_local_path, '')
6
+ assert_equal get_core(:svn, url: '/home/test').scm.send(:prefix_file_for_local_path, '/home/test'),
7
+ 'file:///home/test'
8
8
  end
9
9
 
10
10
  it 'must require https for sourceforge' do
11
11
  OhlohScm::Svn::Scm.any_instance.stubs(:recalc_branch_name)
12
12
 
13
13
  url = '://svn.code.sf.net/p/gallery/code/trunk/gallery2'
14
- get_core(:svn, url: "http#{url}").scm.normalize.url.must_equal "https#{url}"
15
- get_core(:svn, url: "https#{url}").scm.normalize.url.must_equal "https#{url}"
14
+ assert_equal get_core(:svn, url: "http#{url}").scm.normalize.url, "https#{url}"
15
+ assert_equal get_core(:svn, url: "https#{url}").scm.normalize.url, "https#{url}"
16
16
 
17
17
  url = 'https://github.com/blackducksw/ohloh_scm/trunk'
18
- get_core(:svn, url: url).scm.normalize.url.must_equal url
18
+ assert_equal get_core(:svn, url: url).scm.normalize.url, url
19
19
  end
20
20
 
21
21
  it 'must recalc branch name' do
22
22
  with_svn_repository('svn') do |svn_core|
23
23
  svn_scm = get_core(:svn, url: svn_core.scm.url, branch_name: '').scm
24
- svn_scm.branch_name.must_be_nil
25
- svn_scm.send(:recalc_branch_name).must_be_empty
26
- svn_scm.branch_name.must_be_empty
24
+ assert_nil svn_scm.branch_name
25
+ assert_empty svn_scm.send(:recalc_branch_name)
26
+ assert_empty svn_scm.branch_name
27
27
 
28
28
  svn_scm = get_core(:svn, url: svn_core.scm.url, branch_name: '/').scm
29
- svn_scm.send(:recalc_branch_name).must_be_empty
30
- svn_scm.branch_name.must_be_empty
29
+ assert_empty svn_scm.send(:recalc_branch_name)
30
+ assert_empty svn_scm.branch_name
31
31
 
32
- svn_scm = get_core(:svn, url: svn_core.scm.url + '/trunk').scm
32
+ svn_scm = get_core(:svn, url: "#{svn_core.scm.url}/trunk").scm
33
33
  OhlohScm::Svn::Activity.any_instance.stubs(:root).returns(svn_core.scm.url)
34
34
  svn_scm.send(:recalc_branch_name)
35
- svn_scm.branch_name.must_equal '/trunk'
35
+ assert_equal svn_scm.branch_name, '/trunk'
36
36
 
37
- svn_scm = get_core(:svn, url: svn_core.scm.url + '/trunk', branch_name: nil).scm
37
+ svn_scm = get_core(:svn, url: "#{svn_core.scm.url}/trunk", branch_name: nil).scm
38
38
  OhlohScm::Svn::Activity.any_instance.stubs(:root).returns(svn_core.scm.url)
39
- svn_scm.normalize.branch_name.must_equal '/trunk'
39
+ assert_equal svn_scm.normalize.branch_name, '/trunk'
40
40
  end
41
41
  end
42
42
 
43
43
  describe 'restrict_url_to_trunk' do
44
44
  it 'must return url when url ends with trunk' do
45
45
  svn_scm = get_core(:svn, url: 'svn:foobar/trunk').scm
46
- svn_scm.restrict_url_to_trunk.must_equal svn_scm.url
46
+ assert_equal svn_scm.restrict_url_to_trunk, svn_scm.url
47
47
  end
48
48
 
49
49
  it 'must append trunk to url and set branch_name when trunk folder is present' do
50
50
  with_svn_repository('svn') do |svn_core|
51
51
  scm = svn_core.scm
52
- scm.url.must_equal svn_core.activity.root
53
- scm.branch_name.must_be_nil
52
+ assert_equal scm.url, svn_core.activity.root
53
+ assert_nil scm.branch_name
54
54
 
55
55
  scm.restrict_url_to_trunk
56
56
 
57
- scm.url.must_equal svn_core.activity.root + '/trunk'
58
- scm.branch_name.must_equal '/trunk'
57
+ assert_equal scm.url, "#{svn_core.activity.root}/trunk"
58
+ assert_equal scm.branch_name, '/trunk'
59
59
  end
60
60
  end
61
61
 
62
62
  it 'must update url and branch_name when repo has a single subfolder' do
63
63
  with_svn_repository('svn_subdir') do |svn_core|
64
64
  scm = svn_core.scm
65
- scm.url.must_equal svn_core.activity.root
66
- scm.branch_name.must_be_nil
65
+ assert_equal scm.url, svn_core.activity.root
66
+ assert_nil scm.branch_name
67
67
 
68
68
  scm.restrict_url_to_trunk
69
69
 
70
- scm.url.must_equal svn_core.activity.root + '/subdir/trunk'
71
- scm.branch_name.must_equal '/subdir/trunk'
70
+ assert_equal scm.url, "#{svn_core.activity.root}/subdir/trunk"
71
+ assert_equal scm.branch_name, '/subdir/trunk'
72
72
  end
73
73
  end
74
74
  end
@@ -51,12 +51,12 @@ describe 'Svn::Status' do
51
51
  it 'should validate_server_connection' do
52
52
  with_svn_repository('svn') do |svn|
53
53
  svn.validation.send(:validate_server_connection)
54
- svn.validation.errors.must_be :empty?
54
+ assert_empty svn.validation.errors
55
55
  end
56
56
  end
57
57
 
58
58
  it 'should strip trailing whitespace in branch_name' do
59
- get_core(:svn, branch_name: '/trunk/').scm.normalize.branch_name.must_equal '/trunk'
59
+ assert_equal get_core(:svn, branch_name: '/trunk/').scm.normalize.branch_name, '/trunk'
60
60
  end
61
61
 
62
62
  it 'should catch exception when validating server connection' do
@@ -64,7 +64,7 @@ describe 'Svn::Status' do
64
64
  git_svn.validation.instance_variable_set('@errors', nil)
65
65
  git_svn.validation.send :validate_server_connection
66
66
  msg = 'An error occured connecting to the server. Check the URL, username, and password.'
67
- git_svn.validation.errors.must_equal [[:failed, msg]]
67
+ assert_equal git_svn.validation.errors, [[:failed, msg]]
68
68
  end
69
69
 
70
70
  it 'should validate head token when validating server connection' do
@@ -74,7 +74,7 @@ describe 'Svn::Status' do
74
74
  git_svn.validation.expects(:url_error)
75
75
  git_svn.validation.send :validate_server_connection
76
76
  msg = "The server did not respond to a 'svn info' command. Is the URL correct?"
77
- git_svn.validation.errors.must_equal [[:failed, msg]]
77
+ assert_equal git_svn.validation.errors, [[:failed, msg]]
78
78
  end
79
79
 
80
80
  it 'should validate url when validating server connection' do
@@ -83,7 +83,7 @@ describe 'Svn::Status' do
83
83
  OhlohScm::Svn::Activity.any_instance.stubs(:head_token).returns('')
84
84
  OhlohScm::Svn::Activity.any_instance.stubs(:root).returns('tt')
85
85
  git_svn.validation.send :validate_server_connection
86
- git_svn.validation.errors
87
- .must_equal [[:failed, 'The URL did not match the Subversion root tt. Is the URL correct?']]
86
+ assert_equal git_svn.validation.errors,
87
+ [[:failed, 'The URL did not match the Subversion root tt. Is the URL correct?']]
88
88
  end
89
89
  end
@@ -4,16 +4,16 @@ DATA_DIR = File.expand_path(File.join(File.dirname(__FILE__), '../raw_fixtures')
4
4
 
5
5
  describe 'SvnParser' do
6
6
  it 'test_empty_array' do
7
- OhlohScm::SvnParser.parse('').must_be :empty?
7
+ assert_predicate OhlohScm::SvnParser.parse(''), :empty?
8
8
  end
9
9
 
10
10
  it 'test_yield_instead_of_writer' do
11
11
  commits = []
12
- result = OhlohScm::SvnParser.parse(File.read(DATA_DIR + '/simple.svn_log')) do |commit|
12
+ result = OhlohScm::SvnParser.parse(File.read("#{DATA_DIR}/simple.svn_log")) do |commit|
13
13
  commits << commit.token
14
14
  end
15
- result.must_be_nil
16
- commits.must_equal [5, 4, 3, 2, 1]
15
+ assert_nil result
16
+ assert_equal commits, [5, 4, 3, 2, 1]
17
17
  end
18
18
 
19
19
  it 'test_log_parser' do
@@ -37,22 +37,22 @@ describe 'SvnParser' do
37
37
  revs = OhlohScm::SvnParser.parse(sample_log)
38
38
 
39
39
  assert revs
40
- revs.size.must_equal 3
41
-
42
- revs[0].token.must_equal 1
43
- revs[0].committer_name.must_equal 'robin'
44
- revs[0].message.must_equal "Initial Checkin\n" # Note \n at end of comment
45
- revs[0].committer_date.must_equal Time.utc(2006, 6, 11, 18, 28, 0o0)
46
-
47
- revs[1].token.must_equal 2
48
- revs[1].committer_name.must_equal 'jason'
49
- revs[1].message.must_equal 'added makefile' # Note no \n at end of comment
50
- revs[1].committer_date.must_equal Time.utc(2006, 6, 11, 18, 32, 13)
51
-
52
- revs[2].token.must_equal 3
53
- revs[2].committer_name.must_equal 'robin'
54
- revs[2].message.must_equal 'added some documentation and licensing info'
55
- revs[2].committer_date.must_equal Time.utc(2006, 6, 11, 18, 34, 17)
40
+ assert_equal revs.size, 3
41
+
42
+ assert_equal revs[0].token, 1
43
+ assert_equal revs[0].committer_name, 'robin'
44
+ assert_equal revs[0].message, "Initial Checkin\n" # Note \n at end of comment
45
+ assert_equal revs[0].committer_date, Time.utc(2006, 6, 11, 18, 28, 0o0)
46
+
47
+ assert_equal revs[1].token, 2
48
+ assert_equal revs[1].committer_name, 'jason'
49
+ assert_equal revs[1].message, 'added makefile' # Note no \n at end of comment
50
+ assert_equal revs[1].committer_date, Time.utc(2006, 6, 11, 18, 32, 13)
51
+
52
+ assert_equal revs[2].token, 3
53
+ assert_equal revs[2].committer_name, 'robin'
54
+ assert_equal revs[2].message, 'added some documentation and licensing info'
55
+ assert_equal revs[2].committer_date, Time.utc(2006, 6, 11, 18, 34, 17)
56
56
  end
57
57
 
58
58
  # This is an excerpt from the log for Wireshark. It includes Subversion log excerpts in
@@ -95,10 +95,10 @@ describe 'SvnParser' do
95
95
  revs = OhlohScm::SvnParser.parse(log)
96
96
 
97
97
  assert revs
98
- revs.size.must_equal 2
98
+ assert_equal revs.size, 2
99
99
 
100
- revs[0].token.must_equal 21_932
101
- revs[1].token.must_equal 21_931
100
+ assert_equal revs[0].token, 21_932
101
+ assert_equal revs[1].token, 21_931
102
102
 
103
103
  comment = <<~COMMENT
104
104
  Update from samba tree revision 23054 to 23135
@@ -123,7 +123,7 @@ describe 'SvnParser' do
123
123
  ------------------------------------------------------------------------
124
124
  ============================ Samba log end ==============
125
125
  COMMENT
126
- revs[0].message.must_equal comment
126
+ assert_equal revs[0].message, comment
127
127
  end
128
128
 
129
129
  it 'test_svn_copy' do
@@ -137,10 +137,10 @@ describe 'SvnParser' do
137
137
  LOG
138
138
 
139
139
  commits = OhlohScm::SvnParser.parse(log)
140
- commits.size.must_equal 1
141
- commits.first.diffs.size.must_equal 1
142
- commits.first.diffs.first.path.must_equal '/trunk'
143
- commits.first.diffs.first.from_path.must_equal '/branches/development'
144
- commits.first.diffs.first.from_revision.must_equal 7
140
+ assert_equal commits.size, 1
141
+ assert_equal commits.first.diffs.size, 1
142
+ assert_equal commits.first.diffs.first.path, '/trunk'
143
+ assert_equal commits.first.diffs.first.from_path, '/branches/development'
144
+ assert_equal commits.first.diffs.first.from_revision, 7
145
145
  end
146
146
  end
@@ -7,7 +7,7 @@ describe 'System' do
7
7
  end
8
8
 
9
9
  it 'must raise an exception when command fails' do
10
- -> { run_p('ls /tmp/foobartest') }.must_raise(Exception)
10
+ assert_raises(Exception) { run_p('ls /tmp/foobartest') }
11
11
  end
12
12
  end
13
13
 
@@ -15,9 +15,9 @@ describe 'System' do
15
15
  it 'must provide error and exitstatus' do
16
16
  cmd = %q(ruby -e" t = 'Hello World'; STDOUT.puts t; STDERR.puts t ")
17
17
  stdout, stderr, status = run_with_error_p(cmd)
18
- status.exitstatus.must_equal 0
19
- stdout.must_equal "Hello World\n"
20
- stderr.must_equal "Hello World\n"
18
+ assert_equal status.exitstatus, 0
19
+ assert_equal stdout, "Hello World\n"
20
+ assert_equal stderr, "Hello World\n"
21
21
  end
22
22
  end
23
23
 
@@ -26,7 +26,7 @@ describe 'System' do
26
26
  level = (1..5).to_a.sample
27
27
  OhlohScm::System.logger.level = level
28
28
  core = OhlohScm::Factory.get_core(scm_type: :git, url: 'foo')
29
- core.scm.send(:logger).level.must_equal level
29
+ assert_equal core.scm.send(:logger).level, level
30
30
  end
31
31
  end
32
32
  end
@@ -4,6 +4,6 @@ require 'spec_helper'
4
4
 
5
5
  describe 'Version' do
6
6
  it 'must return the version string' do
7
- OhlohScm::Version::STRING.must_be_instance_of String
7
+ assert OhlohScm::Version::STRING.is_a?(String)
8
8
  end
9
9
  end
@@ -12,20 +12,20 @@ describe 'string_encoder' do
12
12
  end
13
13
 
14
14
  it 'preserve length of translated content' do
15
- file_path = FIXTURES_DIR + '/sample-content'
15
+ file_path = "#{FIXTURES_DIR}/sample-content"
16
16
  original_content_length = File.size(file_path)
17
17
  original_content_lines = File.readlines(file_path).size
18
18
 
19
- output = `cat #{ file_path } | #{ @object.string_encoder }`
19
+ output = `cat #{file_path} | #{@object.string_encoder}`
20
20
 
21
21
  assert_equal original_content_length, output.length
22
22
  assert_equal original_content_lines, output.split("\n").length
23
23
  end
24
24
 
25
25
  it 'must convert invalid characters' do
26
- invalid_utf8_word_path = FIXTURES_DIR + '/invalid-utf-word'
26
+ invalid_utf8_word_path = "#{FIXTURES_DIR}/invalid-utf-word"
27
27
 
28
- string = `cat #{ invalid_utf8_word_path } | #{ @object.string_encoder }`
28
+ string = `cat #{invalid_utf8_word_path} | #{@object.string_encoder}`
29
29
 
30
30
  assert_equal true, string.valid_encoding?
31
31
  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: 4.0.4
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenHub Team at Synopsys
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-17 00:00:00.000000000 Z
11
+ date: 2025-08-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  The OpenHub source control management library for \
@@ -97,6 +97,7 @@ files:
97
97
  - lib/ohloh_scm/validation.rb
98
98
  - lib/ohloh_scm/version.rb
99
99
  - ohloh_scm.gemspec
100
+ - security.md
100
101
  - spec/.rubocop.yml
101
102
  - spec/benchmarks/hg_bzr_bash_vs_py_api.rb
102
103
  - spec/benchmarks/process_spawn_benchmark.rb
@@ -185,89 +186,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
185
186
  requirements:
186
187
  - - ">="
187
188
  - !ruby/object:Gem::Version
188
- version: '0'
189
+ version: 3.0.0
189
190
  required_rubygems_version: !ruby/object:Gem::Requirement
190
191
  requirements:
191
192
  - - ">="
192
193
  - !ruby/object:Gem::Version
193
194
  version: '0'
194
195
  requirements: []
195
- rubygems_version: 3.0.3.1
196
- signing_key:
196
+ rubygems_version: 3.3.27
197
+ signing_key:
197
198
  specification_version: 4
198
199
  summary: Source Control Management
199
- test_files:
200
- - spec/.rubocop.yml
201
- - spec/benchmarks/hg_bzr_bash_vs_py_api.rb
202
- - spec/benchmarks/process_spawn_benchmark.rb
203
- - spec/helpers/assert_scm_attr_helper.rb
204
- - spec/helpers/commit_tokens_helper.rb
205
- - spec/helpers/generic_helper.rb
206
- - spec/helpers/repository_helper.rb
207
- - spec/helpers/system_helper.rb
208
- - spec/ohloh_scm/activity_spec.rb
209
- - spec/ohloh_scm/bzr/activity_spec.rb
210
- - spec/ohloh_scm/bzr/scm_spec.rb
211
- - spec/ohloh_scm/bzr/validation_spec.rb
212
- - spec/ohloh_scm/cvs/activity_spec.rb
213
- - spec/ohloh_scm/cvs/scm_spec.rb
214
- - spec/ohloh_scm/cvs/validation_spec.rb
215
- - spec/ohloh_scm/factory_spec.rb
216
- - spec/ohloh_scm/git/activity_spec.rb
217
- - spec/ohloh_scm/git/scm_spec.rb
218
- - spec/ohloh_scm/git/status_spec.rb
219
- - spec/ohloh_scm/git/validation_spec.rb
220
- - spec/ohloh_scm/git_svn/activity_spec.rb
221
- - spec/ohloh_scm/git_svn/scm_spec.rb
222
- - spec/ohloh_scm/hg/activity_spec.rb
223
- - spec/ohloh_scm/hg/scm_spec.rb
224
- - spec/ohloh_scm/hg/status_spec.rb
225
- - spec/ohloh_scm/hg/validation_spec.rb
226
- - spec/ohloh_scm/parser/array_writer_spec.rb
227
- - spec/ohloh_scm/parser/branch_number_spec.rb
228
- - spec/ohloh_scm/parser/cvs_parser_spec.rb
229
- - spec/ohloh_scm/parser/git_parser_spec.rb
230
- - spec/ohloh_scm/parser/hg_parser_spec.rb
231
- - spec/ohloh_scm/svn/activity_spec.rb
232
- - spec/ohloh_scm/svn/scm_spec.rb
233
- - spec/ohloh_scm/svn/validation_spec.rb
234
- - spec/ohloh_scm/svn_parser_spec.rb
235
- - spec/ohloh_scm/system_spec.rb
236
- - spec/ohloh_scm/version_spec.rb
237
- - spec/raw_fixtures/basic.rlog
238
- - spec/raw_fixtures/file_created_on_branch.rlog
239
- - spec/raw_fixtures/invalid-utf-word
240
- - spec/raw_fixtures/multiple_revisions.rlog
241
- - spec/raw_fixtures/sample-content
242
- - spec/raw_fixtures/simple.ohlog
243
- - spec/raw_fixtures/simple.svn_log
244
- - spec/raw_fixtures/simultaneous_checkins.rlog
245
- - spec/raw_fixtures/simultaneous_checkins_2.rlog
246
- - spec/scm_fixtures/bzr.tgz
247
- - spec/scm_fixtures/bzr_colon.tgz
248
- - spec/scm_fixtures/bzr_large.tgz
249
- - spec/scm_fixtures/bzr_with_authors.tgz
250
- - spec/scm_fixtures/bzr_with_branch.tgz
251
- - spec/scm_fixtures/bzr_with_invalid_encoding.tgz
252
- - spec/scm_fixtures/bzr_with_nested_branches.tgz
253
- - spec/scm_fixtures/bzr_with_subdirectories.tgz
254
- - spec/scm_fixtures/cvs.tgz
255
- - spec/scm_fixtures/git.tgz
256
- - spec/scm_fixtures/git_dupe_delete.tgz
257
- - spec/scm_fixtures/git_svn.tgz
258
- - spec/scm_fixtures/git_walk.tgz
259
- - spec/scm_fixtures/git_with_invalid_encoding.tgz
260
- - spec/scm_fixtures/git_with_master_tag.tgz
261
- - spec/scm_fixtures/git_with_multiple_branch.tgz
262
- - spec/scm_fixtures/git_with_mv.tgz
263
- - spec/scm_fixtures/git_with_null_merge.tgz
264
- - spec/scm_fixtures/git_with_submodules.tgz
265
- - spec/scm_fixtures/hg.tgz
266
- - spec/scm_fixtures/hg_dupe_delete.tgz
267
- - spec/scm_fixtures/hg_large.tgz
268
- - spec/scm_fixtures/hg_walk.tgz
269
- - spec/scm_fixtures/hg_with_invalid_encoding.tgz
270
- - spec/scm_fixtures/svn.tgz
271
- - spec/scm_fixtures/svn_subdir.tgz
272
- - spec/spec_helper.rb
273
- - spec/string_encoder_spec.rb
200
+ test_files: []