elliottcable-echoe 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +69 -0
- data/LICENSE +184 -0
- data/MIT-LICENSE +21 -0
- data/Manifest +113 -0
- data/README +114 -0
- data/Rakefile +15 -0
- data/TODO +4 -0
- data/echoe.gemspec +37 -0
- data/lib/echoe/client.rb +25 -0
- data/lib/echoe/extensions.rb +57 -0
- data/lib/echoe/platform.rb +36 -0
- data/lib/echoe/rubygems.rb +41 -0
- data/lib/echoe.rb +717 -0
- data/vendor/rake/CHANGES +400 -0
- data/vendor/rake/MIT-LICENSE +21 -0
- data/vendor/rake/README +285 -0
- data/vendor/rake/Rakefile +418 -0
- data/vendor/rake/TODO +20 -0
- data/vendor/rake/bin/rake +31 -0
- data/vendor/rake/doc/example/Rakefile1 +38 -0
- data/vendor/rake/doc/example/Rakefile2 +35 -0
- data/vendor/rake/doc/example/a.c +6 -0
- data/vendor/rake/doc/example/b.c +6 -0
- data/vendor/rake/doc/example/main.c +11 -0
- data/vendor/rake/doc/glossary.rdoc +51 -0
- data/vendor/rake/doc/jamis.rb +591 -0
- data/vendor/rake/doc/proto_rake.rdoc +127 -0
- data/vendor/rake/doc/rake.1.gz +0 -0
- data/vendor/rake/doc/rakefile.rdoc +534 -0
- data/vendor/rake/doc/rational.rdoc +151 -0
- data/vendor/rake/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/vendor/rake/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/vendor/rake/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/vendor/rake/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/vendor/rake/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/vendor/rake/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/vendor/rake/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/vendor/rake/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/vendor/rake/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/vendor/rake/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/vendor/rake/doc/release_notes/rake-0.8.0.rdoc +114 -0
- data/vendor/rake/doc/release_notes/rake-0.8.2.rdoc +165 -0
- data/vendor/rake/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/vendor/rake/install.rb +88 -0
- data/vendor/rake/lib/rake/classic_namespace.rb +8 -0
- data/vendor/rake/lib/rake/clean.rb +33 -0
- data/vendor/rake/lib/rake/contrib/compositepublisher.rb +24 -0
- data/vendor/rake/lib/rake/contrib/ftptools.rb +153 -0
- data/vendor/rake/lib/rake/contrib/publisher.rb +75 -0
- data/vendor/rake/lib/rake/contrib/rubyforgepublisher.rb +18 -0
- data/vendor/rake/lib/rake/contrib/sshpublisher.rb +47 -0
- data/vendor/rake/lib/rake/contrib/sys.rb +209 -0
- data/vendor/rake/lib/rake/gempackagetask.rb +103 -0
- data/vendor/rake/lib/rake/loaders/makefile.rb +35 -0
- data/vendor/rake/lib/rake/packagetask.rb +185 -0
- data/vendor/rake/lib/rake/rake_test_loader.rb +5 -0
- data/vendor/rake/lib/rake/rdoctask.rb +147 -0
- data/vendor/rake/lib/rake/ruby182_test_unit_fix.rb +23 -0
- data/vendor/rake/lib/rake/runtest.rb +23 -0
- data/vendor/rake/lib/rake/tasklib.rb +23 -0
- data/vendor/rake/lib/rake/testtask.rb +161 -0
- data/vendor/rake/lib/rake/win32.rb +54 -0
- data/vendor/rake/lib/rake.rb +2468 -0
- data/vendor/rake/test/capture_stdout.rb +26 -0
- data/vendor/rake/test/check_expansion.rb +5 -0
- data/vendor/rake/test/contrib/test_sys.rb +47 -0
- data/vendor/rake/test/data/chains/Rakefile +15 -0
- data/vendor/rake/test/data/default/Rakefile +19 -0
- data/vendor/rake/test/data/dryrun/Rakefile +22 -0
- data/vendor/rake/test/data/file_creation_task/Rakefile +33 -0
- data/vendor/rake/test/data/imports/Rakefile +19 -0
- data/vendor/rake/test/data/imports/deps.mf +1 -0
- data/vendor/rake/test/data/multidesc/Rakefile +17 -0
- data/vendor/rake/test/data/namespace/Rakefile +57 -0
- data/vendor/rake/test/data/rakelib/test1.rb +3 -0
- data/vendor/rake/test/data/rbext/rakefile.rb +3 -0
- data/vendor/rake/test/data/sample.mf +12 -0
- data/vendor/rake/test/data/statusreturn/Rakefile +8 -0
- data/vendor/rake/test/data/unittest/Rakefile +1 -0
- data/vendor/rake/test/filecreation.rb +32 -0
- data/vendor/rake/test/functional.rb +15 -0
- data/vendor/rake/test/in_environment.rb +30 -0
- data/vendor/rake/test/rake_test_setup.rb +10 -0
- data/vendor/rake/test/reqfile.rb +3 -0
- data/vendor/rake/test/reqfile2.rb +3 -0
- data/vendor/rake/test/session_functional.rb +337 -0
- data/vendor/rake/test/shellcommand.rb +3 -0
- data/vendor/rake/test/test_application.rb +694 -0
- data/vendor/rake/test/test_clean.rb +14 -0
- data/vendor/rake/test/test_definitions.rb +82 -0
- data/vendor/rake/test/test_earlytime.rb +35 -0
- data/vendor/rake/test/test_extension.rb +63 -0
- data/vendor/rake/test/test_file_creation_task.rb +62 -0
- data/vendor/rake/test/test_file_task.rb +139 -0
- data/vendor/rake/test/test_filelist.rb +618 -0
- data/vendor/rake/test/test_fileutils.rb +250 -0
- data/vendor/rake/test/test_ftp.rb +59 -0
- data/vendor/rake/test/test_invocation_chain.rb +75 -0
- data/vendor/rake/test/test_makefile_loader.rb +25 -0
- data/vendor/rake/test/test_multitask.rb +45 -0
- data/vendor/rake/test/test_namespace.rb +36 -0
- data/vendor/rake/test/test_package_task.rb +116 -0
- data/vendor/rake/test/test_pathmap.rb +209 -0
- data/vendor/rake/test/test_rake.rb +41 -0
- data/vendor/rake/test/test_require.rb +33 -0
- data/vendor/rake/test/test_rules.rb +347 -0
- data/vendor/rake/test/test_task_arguments.rb +89 -0
- data/vendor/rake/test/test_task_manager.rb +170 -0
- data/vendor/rake/test/test_tasklib.rb +12 -0
- data/vendor/rake/test/test_tasks.rb +371 -0
- data/vendor/rake/test/test_test_task.rb +75 -0
- data/vendor/rake/test/test_top_level_functions.rb +84 -0
- data/vendor/rake/test/test_win32.rb +57 -0
- metadata +195 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'stringio'
|
4
|
+
|
5
|
+
# Mix-in for capturing standard output.
|
6
|
+
module CaptureStdout
|
7
|
+
def capture_stdout
|
8
|
+
s = StringIO.new
|
9
|
+
oldstdout = $stdout
|
10
|
+
$stdout = s
|
11
|
+
yield
|
12
|
+
s.string
|
13
|
+
ensure
|
14
|
+
$stdout = oldstdout
|
15
|
+
end
|
16
|
+
|
17
|
+
def capture_stderr
|
18
|
+
s = StringIO.new
|
19
|
+
oldstderr = $stderr
|
20
|
+
$stderr = s
|
21
|
+
yield
|
22
|
+
s.string
|
23
|
+
ensure
|
24
|
+
$stderr = oldstderr
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'test/unit'
|
4
|
+
require 'test/filecreation'
|
5
|
+
require 'rake/contrib/sys'
|
6
|
+
|
7
|
+
class TestSys < Test::Unit::TestCase
|
8
|
+
include FileCreation
|
9
|
+
|
10
|
+
# def test_delete
|
11
|
+
# create_file("testdata/a")
|
12
|
+
# Sys.delete_all("testdata/a")
|
13
|
+
# assert ! File.exist?("testdata/a")
|
14
|
+
# end
|
15
|
+
|
16
|
+
# def test_copy
|
17
|
+
# create_file("testdata/a")
|
18
|
+
# Sys.copy("testdata/a", "testdata/b")
|
19
|
+
# assert File.exist?("testdata/b")
|
20
|
+
# end
|
21
|
+
|
22
|
+
# def test_for_files
|
23
|
+
# test_files = ["testdata/a.pl", "testdata/c.pl", "testdata/b.rb"]
|
24
|
+
# test_files.each { |fn| create_file(fn) }
|
25
|
+
# list = []
|
26
|
+
# Sys.for_files("testdata/*.pl", "testdata/*.rb") { |fn|
|
27
|
+
# list << fn
|
28
|
+
# }
|
29
|
+
# assert_equal test_files.sort, list.sort
|
30
|
+
# end
|
31
|
+
|
32
|
+
# def test_indir
|
33
|
+
# here = Dir.pwd
|
34
|
+
# Sys.makedirs("testdata/dir")
|
35
|
+
# assert_equal "#{here}/testdata/dir", Sys.indir("testdata/dir") { Dir.pwd }
|
36
|
+
# assert_equal here, Dir.pwd
|
37
|
+
# end
|
38
|
+
|
39
|
+
def test_split_all
|
40
|
+
assert_equal ['a'], Sys.split_all('a')
|
41
|
+
assert_equal ['..'], Sys.split_all('..')
|
42
|
+
assert_equal ['/'], Sys.split_all('/')
|
43
|
+
assert_equal ['a', 'b'], Sys.split_all('a/b')
|
44
|
+
assert_equal ['/', 'a', 'b'], Sys.split_all('/a/b')
|
45
|
+
assert_equal ['..', 'a', 'b'], Sys.split_all('../a/b')
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
if ENV['TESTTOPSCOPE']
|
4
|
+
puts "TOPSCOPE"
|
5
|
+
end
|
6
|
+
|
7
|
+
task :default do
|
8
|
+
puts "DEFAULT"
|
9
|
+
end
|
10
|
+
|
11
|
+
task :other => [:default] do
|
12
|
+
puts "OTHER"
|
13
|
+
end
|
14
|
+
|
15
|
+
task :task_scope do
|
16
|
+
if ENV['TESTTASKSCOPE']
|
17
|
+
puts "TASKSCOPE"
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#
|
2
|
+
|
3
|
+
task :default => ["temp_main"]
|
4
|
+
|
5
|
+
file "temp_main" => [:all_apps] do touch "temp_main" end
|
6
|
+
|
7
|
+
task :all_apps => [:one, :two]
|
8
|
+
task :one => ["temp_one"]
|
9
|
+
task :two => ["temp_two"]
|
10
|
+
|
11
|
+
file "temp_one" do |t|
|
12
|
+
touch "temp_one"
|
13
|
+
end
|
14
|
+
file "temp_two" do |t|
|
15
|
+
touch "temp_two"
|
16
|
+
end
|
17
|
+
|
18
|
+
task :clean do
|
19
|
+
["temp_one", "temp_two", "temp_main"].each do |file|
|
20
|
+
rm_f file
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
N = 2
|
4
|
+
|
5
|
+
task :default => :run
|
6
|
+
|
7
|
+
BUILD_DIR = 'build'
|
8
|
+
task :clean do
|
9
|
+
rm_rf 'build'
|
10
|
+
rm_rf 'src'
|
11
|
+
end
|
12
|
+
|
13
|
+
task :run
|
14
|
+
|
15
|
+
TARGET_DIR = 'build/copies'
|
16
|
+
|
17
|
+
FileList['src/*'].each do |src|
|
18
|
+
directory TARGET_DIR
|
19
|
+
target = File.join TARGET_DIR, File.basename(src)
|
20
|
+
file target => [src, TARGET_DIR] do
|
21
|
+
cp src, target
|
22
|
+
# sleep 3 if src !~ /foo#{N-1}$/ # I'm commenting out this sleep, it doesn't seem to do anything.
|
23
|
+
end
|
24
|
+
task :run => target
|
25
|
+
end
|
26
|
+
|
27
|
+
task :prep => :clean do
|
28
|
+
mkdir_p 'src'
|
29
|
+
N.times do |n|
|
30
|
+
puts "DBG: Touching src/foo#{n}"
|
31
|
+
touch "src/foo#{n}"
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rake/loaders/makefile'
|
4
|
+
|
5
|
+
task :default
|
6
|
+
|
7
|
+
task :other do
|
8
|
+
puts "OTHER"
|
9
|
+
end
|
10
|
+
|
11
|
+
file "dynamic_deps" do |t|
|
12
|
+
open(t.name, "w") do |f| f.puts "puts 'DYNAMIC'" end
|
13
|
+
end
|
14
|
+
|
15
|
+
import "dynamic_deps"
|
16
|
+
import "static_deps"
|
17
|
+
import "static_deps"
|
18
|
+
import "deps.mf"
|
19
|
+
puts "FIRST"
|
@@ -0,0 +1 @@
|
|
1
|
+
default: other
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
desc "copy"
|
4
|
+
task :copy do
|
5
|
+
puts "COPY"
|
6
|
+
end
|
7
|
+
|
8
|
+
namespace "nest" do
|
9
|
+
desc "nest copy"
|
10
|
+
task :copy do
|
11
|
+
puts "NEST COPY"
|
12
|
+
end
|
13
|
+
task :xx => :copy
|
14
|
+
end
|
15
|
+
|
16
|
+
anon_ns = namespace do
|
17
|
+
desc "anonymous copy task"
|
18
|
+
task :copy do
|
19
|
+
puts "ANON COPY"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
desc "Top level task to run the anonymous version of copy"
|
24
|
+
task :anon => anon_ns[:copy]
|
25
|
+
|
26
|
+
namespace "very" do
|
27
|
+
namespace "nested" do
|
28
|
+
task "run" => "rake:copy"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
namespace "a" do
|
33
|
+
desc "Run task in the 'a' namespace"
|
34
|
+
task "run" do
|
35
|
+
puts "IN A"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
namespace "b" do
|
40
|
+
desc "Run task in the 'b' namespace"
|
41
|
+
task "run" => "a:run" do
|
42
|
+
puts "IN B"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
namespace "file1" do
|
47
|
+
file "xyz.rb" do
|
48
|
+
puts "XYZ1"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
namespace "file2" do
|
53
|
+
file "xyz.rb" do
|
54
|
+
puts "XYZ2"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
# Empty Rakefile for Unit Test
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
module FileCreation
|
4
|
+
OLDFILE = "testdata/old"
|
5
|
+
NEWFILE = "testdata/new"
|
6
|
+
|
7
|
+
def create_timed_files(oldfile, *newfiles)
|
8
|
+
return if File.exist?(oldfile) && newfiles.all? { |newfile| File.exist?(newfile) }
|
9
|
+
old_time = create_file(oldfile)
|
10
|
+
newfiles.each do |newfile|
|
11
|
+
while create_file(newfile) <= old_time
|
12
|
+
sleep(0.1)
|
13
|
+
File.delete(newfile) rescue nil
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def create_dir(dirname)
|
19
|
+
FileUtils.mkdir_p(dirname) unless File.exist?(dirname)
|
20
|
+
File.stat(dirname).mtime
|
21
|
+
end
|
22
|
+
|
23
|
+
def create_file(name)
|
24
|
+
create_dir(File.dirname(name))
|
25
|
+
FileUtils.touch(name) unless File.exist?(name)
|
26
|
+
File.stat(name).mtime
|
27
|
+
end
|
28
|
+
|
29
|
+
def delete_file(name)
|
30
|
+
File.delete(name) rescue nil
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'rubygems'
|
5
|
+
gem 'session'
|
6
|
+
require 'session'
|
7
|
+
rescue LoadError
|
8
|
+
puts "UNABLE TO RUN FUNCTIONAL TESTS"
|
9
|
+
puts "No Session Found (gem install session)"
|
10
|
+
end
|
11
|
+
|
12
|
+
if defined?(Session)
|
13
|
+
puts "RUNNING WITH SESSIONS"
|
14
|
+
require 'test/session_functional'
|
15
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module InEnvironment
|
2
|
+
private
|
3
|
+
|
4
|
+
# Create an environment for a test. At the completion of the yielded
|
5
|
+
# block, the environment is restored to its original conditions.
|
6
|
+
def in_environment(settings)
|
7
|
+
original_settings = set_env(settings)
|
8
|
+
yield
|
9
|
+
ensure
|
10
|
+
set_env(original_settings)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Set the environment according to the settings hash.
|
14
|
+
def set_env(settings) # :nodoc:
|
15
|
+
result = {}
|
16
|
+
settings.each do |k, v|
|
17
|
+
result[k] = ENV[k]
|
18
|
+
if k == 'PWD'
|
19
|
+
result[k] = Dir.pwd
|
20
|
+
Dir.chdir(v)
|
21
|
+
elsif v.nil?
|
22
|
+
ENV.delete(k)
|
23
|
+
else
|
24
|
+
ENV[k] = v
|
25
|
+
end
|
26
|
+
end
|
27
|
+
result
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|