elliottcable-echoe 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. data/CHANGELOG +69 -0
  2. data/LICENSE +184 -0
  3. data/MIT-LICENSE +21 -0
  4. data/Manifest +113 -0
  5. data/README +114 -0
  6. data/Rakefile +15 -0
  7. data/TODO +4 -0
  8. data/echoe.gemspec +37 -0
  9. data/lib/echoe/client.rb +25 -0
  10. data/lib/echoe/extensions.rb +57 -0
  11. data/lib/echoe/platform.rb +36 -0
  12. data/lib/echoe/rubygems.rb +41 -0
  13. data/lib/echoe.rb +717 -0
  14. data/vendor/rake/CHANGES +400 -0
  15. data/vendor/rake/MIT-LICENSE +21 -0
  16. data/vendor/rake/README +285 -0
  17. data/vendor/rake/Rakefile +418 -0
  18. data/vendor/rake/TODO +20 -0
  19. data/vendor/rake/bin/rake +31 -0
  20. data/vendor/rake/doc/example/Rakefile1 +38 -0
  21. data/vendor/rake/doc/example/Rakefile2 +35 -0
  22. data/vendor/rake/doc/example/a.c +6 -0
  23. data/vendor/rake/doc/example/b.c +6 -0
  24. data/vendor/rake/doc/example/main.c +11 -0
  25. data/vendor/rake/doc/glossary.rdoc +51 -0
  26. data/vendor/rake/doc/jamis.rb +591 -0
  27. data/vendor/rake/doc/proto_rake.rdoc +127 -0
  28. data/vendor/rake/doc/rake.1.gz +0 -0
  29. data/vendor/rake/doc/rakefile.rdoc +534 -0
  30. data/vendor/rake/doc/rational.rdoc +151 -0
  31. data/vendor/rake/doc/release_notes/rake-0.4.14.rdoc +23 -0
  32. data/vendor/rake/doc/release_notes/rake-0.4.15.rdoc +35 -0
  33. data/vendor/rake/doc/release_notes/rake-0.5.0.rdoc +53 -0
  34. data/vendor/rake/doc/release_notes/rake-0.5.3.rdoc +78 -0
  35. data/vendor/rake/doc/release_notes/rake-0.5.4.rdoc +46 -0
  36. data/vendor/rake/doc/release_notes/rake-0.6.0.rdoc +141 -0
  37. data/vendor/rake/doc/release_notes/rake-0.7.0.rdoc +119 -0
  38. data/vendor/rake/doc/release_notes/rake-0.7.1.rdoc +59 -0
  39. data/vendor/rake/doc/release_notes/rake-0.7.2.rdoc +121 -0
  40. data/vendor/rake/doc/release_notes/rake-0.7.3.rdoc +47 -0
  41. data/vendor/rake/doc/release_notes/rake-0.8.0.rdoc +114 -0
  42. data/vendor/rake/doc/release_notes/rake-0.8.2.rdoc +165 -0
  43. data/vendor/rake/doc/release_notes/rake-0.8.3.rdoc +112 -0
  44. data/vendor/rake/install.rb +88 -0
  45. data/vendor/rake/lib/rake/classic_namespace.rb +8 -0
  46. data/vendor/rake/lib/rake/clean.rb +33 -0
  47. data/vendor/rake/lib/rake/contrib/compositepublisher.rb +24 -0
  48. data/vendor/rake/lib/rake/contrib/ftptools.rb +153 -0
  49. data/vendor/rake/lib/rake/contrib/publisher.rb +75 -0
  50. data/vendor/rake/lib/rake/contrib/rubyforgepublisher.rb +18 -0
  51. data/vendor/rake/lib/rake/contrib/sshpublisher.rb +47 -0
  52. data/vendor/rake/lib/rake/contrib/sys.rb +209 -0
  53. data/vendor/rake/lib/rake/gempackagetask.rb +103 -0
  54. data/vendor/rake/lib/rake/loaders/makefile.rb +35 -0
  55. data/vendor/rake/lib/rake/packagetask.rb +185 -0
  56. data/vendor/rake/lib/rake/rake_test_loader.rb +5 -0
  57. data/vendor/rake/lib/rake/rdoctask.rb +147 -0
  58. data/vendor/rake/lib/rake/ruby182_test_unit_fix.rb +23 -0
  59. data/vendor/rake/lib/rake/runtest.rb +23 -0
  60. data/vendor/rake/lib/rake/tasklib.rb +23 -0
  61. data/vendor/rake/lib/rake/testtask.rb +161 -0
  62. data/vendor/rake/lib/rake/win32.rb +54 -0
  63. data/vendor/rake/lib/rake.rb +2468 -0
  64. data/vendor/rake/test/capture_stdout.rb +26 -0
  65. data/vendor/rake/test/check_expansion.rb +5 -0
  66. data/vendor/rake/test/contrib/test_sys.rb +47 -0
  67. data/vendor/rake/test/data/chains/Rakefile +15 -0
  68. data/vendor/rake/test/data/default/Rakefile +19 -0
  69. data/vendor/rake/test/data/dryrun/Rakefile +22 -0
  70. data/vendor/rake/test/data/file_creation_task/Rakefile +33 -0
  71. data/vendor/rake/test/data/imports/Rakefile +19 -0
  72. data/vendor/rake/test/data/imports/deps.mf +1 -0
  73. data/vendor/rake/test/data/multidesc/Rakefile +17 -0
  74. data/vendor/rake/test/data/namespace/Rakefile +57 -0
  75. data/vendor/rake/test/data/rakelib/test1.rb +3 -0
  76. data/vendor/rake/test/data/rbext/rakefile.rb +3 -0
  77. data/vendor/rake/test/data/sample.mf +12 -0
  78. data/vendor/rake/test/data/statusreturn/Rakefile +8 -0
  79. data/vendor/rake/test/data/unittest/Rakefile +1 -0
  80. data/vendor/rake/test/filecreation.rb +32 -0
  81. data/vendor/rake/test/functional.rb +15 -0
  82. data/vendor/rake/test/in_environment.rb +30 -0
  83. data/vendor/rake/test/rake_test_setup.rb +10 -0
  84. data/vendor/rake/test/reqfile.rb +3 -0
  85. data/vendor/rake/test/reqfile2.rb +3 -0
  86. data/vendor/rake/test/session_functional.rb +337 -0
  87. data/vendor/rake/test/shellcommand.rb +3 -0
  88. data/vendor/rake/test/test_application.rb +694 -0
  89. data/vendor/rake/test/test_clean.rb +14 -0
  90. data/vendor/rake/test/test_definitions.rb +82 -0
  91. data/vendor/rake/test/test_earlytime.rb +35 -0
  92. data/vendor/rake/test/test_extension.rb +63 -0
  93. data/vendor/rake/test/test_file_creation_task.rb +62 -0
  94. data/vendor/rake/test/test_file_task.rb +139 -0
  95. data/vendor/rake/test/test_filelist.rb +618 -0
  96. data/vendor/rake/test/test_fileutils.rb +250 -0
  97. data/vendor/rake/test/test_ftp.rb +59 -0
  98. data/vendor/rake/test/test_invocation_chain.rb +75 -0
  99. data/vendor/rake/test/test_makefile_loader.rb +25 -0
  100. data/vendor/rake/test/test_multitask.rb +45 -0
  101. data/vendor/rake/test/test_namespace.rb +36 -0
  102. data/vendor/rake/test/test_package_task.rb +116 -0
  103. data/vendor/rake/test/test_pathmap.rb +209 -0
  104. data/vendor/rake/test/test_rake.rb +41 -0
  105. data/vendor/rake/test/test_require.rb +33 -0
  106. data/vendor/rake/test/test_rules.rb +347 -0
  107. data/vendor/rake/test/test_task_arguments.rb +89 -0
  108. data/vendor/rake/test/test_task_manager.rb +170 -0
  109. data/vendor/rake/test/test_tasklib.rb +12 -0
  110. data/vendor/rake/test/test_tasks.rb +371 -0
  111. data/vendor/rake/test/test_test_task.rb +75 -0
  112. data/vendor/rake/test/test_top_level_functions.rb +84 -0
  113. data/vendor/rake/test/test_win32.rb +57 -0
  114. metadata +195 -0
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'test/unit'
4
+ require 'fileutils'
5
+ require 'rake'
6
+ require 'test/filecreation'
7
+
8
+ ######################################################################
9
+ class TestDefinitions < Test::Unit::TestCase
10
+ include Rake
11
+ EXISTINGFILE = "testdata/existing"
12
+
13
+ def setup
14
+ Task.clear
15
+ end
16
+
17
+ def test_task
18
+ done = false
19
+ task :one => [:two] do done = true end
20
+ task :two
21
+ task :three => [:one, :two]
22
+ check_tasks(:one, :two, :three)
23
+ assert done, "Should be done"
24
+ end
25
+
26
+ def test_file_task
27
+ done = false
28
+ file "testdata/one" => "testdata/two" do done = true end
29
+ file "testdata/two"
30
+ file "testdata/three" => ["testdata/one", "testdata/two"]
31
+ check_tasks("testdata/one", "testdata/two", "testdata/three")
32
+ assert done, "Should be done"
33
+ end
34
+
35
+ def check_tasks(n1, n2, n3)
36
+ t = Task[n1]
37
+ assert Task === t, "Should be a Task"
38
+ assert_equal n1.to_s, t.name
39
+ assert_equal [n2.to_s], t.prerequisites.collect{|n| n.to_s}
40
+ t.invoke
41
+ t2 = Task[n2]
42
+ assert_equal FileList[], t2.prerequisites
43
+ t3 = Task[n3]
44
+ assert_equal [n1.to_s, n2.to_s], t3.prerequisites.collect{|n|n.to_s}
45
+ end
46
+
47
+ def test_incremental_definitions
48
+ runs = []
49
+ task :t1 => [:t2] do runs << "A"; 4321 end
50
+ task :t1 => [:t3] do runs << "B"; 1234 end
51
+ task :t1 => [:t3]
52
+ task :t2
53
+ task :t3
54
+ Task[:t1].invoke
55
+ assert_equal ["A", "B"], runs
56
+ assert_equal ["t2", "t3"], Task[:t1].prerequisites
57
+ end
58
+
59
+ def test_missing_dependencies
60
+ task :x => ["testdata/missing"]
61
+ assert_raises(RuntimeError) { Task[:x].invoke }
62
+ end
63
+
64
+ def test_implicit_file_dependencies
65
+ runs = []
66
+ create_existing_file
67
+ task :y => [EXISTINGFILE] do |t| runs << t.name end
68
+ Task[:y].invoke
69
+ assert_equal runs, ['y']
70
+ end
71
+
72
+ private # ----------------------------------------------------------
73
+
74
+ def create_existing_file
75
+ Dir.mkdir File.dirname(EXISTINGFILE) unless
76
+ File.exist?(File.dirname(EXISTINGFILE))
77
+ open(EXISTINGFILE, "w") do |f| f.puts "HI" end unless
78
+ File.exist?(EXISTINGFILE)
79
+ end
80
+
81
+ end
82
+
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'test/unit'
4
+ require 'rake'
5
+
6
+ class TestEarlyTime < Test::Unit::TestCase
7
+ def test_create
8
+ early = Rake::EarlyTime.instance
9
+ time = Time.mktime(1970, 1, 1, 0, 0, 0)
10
+ assert early <= Time.now
11
+ assert early < Time.now
12
+ assert early != Time.now
13
+ assert Time.now > early
14
+ assert Time.now >= early
15
+ assert Time.now != early
16
+ end
17
+
18
+ def test_equality
19
+ early = Rake::EarlyTime.instance
20
+ assert_equal early, early, "two early times should be equal"
21
+ end
22
+
23
+ def test_original_time_compare_is_not_messed_up
24
+ t1 = Time.mktime(1970, 1, 1, 0, 0, 0)
25
+ t2 = Time.now
26
+ assert t1 < t2
27
+ assert t2 > t1
28
+ assert t1 == t1
29
+ assert t2 == t2
30
+ end
31
+
32
+ def test_to_s
33
+ assert_equal "<EARLY TIME>", Rake::EARLY.to_s
34
+ end
35
+ end
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'test/unit'
4
+ require 'rake'
5
+ require 'stringio'
6
+
7
+ ######################################################################
8
+ class TestExtension < Test::Unit::TestCase
9
+
10
+ module Redirect
11
+ def error_redirect
12
+ old_err = $stderr
13
+ result = StringIO.new
14
+ $stderr = result
15
+ yield
16
+ result
17
+ ensure
18
+ $stderr = old_err
19
+ end
20
+ end
21
+
22
+ class Sample
23
+ extend Redirect
24
+
25
+ def duplicate_method
26
+ :original
27
+ end
28
+
29
+ OK_ERRS = error_redirect do
30
+ rake_extension("a") do
31
+ def ok_method
32
+ end
33
+ end
34
+ end
35
+
36
+
37
+ DUP_ERRS = error_redirect do
38
+ rake_extension("duplicate_method") do
39
+ def duplicate_method
40
+ :override
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ def test_methods_actually_exist
47
+ sample = Sample.new
48
+ sample.ok_method
49
+ sample.duplicate_method
50
+ end
51
+
52
+ def test_no_warning_when_defining_ok_method
53
+ assert_equal "", Sample::OK_ERRS.string
54
+ end
55
+
56
+ def test_extension_complains_when_a_method_that_is_present
57
+ assert_match(/warning:/i, Sample::DUP_ERRS.string)
58
+ assert_match(/already exists/i, Sample::DUP_ERRS.string)
59
+ assert_match(/duplicate_method/i, Sample::DUP_ERRS.string)
60
+ assert_equal :original, Sample.new.duplicate_method
61
+ end
62
+
63
+ end
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'test/unit'
4
+ require 'fileutils'
5
+ require 'rake'
6
+ require 'test/filecreation'
7
+
8
+ ######################################################################
9
+ class TestFileCreationTask < Test::Unit::TestCase
10
+ include Rake
11
+ include FileCreation
12
+
13
+ DUMMY_DIR = 'testdata/dummy_dir'
14
+
15
+ def setup
16
+ Task.clear
17
+ end
18
+
19
+ def teardown
20
+ FileUtils.rm_rf DUMMY_DIR
21
+ end
22
+
23
+ def test_file_needed
24
+ create_dir DUMMY_DIR
25
+ fc_task = Task[DUMMY_DIR]
26
+ assert_equal DUMMY_DIR, fc_task.name
27
+ FileUtils.rm_rf fc_task.name
28
+ assert fc_task.needed?, "file should be needed"
29
+ FileUtils.mkdir fc_task.name
30
+ assert_equal nil, fc_task.prerequisites.collect{|n| Task[n].timestamp}.max
31
+ assert ! fc_task.needed?, "file should not be needed"
32
+ end
33
+
34
+ def test_directory
35
+ directory DUMMY_DIR
36
+ fc_task = Task[DUMMY_DIR]
37
+ assert_equal DUMMY_DIR, fc_task.name
38
+ assert FileCreationTask === fc_task
39
+ end
40
+
41
+ def test_no_retriggers_on_filecreate_task
42
+ create_timed_files(OLDFILE, NEWFILE)
43
+ t1 = Rake.application.intern(FileCreationTask, OLDFILE).enhance([NEWFILE])
44
+ t2 = Rake.application.intern(FileCreationTask, NEWFILE)
45
+ assert ! t2.needed?, "Should not need to build new file"
46
+ assert ! t1.needed?, "Should not need to rebuild old file because of new"
47
+ end
48
+
49
+ def test_no_retriggers_on_file_task
50
+ create_timed_files(OLDFILE, NEWFILE)
51
+ t1 = Rake.application.intern(FileCreationTask, OLDFILE).enhance([NEWFILE])
52
+ t2 = Rake.application.intern(FileCreationTask, NEWFILE)
53
+ assert ! t2.needed?, "Should not need to build new file"
54
+ assert ! t1.needed?, "Should not need to rebuild old file because of new"
55
+ end
56
+
57
+ def test_very_early_timestamp
58
+ t1 = Rake.application.intern(FileCreationTask, OLDFILE)
59
+ assert t1.timestamp < Time.now
60
+ assert t1.timestamp < Time.now - 1000000
61
+ end
62
+ end
@@ -0,0 +1,139 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'test/unit'
4
+ require 'fileutils'
5
+ require 'rake'
6
+ require 'test/filecreation'
7
+
8
+ ######################################################################
9
+ class TestFileTask < Test::Unit::TestCase
10
+ include Rake
11
+ include FileCreation
12
+
13
+ def setup
14
+ Task.clear
15
+ @runs = Array.new
16
+ FileUtils.rm_f NEWFILE
17
+ FileUtils.rm_f OLDFILE
18
+ end
19
+
20
+ def test_file_need
21
+ name = "testdata/dummy"
22
+ file name
23
+ ftask = Task[name]
24
+ assert_equal name.to_s, ftask.name
25
+ File.delete(ftask.name) rescue nil
26
+ assert ftask.needed?, "file should be needed"
27
+ open(ftask.name, "w") { |f| f.puts "HI" }
28
+ assert_equal nil, ftask.prerequisites.collect{|n| Task[n].timestamp}.max
29
+ assert ! ftask.needed?, "file should not be needed"
30
+ File.delete(ftask.name) rescue nil
31
+ end
32
+
33
+ def test_file_times_new_depends_on_old
34
+ create_timed_files(OLDFILE, NEWFILE)
35
+
36
+ t1 = Rake.application.intern(FileTask, NEWFILE).enhance([OLDFILE])
37
+ t2 = Rake.application.intern(FileTask, OLDFILE)
38
+ assert ! t2.needed?, "Should not need to build old file"
39
+ assert ! t1.needed?, "Should not need to rebuild new file because of old"
40
+ end
41
+
42
+ def test_file_times_old_depends_on_new
43
+ create_timed_files(OLDFILE, NEWFILE)
44
+
45
+ t1 = Rake.application.intern(FileTask,OLDFILE).enhance([NEWFILE])
46
+ t2 = Rake.application.intern(FileTask, NEWFILE)
47
+ assert ! t2.needed?, "Should not need to build new file"
48
+ preq_stamp = t1.prerequisites.collect{|t| Task[t].timestamp}.max
49
+ assert_equal t2.timestamp, preq_stamp
50
+ assert t1.timestamp < preq_stamp, "T1 should be older"
51
+ assert t1.needed?, "Should need to rebuild old file because of new"
52
+ end
53
+
54
+ def test_file_depends_on_task_depend_on_file
55
+ create_timed_files(OLDFILE, NEWFILE)
56
+
57
+ file NEWFILE => [:obj] do |t| @runs << t.name end
58
+ task :obj => [OLDFILE] do |t| @runs << t.name end
59
+ file OLDFILE do |t| @runs << t.name end
60
+
61
+ Task[:obj].invoke
62
+ Task[NEWFILE].invoke
63
+ assert ! @runs.include?(NEWFILE)
64
+ end
65
+
66
+ def test_existing_file_depends_on_non_existing_file
67
+ create_file(OLDFILE)
68
+ delete_file(NEWFILE)
69
+ file NEWFILE
70
+ file OLDFILE => NEWFILE
71
+ assert_nothing_raised do Task[OLDFILE].invoke end
72
+ end
73
+
74
+ # I have currently disabled this test. I'm not convinced that
75
+ # deleting the file target on failure is always the proper thing to
76
+ # do. I'm willing to hear input on this topic.
77
+ def ztest_file_deletes_on_failure
78
+ task :obj
79
+ file NEWFILE => [:obj] do |t|
80
+ FileUtils.touch NEWFILE
81
+ fail "Ooops"
82
+ end
83
+ assert Task[NEWFILE]
84
+ begin
85
+ Task[NEWFILE].invoke
86
+ rescue Exception
87
+ end
88
+ assert( ! File.exist?(NEWFILE), "NEWFILE should be deleted")
89
+ end
90
+
91
+ end
92
+
93
+ ######################################################################
94
+ class TestDirectoryTask < Test::Unit::TestCase
95
+ include Rake
96
+
97
+ def setup
98
+ rm_rf "testdata", :verbose=>false
99
+ end
100
+
101
+ def teardown
102
+ rm_rf "testdata", :verbose=>false
103
+ end
104
+
105
+ def test_directory
106
+ desc "DESC"
107
+ directory "testdata/a/b/c"
108
+ assert_equal FileCreationTask, Task["testdata"].class
109
+ assert_equal FileCreationTask, Task["testdata/a"].class
110
+ assert_equal FileCreationTask, Task["testdata/a/b/c"].class
111
+ assert_nil Task["testdata"].comment
112
+ assert_equal "DESC", Task["testdata/a/b/c"].comment
113
+ assert_nil Task["testdata/a/b"].comment
114
+ verbose(false) {
115
+ Task['testdata/a/b'].invoke
116
+ }
117
+ assert File.exist?("testdata/a/b")
118
+ assert ! File.exist?("testdata/a/b/c")
119
+ end
120
+
121
+ def test_directory_win32
122
+ desc "WIN32 DESC"
123
+ FileUtils.mkdir_p("testdata")
124
+ Dir.chdir("testdata") do
125
+ directory 'c:/testdata/a/b/c'
126
+ assert_equal FileCreationTask, Task['c:/testdata'].class
127
+ assert_equal FileCreationTask, Task['c:/testdata/a'].class
128
+ assert_equal FileCreationTask, Task['c:/testdata/a/b/c'].class
129
+ assert_nil Task['c:/testdata'].comment
130
+ assert_equal "WIN32 DESC", Task['c:/testdata/a/b/c'].comment
131
+ assert_nil Task['c:/testdata/a/b'].comment
132
+ verbose(false) {
133
+ Task['c:/testdata/a/b'].invoke
134
+ }
135
+ assert File.exist?('c:/testdata/a/b')
136
+ assert ! File.exist?('c:/testdata/a/b/c')
137
+ end
138
+ end
139
+ end