redcar 0.3.9 → 0.3.10.0dev
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +18 -2
- data/Rakefile +9 -1
- data/bin/redcar +1 -1
- data/lib/redcar.rb +26 -21
- data/lib/redcar/runner.rb +8 -4
- data/plugins/document_search/features/replace.feature +9 -0
- data/plugins/document_search/lib/document_search/search.rb +7 -5
- data/plugins/project/lib/project.rb +1 -1
- data/plugins/project/lib/project/adapters/remote.rb +0 -2
- data/plugins/project/lib/project/adapters/remote_protocols/ftp.rb +2 -2
- data/plugins/project/lib/project/adapters/remote_protocols/protocol.rb +0 -2
- data/plugins/project/lib/project/adapters/remote_protocols/sftp.rb +2 -2
- data/plugins/redcar/redcar.rb +4 -1
- data/plugins/runnables/lib/runnables.rb +27 -12
- data/plugins/runnables/lib/runnables/command_output_controller.rb +20 -3
- data/plugins/runnables/lib/runnables/output_processor.rb +63 -0
- data/plugins/runnables/spec/runnables/output_processor_spec.rb +57 -0
- data/plugins/runnables/spec/spec_helper.rb +5 -0
- data/plugins/runnables/vendor/session/LICENSE +3 -0
- data/plugins/runnables/vendor/{session-2.4.0/HISTORY → session/README} +96 -1
- data/plugins/runnables/vendor/session/Rakefile +233 -0
- data/plugins/runnables/vendor/session/gemspec.rb +62 -0
- data/plugins/runnables/vendor/{session-2.4.0 → session}/lib/session.rb +6 -103
- data/plugins/runnables/vendor/{session-2.4.0 → session}/sample/bash.rb +0 -0
- data/plugins/runnables/vendor/{session-2.4.0 → session}/sample/driver.rb +0 -0
- data/plugins/runnables/vendor/{session-2.4.0 → session}/sample/session_idl.rb +0 -0
- data/plugins/runnables/vendor/{session-2.4.0 → session}/sample/session_sh.rb +0 -0
- data/plugins/runnables/vendor/{session-2.4.0 → session}/sample/sh0.rb +0 -0
- data/plugins/runnables/vendor/{session-2.4.0 → session}/sample/stdin.rb +0 -0
- data/plugins/runnables/vendor/{session-2.4.0 → session}/sample/threadtest.rb +0 -0
- data/plugins/runnables/vendor/session/session.gemspec +27 -0
- data/plugins/runnables/vendor/{session-2.4.0 → session}/test/session.rb +3 -0
- data/plugins/runnables/views/basic_ansi.css +34 -0
- data/plugins/runnables/views/color_tester.html +50 -0
- data/plugins/runnables/views/command_output.html.erb +7 -1
- data/plugins/strip_trailing_spaces/CHANGELOG +12 -0
- data/plugins/strip_trailing_spaces/README.md +32 -0
- data/plugins/strip_trailing_spaces/lib/strip_trailing_spaces.rb +53 -0
- data/plugins/strip_trailing_spaces/plugin.rb +8 -0
- metadata +4225 -4200
- data/plugins/runnables/vendor/session-2.4.0/README +0 -89
- data/plugins/runnables/vendor/session-2.4.0/TODO +0 -3
- data/plugins/runnables/vendor/session-2.4.0/VERSION +0 -1
- data/plugins/runnables/vendor/session-2.4.0/gemspec.rb +0 -22
- data/plugins/runnables/vendor/session-2.4.0/install.rb +0 -143
- data/plugins/runnables/vendor/session-2.4.0/session-2.4.0.gem +0 -0
@@ -1,89 +0,0 @@
|
|
1
|
-
URLS: |
|
2
|
-
|
3
|
-
http://raa.ruby-lang.org/project/session/
|
4
|
-
http://www.codeforpeople.com/lib/ruby/session/
|
5
|
-
|
6
|
-
|
7
|
-
NAME: |
|
8
|
-
|
9
|
-
Session
|
10
|
-
::Sh
|
11
|
-
::Bash
|
12
|
-
::Shell
|
13
|
-
::IDL
|
14
|
-
|
15
|
-
SYNOPSIS: |
|
16
|
-
|
17
|
-
Session::* offers a set of classes built upon Open3::popen3 for driving
|
18
|
-
external progams via pipes. It offers a significant abstraction over
|
19
|
-
Open3::popen in that the stdout/stderr of each command sent can be deliniated:
|
20
|
-
|
21
|
-
open3:
|
22
|
-
|
23
|
-
i.o,e = Open3::popen3 '/bin/sh'
|
24
|
-
|
25
|
-
i.puts 'ls'
|
26
|
-
i.puts 'echo 42'
|
27
|
-
|
28
|
-
now, how to determine the boundry between the output from 'ls' and 'echo'?
|
29
|
-
the only (simple) way is start a process for each command
|
30
|
-
|
31
|
-
i.o,e = Open3::popen3 '/bin/sh'
|
32
|
-
i.puts 'ls'
|
33
|
-
i.close
|
34
|
-
stdout, stderr = o.read, e.read
|
35
|
-
|
36
|
-
i.o,e = Open3::popen3 '/bin/sh'
|
37
|
-
i.puts 'echo 42'
|
38
|
-
i.close
|
39
|
-
stdout, stderr = o.read, e.read
|
40
|
-
|
41
|
-
session:
|
42
|
-
|
43
|
-
sh = Session::new
|
44
|
-
|
45
|
-
stdout, stderr = sh.execute 'ls'
|
46
|
-
stdout, stderr = sh.execute 'echo 42'
|
47
|
-
|
48
|
-
Both stderr and stdout can be redirected, and the exit_status of each command
|
49
|
-
is made available:
|
50
|
-
|
51
|
-
bash = Session::Bash.new
|
52
|
-
stdout, stderr = StringIO::new, StringIO::new
|
53
|
-
|
54
|
-
bash.execute 'ls', :stdout => stdout, :stderr => stderr
|
55
|
-
# bash.execute 'ls', 1 => stdout, 2 => stderr # same thing
|
56
|
-
# bash.execute 'ls', :o => stdout, :e => stderr # same thing
|
57
|
-
|
58
|
-
exit_status = bash.exit_status
|
59
|
-
|
60
|
-
A block form can be used to specify a callback to be invoked whenever output
|
61
|
-
has become availible:
|
62
|
-
|
63
|
-
bash = Session::Bash.new
|
64
|
-
|
65
|
-
bash.execute( 'long_running_command.exe' ) do |out, err|
|
66
|
-
logger << out if out
|
67
|
-
elogger << err if err
|
68
|
-
end
|
69
|
-
|
70
|
-
Sessions are Thread safe (in the sense that they do not block on io
|
71
|
-
operations) allowing commands spawned from guis to update widgets with output
|
72
|
-
while running in the background.
|
73
|
-
|
74
|
-
button.configure 'action' => lambda do
|
75
|
-
sh = Session::new
|
76
|
-
sh.execute(cmd) do |o,e|
|
77
|
-
out_widget.update o if o
|
78
|
-
err_widget.update e if e
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
SAMPLES: |
|
83
|
-
|
84
|
-
see samples/*
|
85
|
-
|
86
|
-
|
87
|
-
AUTHOR: |
|
88
|
-
|
89
|
-
ara.t.howard@noaa.gov
|
@@ -1 +0,0 @@
|
|
1
|
-
2.4.0
|
@@ -1,22 +0,0 @@
|
|
1
|
-
lib, version = File::basename(File::dirname(File::expand_path(__FILE__))).split %r/-/, 2
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
|
5
|
-
spec = Gem::Specification.new do |s|
|
6
|
-
s.name = lib
|
7
|
-
s.version = version
|
8
|
-
s.platform = Gem::Platform::RUBY
|
9
|
-
s.summary = lib
|
10
|
-
|
11
|
-
s.files = Dir["lib/*"] + Dir["bin/*"]
|
12
|
-
|
13
|
-
s.require_path = "lib"
|
14
|
-
s.autorequire = lib
|
15
|
-
|
16
|
-
s.has_rdoc = File::exist? "doc"
|
17
|
-
s.test_suite_file = "test/#{ lib }.rb" if File::directory? "test"
|
18
|
-
|
19
|
-
s.author = "Ara T. Howard"
|
20
|
-
s.email = "ara.t.howard@noaa.gov"
|
21
|
-
s.homepage = "http://codeforpeople.com/lib/ruby/#{ lib }/"
|
22
|
-
end
|
@@ -1,143 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'rbconfig'
|
3
|
-
require 'find'
|
4
|
-
require 'ftools'
|
5
|
-
require 'tempfile'
|
6
|
-
include Config
|
7
|
-
|
8
|
-
LIBDIR = "lib"
|
9
|
-
LIBDIR_MODE = 0644
|
10
|
-
|
11
|
-
BINDIR = "bin"
|
12
|
-
BINDIR_MODE = 0755
|
13
|
-
|
14
|
-
|
15
|
-
$srcdir = CONFIG["srcdir"]
|
16
|
-
$version = CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
|
17
|
-
$libdir = File.join(CONFIG["libdir"], "ruby", $version)
|
18
|
-
$archdir = File.join($libdir, CONFIG["arch"])
|
19
|
-
$site_libdir = $:.find {|x| x =~ /site_ruby$/}
|
20
|
-
$bindir = CONFIG["bindir"]
|
21
|
-
$ruby_install_name = CONFIG['ruby_install_name'] || CONFIG['RUBY_INSTALL_NAME']
|
22
|
-
$ruby = File.join($bindir, $ruby_install_name || 'ruby')
|
23
|
-
|
24
|
-
if !$site_libdir
|
25
|
-
$site_libdir = File.join($libdir, "site_ruby")
|
26
|
-
elsif $site_libdir !~ %r/#{Regexp.quote($version)}/
|
27
|
-
$site_libdir = File.join($site_libdir, $version)
|
28
|
-
end
|
29
|
-
|
30
|
-
def install_rb(srcdir=nil, destdir=nil, mode=nil, bin=nil)
|
31
|
-
#{{{
|
32
|
-
path = []
|
33
|
-
dir = []
|
34
|
-
Find.find(srcdir) do |f|
|
35
|
-
next unless FileTest.file?(f)
|
36
|
-
next if (f = f[srcdir.length+1..-1]) == nil
|
37
|
-
next if (/CVS$/ =~ File.dirname(f))
|
38
|
-
path.push f
|
39
|
-
dir |= [File.dirname(f)]
|
40
|
-
end
|
41
|
-
for f in dir
|
42
|
-
next if f == "."
|
43
|
-
next if f == "CVS"
|
44
|
-
File::makedirs(File.join(destdir, f))
|
45
|
-
end
|
46
|
-
for f in path
|
47
|
-
next if (/\~$/ =~ f)
|
48
|
-
next if (/^\./ =~ File.basename(f))
|
49
|
-
unless bin
|
50
|
-
File::install(File.join(srcdir, f), File.join(destdir, f), mode, true)
|
51
|
-
else
|
52
|
-
from = File.join(srcdir, f)
|
53
|
-
to = File.join(destdir, f)
|
54
|
-
shebangify(from) do |sf|
|
55
|
-
$deferr.print from, " -> ", File::catname(from, to), "\n"
|
56
|
-
$deferr.printf "chmod %04o %s\n", mode, to
|
57
|
-
File::install(sf, to, mode, false)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
#}}}
|
62
|
-
end
|
63
|
-
def shebangify f
|
64
|
-
#{{{
|
65
|
-
open(f) do |fd|
|
66
|
-
buf = fd.read 42
|
67
|
-
if buf =~ %r/^\s*#\s*!.*ruby/o
|
68
|
-
ftmp = Tempfile::new("#{ $$ }_#{ File::basename(f) }")
|
69
|
-
begin
|
70
|
-
fd.rewind
|
71
|
-
ftmp.puts "#!#{ $ruby }"
|
72
|
-
while((buf = fd.read(8192)))
|
73
|
-
ftmp.write buf
|
74
|
-
end
|
75
|
-
ftmp.close
|
76
|
-
yield ftmp.path
|
77
|
-
ensure
|
78
|
-
ftmp.close!
|
79
|
-
end
|
80
|
-
else
|
81
|
-
yield f
|
82
|
-
end
|
83
|
-
end
|
84
|
-
#}}}
|
85
|
-
end
|
86
|
-
def ARGV.switch
|
87
|
-
#{{{
|
88
|
-
return nil if self.empty?
|
89
|
-
arg = self.shift
|
90
|
-
return nil if arg == '--'
|
91
|
-
if arg =~ /^-(.)(.*)/
|
92
|
-
return arg if $1 == '-'
|
93
|
-
raise 'unknown switch "-"' if $2.index('-')
|
94
|
-
self.unshift "-#{$2}" if $2.size > 0
|
95
|
-
"-#{$1}"
|
96
|
-
else
|
97
|
-
self.unshift arg
|
98
|
-
nil
|
99
|
-
end
|
100
|
-
#}}}
|
101
|
-
end
|
102
|
-
def ARGV.req_arg
|
103
|
-
#{{{
|
104
|
-
self.shift || raise('missing argument')
|
105
|
-
#}}}
|
106
|
-
end
|
107
|
-
|
108
|
-
|
109
|
-
#
|
110
|
-
# main program
|
111
|
-
#
|
112
|
-
|
113
|
-
libdir = $site_libdir
|
114
|
-
bindir = $bindir
|
115
|
-
|
116
|
-
begin
|
117
|
-
while switch = ARGV.switch
|
118
|
-
case switch
|
119
|
-
when '-d', '--destdir'
|
120
|
-
libdir = ARGV.req_arg
|
121
|
-
when '-l', '--libdir'
|
122
|
-
libdir = ARGV.req_arg
|
123
|
-
when '-b', '--bindir'
|
124
|
-
bindir = ARGV.req_arg
|
125
|
-
when '-r', '--ruby'
|
126
|
-
$ruby = ARGV.req_arg
|
127
|
-
else
|
128
|
-
raise "unknown switch #{switch.dump}"
|
129
|
-
end
|
130
|
-
end
|
131
|
-
rescue
|
132
|
-
STDERR.puts $!.to_s
|
133
|
-
STDERR.puts File.basename($0) +
|
134
|
-
" -d <destdir>" +
|
135
|
-
" -l <libdir>" +
|
136
|
-
" -b <bindir>"
|
137
|
-
" -r <ruby>"
|
138
|
-
exit 1
|
139
|
-
end
|
140
|
-
|
141
|
-
install_rb(LIBDIR, libdir, LIBDIR_MODE)
|
142
|
-
install_rb(BINDIR, bindir, BINDIR_MODE, bin=true)
|
143
|
-
|
Binary file
|