ohloh_scm 3.0.5 → 3.0.10

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
  SHA256:
3
- metadata.gz: b11f981c7254d3f740cc89cf98c8214622f5eb971a191a71fb8eea4c01b5c434
4
- data.tar.gz: 10729adb8d48eb1e19daaba54f70bf8f13679f023875b9d001d12f470f5cee99
3
+ metadata.gz: 916431fb0c2dc54193b858fe60a21e9231a1a39c425a351ea81c4d525ab1ecab
4
+ data.tar.gz: d63c471089147438d8c674b934893106954a5666a01b00dcba89a6480e5fb334
5
5
  SHA512:
6
- metadata.gz: fcbac1368d1c58e7aa8a18473c1893d5438025c31e7caff8da4621b63c3f02272d5ac3742a4851ed89aa199351cfb4390638aa0387639030a1002417dd39c6da
7
- data.tar.gz: 1cbc4944d0b7345d5613f4a1f9d4bfd61287513f87d808bc2a03eef901d902dcdddcc8ae8103db60b7236e8760af307e0bf8de8b4dbb2435668ff032e6b2fbf6
6
+ metadata.gz: e3fe22f644dbf5827384a0991208e8d6863271ea316399efc51b1da6e65c23181e2e108065b897c9fb25d390f754dcd21a20ebc860b7bda5d15671e293ca8b29
7
+ data.tar.gz: abd36a5cbe1e95488d90b32221ed056656f9962bc9c839151128234f9524f76131d14f5d50b180044397dc46900c328a598d18fecf85a63ef4be6b73dfd41b8b
data/Gemfile CHANGED
@@ -11,5 +11,4 @@ group :development do
11
11
  gem 'rubocop', '~> 0.67'
12
12
  gem 'rubocop-performance'
13
13
  gem 'simplecov'
14
- gem 'rspec'
15
14
  end
@@ -3,7 +3,6 @@ GEM
3
3
  specs:
4
4
  ast (2.4.0)
5
5
  byebug (11.0.1)
6
- diff-lcs (1.3)
7
6
  docile (1.3.1)
8
7
  jaro_winkler (1.5.2)
9
8
  json (2.2.0)
@@ -20,19 +19,6 @@ GEM
20
19
  psych (3.1.0)
21
20
  rainbow (3.0.0)
22
21
  rake (12.3.2)
23
- rspec (3.8.0)
24
- rspec-core (~> 3.8.0)
25
- rspec-expectations (~> 3.8.0)
26
- rspec-mocks (~> 3.8.0)
27
- rspec-core (3.8.2)
28
- rspec-support (~> 3.8.0)
29
- rspec-expectations (3.8.4)
30
- diff-lcs (>= 1.2.0, < 2.0)
31
- rspec-support (~> 3.8.0)
32
- rspec-mocks (3.8.1)
33
- diff-lcs (>= 1.2.0, < 2.0)
34
- rspec-support (~> 3.8.0)
35
- rspec-support (3.8.2)
36
22
  rubocop (0.67.2)
37
23
  jaro_winkler (~> 1.5.1)
38
24
  parallel (~> 1.10)
@@ -60,7 +46,6 @@ DEPENDENCIES
60
46
  mocha
61
47
  nokogiri
62
48
  rake
63
- rspec
64
49
  rubocop (~> 0.67)
65
50
  rubocop-performance
66
51
  simplecov
@@ -23,7 +23,7 @@ module OhlohScm
23
23
  # rubocop:enable Metrics/MethodLength
24
24
 
25
25
  def export_tag(dest_dir, tag_name)
26
- run "cd '#{path}' && bzr export -r #{tag_name} #{dest_dir}"
26
+ run "cd '#{url}' && bzr export -r #{tag_name} #{dest_dir}"
27
27
  end
28
28
 
29
29
  def export(dest_dir, token = head_token)
@@ -27,7 +27,7 @@ module OhlohScm
27
27
 
28
28
  def clone_or_fetch(remote_scm, callback)
29
29
  callback.update(0, 1)
30
- if status.branch?(branch_name)
30
+ if status.exist? && status.branch?(branch_name)
31
31
  clean_and_checkout_branch # must be on correct branch, but we want to be careful.
32
32
  fetch_new_commits(remote_scm)
33
33
  else
