tap 0.7.9 → 0.8.0

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.
Files changed (149) hide show
  1. data/History +28 -0
  2. data/MIT-LICENSE +1 -1
  3. data/README +71 -43
  4. data/Rakefile +81 -64
  5. data/Tutorial +235 -0
  6. data/bin/tap +80 -44
  7. data/lib/tap.rb +41 -12
  8. data/lib/tap/app.rb +243 -246
  9. data/lib/tap/file_task.rb +357 -118
  10. data/lib/tap/generator.rb +88 -29
  11. data/lib/tap/generator/generators/config/config_generator.rb +4 -2
  12. data/lib/tap/generator/generators/config/templates/config.erb +1 -2
  13. data/lib/tap/generator/generators/file_task/file_task_generator.rb +3 -18
  14. data/lib/tap/generator/generators/file_task/templates/task.erb +22 -15
  15. data/lib/tap/generator/generators/file_task/templates/test.erb +13 -2
  16. data/{test/test/inference_methods/test_assert_files_exist/input/input_1.txt → lib/tap/generator/generators/generator/USAGE} +0 -0
  17. data/lib/tap/generator/generators/generator/generator_generator.rb +21 -0
  18. data/lib/tap/generator/generators/generator/templates/generator.erb +23 -0
  19. data/lib/tap/generator/generators/generator/templates/usage.erb +1 -0
  20. data/{test/test/inference_methods/test_assert_files_exist/input/input_2.txt → lib/tap/generator/generators/package/USAGE} +0 -0
  21. data/lib/tap/generator/generators/package/package_generator.rb +38 -0
  22. data/lib/tap/generator/generators/package/templates/package.erb +186 -0
  23. data/lib/tap/generator/generators/root/root_generator.rb +14 -9
  24. data/lib/tap/generator/generators/root/templates/Rakefile +20 -14
  25. data/{test/test/inference_methods/test_infer_glob/expected/file.yml → lib/tap/generator/generators/root/templates/ReadMe.txt} +0 -0
  26. data/lib/tap/generator/generators/root/templates/tap.yml +82 -0
  27. data/lib/tap/generator/generators/root/templates/test/tap_test_helper.rb +0 -1
  28. data/lib/tap/generator/generators/root/templates/test/tap_test_suite.rb +2 -1
  29. data/{test/test/inference_methods/test_infer_glob/expected/file_1.txt → lib/tap/generator/generators/script/USAGE} +0 -0
  30. data/lib/tap/generator/generators/script/script_generator.rb +17 -0
  31. data/lib/tap/generator/generators/script/templates/script.erb +42 -0
  32. data/lib/tap/generator/generators/task/task_generator.rb +1 -1
  33. data/lib/tap/generator/generators/task/templates/task.erb +24 -16
  34. data/lib/tap/generator/generators/task/templates/test.erb +13 -17
  35. data/lib/tap/generator/generators/workflow/templates/task.erb +10 -10
  36. data/lib/tap/generator/generators/workflow/templates/test.erb +1 -1
  37. data/lib/tap/generator/generators/workflow/workflow_generator.rb +3 -18
  38. data/lib/tap/root.rb +108 -146
  39. data/lib/tap/script.rb +362 -0
  40. data/lib/tap/script/console.rb +28 -0
  41. data/lib/tap/script/destroy.rb +13 -1
  42. data/lib/tap/script/generate.rb +13 -1
  43. data/lib/tap/script/run.rb +100 -57
  44. data/lib/tap/support/batch_queue.rb +0 -3
  45. data/lib/tap/support/logger.rb +6 -3
  46. data/lib/tap/support/rake.rb +54 -0
  47. data/lib/tap/support/task_configuration.rb +169 -0
  48. data/lib/tap/support/tdoc.rb +198 -0
  49. data/lib/tap/support/tdoc/config_attr.rb +338 -0
  50. data/lib/tap/support/tdoc/tdoc_html_generator.rb +38 -0
  51. data/lib/tap/support/tdoc/tdoc_html_template.rb +42 -0
  52. data/lib/tap/support/versions.rb +33 -1
  53. data/lib/tap/task.rb +339 -227
  54. data/lib/tap/test.rb +86 -128
  55. data/lib/tap/test/env_vars.rb +16 -5
  56. data/lib/tap/test/file_methods.rb +373 -0
  57. data/lib/tap/test/subset_methods.rb +299 -180
  58. data/lib/tap/version.rb +2 -1
  59. data/lib/tap/workflow.rb +2 -0
  60. data/test/app/lib/app_test_task.rb +1 -0
  61. data/test/app_test.rb +327 -83
  62. data/test/check/binding_eval.rb +23 -0
  63. data/test/check/define_method_check.rb +22 -0
  64. data/test/check/dependencies_check.rb +175 -0
  65. data/test/check/inheritance_check.rb +22 -0
  66. data/test/file_task_test.rb +524 -291
  67. data/test/{test/inference_methods/test_infer_glob/expected/file_2.txt → root/glob/one.txt} +0 -0
  68. data/test/root/glob/two.txt +0 -0
  69. data/test/root_test.rb +330 -262
  70. data/test/script_test.rb +194 -0
  71. data/test/support/audit_test.rb +5 -2
  72. data/test/support/combinator_test.rb +10 -10
  73. data/test/support/rake_test.rb +35 -0
  74. data/test/support/task_configuration_test.rb +272 -0
  75. data/test/support/tdoc_test.rb +363 -0
  76. data/test/support/templater_test.rb +2 -2
  77. data/test/support/versions_test.rb +32 -0
  78. data/test/tap_test_helper.rb +39 -0
  79. data/test/task_base_test.rb +115 -0
  80. data/test/task_class_test.rb +56 -4
  81. data/test/task_execute_test.rb +29 -0
  82. data/test/task_test.rb +89 -70
  83. data/test/test/env_vars_test.rb +48 -0
  84. data/test/test/{inference_methods → file_methods}/test_assert_expected/expected/file.txt +0 -0
  85. data/test/test/{inference_methods → file_methods}/test_assert_expected/expected/folder/file.txt +0 -0
  86. data/test/test/{inference_methods → file_methods}/test_assert_expected/input/file.txt +0 -0
  87. data/test/test/{inference_methods → file_methods}/test_assert_expected/input/folder/file.txt +0 -0
  88. data/test/test/file_methods/test_assert_files_exist/input/input_1.txt +0 -0
  89. data/test/test/file_methods/test_assert_files_exist/input/input_2.txt +0 -0
  90. data/test/test/file_methods/test_assert_output_files_equal/expected/one.txt +1 -0
  91. data/test/test/file_methods/test_assert_output_files_equal/expected/two.txt +1 -0
  92. data/test/test/file_methods/test_assert_output_files_equal/input/one.txt +1 -0
  93. data/test/test/file_methods/test_assert_output_files_equal/input/two.txt +1 -0
  94. data/test/test/{inference_methods → file_methods}/test_file_compare/expected/output_1.txt +0 -0
  95. data/test/test/{inference_methods → file_methods}/test_file_compare/expected/output_2.txt +0 -0
  96. data/test/test/{inference_methods → file_methods}/test_file_compare/input/input_1.txt +0 -0
  97. data/test/test/{inference_methods → file_methods}/test_file_compare/input/input_2.txt +0 -0
  98. data/test/test/file_methods/test_infer_glob/expected/file.yml +0 -0
  99. data/test/test/file_methods/test_infer_glob/expected/file_1.txt +0 -0
  100. data/test/test/file_methods/test_infer_glob/expected/file_2.txt +0 -0
  101. data/test/test/file_methods/test_method_glob/expected/file.yml +0 -0
  102. data/test/test/file_methods/test_method_glob/expected/file_1.txt +0 -0
  103. data/test/test/file_methods/test_method_glob/expected/file_2.txt +0 -0
  104. data/test/test/{inference_methods → file_methods}/test_yml_compare/expected/output_1.yml +0 -0
  105. data/test/test/{inference_methods → file_methods}/test_yml_compare/expected/output_2.yml +0 -0
  106. data/test/test/{inference_methods → file_methods}/test_yml_compare/input/input_1.yml +0 -0
  107. data/test/test/{inference_methods → file_methods}/test_yml_compare/input/input_2.yml +0 -0
  108. data/test/test/file_methods_test.rb +204 -0
  109. data/test/test/subset_methods_test.rb +93 -33
  110. data/test/test/test_assert_expected_result_files/expected/task/name/a.txt +1 -0
  111. data/test/test/test_assert_expected_result_files/expected/task/name/b.txt +1 -0
  112. data/test/test/test_assert_expected_result_files/input/a.txt +1 -0
  113. data/test/test/test_assert_expected_result_files/input/b.txt +1 -0
  114. data/test/test/test_file_task_test/expected/one.txt +1 -0
  115. data/test/test/test_file_task_test/expected/two.txt +1 -0
  116. data/test/test/test_file_task_test/input/one.txt +1 -0
  117. data/test/test/test_file_task_test/input/two.txt +1 -0
  118. data/test/test_test.rb +143 -3
  119. data/test/workflow_test.rb +2 -0
  120. data/vendor/rails_generator.rb +56 -0
  121. data/vendor/rails_generator/base.rb +263 -0
  122. data/vendor/rails_generator/commands.rb +581 -0
  123. data/vendor/rails_generator/generated_attribute.rb +42 -0
  124. data/vendor/rails_generator/lookup.rb +209 -0
  125. data/vendor/rails_generator/manifest.rb +53 -0
  126. data/vendor/rails_generator/options.rb +143 -0
  127. data/vendor/rails_generator/scripts.rb +83 -0
  128. data/vendor/rails_generator/scripts/destroy.rb +7 -0
  129. data/vendor/rails_generator/scripts/generate.rb +7 -0
  130. data/vendor/rails_generator/scripts/update.rb +12 -0
  131. data/vendor/rails_generator/simple_logger.rb +46 -0
  132. data/vendor/rails_generator/spec.rb +44 -0
  133. metadata +180 -196
  134. data/lib/tap/generator/generators/root/templates/app.yml +0 -19
  135. data/lib/tap/generator/generators/root/templates/config/process_tap_request.yml +0 -4
  136. data/lib/tap/generator/generators/root/templates/lib/process_tap_request.rb +0 -26
  137. data/lib/tap/generator/generators/root/templates/public/images/nav.jpg +0 -0
  138. data/lib/tap/generator/generators/root/templates/public/stylesheets/color.css +0 -57
  139. data/lib/tap/generator/generators/root/templates/public/stylesheets/layout.css +0 -108
  140. data/lib/tap/generator/generators/root/templates/public/stylesheets/normalize.css +0 -40
  141. data/lib/tap/generator/generators/root/templates/public/stylesheets/typography.css +0 -21
  142. data/lib/tap/generator/generators/root/templates/server/config/environment.rb +0 -60
  143. data/lib/tap/generator/generators/root/templates/server/lib/tasks/clear_database_prerequisites.rake +0 -5
  144. data/lib/tap/generator/generators/root/templates/server/test/test_helper.rb +0 -53
  145. data/lib/tap/script/server.rb +0 -12
  146. data/lib/tap/support/rap.rb +0 -38
  147. data/lib/tap/test/inference_methods.rb +0 -298
  148. data/test/task/config/task_with_config.yml +0 -1
  149. data/test/test/inference_methods_test.rb +0 -311
