syncwrap 2.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 31766d4da53365ca66e620737ad154a7ffdcbac9
4
- data.tar.gz: b18b461aaf1ece566be69c71d217113aa8da8473
3
+ metadata.gz: 3500abca37060701fb9e37fa8be04a5f1d50c8f4
4
+ data.tar.gz: e7f02b99eebccd0bf12e9d9b6b8dca69ac73dba1
5
5
  SHA512:
6
- metadata.gz: 9c95179c17e29b9d1fa2e0690481f7e9548db9c19b20e390995661f82e5bbdd0517c7f7b032d87c55032086ce069497199e0aa08314d14afcbd4f799f048104a
7
- data.tar.gz: 6b9fe9ed21313705a4604214d4bea5f88d79ff314b3898933383b44269af453454379452733f95fab4228d3f8b253783b6cdd6c6d78e9541e2af95ec99667da5
6
+ metadata.gz: cdea13437020dbe472ccc9dd5b5d92b036960a9c267fcc3b92537c56e1c80905ad877caad057a37bf85f0ff212e765a45d5ec92ad808da3982f2c3cec0cfc8a5
7
+ data.tar.gz: 7295c65e3ff1ebe839d0da32a8a31012baa7e8302ec1be9b6956061ee3fe034fd988f6ee6ec6949370928e0318c73214f3323e6bc4cf06b5ba5bb992aa51beb2
data/History.rdoc CHANGED
@@ -1,3 +1,15 @@
1
+ === 2.4.0 (2015-1-2)
2
+ * Upgrade SyncWrap::CRubyVM default version to 2.1.5 and add libffi as
3
+ build dependency.
4
+ * Upgrade SyncWrap::JRubyVM default version to 1.7.17
5
+ * When using the sh :user option which uses `sudo` on the remote, add
6
+ a `cd /` to the start of the shell command sequence. Prior to this
7
+ change, the working directory remained the home directory of the ssh
8
+ user (by convention, a dev. user) which shouldn't be writable and
9
+ might not even by readable by the target :user (ex: runr). This
10
+ caused often cryptic warnings or even fatal errors when accessing
11
+ certain command line tools from the shell.
12
+
1
13
  === 2.3.0 (2014-9-20)
2
14
  * Add SyncWrap::Debian (with Ubuntu as child), SyncWrap::CentOS and
3
15
  SyncWrap::AmazonLinux (with RHEL as parent) to form a Distro
data/examples/jruby.rb CHANGED
@@ -5,7 +5,7 @@ role( :all,
5
5
 
6
6
  role( :jruby,
7
7
  OpenJDK.new,
8
- JRubyVM.new( jruby_version: '1.7.13' ),
8
+ JRubyVM.new( jruby_version: '1.7.17' ),
9
9
  Hashdot.new )
10
10
 
11
11
  host( 'centos-1', RHEL.new, :jruby, internal_ip: '192.168.122.4' )
data/lib/syncwrap/base.rb CHANGED
@@ -15,7 +15,7 @@
15
15
  #++
16
16
 
17
17
  module SyncWrap
18
- VERSION='2.3.0'
18
+ VERSION='2.4.0'
19
19
 
20
20
  GEM_ROOT = File.dirname(File.dirname(File.dirname(__FILE__))) # :nodoc:
21
21
  end
@@ -47,9 +47,9 @@ module SyncWrap
47
47
  # The ruby version to install, as it appears in source packages
48
48
  # from ruby-lang.org. Note that starting with 2.1.0, the patch
49
49
  # release (p#) no longer appears in package names.
50
- # (Default: 2.1.2)
50
+ # (Default: 2.1.5)
51
51
  #
52
- # Example values: '2.0.0-p481', '2.1.2'
52
+ # Example values: '2.0.0-p481', '2.1.5'
53
53
  attr_accessor :ruby_version
54
54
 
55
55
  # If true, attempt to uninstall any pre-existing distro packaged
@@ -58,7 +58,7 @@ module SyncWrap
58
58
  attr_accessor :do_uninstall_distro_ruby
59
59
 
60
60
  def initialize( opts = {} )
61
- @ruby_version = "2.1.2"
61
+ @ruby_version = "2.1.5"
62
62
  @do_uninstall_distro_ruby = true
63
63
 
64
64
  super
@@ -121,10 +121,10 @@ module SyncWrap
121
121
  def install_build_deps
122
122
  if distro.is_a?( RHEL )
123
123
  dist_install( %w[ gcc make autoconf zlib-devel
124
- openssl-devel readline-devel libyaml-devel ] )
124
+ openssl-devel readline-devel libyaml-devel libffi-devel ] )
125
125
  else
