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 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
@@ -0,0 +1,13 @@
1
+ #/usr/bin/env sh
2
+
3
+ bazaar_plugins_path=`bzr --version | awk '/bzrlib:/ {print $2}'`
4
+
5
+ cd "$bazaar_plugins_path/plugins"
6
+
7
+ sudo bzr branch lp:bzr-xmloutput
8
+
9
+ sudo mv bzr-xmloutput xmloutput
10
+
11
+ cd xmloutput
12
+
13
+ python setup.py build_ext -i
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.0.0
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ install:
3
+ - gem install posix-spawn
4
+ - sh .install_dependencies.sh
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 'open4'
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 = Open4::popen4 "python #{@py_script}"
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
- @bzr_client = BzrPipeClient.new(url)
9
- @bzr_client.start
8
+ bzr_client = BzrPipeClient.new(url)
9
+ bzr_client.start
10
+ bzr_client
10
11
  end
11
12
 
12
13
  def bzr_client
13
- setup unless @bzr_client
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 'open4'
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 = Open4::popen4 "python #{@py_script}"
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
@@ -1,6 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'stringio'
3
- require 'open3'
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
- out, err, exit_status = Open3.capture3(cmd)
12
+ posix_spawn = POSIX::Spawn::Child.new(cmd)
13
13
 
14
- return exit_status, out, err
14
+ return posix_spawn.status, posix_spawn.out, posix_spawn.err
15
15
  end
16
16
 
17
17
  def run(cmd)
@@ -1,5 +1,5 @@
1
1
  module OhlohScm
2
2
  module Version
3
- STRING = '2.0.1'
3
+ STRING = '2.1.0'
4
4
  end
5
5
  end
data/ohloh_scm.gemspec CHANGED
@@ -16,4 +16,6 @@ Gem::Specification.new do |gem|
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = %w(lib)
19
+
20
+ gem.add_runtime_dependency 'posix-spawn', '~> 0.3'
19
21
  end
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.1
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: 2014-10-16 00:00:00.000000000 Z
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: 1.8.23
630
+ rubygems_version: 2.4.8
616
631
  signing_key:
617
- specification_version: 3
632
+ specification_version: 4
618
633
  summary: Source Control Management
619
634
  test_files:
620
635
  - test/bin/svn