@@ -43,7 +43,7 @@ module OhlohScm
43
43
  end
44
44
 
45
45
  def clone_and_create_tracking_branch(remote_scm)
46
- unless status.scm_dir_exist?
46
+ unless status.exist?
47
47
  run "rm -rf '#{url}'"
48
48
  run "git clone -q -n '#{remote_scm.url}' '#{url}'"
49
49
  end
@@ -58,8 +58,8 @@ module OhlohScm
58
58
  run "cd '#{url}' && git clean -f -d -x"
59
59
  return unless status.branch?(branch_name)
60
60
 
61
- run "cd '#{url}' && git reset --hard HEAD"
62
61
  run "cd '#{url}' && git checkout #{branch_name} --"
62
+ run "cd '#{url}' && git reset --hard heads/#{branch_name} --"
63
63
  end
64
64
 
65
65
  def create_tracking_branch(branch_name)
@@ -3,10 +3,16 @@
3
3
  module OhlohScm
4
4
  module Git
5
5
  class Validation < OhlohScm::Validation
6
+ def validate
7
+ super
8
+ @errors << [:branch_name, 'Invalid Branch Name.'] if scm.branch_name.to_s.empty?
9
+ end
10
+
6
11
  private
7
12
 
8
13
  def validate_server_connection
9
- msg = "The server did not respond to the 'git-ls-remote' command. Is the URL correct?"
14
+ msg = "The server did not respond to the 'git-ls-remote' command."
15
+ msg << ' Are the URL and Branch fields correct?'
10
16
  @errors << [:failed, msg] unless status.exist?
11
17
  end
12
18
 
@@ -40,6 +40,10 @@ module OhlohScm
40
40
  cat("#{git_commit(commit)}^", diff.path)
41
41
  end
42
42
 
43
+ def git_commit(commit)
44
+ run("cd #{url} && git svn find-rev r#{commit.token}").strip
45
+ end
46
+
43
47
  private
44
48
 
45
49
  def open_log_file(opts = {})
@@ -72,10 +76,6 @@ module OhlohScm
72
76
  run("cd #{url} && git show #{revision}:#{file_path.shellescape}").strip
73
77
  end
74
78
 
75
- def git_commit(commit)
76
- run("cd #{url} && git svn find-rev r#{commit.token}").strip
77
- end
78
-
79
79
  def git_svn_log_cmd
80
80
  "cd #{url} && git svn log"
81
81
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module OhlohScm
4
4
  module Version
5
- STRING = '3.0.5'
5
+ STRING = '3.0.10'
6
6
  GIT = '2.17.1'
7
7
  SVN = '1.9.7'
8
8
  CVSNT = '2.5.04'
@@ -1,5 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'byebug'
3
2
 
4
3
  describe 'Git::Scm' do
5
4
  it 'must pull git repository' do
@@ -27,7 +26,6 @@ describe 'Git::Scm' do
27
26
  remote_master_branch_sha = `cd #{dest_dir} && git rev-parse origin/master`
28
27
  master_branch_sha = `cd #{dest_dir} && git rev-parse master`
29
28
  test_branch_sha = `cd #{dest_dir} && git rev-parse test`
30
- byebug
31
29
 
32
30
  master_branch_sha.wont_equal test_branch_sha
33
31
  master_branch_sha.must_equal remote_master_branch_sha
@@ -7,6 +7,10 @@ describe 'Git::Validation' do
7
7
  core.errors.must_be :empty?
8
8
  end
9
9
 
10
+ it 'must have errors for no branch_name' do
11
+ get_core(:git, branch_name: '').validation.send(:branch_name_errors).wont_be :empty?
12
+ end
13
+
10
14
  it 'must have errors for invalid branch_name' do
11
15
  get_core(:git, branch_name: 'x' * 81).validation.send(:branch_name_errors).wont_be :empty?
12
16
  get_core(:git, branch_name: 'foo@bar').validation.send(:branch_name_errors).wont_be :empty?
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: 3.0.5
4
+ version: 3.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenHub Team at Synopsys
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-13 00:00:00.000000000 Z
11
+ date: 2020-09-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  The OpenHub source control management library for \
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  - !ruby/object:Gem::Version
191
191
  version: '0'
192
192
  requirements: []
193
- rubygems_version: 3.0.2
193
+ rubygems_version: 3.0.3
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: Source Control Management