126
126
  dist_install( %w[ gcc make autoconf zlib1g-dev
127
- libssl-dev libreadline-dev libyaml-dev ] )
127
+ libssl-dev libreadline-dev libyaml-dev libffi-dev ] )
128
128
  end
129
129
  end
130
130
 
@@ -29,11 +29,11 @@ module SyncWrap
29
29
  include VersionSupport
30
30
  include RubySupport
31
31
 
32
- # JRuby version to install (default: 1.7.13)
32
+ # JRuby version to install (default: 1.7.17)
33
33
  attr_accessor :jruby_version
34
34
 
35
35
  def initialize( opts = {} )
36
- @jruby_version = '1.7.13'
36
+ @jruby_version = '1.7.17'
37
37
 
38
38
  super( { ruby_command: 'jruby',
39
39
  gem_command: 'jgem' }.merge( opts ) )
@@ -102,6 +102,7 @@ module SyncWrap
102
102
  if opts[ :sh_verbose ]
103
103
  cmd << "set " << ( opts[ :sh_verbose ] == :x ? '-x' : '-v' ) << "\n"
104
104
  end
105
+ cmd << "cd /\n" if opts[:user]
105
106
  cmd << command_lines_cleanup( command )
106
107
  args << cmd
107
108
  else
@@ -109,7 +110,10 @@ module SyncWrap
109
110
  args << ( opts[ :sh_verbose ] == :x ? '-x' : '-v' )
110
111
  end
111
112
  args << '-c'
112
- args << command_lines_cleanup( command )
113
+ cmd = ""
114
+ cmd << "cd /\n" if opts[:user]
115
+ cmd << command_lines_cleanup( command )
116
+ args << cmd
113
117
  end
114
118
  args
115
119
  end
data/test/test_shell.rb CHANGED
@@ -252,9 +252,10 @@ class TestShell < MiniTest::Unit::TestCase
252
252
  cmd = ssh_args( SAFE_SSH, 'echo foo', sh_verbose: :v, user: :root )
253
253
  exit_code, outputs = capture3( cmd )
254
254
  assert_equal( 0, exit_code )
255
- assert_equal( [ [:err, "echo foo\n"],
256
- [:out, "foo\n" ] ],
257
- outputs.sort ) #order uncertain
255
+ assert_equal( "cd /\necho foo\n",
256
+ collect_stream( :err, outputs ) )
257
+ assert_equal( "foo\n",
258
+ collect_stream( :out, outputs ) )
258
259
  end
259
260
 
260
261
  def test_ssh_sudo_coalesce
@@ -268,7 +269,7 @@ class TestShell < MiniTest::Unit::TestCase
268
269
  unmerged << [ stream, chunk ]
269
270
  end
270
271
  assert_equal( 0, exit_code )
271
- assert_equal( [[:err, "echo foo\nfoo\necho bar\nbar\n"]],
272
+ assert_equal( [[:err, "cd /\necho foo\nfoo\necho bar\nbar\n"]],
272
273
  merged, merged )
273
274
  post_merged = unmerged.map {|s,c| c}.inject( "", :+ )
274
275
  assert_equal( merged[0][1], post_merged )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syncwrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Kellum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-21 00:00:00.000000000 Z
11
+ date: 2015-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: term-ansicolor