rush 0.6.7 → 0.6.8
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.
- data/VERSION +1 -1
- data/lib/rush/local.rb +10 -8
- metadata +71 -18
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.8
|
data/lib/rush/local.rb
CHANGED
@@ -193,16 +193,18 @@ class Rush::Connection::Local
|
|
193
193
|
# Read a single file in /proc and store the parsed values in a hash suitable
|
194
194
|
# for use in the Rush::Process#new.
|
195
195
|
def read_proc_file(file)
|
196
|
-
|
196
|
+
stat_contents = ::File.read(file)
|
197
|
+
stat_contents.gsub!(/\((.*)\)/, "")
|
198
|
+
command = $1
|
199
|
+
data = stat_contents.split(" ")
|
197
200
|
uid = ::File.stat(file).uid
|
198
201
|
pid = data[0]
|
199
|
-
command = data[1].match(/^\((.*)\)$/)[1]
|
200
202
|
cmdline = ::File.read("/proc/#{pid}/cmdline").gsub(/\0/, ' ')
|
201
|
-
parent_pid = data[
|
202
|
-
utime = data[
|
203
|
-
ktime = data[
|
204
|
-
vss = data[
|
205
|
-
rss = data[
|
203
|
+
parent_pid = data[2].to_i
|
204
|
+
utime = data[12].to_i
|
205
|
+
ktime = data[13].to_i
|
206
|
+
vss = data[21].to_i / 1024
|
207
|
+
rss = data[22].to_i * 4
|
206
208
|
time = utime + ktime
|
207
209
|
|
208
210
|
{
|
@@ -317,7 +319,7 @@ class Rush::Connection::Local
|
|
317
319
|
shell = reset_environment ? "env -i bash" : "bash"
|
318
320
|
|
319
321
|
if user and user != ""
|
320
|
-
out, err = sh.execute "cd /; sudo -H -u #{user}
|
322
|
+
out, err = sh.execute "cd /; sudo -H -u #{user} \"#{shell}\"", :stdin => command
|
321
323
|
else
|
322
324
|
out, err = sh.execute shell, :stdin => command
|
323
325
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 6
|
8
|
-
-
|
9
|
-
version: 0.6.
|
9
|
+
- 8
|
10
|
+
version: 0.6.8
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Adam Wiggins
|
@@ -14,21 +15,70 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
-
default_executable:
|
18
|
+
date: 2010-01-29 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
name:
|
21
|
+
name: rake
|
22
22
|
prerelease: false
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 59
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
- 9
|
32
|
+
- 0
|
33
|
+
version: 0.9.0
|
34
|
+
type: :development
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: jeweler
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
24
41
|
requirements:
|
25
42
|
- - ">="
|
26
43
|
- !ruby/object:Gem::Version
|
44
|
+
hash: 49
|
45
|
+
segments:
|
46
|
+
- 1
|
47
|
+
- 8
|
48
|
+
- 3
|
49
|
+
version: 1.8.3
|
50
|
+
type: :development
|
51
|
+
version_requirements: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: rspec
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ~>
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 31
|
61
|
+
segments:
|
62
|
+
- 1
|
63
|
+
- 2
|
64
|
+
- 0
|
65
|
+
version: 1.2.0
|
66
|
+
type: :development
|
67
|
+
version_requirements: *id003
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: session
|
70
|
+
prerelease: false
|
71
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
hash: 3
|
27
77
|
segments:
|
28
78
|
- 0
|
29
79
|
version: "0"
|
30
80
|
type: :runtime
|
31
|
-
version_requirements: *
|
81
|
+
version_requirements: *id004
|
32
82
|
description: A Ruby replacement for bash+ssh, providing both an interactive shell and a library. Manage both local and remote unix systems from a single client.
|
33
83
|
email: adam@heroku.com
|
34
84
|
executables:
|
@@ -88,7 +138,6 @@ files:
|
|
88
138
|
- spec/shell_spec.rb
|
89
139
|
- spec/ssh_tunnel_spec.rb
|
90
140
|
- spec/string_ext_spec.rb
|
91
|
-
has_rdoc: true
|
92
141
|
homepage: http://rush.heroku.com/
|
93
142
|
licenses: []
|
94
143
|
|
@@ -98,23 +147,27 @@ rdoc_options:
|
|
98
147
|
require_paths:
|
99
148
|
- lib
|
100
149
|
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
+
none: false
|
101
151
|
requirements:
|
102
152
|
- - ">="
|
103
153
|
- !ruby/object:Gem::Version
|
154
|
+
hash: 3
|
104
155
|
segments:
|
105
156
|
- 0
|
106
157
|
version: "0"
|
107
158
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
+
none: false
|
108
160
|
requirements:
|
109
161
|
- - ">="
|
110
162
|
- !ruby/object:Gem::Version
|
163
|
+
hash: 3
|
111
164
|
segments:
|
112
165
|
- 0
|
113
166
|
version: "0"
|
114
167
|
requirements: []
|
115
168
|
|
116
169
|
rubyforge_project: ruby-shell
|
117
|
-
rubygems_version: 1.
|
170
|
+
rubygems_version: 1.8.12
|
118
171
|
signing_key:
|
119
172
|
specification_version: 3
|
120
173
|
summary: A Ruby replacement for bash+ssh.
|
@@ -122,21 +175,21 @@ test_files:
|
|
122
175
|
- spec/access_spec.rb
|
123
176
|
- spec/array_ext_spec.rb
|
124
177
|
- spec/base.rb
|
178
|
+
- spec/box_spec.rb
|
125
179
|
- spec/commands_spec.rb
|
126
180
|
- spec/config_spec.rb
|
127
|
-
- spec/find_by_spec.rb
|
128
|
-
- spec/fixnum_ext_spec.rb
|
129
|
-
- spec/search_results_spec.rb
|
130
|
-
- spec/ssh_tunnel_spec.rb
|
131
|
-
- spec/string_ext_spec.rb
|
132
|
-
- spec/embeddable_shell_spec.rb
|
133
|
-
- spec/file_spec.rb
|
134
|
-
- spec/process_set_spec.rb
|
135
|
-
- spec/box_spec.rb
|
136
181
|
- spec/dir_spec.rb
|
182
|
+
- spec/embeddable_shell_spec.rb
|
137
183
|
- spec/entry_spec.rb
|
184
|
+
- spec/file_spec.rb
|
185
|
+
- spec/find_by_spec.rb
|
186
|
+
- spec/fixnum_ext_spec.rb
|
138
187
|
- spec/local_spec.rb
|
188
|
+
- spec/process_set_spec.rb
|
139
189
|
- spec/process_spec.rb
|
140
190
|
- spec/remote_spec.rb
|
141
191
|
- spec/rush_spec.rb
|
192
|
+
- spec/search_results_spec.rb
|
142
193
|
- spec/shell_spec.rb
|
194
|
+
- spec/ssh_tunnel_spec.rb
|
195
|
+
- spec/string_ext_spec.rb
|