ohloh_scm 2.4.0 → 2.4.1

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: 5f2741be982e5a3ff6682d155224b0fda48d96d0
4
- data.tar.gz: 5c2a84c08c7e2b65c82e6c46bac0239b19457b6c
3
+ metadata.gz: e8d51dc67baf8863f7210a845fdcaf36f198839d
4
+ data.tar.gz: 88a4858964e5e0ce728fb8dab1a520d7174c2036
5
5
  SHA512:
6
- metadata.gz: 9daaef7667bdb94b8a244e462dfc90152c6a36ed3301e4bf9180037a88b8685217ec6495baca24f31d3c6c6c6b2ef1cffe67d45c46338f7c02f7d66eb60ddbc3
7
- data.tar.gz: 0e08308d709fa671b3ca42b345f471eaa038eac5b191d22e55f7c3798aa67f97d63a865cd9afab44ff6ec1b7a649de89d1213d20eb719f5a8c0aacefe5e4f3e6
6
+ metadata.gz: bb9a2b2051ba005758c45f78fb0e1dc9d2761424e88e928a8b5b45b7d879e7b6847f0f8d17d621ff315a194ff1eb7eb479e4c906136ab4f7048b710b4ef4a1b9
7
+ data.tar.gz: 4a430f3725a3edcf569895cc2df0a100f39692c32eba26c357c9aa5deb1dc637d5aec8acb35f01a28aab67cc46551e6a0feaeb519aef87c5f4252fef7badfe42
@@ -10,5 +10,6 @@ install:
10
10
  - gem install posix-spawn
11
11
  - gem install nokogiri -v 1.8.1
12
12
  - gem install test-unit -v 3.2.7
13
+ - sudo apt-get install expect
13
14
  before_script:
14
15
  - cd $TRAVIS_BUILD_DIR
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/expect -f
2
+
3
+ set OPTS [lindex $argv 0]
4
+ set URL [lindex $argv 1]
5
+
6
+ set timeout 10
7
+
8
+ spawn svn info "$OPTS" "$URL"
9
+
10
+ expect {
11
+ "(R)eject, accept (t)emporarily or accept (p)ermanently? " { send "p\r"; }
12
+ }
@@ -9,5 +9,8 @@ module OhlohScm::Adapters
9
9
  []
10
10
  end
11
11
 
12
+ def escape_single_quote(str)
13
+ str.to_s.gsub("'", "'\''")
14
+ end
12
15
  end
13
16
  end
@@ -11,7 +11,7 @@ module OhlohScm::Adapters
11
11
  private
12
12
 
13
13
  def cat(revision, file_path)
14
- run("cd #{self.url} && git show #{ revision }:'#{ file_path }'").strip
14
+ run("cd #{self.url} && git show #{ revision }:'#{ escape_single_quote(file_path) }'").strip
15
15
  end
16
16
 
17
17
  def git_commit(commit)
@@ -15,6 +15,7 @@ module OhlohScm::Adapters
15
15
  yield(0, 1) if block_given?
16
16
 
17
17
  if FileTest.exist?(git_path)
18
+ accept_certificate_if_prompted
18
19
  fetch(&block)
19
20
  else
20
21
  clone(&block)
@@ -43,7 +44,13 @@ module OhlohScm::Adapters
43
44
  def accept_certificate_if_prompted
44
45
  # git svn does not support non iteractive and serv-certificate options
45
46
  # Permanently accept svn certificate when it prompts
46
- run "echo p | svn info #{username_opts} #{password_opts} '#{ @source_scm.url }'"
47
+ opts = "#{username_opts} #{password_opts}"
48
+ opts = '--xml' if opts.strip.empty?
49
+ run "#{accept_ssl_certificate_cmd} '#{opts}' '#{@source_scm.url}'"
50
+ end
51
+
52
+ def accept_ssl_certificate_cmd
53
+ File.expand_path('../../../../../bin/accept_svn_ssl_certificate', __FILE__)
47
54
  end
48
55
 
49
56
  def password_prompt
@@ -22,7 +22,9 @@ module OhlohScm::Adapters
22
22
  def tags
23
23
  tag_strings = run("cd '#{path}' && hg tags").split(/\n/)
24
24
  tag_strings.map do |tag_string|
25
- tag_name, rev_number_and_hash = tag_string.split(/\s+/)
25
+ parsed_str = tag_string.split(' ')
26
+ rev_number_and_hash = parsed_str.pop
27
+ tag_name = parsed_str.join(' ')
26
28
  rev = rev_number_and_hash.slice(/\A\d+/)
27
29
  time_string = run("cd '#{ path }' && hg log -r #{ rev } | grep 'date:' | sed 's/date://'")
28
30
  [tag_name, rev, Time.parse(time_string)]
@@ -1,5 +1,5 @@
1
1
  module OhlohScm
2
2
  module Version
3
- STRING = '2.4.0'
3
+ STRING = '2.4.1'
4
4
  end
5
5
  end
Binary file
@@ -40,7 +40,8 @@ module OhlohScm::Adapters
40
40
  def test_tags
41
41
  with_hg_repository('hg') do |hg|
42
42
  time = Time.parse('Fri Jul 22 18:00:18 2016 +0530')
43
- assert_equal [['tip', '5', time]], hg.tags
43
+ assert_equal ['tip', '5', time], hg.tags.first
44
+ assert_equal ['tagname with space', '2'], hg.tags.last.first(2)
44
45
  end
45
46
  end
46
47
  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.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - BlackDuck Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-15 00:00:00.000000000 Z
11
+ date: 2018-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: posix-spawn
@@ -69,6 +69,7 @@ description: The Ohloh source control management library for interacting with Gi
69
69
  email:
70
70
  - info@openhub.net
71
71
  executables:
72
+ - accept_svn_ssl_certificate
72
73
  - ohlog
73
74
  - string_encoder
74
75
  extensions: []
@@ -83,6 +84,7 @@ files:
83
84
  - COPYING
84
85
  - README.md
85
86
  - Rakefile
87
+ - bin/accept_svn_ssl_certificate
86
88
  - bin/ohlog
87
89
  - bin/string_encoder
88
90
  - lib/ohloh_scm.rb