@@ -1,19 +0,0 @@
1
- # Put your app configurations here:
2
-
3
- #root: #
4
- #directories: # uncomment to specify aliases for directories
5
- #lib:
6
- #log:
7
- #...
8
-
9
- #options: # uncomment to specify options
10
- #trace: true # full error output, increased logging
11
- #quiet: true # supresses logging
12
- #... # you can add your own options
13
-
14
- logger:
15
- #device: # STDOUT by default
16
- #level: 1 # [DEBUG, INFO, WARN, ERROR, FATAL, ANY]
17
- datetime_format: %H:%M:%S # Hour:Minute:Second
18
-
19
- loadable: 'lib'
@@ -1,4 +0,0 @@
1
- # Put your task configurations here:
2
-
3
- # Remote URL should point to the host and port of the remote server
4
- remote_url: http://localhost:3000
@@ -1,26 +0,0 @@
1
- require 'net/http'
2
- require 'cgi'
3
- require 'yaml'
4
-
5
- class ProcessTapRequest < Tap::Task
6
- def process(input)
7
- id = input['id']
8
- key = input['key']
9
-
10
- url = URI.parse(config[:remote_url])
11
- res = Net::HTTP.start(url.host, url.port) do |http|
12
- http.get("/tap/queue/#{id}?key=#{key}")
13
- end
14
-
15
- unless res.kind_of?(Net::HTTPSuccess)
16
- puts res.body
17
- return
18
- end
19
-
20
- queue = YAML.load(res.body)
21
- task = queue['task']
22
- input = queue['input']
23
-
24
- Tap::App.run(task, *input)
25
- end
26
- end
@@ -1,57 +0,0 @@
1
- /* Color scheme
2
-
3
- off_white background: #f1f8ee;
4
- light background: #DCE6CF;
5
- dark background: #648F7D;
6
-
7
- content text: black
8
- red text: #8a181d;
9
- identifiers: #708059;
10
-
11
- muted:
12
- links _ color: #805976;
13
- hover _ color: #CC0099;
14
-
15
- bold:
16
- links _ color: #0000FF;
17
- hover _ color: #800080;
18
-
19
- light contrast (notifications and links): #708059;
20
- strong contrast (notifications and hover): #CC0099;
21
-
22
- */
23
-
24
- body {
25
- color: black;
26
- background-color: #DCE6CF;
27
- }
28
-
29
- a { color: #8a181d; }
30
- a:hover{ color: #800080;}
31
-
32
- a.muted { color: #805976; }
33
- a.muted:hover{ color: #CC0099; }
34
-
35
- .highlight {color: #FF0000;}
36
-
37
- #flash { color: #99BF60; }
38
-
39
- /* Branding */
40
- div#brandingLogo {
41
- color: #f1f8ee;
42
- }
43
-
44
- /* Navigation */
45
- div#navMain ul li {
46
- background-color: #B4CC8F;
47
- border-top-color: #805976;
48
- border-right-color: #805976;
49
- }
50
- div#navSupp ul li {
51
- background-color: #B4CC8F;
52
- border-top-color: #805976;
53
- border-left-color: #805976;
54
- }
55
- div#navControl a {
56
- color: #f1f8ee;
57
- }
@@ -1,108 +0,0 @@
1
- @import url(normalize.css);
2
- @import url(color.css);
3
- @import url(typography.css);
4
-
5
- body {
6
- margin: 0;
7
- padding: 0;
8
- width: 100%;
9
- }
10
-
11
- div#branding, div#nav, div#content {
12
- position: relative;
13
- min-width: 50em;
14
- width: 100%;
15
- }
16
-
17
- /* Branding */
18
- div#branding {
19
- position: absolute;
20
- z-index: 10; /* sets the branding above the nav background */
21
- }
22
- div#brandingLogo {
23
- position: absolute;
24
- top: .5em;
25
- left: .5em;
26
- }
27
-
28
- /* Navigation */
29
- div#nav {
30
- top: 0;
31
- left: 0;
32
- height: 6em;
33
- background-image: url(../images/nav.jpg);
34
- background-repeat: no-repeat;
35
- background-position: center top;
36
- }
37
-
38
- /* Control Navigation */
39
- div#navControl {
40
- position: absolute;
41
- top: 0;
42
- right: 0;
43
- }
44
-
45
- /* Main and Supp Navigation */
46
- div#navMain, div#navSupp {
47
- position: absolute;
48
- bottom: 0;
49
- }
50
- div#navMain {
51
- left:0;
52
- }
53
- div#navSupp {
54
- right: 0;
55
- }
56
-
57
- div#nav ul li {
58
- float: left;
59
- padding-left: .5em;
60
- padding-right: .5em;
61
- }
62
- div#navMain ul li {
63
- border-top-style: solid;
64
- border-top-width: 1px;
65
- border-right-style: solid;
66
- border-right-width: 1px;
67
- }
68
- div#navSupp ul li {
69
- border-top-style: solid;
70
- border-top-width: 1px;
71
- border-left-style: solid;
72
- border-left-width: 1px;
73
- }
74
-
75
- /* Misc Navigation - these are intended for contentSupp */
76
- .navMisc {
77
- padding-top: 1em;
78
- padding-left: 3em;
79
- padding-right: 1em;
80
- }
81
- .navMisc ul {
82
- padding-left: 1em;
83
- }
84
-
85
- /* Content */
86
- div#contentMain {
87
- left: 0;
88
- width: 75%;
89
- }
90
- div#contentSupp {
91
- left: 75%;
92
- width: 25%;
93
- }
94
-
95
- /* Inman clearing */
96
- .pc,.sc {position:absolute; top:0;}
97
- .clear_children,.cc_tallest { position: relative; } /**/* html .clear_children { display: inline;}/* PREVENTS MISSING CHILDREN IN IE WIN 5.0 */
98
- .cc_tallest:after { content: ''; } /* PREVENTS A REDRAW BUG IN SAFARI */
99
-
100
- /* Site Infor */
101
- div#siteInfo {
102
- text-align:center;
103
- width: 75%;
104
- min-width: 37.5em;
105
- }
106
- div#siteInfo p {
107
- display: inline;
108
- }
@@ -1,40 +0,0 @@
1
- /* normalize.css */
2
- /* Based the normalizations presented in Transcending CSS - Andy Clarke 2007
3
- * and undohtml.css file by Tantek Celik 2004
4
- * http://tantek.com/log/2004/undohtml.css */
5
-
6
- /* Normalize margin, padding */
7
- body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td
8
- { margin: 0; padding: 0 }
9
-
10
- /* Normalize font-size for headers */
11
- h1,h2,h3,h4,h5,h6
12
- { font-size: 100% }
13
-
14
- /* Removes list-style from lists */
15
- ul,ol
16
- { list-style: none }
17
-
18
- /* Normalize font-style and font-weight to normal */
19
- address,caption,cite,code,dfn,em,strong,th,var
20
- { font-style: normal; font-weight: normal;}
21
-
22
- /* Normalizes table style*/
23
- table
24
- { border-collapse: collapse; border-spacing: 0;}
25
-
26
- /* Remove border from fieldset and img */
27
- fieldset,img
28
- { border: 0;}
29
-
30
- /* Left-align text in caption and th */
31
- caption,th
32
- { text-align: left;}
33
-
34
- /* Remove quotation marks from q */
35
- q:before,q:after
36
- { content:'';}
37
-
38
- /* link underlines tend to make hypertext less readable,
39
- because underlines obscure the shapes of the lower halves of words */
40
- a:link,a:visited { text-decoration:none }
@@ -1,21 +0,0 @@
1
-
2
- body {
3
- font-family: trebuchet ms, verdana, arial, tahoma;
4
- font-size: 100%; /* can't remember why, but for an IE bug this was included */
5
- }
6
-
7
- .emphasize {font-weight: bold;}
8
-
9
- /* Branding */
10
- div#brandingLogo {
11
- font-size: 2em;
12
- }
13
-
14
-
15
- /* Navigation */
16
- div#navMain, div#navSupp {
17
- font-weight: bold;
18
- }
19
- div#navControl {
20
- font-size: 0.8em;
21
- }
@@ -1,60 +0,0 @@
1
- # Be sure to restart your web server when you modify this file.
2
-
3
- # Uncomment below to force Rails into production mode when
4
- # you don't control web/app server and can't set it the proper way
5
- # ENV['RAILS_ENV'] ||= 'production'
6
-
7
- # Specifies gem version of Rails to use when vendor/rails is not present
8
- RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION
9
-
10
- # Bootstrap the Rails environment, frameworks, and default configuration
11
- require File.join(File.dirname(__FILE__), 'boot')
12
-
13
- Rails::Initializer.run do |config|
14
- # Settings in config/environments/* take precedence over those specified here
15
-
16
- # Skip frameworks you're not going to use (only works if using vendor/rails)
17
- config.frameworks -= [ :action_web_service, :action_mailer ]
18
-
19
- # Only load the plugins named here, by default all plugins in vendor/plugins are loaded
20
- # config.plugins = %W( exception_notification ssl_requirement )
21
-
22
- # Add additional load paths for your own custom dirs
23
- # config.load_paths += %W( #{RAILS_ROOT}/extras )
24
-
25
- # Force all environments to use the same logger level
26
- # (by default production uses :info, the others :debug)
27
- # config.log_level = :debug
28
-
29
- # Use the database for sessions instead of the file system
30
- # (create the session table with 'rake db:sessions:create')
31
- # config.action_controller.session_store = :active_record_store
32
-
33
- # Use SQL instead of Active Record's schema dumper when creating the test database.
34
- # This is necessary if your schema can't be completely dumped by the schema dumper,
35
- # like if you have constraints or database-specific column types
36
- # config.active_record.schema_format = :sql
37
-
38
- # Activate observers that should always be running
39
- # config.active_record.observers = :cacher, :garbage_collector
40
-
41
- # Make Active Record use UTC-base instead of local time
42
- # config.active_record.default_timezone = :utc
43
-
44
- # See Rails::Configuration for more options
45
- end
46
-
47
- # Add new inflection rules using the following format
48
- # (all these examples are active by default):
49
- # Inflector.inflections do |inflect|
50
- # inflect.plural /^(ox)$/i, '\1en'
51
- # inflect.singular /^(ox)en/i, '\1'
52
- # inflect.irregular 'person', 'people'
53
- # inflect.uncountable %w( fish sheep )
54
- # end
55
-
56
- # Add new mime types for use in respond_to blocks:
57
- # Mime::Type.register "text/richtext", :rtf
58
- # Mime::Type.register "application/x-mobile", :mobile
59
-
60
- # Include your application configuration below
@@ -1,5 +0,0 @@
1
- # This clears the built-in prerequisite 'db:test:prepare' from all the test tasks, allowing
2
- # rails to run without a database (updated from "Rails Recipies":http://media.pragprog.com/titles/fr_rr/NoDatabase.pdf)
3
- ['test:units', 'test:functionals', 'test:recent', 'test:integration', 'test:uncommitted'].each do |name|
4
- Rake::Task[name].prerequisites.clear
5
- end
@@ -1,53 +0,0 @@
1
- ENV["RAILS_ENV" ] = "test"
2
- require File.expand_path(File.dirname(__FILE__) + "/../config/environment" )
3
-
4
- #################
5
- # Here I've copied the contents of 'test_help' so I could remove the dependencies
6
- # causing rails to raise errors if running without a database.
7
- #
8
- # require 'test_help'
9
- require_dependency 'application'
10
-
11
- # Make double-sure the RAILS_ENV is set to test,
12
- # so fixtures are loaded to the right database
13
- silence_warnings { RAILS_ENV = "test" }
14
-
15
- require 'test/unit'
16
- #require 'active_record/fixtures'
17
- require 'action_controller/test_process'
18
- require 'action_controller/integration'
19
- #require 'action_web_service/test_invoke'
20
- require 'breakpoint'
21
-
22
- #Test::Unit::TestCase.fixture_path = RAILS_ROOT + "/test/fixtures/"
23
- #ActionController::IntegrationTest.fixture_path = Test::Unit::TestCase.fixture_path
24
-
25
- #def create_fixtures(*table_names)
26
- # Fixtures.create_fixtures(RAILS_ROOT + "/test/fixtures", table_names)
27
- #end
28
- #################
29
-
30
- class Test::Unit::TestCase
31
- # Transactional fixtures accelerate your tests by wrapping each test method
32
- # in a transaction that's rolled back on completion. This ensures that the
33
- # test database remains unchanged so your fixtures don't have to be reloaded
34
- # between every test method. Fewer database queries means faster tests.
35
- #
36
- # Read Mike Clark's excellent walkthrough at
37
- # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
38
- #
39
- # Every Active Record database supports transactions except MyISAM tables
40
- # in MySQL. Turn off transactional fixtures in this case; however, if you
41
- # don't care one way or the other, switching from MyISAM to InnoDB tables
42
- # is recommended.
43
- #self.use_transactional_fixtures = true
44
-
45
- # Instantiated fixtures are slow, but give you @david where otherwise you
46
- # would need people(:david). If you don't want to migrate your existing
47
- # test cases which use the @david style and don't mind the speed hit (each
48
- # instantiated fixtures translates to a database query per test method),
49
- # then set this back to true.
50
- #self.use_instantiated_fixtures = false
51
-
52
- # Add more helper methods to be used by all tests here...
53
- end
@@ -1,12 +0,0 @@
1
- # change to the server dir so that script/server launches as normal
2
- # (otherwise Mongrel can raise errors because it can't find a log file)
3
- Dir.chdir Tap::App.instance[:server]
4
-
5
- server_script = "script/server"
6
- unless File.exists?(server_script)
7
- puts "server script does not exist: #{Tap::App.instance.filepath(:server, server_script)}"
8
- puts "no tap server available?"
9
- exit
10
- end
11
-
12
- load server_script
@@ -1,38 +0,0 @@
1
- module Tap
2
- module Support
3
-
4
- # Defines the minimum methods to run (ie to queue and to execute)
5
- # an object from Tap::App, aside from execute which must be
6
- # provided by the object itself. Does not permit use in workflow
7
- # methods (requires results, condition, and on_complete)
8
- #
9
- # == Advice
10
- #
11
- # If you ever want to multithread the object, execute should be
12
- # limited to one thread at a time, for example by wrapping it in
13
- # synchronize from the MonitorMixin. You will probably get away
14
- # without doing so unless you're adding the object to the queue
15
- # multiple times in succession -- but be on the lookout for
16
- # unexpected results due to unsynchronized execution.
17
- module Rap
18
- attr_accessor :multithread
19
-
20
- def multithread?
21
- multithread
22
- end
23
-
24
- def executable?(inputs)
25
- true
26
- end
27
-
28
- def batch
29
- @batch ||= [self]
30
- end
31
-
32
- def batched?
33
- batch.length > 1
34
- end
35
- end
36
- end
37
- end
38
-