ohloh_scm 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +15 -0
- data/lib/ohloh_scm/activity.rb +3 -2
- data/lib/ohloh_scm/core.rb +4 -0
- data/lib/ohloh_scm/git/scm.rb +4 -2
- data/lib/ohloh_scm/git_svn/activity.rb +3 -2
- data/lib/ohloh_scm/scm.rb +1 -1
- data/lib/ohloh_scm/version.rb +1 -1
- data/spec/ohloh_scm/activity_spec.rb +20 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb6ebfb6e6f3ee258e4e3c5042c3673e3ed94101e3c84f9cdfd751373a4b0ea6
|
4
|
+
data.tar.gz: dd605cfd3fca5d5c0720358e71027cf3add2f4bbf4f0eebb6627d4da9efa7bd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dcfb8c8757ecd79290c483682ab1fbaf349f4a71f54fe26a78e954cbde66584145e90eb762d45d06f8cf1b9179d11e962012a6370dbea714350d390203cb4ff
|
7
|
+
data.tar.gz: 712a961eec10b7346b92b4dc851be4b2bfaf1b99c6eeeee23030cb3d99cd7bc147ca1a1d13dfa29160fcbd1632d8efcf00e9cdfc60a1298ea4bb0eafa365ae34
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -3,6 +3,7 @@ GEM
|
|
3
3
|
specs:
|
4
4
|
ast (2.4.0)
|
5
5
|
byebug (11.0.1)
|
6
|
+
diff-lcs (1.3)
|
6
7
|
docile (1.3.1)
|
7
8
|
jaro_winkler (1.5.2)
|
8
9
|
json (2.2.0)
|
@@ -19,6 +20,19 @@ GEM
|
|
19
20
|
psych (3.1.0)
|
20
21
|
rainbow (3.0.0)
|
21
22
|
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)
|
22
36
|
rubocop (0.67.2)
|
23
37
|
jaro_winkler (~> 1.5.1)
|
24
38
|
parallel (~> 1.10)
|
@@ -46,6 +60,7 @@ DEPENDENCIES
|
|
46
60
|
mocha
|
47
61
|
nokogiri
|
48
62
|
rake
|
63
|
+
rspec
|
49
64
|
rubocop (~> 0.67)
|
50
65
|
rubocop-performance
|
51
66
|
simplecov
|
data/lib/ohloh_scm/activity.rb
CHANGED
@@ -5,14 +5,15 @@ module OhlohScm
|
|
5
5
|
include OhlohScm::System
|
6
6
|
extend Forwardable
|
7
7
|
def_delegators :@core, :scm, :status
|
8
|
-
def_delegators :scm, :url
|
8
|
+
def_delegators :scm, :url, :temp_dir
|
9
9
|
|
10
10
|
def initialize(core)
|
11
11
|
@core = core
|
12
12
|
end
|
13
13
|
|
14
14
|
def log_filename
|
15
|
-
|
15
|
+
tmp_dir = temp_dir || Dir.tmpdir
|
16
|
+
File.join(tmp_dir, url.gsub(/\W/, '') + '.log')
|
16
17
|
end
|
17
18
|
|
18
19
|
def tags; end
|
data/lib/ohloh_scm/core.rb
CHANGED
data/lib/ohloh_scm/git/scm.rb
CHANGED
@@ -43,8 +43,10 @@ module OhlohScm
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def clone_and_create_tracking_branch(remote_scm)
|
46
|
-
|
47
|
-
|
46
|
+
unless status.scm_dir_exist?
|
47
|
+
run "rm -rf '#{url}'"
|
48
|
+
run "git clone -q -n '#{remote_scm.url}' '#{url}'"
|
49
|
+
end
|
48
50
|
create_tracking_branch(remote_scm.branch_name) # ensure the correct branch exists locally
|
49
51
|
clean_and_checkout_branch # switch to the correct branch
|
50
52
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module OhlohScm
|
4
4
|
module GitSvn
|
5
5
|
class Activity < OhlohScm::Activity
|
6
|
-
def_delegators :scm, :url
|
6
|
+
def_delegators :scm, :url, :temp_dir
|
7
7
|
|
8
8
|
def commit_count(opts = {})
|
9
9
|
cmd = "#{after_revision(opts)} | grep -E -e '^r[0-9]+.*lines$' | wc -l"
|
@@ -49,7 +49,8 @@ module OhlohScm
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def log_filename
|
52
|
-
|
52
|
+
tmp_dir = temp_dir || '/tmp'
|
53
|
+
File.join(tmp_dir, url.gsub(/\W/, '') + '.log')
|
53
54
|
end
|
54
55
|
|
55
56
|
def after_revision(opts)
|
data/lib/ohloh_scm/scm.rb
CHANGED
@@ -6,7 +6,7 @@ module OhlohScm
|
|
6
6
|
extend Forwardable
|
7
7
|
def_delegators :@core, :status, :activity
|
8
8
|
attr_reader :url, :username, :password
|
9
|
-
attr_accessor :branch_name
|
9
|
+
attr_accessor :branch_name, :temp_dir
|
10
10
|
|
11
11
|
def initialize(core:, url:, branch_name: nil, username: nil, password: nil)
|
12
12
|
@core = core
|
data/lib/ohloh_scm/version.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe 'Activity' do
|
6
|
+
describe 'log_filename' do
|
7
|
+
it 'should return system tmp dir path' do
|
8
|
+
core = get_core(:git)
|
9
|
+
scm = OhlohScm::Activity.new(core)
|
10
|
+
scm.log_filename.must_equal "#{Dir.tmpdir}/foobar.log"
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should return temp folder path' do
|
14
|
+
core = get_core(:git)
|
15
|
+
core.temp_dir = '/test'
|
16
|
+
scm = OhlohScm::Activity.new(core)
|
17
|
+
scm.log_filename.must_equal '/test/foobar.log'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
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: 3.0.
|
4
|
+
version: 3.0.3
|
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-07-
|
11
|
+
date: 2019-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
The OpenHub source control management library for \
|
@@ -103,6 +103,7 @@ files:
|
|
103
103
|
- spec/helpers/generic_helper.rb
|
104
104
|
- spec/helpers/repository_helper.rb
|
105
105
|
- spec/helpers/system_helper.rb
|
106
|
+
- spec/ohloh_scm/activity_spec.rb
|
106
107
|
- spec/ohloh_scm/bzr/activity_spec.rb
|
107
108
|
- spec/ohloh_scm/bzr/scm_spec.rb
|
108
109
|
- spec/ohloh_scm/bzr/validation_spec.rb
|
@@ -189,8 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
190
|
- !ruby/object:Gem::Version
|
190
191
|
version: '0'
|
191
192
|
requirements: []
|
192
|
-
|
193
|
-
rubygems_version: 2.7.6
|
193
|
+
rubygems_version: 3.0.2
|
194
194
|
signing_key:
|
195
195
|
specification_version: 4
|
196
196
|
summary: Source Control Management
|
@@ -203,6 +203,7 @@ test_files:
|
|
203
203
|
- spec/helpers/generic_helper.rb
|
204
204
|
- spec/helpers/repository_helper.rb
|
205
205
|
- spec/helpers/system_helper.rb
|
206
|
+
- spec/ohloh_scm/activity_spec.rb
|
206
207
|
- spec/ohloh_scm/bzr/activity_spec.rb
|
207
208
|
- spec/ohloh_scm/bzr/scm_spec.rb
|
208
209
|
- spec/ohloh_scm/bzr/validation_spec.rb
|