ohloh_scm 3.0.16 → 3.0.17

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: a9497b7b0c42cdc606034e2b8aa0307dae5da9cfe6be3f371fb8043e6c4001d2
4
- data.tar.gz: 822e2cc571a191231fd441519ba059c86494977bb7403edc83605d7f3d8dd221
3
+ metadata.gz: 376633ab1bce231fd0d3dbcb685a6270c6f90b41bb99f2e4062965a2011476b4
4
+ data.tar.gz: 159827abd46fd1f87d7c85cb226ea410071ba6d8a6e73c2db0a598c2f44d1465
5
5
  SHA512:
6
- metadata.gz: 1303a8d011f502ac2c962467e1c1593093255cd31c4ef567a4bbabf89eef10fdcaf409ae30388494c39feb885894de2c991b8e4de7bb6ebc02f954b2794ab930
7
- data.tar.gz: 4c5d7fbae432815703ddcb0eade08d19a4c41c163366c3d957672aeca3d82eb34348735ea00b4dc5a02c24fcc13ed492be0e3c3cf451cf62d6a3c0d60fe6f794
6
+ metadata.gz: 520a3bc2a9c827959f715ad2febf37df9f63ef9f817743c0b9e82d69f486632b2cbf7b72d89c604848b1680d5ab37aa15f8b58c3408da0b90960f504a14d451a
7
+ data.tar.gz: a346e6eb4db5eb8e69ed3e8dbe66043c3a69350bfc8760abffbbd8202b9bb8f4e58099a8ae6279adec67a4d897be3052e822838c3eb5aa7e638ddfc63e42a791
@@ -19,6 +19,10 @@ module OhlohScm
19
19
  def vcs_path
20
20
  "#{url}/.bzr"
21
21
  end
22
+
23
+ def checkout_files(_names)
24
+ # Files are already checked out.
25
+ end
22
26
  end
23
27
  end
24
28
  end
@@ -23,6 +23,11 @@ module OhlohScm
23
23
  "#{url}/.git"
24
24
  end
25
25
 
26
+ def checkout_files(names)
27
+ filenames = names.map { |name| "*#{name}" }.join(' ')
28
+ run "cd #{url} && git checkout $(git ls-files #{filenames})"
29
+ end
30
+
26
31
  private
27
32
 
28
33
  def clone_or_fetch(remote_scm, callback)
@@ -72,7 +77,6 @@ module OhlohScm
72
77
  # Deletes everything but the *.git* folder in the working directory.
73
78
  def clean_up_disk
74
79
  return unless Dir.exist?(url)
75
- sleep 1
76
80
 
77
81
  run "cd #{url} && find . -maxdepth 1 -not -name .git -not -name . -print0"\
78
82
  ' | xargs -0 rm -rf --'
@@ -21,6 +21,11 @@ module OhlohScm
21
21
  "#{url}/.git"
22
22
  end
23
23
 
24
+ def checkout_files(names)
25
+ filenames = names.map { |name| "*#{name}" }.join(' ')
26
+ run "cd #{url} && git checkout $(git ls-files #{filenames})"
27
+ end
28
+
24
29
  private
25
30
 
26
31
  def convert_to_git(callback)
@@ -82,7 +87,6 @@ module OhlohScm
82
87
 
83
88
  def clean_up_disk
84
89
  return unless File.exist?(url)
85
- sleep 1
86
90
 
87
91
  run "cd #{url} && find . -maxdepth 1 -not -name .git -not -name . -print0"\
88
92
  ' | xargs -0 rm -rf --'
@@ -18,6 +18,11 @@ module OhlohScm
18
18
  "#{url}/.hg"
19
19
  end
20
20
 
21
+ def checkout_files(names)
22
+ pattern = "(#{ names.join('|') })"
23
+ run "cd #{url} && hg revert $(hg manifest | grep -P '#{pattern}')"
24
+ end
25
+
21
26
  private
22
27
 
23
28
  def clone_or_fetch(remote_scm, callback)
@@ -42,7 +47,6 @@ module OhlohScm
42
47
 
43
48
  def clean_up_disk
44
49
  return unless FileTest.exist?(url)
45
- sleep 1
46
50
 
47
51
  run "cd #{url} && find . -maxdepth 1 -not -name .hg -not -name . -print0"\
48
52
  ' | xargs -0 rm -rf --'
@@ -2,7 +2,7 @@
2
2
 
3
3
  module OhlohScm
4
4
  module Version
5
- STRING = '3.0.16'
5
+ STRING = '3.0.17'
6
6
  GIT = '2.17.1'
7
7
  SVN = '1.9.7'
8
8
  CVSNT = '2.5.04'
@@ -77,4 +77,17 @@ describe 'Git::Scm' do
77
77
  end
78
78
  end
79
79
  end
80
+
81
+ it 'must checkout_files matching given names' do
82
+ with_git_repository('git') do |src_core|
83
+ dir = src_core.scm.url
84
+ core = OhlohScm::Factory.get_core(scm_type: :git, url: dir)
85
+
86
+ core.scm.checkout_files(['Gemfile.lock', 'package.json', 'Godeps.json', 'doesnt-exist'])
87
+
88
+ assert system("ls #{dir}/Gemfile.lock > /dev/null")
89
+ assert system("ls #{dir}/nested/nested_again/package.json > /dev/null")
90
+ assert system("ls #{dir}/Godeps/Godeps.json > /dev/null")
91
+ end
92
+ end
80
93
  end
@@ -20,4 +20,17 @@ describe 'Hg::Scm' do
20
20
  end
21
21
  end
22
22
  end
23
+
24
+ it 'must checkout_files matching given names' do
25
+ with_git_repository('hg') do |src_core|
26
+ dir = src_core.scm.url
27
+ core = OhlohScm::Factory.get_core(scm_type: :hg, url: dir)
28
+
29
+ core.scm.checkout_files(['Gemfile.lock', 'package.json', 'Godeps.json', 'doesnt-exist'])
30
+
31
+ assert system("ls #{dir}/Gemfile.lock > /dev/null")
32
+ assert system("ls #{dir}/nested/nested_again/package.json > /dev/null")
33
+ assert system("ls #{dir}/Godeps/Godeps.json > /dev/null")
34
+ end
35
+ end
23
36
  end
Binary file
Binary file
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.16
4
+ version: 3.0.17
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: 2022-08-16 00:00:00.000000000 Z
11
+ date: 2022-09-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  The OpenHub source control management library for \
@@ -190,8 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  - !ruby/object:Gem::Version
191
191
  version: '0'
192
192
  requirements: []
193
- rubyforge_project:
194
- rubygems_version: 2.7.6
193
+ rubygems_version: 3.0.3.1
195
194
  signing_key:
196
195
  specification_version: 4
197
196
  summary: Source Control Management