ohloh_scm 2.0.1 → 2.1.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.
- checksums.yaml +7 -0
- data/.install_dependencies.sh +13 -0
- data/.ruby-version +1 -0
- data/.travis.yml +4 -0
- data/README.md +7 -0
- data/lib/ohloh_scm/adapters/bzrlib/bzrlib_pipe_client.rb +6 -4
- data/lib/ohloh_scm/adapters/bzrlib_adapter.rb +4 -4
- data/lib/ohloh_scm/adapters/hglib/client.rb +4 -2
- data/lib/ohloh_scm/shellout.rb +3 -3
- data/lib/ohloh_scm/version.rb +1 -1
- data/ohloh_scm.gemspec +2 -0
- metadata +25 -10
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 60fae1479971d5e93adf67edcc4d4154de583112
|
4
|
+
data.tar.gz: e2a25ad7fdef67f35d47bc54d016742333118d6f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 573bb4c5bd6147adc78776530a0941b63ea704afa2374462d0ee1249beb35b035195d1c7c7fdfc702a2cfc190ece8cccb9374eab33c3b5ec7165eae7d3dc4017
|
7
|
+
data.tar.gz: b7c2f9f4a4140b2825529a5b14c341aba1efef8e9b33dde80755dfd1f67bd93f5aed752a5b1e8e37e4dde3568681acce68573bede3f600c4367cb866ac1646c5
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.0.0
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -49,10 +49,17 @@ hg 1.1.2
|
|
49
49
|
If you are using CVS instead of CVSNT, you can potentially try creating
|
50
50
|
a shell alias or symlink mapping 'cvsnt' to 'cvs'.
|
51
51
|
|
52
|
+
Ohloh SCM uses [posix-spawn](https://github.com/rtomayko/posix-spawn) to
|
53
|
+
execute commands so ensure *posix-spawn* gem is installed
|
54
|
+
|
55
|
+
``gem install posix-spawn``
|
56
|
+
|
57
|
+
|
52
58
|
## Usage with Bundler
|
53
59
|
|
54
60
|
```
|
55
61
|
gem 'ohloh_scm', git: 'https://github.com/blackducksw/ohloh_scm/', require: 'scm'
|
62
|
+
gem 'posix-spawn'
|
56
63
|
```
|
57
64
|
## Running
|
58
65
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require '
|
2
|
+
require 'posix/spawn'
|
3
3
|
|
4
4
|
class BzrPipeClient
|
5
5
|
def initialize(repository_url)
|
6
6
|
@repository_url = repository_url
|
7
7
|
@py_script = File.dirname(__FILE__) + '/bzrlib_pipe_server.py'
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
def start
|
11
|
-
@pid, @stdin, @stdout, @stderr =
|
11
|
+
@pid, @stdin, @stdout, @stderr = POSIX::Spawn::popen4 "python #{@py_script}"
|
12
12
|
open_repository
|
13
13
|
end
|
14
14
|
|
@@ -27,8 +27,9 @@ class BzrPipeClient
|
|
27
27
|
# send the command
|
28
28
|
@stdin.puts cmd
|
29
29
|
@stdin.flush
|
30
|
+
return if cmd == "QUIT"
|
30
31
|
|
31
|
-
# get status on stderr, first letter indicates state,
|
32
|
+
# get status on stderr, first letter indicates state,
|
32
33
|
# remaing value indicates length of the file content
|
33
34
|
status = @stderr.read(10)
|
34
35
|
flag = status[0,1]
|
@@ -46,6 +47,7 @@ class BzrPipeClient
|
|
46
47
|
|
47
48
|
def shutdown
|
48
49
|
send_command("QUIT")
|
50
|
+
[@stdout, @stdin, @stderr].each { |io| io.close unless io.closed? }
|
49
51
|
Process.waitpid(@pid, Process::WNOHANG)
|
50
52
|
end
|
51
53
|
end
|
@@ -5,13 +5,13 @@ module OhlohScm::Adapters
|
|
5
5
|
class BzrlibAdapter < BzrAdapter
|
6
6
|
|
7
7
|
def setup
|
8
|
-
|
9
|
-
|
8
|
+
bzr_client = BzrPipeClient.new(url)
|
9
|
+
bzr_client.start
|
10
|
+
bzr_client
|
10
11
|
end
|
11
12
|
|
12
13
|
def bzr_client
|
13
|
-
|
14
|
-
return @bzr_client
|
14
|
+
@bzr_client ||= setup
|
15
15
|
end
|
16
16
|
|
17
17
|
def cleanup
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require '
|
2
|
+
require 'posix/spawn'
|
3
3
|
|
4
4
|
class HglibClient
|
5
5
|
def initialize(repository_url)
|
@@ -8,7 +8,7 @@ class HglibClient
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def start
|
11
|
-
@pid, @stdin, @stdout, @stderr =
|
11
|
+
@pid, @stdin, @stdout, @stderr = POSIX::Spawn::popen4 "python #{@py_script}"
|
12
12
|
open_repository
|
13
13
|
end
|
14
14
|
|
@@ -36,6 +36,7 @@ class HglibClient
|
|
36
36
|
# send the command
|
37
37
|
@stdin.puts cmd
|
38
38
|
@stdin.flush
|
39
|
+
return if cmd == "QUIT"
|
39
40
|
|
40
41
|
# get status on stderr, first letter indicates state,
|
41
42
|
# remaing value indicates length of the file content
|
@@ -55,6 +56,7 @@ class HglibClient
|
|
55
56
|
|
56
57
|
def shutdown
|
57
58
|
send_command("QUIT")
|
59
|
+
[@stdout, @stdin, @stderr].each { |io| io.close unless io.closed? }
|
58
60
|
Process.waitpid(@pid, Process::WNOHANG)
|
59
61
|
end
|
60
62
|
end
|
data/lib/ohloh_scm/shellout.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'stringio'
|
3
|
-
require '
|
3
|
+
require 'posix/spawn'
|
4
4
|
|
5
5
|
class Shellout
|
6
6
|
|
@@ -9,9 +9,9 @@ class Shellout
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.execute(cmd)
|
12
|
-
|
12
|
+
posix_spawn = POSIX::Spawn::Child.new(cmd)
|
13
13
|
|
14
|
-
return
|
14
|
+
return posix_spawn.status, posix_spawn.out, posix_spawn.err
|
15
15
|
end
|
16
16
|
|
17
17
|
def run(cmd)
|
data/lib/ohloh_scm/version.rb
CHANGED
data/ohloh_scm.gemspec
CHANGED
metadata
CHANGED
@@ -1,16 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ohloh_scm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
5
|
-
prerelease:
|
4
|
+
version: 2.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- BlackDuck Software
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
11
|
+
date: 2016-06-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: posix-spawn
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.3'
|
14
27
|
description: The Ohloh source control management library for interacting with Git,
|
15
28
|
SVN, CVS, Hg and Bzr repositories.
|
16
29
|
email:
|
@@ -22,6 +35,9 @@ extensions: []
|
|
22
35
|
extra_rdoc_files: []
|
23
36
|
files:
|
24
37
|
- .gitignore
|
38
|
+
- .install_dependencies.sh
|
39
|
+
- .ruby-version
|
40
|
+
- .travis.yml
|
25
41
|
- COPYING
|
26
42
|
- README.md
|
27
43
|
- Rakefile
|
@@ -594,27 +610,26 @@ files:
|
|
594
610
|
homepage: https://github.com/blackducksw/ohloh_scm/
|
595
611
|
licenses:
|
596
612
|
- GPL v2.0
|
613
|
+
metadata: {}
|
597
614
|
post_install_message:
|
598
615
|
rdoc_options: []
|
599
616
|
require_paths:
|
600
617
|
- lib
|
601
618
|
required_ruby_version: !ruby/object:Gem::Requirement
|
602
|
-
none: false
|
603
619
|
requirements:
|
604
|
-
- -
|
620
|
+
- - '>='
|
605
621
|
- !ruby/object:Gem::Version
|
606
622
|
version: '0'
|
607
623
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
608
|
-
none: false
|
609
624
|
requirements:
|
610
|
-
- -
|
625
|
+
- - '>='
|
611
626
|
- !ruby/object:Gem::Version
|
612
627
|
version: '0'
|
613
628
|
requirements: []
|
614
629
|
rubyforge_project:
|
615
|
-
rubygems_version:
|
630
|
+
rubygems_version: 2.4.8
|
616
631
|
signing_key:
|
617
|
-
specification_version:
|
632
|
+
specification_version: 4
|
618
633
|
summary: Source Control Management
|
619
634
|
test_files:
|
620
635
|
- test/bin/svn
|