shexy 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/shexy.rb +7 -3
  2. metadata +41 -41
@@ -33,7 +33,7 @@ require 'net/scp'
33
33
 
34
34
  module Shexy
35
35
 
36
- VERSION = '0.3.3'
36
+ VERSION = '0.3.4'
37
37
 
38
38
  [:user, :password, :key, :cmd, :host].each do |n|
39
39
  instance_eval %{
@@ -103,8 +103,12 @@ module Shexy
103
103
  # FIXME: may not be successful, warn about it
104
104
  ch.request_pty
105
105
  if sudo?
106
- if cmd =~ /(&&|\|\||&|\|)/
107
- self.cmd = cmd.gsub(/(&&|\|\||&|\|)/, $1 + 'sudo')
106
+ regexp = /(&&|\|\||&|\|)/
107
+ if cmd =~ regexp
108
+ new_cmd = cmd.split(regexp).map do |t|
109
+ t =~ /^(&&|\|\||&|\|)$/ ? t : "sudo #{t}"
110
+ end
111
+ self.cmd = new_cmd.join ''
108
112
  end
109
113
  self.cmd = "sudo #{cmd}"
110
114
  puts "SHEXY: #{cmd}" if $DEBUG
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shexy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,120 +9,120 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-05 00:00:00.000000000 Z
12
+ date: 2013-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
+ name: net-ssh
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0'
20
- none: false
22
+ type: :runtime
23
+ prerelease: false
21
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
22
26
  requirements:
23
27
  - - ! '>='
24
28
  - !ruby/object:Gem::Version
25
29
  version: '0'
26
- none: false
27
- name: net-ssh
28
- prerelease: false
29
- type: :runtime
30
30
  - !ruby/object:Gem::Dependency
31
+ name: net-scp
31
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
32
34
  requirements:
33
35
  - - ! '>='
34
36
  - !ruby/object:Gem::Version
35
37
  version: '0'
36
- none: false
38
+ type: :runtime
39
+ prerelease: false
37
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
43
  - - ! '>='
40
44
  - !ruby/object:Gem::Version
41
45
  version: '0'
42
- none: false
43
- name: net-scp
44
- prerelease: false
45
- type: :runtime
46
46
  - !ruby/object:Gem::Dependency
47
+ name: shoulda
47
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
48
50
  requirements:
49
51
  - - ! '>='
50
52
  - !ruby/object:Gem::Version
51
53
  version: '0'
52
- none: false
54
+ type: :development
55
+ prerelease: false
53
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
54
58
  requirements:
55
59
  - - ! '>='
56
60
  - !ruby/object:Gem::Version
57
61
  version: '0'
58
- none: false
59
- name: shoulda
60
- prerelease: false
61
- type: :development
62
62
  - !ruby/object:Gem::Dependency
63
+ name: rdoc
63
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
64
66
  requirements:
65
67
  - - ! '>='
66
68
  - !ruby/object:Gem::Version
67
69
  version: '3.12'
68
- none: false
70
+ type: :development
71
+ prerelease: false
69
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
70
74
  requirements:
71
75
  - - ! '>='
72
76
  - !ruby/object:Gem::Version
73
77
  version: '3.12'
74
- none: false
75
- name: rdoc
76
- prerelease: false
77
- type: :development
78
78
  - !ruby/object:Gem::Dependency
79
+ name: bundler
79
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
80
82
  requirements:
81
83
  - - ! '>='
82
84
  - !ruby/object:Gem::Version
83
85
  version: 1.0.0
84
- none: false
86
+ type: :development
87
+ prerelease: false
85
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
86
90
  requirements:
87
91
  - - ! '>='
88
92
  - !ruby/object:Gem::Version
89
93
  version: 1.0.0
90
- none: false
91
- name: bundler
92
- prerelease: false
93
- type: :development
94
94
  - !ruby/object:Gem::Dependency
95
+ name: jeweler
95
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
96
98
  requirements:
97
99
  - - ! '>='
98
100
  - !ruby/object:Gem::Version
99
101
  version: 1.8.4
100
- none: false
102
+ type: :development
103
+ prerelease: false
101
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
102
106
  requirements:
103
107
  - - ! '>='
104
108
  - !ruby/object:Gem::Version
105
109
  version: 1.8.4
106
- none: false
107
- name: jeweler
108
- prerelease: false
109
- type: :development
110
110
  - !ruby/object:Gem::Dependency
111
+ name: simplecov
111
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
112
114
  requirements:
113
115
  - - ! '>='
114
116
  - !ruby/object:Gem::Version
115
117
  version: '0'
116
- none: false
118
+ type: :development
119
+ prerelease: false
117
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
118
122
  requirements:
119
123
  - - ! '>='
120
124
  - !ruby/object:Gem::Version
121
125
  version: '0'
122
- none: false
123
- name: simplecov
124
- prerelease: false
125
- type: :development
126
126
  description: ! '[extremely] thin wrapper around net-ssh and net-scp'
127
127
  email: rubiojr@frameos.org
128
128
  executables: []
@@ -147,23 +147,23 @@ rdoc_options: []
147
147
  require_paths:
148
148
  - lib
149
149
  required_ruby_version: !ruby/object:Gem::Requirement
150
+ none: false
150
151
  requirements:
151
152
  - - ! '>='
152
153
  - !ruby/object:Gem::Version
153
- hash: 2272871698138737244
154
154
  version: '0'
155
155
  segments:
156
156
  - 0
157
- none: false
157
+ hash: -3246701262734405878
158
158
  required_rubygems_version: !ruby/object:Gem::Requirement
159
+ none: false
159
160
  requirements:
160
161
  - - ! '>='
161
162
  - !ruby/object:Gem::Version
162
163
  version: '0'
163
- none: false
164
164
  requirements: []
165
165
  rubyforge_project:
166
- rubygems_version: 1.8.24
166
+ rubygems_version: 1.8.23
167
167
  signing_key:
168
168
  specification_version: 3
169
169
  summary: SSH, the way I like it