tap 0.9.1 → 0.10.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.
- data/History +37 -30
- data/MIT-LICENSE +1 -1
- data/README +92 -44
- data/bin/tap +62 -75
- data/cmd/console.rb +42 -0
- data/cmd/destroy.rb +16 -0
- data/cmd/generate.rb +16 -0
- data/cmd/run.rb +126 -0
- data/doc/Class Reference +362 -0
- data/doc/Command Reference +153 -0
- data/doc/Tutorial +237 -0
- data/lib/tap.rb +6 -45
- data/lib/tap/app.rb +126 -500
- data/lib/tap/constants.rb +2 -29
- data/lib/tap/env.rb +555 -250
- data/lib/tap/file_task.rb +60 -103
- data/lib/tap/generator/base.rb +109 -0
- data/lib/tap/generator/destroy.rb +37 -0
- data/lib/tap/generator/generate.rb +61 -0
- data/lib/tap/generator/generators/command/command_generator.rb +16 -12
- data/lib/tap/generator/generators/command/templates/command.erb +13 -19
- data/lib/tap/generator/generators/config/config_generator.rb +18 -27
- data/lib/tap/generator/generators/config/templates/doc.erb +12 -0
- data/lib/tap/generator/generators/config/templates/nodoc.erb +8 -0
- data/lib/tap/generator/generators/file_task/file_task_generator.rb +16 -11
- data/lib/tap/generator/generators/file_task/templates/file.txt +11 -2
- data/lib/tap/generator/generators/file_task/templates/result.yml +6 -0
- data/lib/tap/generator/generators/file_task/templates/task.erb +24 -31
- data/lib/tap/generator/generators/file_task/templates/test.erb +18 -22
- data/lib/tap/generator/generators/root/root_generator.rb +45 -31
- data/lib/tap/generator/generators/root/templates/Rakefile +64 -41
- data/lib/tap/generator/generators/root/templates/gemspec +27 -0
- data/lib/tap/generator/generators/root/templates/tapfile +8 -0
- data/lib/tap/generator/generators/root/templates/test/tap_test_helper.rb +0 -0
- data/lib/tap/generator/generators/root/templates/test/tap_test_suite.rb +1 -1
- data/lib/tap/generator/generators/root/templates/test/tapfile_test.rb +15 -0
- data/lib/tap/generator/generators/task/task_generator.rb +21 -28
- data/lib/tap/generator/generators/task/templates/task.erb +13 -23
- data/lib/tap/generator/generators/task/templates/test.erb +15 -18
- data/lib/tap/generator/manifest.rb +14 -0
- data/lib/tap/patches/rake/rake_test_loader.rb +0 -0
- data/lib/tap/patches/rake/testtask.rb +0 -0
- data/lib/tap/patches/ruby19/backtrace_filter.rb +0 -0
- data/lib/tap/patches/ruby19/parsedate.rb +0 -0
- data/lib/tap/root.rb +260 -21
- data/lib/tap/support/aggregator.rb +11 -11
- data/lib/tap/support/assignments.rb +172 -0
- data/lib/tap/support/audit.rb +20 -18
- data/lib/tap/support/batchable.rb +21 -10
- data/lib/tap/support/batchable_class.rb +107 -0
- data/lib/tap/support/class_configuration.rb +154 -239
- data/lib/tap/support/command_line.rb +97 -102
- data/lib/tap/support/comment.rb +270 -0
- data/lib/tap/support/configurable.rb +86 -65
- data/lib/tap/support/configurable_class.rb +296 -0
- data/lib/tap/support/configuration.rb +122 -0
- data/lib/tap/support/constant.rb +70 -0
- data/lib/tap/support/constant_utils.rb +127 -0
- data/lib/tap/support/declarations.rb +111 -0
- data/lib/tap/support/executable.rb +30 -17
- data/lib/tap/support/executable_queue.rb +0 -0
- data/lib/tap/support/framework.rb +71 -0
- data/lib/tap/support/framework_class.rb +199 -0
- data/lib/tap/support/instance_configuration.rb +147 -0
- data/lib/tap/support/lazydoc.rb +428 -0
- data/lib/tap/support/manifest.rb +89 -0
- data/lib/tap/support/run_error.rb +0 -0
- data/lib/tap/support/shell_utils.rb +33 -9
- data/lib/tap/support/summary.rb +30 -0
- data/lib/tap/support/tdoc.rb +339 -134
- data/lib/tap/support/tdoc/tdoc_html_generator.rb +0 -0
- data/lib/tap/support/tdoc/tdoc_html_template.rb +0 -0
- data/lib/tap/support/templater.rb +180 -0
- data/lib/tap/support/validation.rb +409 -76
- data/lib/tap/support/versions.rb +5 -3
- data/lib/tap/task.rb +78 -174
- data/lib/tap/tasks/dump.rb +56 -0
- data/lib/tap/tasks/rake.rb +93 -0
- data/lib/tap/test.rb +3 -3
- data/lib/tap/test/env_vars.rb +2 -2
- data/lib/tap/test/file_methods.rb +19 -20
- data/lib/tap/test/script_methods.rb +144 -0
- data/lib/tap/test/subset_methods.rb +1 -1
- data/lib/tap/test/tap_methods.rb +28 -62
- data/lib/tap/workflow.rb +22 -39
- metadata +48 -179
- data/Basic Overview +0 -151
- data/Command Reference +0 -99
- data/Rakefile +0 -127
- data/Tutorial +0 -287
- data/lib/tap/cmd/console.rb +0 -31
- data/lib/tap/cmd/destroy.rb +0 -20
- data/lib/tap/cmd/generate.rb +0 -20
- data/lib/tap/cmd/run.rb +0 -151
- data/lib/tap/dump.rb +0 -57
- data/lib/tap/generator.rb +0 -91
- data/lib/tap/generator/generators/command/USAGE +0 -6
- data/lib/tap/generator/generators/config/USAGE +0 -21
- data/lib/tap/generator/generators/config/templates/config.erb +0 -1
- data/lib/tap/generator/generators/file_task/USAGE +0 -3
- data/lib/tap/generator/generators/file_task/templates/file.yml +0 -3
- data/lib/tap/generator/generators/generator/USAGE +0 -0
- data/lib/tap/generator/generators/generator/generator_generator.rb +0 -21
- data/lib/tap/generator/generators/generator/templates/generator.erb +0 -32
- data/lib/tap/generator/generators/generator/templates/usage.erb +0 -1
- data/lib/tap/generator/generators/root/USAGE +0 -0
- data/lib/tap/generator/generators/root/templates/ReadMe.txt +0 -0
- data/lib/tap/generator/generators/root/templates/tap.yml +0 -80
- data/lib/tap/generator/generators/task/USAGE +0 -3
- data/lib/tap/generator/generators/workflow/USAGE +0 -0
- data/lib/tap/generator/generators/workflow/templates/task.erb +0 -16
- data/lib/tap/generator/generators/workflow/templates/test.erb +0 -7
- data/lib/tap/generator/generators/workflow/workflow_generator.rb +0 -6
- data/lib/tap/generator/options.rb +0 -26
- data/lib/tap/generator/usage.rb +0 -26
- data/lib/tap/support/batchable_methods.rb +0 -34
- data/lib/tap/support/command_line_methods.rb +0 -76
- data/lib/tap/support/configurable_methods.rb +0 -224
- data/lib/tap/support/logger.rb +0 -88
- data/lib/tap/support/rake.rb +0 -43
- data/lib/tap/support/tdoc/config_attr.rb +0 -362
- data/test/app/config/another/task.yml +0 -1
- data/test/app/config/batch.yml +0 -2
- data/test/app/config/empty.yml +0 -0
- data/test/app/config/erb.yml +0 -2
- data/test/app/config/some/task.yml +0 -1
- data/test/app/config/template.yml +0 -2
- data/test/app/config/version-0.1.yml +0 -1
- data/test/app/config/version.yml +0 -1
- data/test/app/lib/app_test_task.rb +0 -3
- data/test/app_test.rb +0 -1849
- data/test/env/test_configure/recurse_a.yml +0 -2
- data/test/env/test_configure/recurse_b.yml +0 -2
- data/test/env/test_configure/tap.yml +0 -23
- data/test/env/test_load_env_config/dir/tap.yml +0 -3
- data/test/env/test_load_env_config/recurse_a.yml +0 -2
- data/test/env/test_load_env_config/recurse_b.yml +0 -2
- data/test/env/test_load_env_config/tap.yml +0 -3
- data/test/env_test.rb +0 -198
- data/test/file_task/config/batch.yml +0 -2
- data/test/file_task/config/configured.yml +0 -1
- data/test/file_task/old_file_one.txt +0 -0
- data/test/file_task/old_file_two.txt +0 -0
- data/test/file_task_test.rb +0 -1291
- data/test/root/alt_lib/alt_module.rb +0 -4
- data/test/root/file.txt +0 -0
- data/test/root/glob/one.txt +0 -0
- data/test/root/glob/two.txt +0 -0
- data/test/root/lib/absolute_alt_filepath.rb +0 -2
- data/test/root/lib/alternative_filepath.rb +0 -2
- data/test/root/lib/another_module.rb +0 -2
- data/test/root/lib/nested/some_module.rb +0 -4
- data/test/root/lib/no_module_included.rb +0 -0
- data/test/root/lib/some/module.rb +0 -4
- data/test/root/lib/some_class.rb +0 -2
- data/test/root/lib/some_module.rb +0 -3
- data/test/root/load_path/load_path_module.rb +0 -2
- data/test/root/load_path/skip_module.rb +0 -2
- data/test/root/mtime/older.txt +0 -0
- data/test/root/unload/full_path.rb +0 -2
- data/test/root/unload/loaded_by_nested.rb +0 -2
- data/test/root/unload/nested/nested_load.rb +0 -6
- data/test/root/unload/nested/nested_with_ext.rb +0 -4
- data/test/root/unload/nested/relative_path.rb +0 -4
- data/test/root/unload/older.rb +0 -2
- data/test/root/unload/unload_base.rb +0 -9
- data/test/root/versions/another.yml +0 -0
- data/test/root/versions/file-0.1.2.yml +0 -0
- data/test/root/versions/file-0.1.yml +0 -0
- data/test/root/versions/file.yml +0 -0
- data/test/root_test.rb +0 -718
- data/test/support/aggregator_test.rb +0 -99
- data/test/support/audit_test.rb +0 -445
- data/test/support/batchable_test.rb +0 -74
- data/test/support/class_configuration_test.rb +0 -331
- data/test/support/command_line_test.rb +0 -58
- data/test/support/configurable/config/configured.yml +0 -2
- data/test/support/configurable_test.rb +0 -295
- data/test/support/executable_queue_test.rb +0 -103
- data/test/support/executable_test.rb +0 -38
- data/test/support/logger_test.rb +0 -31
- data/test/support/rake_test.rb +0 -37
- data/test/support/shell_utils_test.rb +0 -24
- data/test/support/tdoc_test.rb +0 -370
- data/test/support/validation_test.rb +0 -54
- data/test/support/versions_test.rb +0 -103
- data/test/tap_test_helper.rb +0 -57
- data/test/tap_test_suite.rb +0 -7
- data/test/task/config/batch.yml +0 -2
- data/test/task/config/batched.yml +0 -2
- data/test/task/config/configured.yml +0 -1
- data/test/task/config/example.yml +0 -1
- data/test/task_base_test.rb +0 -24
- data/test/task_syntax_test.rb +0 -300
- data/test/task_test.rb +0 -320
- data/test/test/env_vars_test.rb +0 -48
- data/test/test/file_methods/test_assert_files/expected/one.txt +0 -1
- data/test/test/file_methods/test_assert_files/expected/two.txt +0 -1
- data/test/test/file_methods/test_assert_files/input/one.txt +0 -1
- data/test/test/file_methods/test_assert_files/input/two.txt +0 -1
- data/test/test/file_methods/test_assert_files_can_have_no_expected_files_if_specified/input/one.txt +0 -1
- data/test/test/file_methods/test_assert_files_can_have_no_expected_files_if_specified/input/two.txt +0 -1
- data/test/test/file_methods/test_assert_files_fails_for_different_content/expected/one.txt +0 -1
- data/test/test/file_methods/test_assert_files_fails_for_different_content/expected/two.txt +0 -1
- data/test/test/file_methods/test_assert_files_fails_for_different_content/input/one.txt +0 -1
- data/test/test/file_methods/test_assert_files_fails_for_different_content/input/two.txt +0 -1
- data/test/test/file_methods/test_assert_files_fails_for_missing_expected_file/expected/one.txt +0 -1
- data/test/test/file_methods/test_assert_files_fails_for_missing_expected_file/input/one.txt +0 -1
- data/test/test/file_methods/test_assert_files_fails_for_missing_expected_file/input/two.txt +0 -1
- data/test/test/file_methods/test_assert_files_fails_for_missing_output_file/expected/one.txt +0 -1
- data/test/test/file_methods/test_assert_files_fails_for_missing_output_file/expected/two.txt +0 -1
- data/test/test/file_methods/test_assert_files_fails_for_missing_output_file/input/one.txt +0 -1
- data/test/test/file_methods/test_assert_files_fails_for_missing_output_file/input/two.txt +0 -1
- data/test/test/file_methods/test_assert_files_fails_for_no_expected_files/input/one.txt +0 -1
- data/test/test/file_methods/test_assert_files_fails_for_no_expected_files/input/two.txt +0 -1
- data/test/test/file_methods/test_method_glob/expected/file.yml +0 -0
- data/test/test/file_methods/test_method_glob/expected/file_1.txt +0 -0
- data/test/test/file_methods/test_method_glob/expected/file_2.txt +0 -0
- data/test/test/file_methods_doc/test_sub/expected/one.txt +0 -1
- data/test/test/file_methods_doc/test_sub/expected/two.txt +0 -1
- data/test/test/file_methods_doc/test_sub/input/one.txt +0 -1
- data/test/test/file_methods_doc/test_sub/input/two.txt +0 -1
- data/test/test/file_methods_doc_test.rb +0 -29
- data/test/test/file_methods_test.rb +0 -275
- data/test/test/subset_methods_test.rb +0 -171
- data/test/test/tap_methods/test_assert_files/expected/task/name/a.txt +0 -1
- data/test/test/tap_methods/test_assert_files/expected/task/name/b.txt +0 -1
- data/test/test/tap_methods/test_assert_files/input/a.txt +0 -1
- data/test/test/tap_methods/test_assert_files/input/b.txt +0 -1
- data/test/test/tap_methods_test.rb +0 -399
- data/test/workflow_test.rb +0 -120
- data/vendor/rails_generator.rb +0 -56
- data/vendor/rails_generator/base.rb +0 -263
- data/vendor/rails_generator/commands.rb +0 -581
- data/vendor/rails_generator/generated_attribute.rb +0 -42
- data/vendor/rails_generator/lookup.rb +0 -209
- data/vendor/rails_generator/manifest.rb +0 -53
- data/vendor/rails_generator/options.rb +0 -143
- data/vendor/rails_generator/scripts.rb +0 -83
- data/vendor/rails_generator/scripts/destroy.rb +0 -7
- data/vendor/rails_generator/scripts/generate.rb +0 -7
- data/vendor/rails_generator/scripts/update.rb +0 -12
- data/vendor/rails_generator/simple_logger.rb +0 -46
- data/vendor/rails_generator/spec.rb +0 -44
data/History
CHANGED
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
== 0.
|
|
1
|
+
== 0.10.0 / 2008-08-08
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Major revision. Reworked configurations and the execution
|
|
4
|
+
environment. Added Lazydoc documentation. Backwards incompatible.
|
|
5
|
+
Development is now on GitHub.
|
|
4
6
|
|
|
5
|
-
== 0.
|
|
7
|
+
== 0.9.1 / 2008-04-26 revision 253
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
Relatively minor update, but with one important refactoring that
|
|
10
|
+
removes the Tap::Script module. This breaks backward compatibility
|
|
11
|
+
but only should affect people who have made their own commands.
|
|
12
|
+
Simply sub Tap::Support::CommandLine for Tap::Script to fix.
|
|
9
13
|
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* Included rails_generators in distribution, removing rails dependency
|
|
15
|
-
* Reworked many classes to clean up interface
|
|
16
|
-
* Reworked testing methods
|
|
17
|
-
* Improved configuration for tasks
|
|
18
|
-
* Optimized loading
|
|
19
|
-
* Reworked threading model
|
|
20
|
-
* Addition of TDoc documentation
|
|
21
|
-
* Reworked tap command and subcommands
|
|
22
|
-
* Added packaging into executables
|
|
23
|
-
* Updated to ActiveSupport 2.0.1
|
|
24
|
-
* documentation, documentation, documentation
|
|
25
|
-
* many other things as well...
|
|
14
|
+
* Added constants methods (ex try_constantize) to String
|
|
15
|
+
* Added gem discovery when no tap.yml file is present
|
|
16
|
+
* Cleanup and refactoring -- removal of Tap::Script
|
|
17
|
+
* Bug fix for JRuby 1.1.1
|
|
26
18
|
|
|
27
19
|
== 0.9.0 / 2008-04-09 revision 246
|
|
28
20
|
|
|
@@ -49,14 +41,29 @@ Major update to Tap. Many changes in this release ARE NOT BACKWARD COMPATIBLE.
|
|
|
49
41
|
* Removed condition blocks from tasks
|
|
50
42
|
* many other things also...
|
|
51
43
|
|
|
52
|
-
== 0.
|
|
44
|
+
== 0.8.0 / 2007-12-08 revision 138
|
|
53
45
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
Major update to Tap. Many changes in this release ARE NOT BACKWARD COMPATIBLE.
|
|
47
|
+
Documentation is still patchy, but improving.
|
|
48
|
+
|
|
49
|
+
* Expanded/reworked application configuration, allowing specification of gems
|
|
50
|
+
to be loaded as task libraries.
|
|
51
|
+
* Default app config file is now tap.yml (from app.yml)
|
|
52
|
+
* Updated and improved generators
|
|
53
|
+
* Included rails_generators in distribution, removing rails dependency
|
|
54
|
+
* Reworked many classes to clean up interface
|
|
55
|
+
* Reworked testing methods
|
|
56
|
+
* Improved configuration for tasks
|
|
57
|
+
* Optimized loading
|
|
58
|
+
* Reworked threading model
|
|
59
|
+
* Addition of TDoc documentation
|
|
60
|
+
* Reworked tap command and subcommands
|
|
61
|
+
* Added packaging into executables
|
|
62
|
+
* Updated to ActiveSupport 2.0.1
|
|
63
|
+
* documentation, documentation, documentation
|
|
64
|
+
* many other things as well...
|
|
65
|
+
|
|
66
|
+
== 0.7.9 / 2007-09-14
|
|
67
|
+
|
|
68
|
+
* Initial testing release with partial documentation
|
|
58
69
|
|
|
59
|
-
* Added constants methods (ex try_constantize) to String
|
|
60
|
-
* Added gem discovery when no tap.yml file is present
|
|
61
|
-
* Cleanup and refactoring -- removal of Tap::Script
|
|
62
|
-
* Bug fix for JRuby 1.1.1
|
data/MIT-LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c) 2006-
|
|
1
|
+
Copyright (c) 2006-2008, Regents of the University of Colorado.
|
|
2
2
|
Developer:: Simon Chiang, Biomolecular Structure Program, Hansen Lab
|
|
3
3
|
Support:: CU Denver School of Medicine Deans Academic Enrichment Fund
|
|
4
4
|
|
data/README
CHANGED
|
@@ -1,52 +1,103 @@
|
|
|
1
|
-
= Tap (Task Application)
|
|
1
|
+
= {Tap (Task Application)}[http://tap.rubyforge.org]
|
|
2
2
|
|
|
3
|
-
A framework for creating configurable, distributable
|
|
4
|
-
|
|
5
|
-
See the {website}[http://tap.rubyforge.org] for more information.
|
|
3
|
+
A framework for creating configurable, distributable tasks and workflows.
|
|
6
4
|
|
|
7
5
|
== Description
|
|
8
6
|
|
|
9
|
-
Tap
|
|
7
|
+
Tap tasks are designed to be easy to test, subclass, use in scripts, and run
|
|
8
|
+
from the command line. Tap provides methods to generate and utilize config
|
|
9
|
+
files, join tasks into workflows, as well as dump and reuse results. Task
|
|
10
|
+
libraries are readily shared as gems. Check out the links for tutorials,
|
|
11
|
+
development, and bug tracking.
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
* {Tutorial}[link:files/doc/Tutorial.html], {Class}[link:files/doc/Class%20Reference.html] and {Command}[link:files/doc/Command%20Reference.html] Reference
|
|
14
|
+
* Website[http://tap.rubyforge.org]
|
|
15
|
+
* Lighthouse[http://bahuvrihi.lighthouseapp.com/projects/9908-tap-task-application/overview]
|
|
16
|
+
* Github[http://github.com/bahuvrihi/tap/tree/master]
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
=== Additional Notes:
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
- Tap and Rake[http://rake.rubyforge.org/] are targeted at different problems,
|
|
21
|
+
but play well together. See Tap::Tasks::Rake to use rake tasks in tap.
|
|
22
|
+
- Tap is tested on MRI (the standard Ruby interpreter, versions 1.8.6 and
|
|
23
|
+
1.9.0) and JRuby[http://jruby.codehaus.org/].
|
|
24
|
+
|
|
25
|
+
=== Usage
|
|
26
|
+
|
|
27
|
+
A simple task illustrates the usage of tap:
|
|
28
|
+
|
|
29
|
+
# Goodnight::manifest your basic goodnight moon task
|
|
30
|
+
# Says goodnight with a configurable message.
|
|
31
|
+
class Goodnight < Tap::Task
|
|
32
|
+
|
|
33
|
+
config :message, 'goodnight' # a goodnight message
|
|
34
|
+
|
|
35
|
+
def process(name)
|
|
36
|
+
log(message, name)
|
|
37
|
+
"#{message} #{name}"
|
|
38
|
+
end
|
|
39
|
+
end
|
|
24
40
|
|
|
25
|
-
|
|
26
|
-
irb(main):001:0> t = app.task('sample/task', :key => 'value')
|
|
27
|
-
irb(main):002:0> t.enq('input')
|
|
28
|
-
irb(main):003:0> app.run
|
|
29
|
-
I[10:55:17] sample/task input was processed with value
|
|
41
|
+
Tap pulls documentation out of task classes to generate manifests:
|
|
30
42
|
|
|
31
|
-
|
|
43
|
+
% tap run -T
|
|
44
|
+
sample:
|
|
45
|
+
goodnight # your basic goodnight moon task
|
|
46
|
+
tap:
|
|
47
|
+
dump # the default dump task
|
|
48
|
+
rake # run rake tasks
|
|
32
49
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
50
|
+
And help:
|
|
51
|
+
|
|
52
|
+
% tap run -- goodnight --help
|
|
53
|
+
Goodnight -- your basic goodnight moon task
|
|
54
|
+
--------------------------------------------------------------------------------
|
|
55
|
+
Says goodnight with a configurable message.
|
|
56
|
+
--------------------------------------------------------------------------------
|
|
57
|
+
usage: tap run -- goodnight NAME
|
|
58
|
+
|
|
59
|
+
configurations:
|
|
60
|
+
--message MESSAGE a goodnight message
|
|
61
|
+
|
|
62
|
+
options:
|
|
63
|
+
-h, --help Print this help
|
|
64
|
+
--name NAME Specify a name
|
|
65
|
+
--use FILE Loads inputs from file
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
Tasks are immediately available to run:
|
|
69
|
+
|
|
70
|
+
% tap run -- goodnight moon
|
|
71
|
+
I[00:09:55] goodnight moon
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
% tap run -- goodnight moon --message hello
|
|
75
|
+
I[00:10:01] hello moon
|
|
76
|
+
|
|
77
|
+
Tap comes with generators and allows distribution of task libraries as gems.
|
|
78
|
+
This can be illustrated by installing the
|
|
79
|
+
{sample_tasks}[http://tap.rubyforge.org/sample_tasks] gem:
|
|
80
|
+
|
|
81
|
+
% gem install sample_tasks
|
|
82
|
+
% tap run -T
|
|
83
|
+
sample:
|
|
84
|
+
goodnight # your basic goodnight moon task
|
|
85
|
+
sample_tasks:
|
|
86
|
+
concat # concatenate files with formatting
|
|
87
|
+
copy # copies files
|
|
88
|
+
grep # search for lines matching a pattern
|
|
89
|
+
print_tree # print a directory tree
|
|
90
|
+
tap:
|
|
91
|
+
dump # the default dump task
|
|
92
|
+
rake # run rake tasks
|
|
36
93
|
|
|
37
94
|
=== Bugs/Known Issues
|
|
38
95
|
|
|
39
96
|
- Some inconsequential tests on JRuby fail due to bugs in JRuby itself.
|
|
40
97
|
- Several patches are required so that Tap runs properly on MRI 1.9.0. These
|
|
41
98
|
will likely resolve themselves as 1.9.0 becomes stable.
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
== Info
|
|
45
|
-
|
|
46
|
-
Copyright (c) 2006-2007, Regents of the University of Colorado.
|
|
47
|
-
Developer:: {Simon Chiang}[http://bahuvrihi.wordpress.com], {Biomolecular Structure Program}[http://biomol.uchsc.edu/], {Hansen Lab}[http://hsc-proteomics.uchsc.edu/hansenlab/]
|
|
48
|
-
Support:: CU Denver School of Medicine Deans Academic Enrichment Fund
|
|
49
|
-
Licence:: MIT-Style
|
|
99
|
+
- Despite the talk of workflows, the Workflow class should still be considered
|
|
100
|
+
in progress. Tasks themselves are stable.
|
|
50
101
|
|
|
51
102
|
== Installation
|
|
52
103
|
|
|
@@ -54,18 +105,15 @@ Tap is available as a gem on RubyForge[http://rubyforge.org/projects/tap]. Use:
|
|
|
54
105
|
|
|
55
106
|
% gem install tap
|
|
56
107
|
|
|
57
|
-
|
|
108
|
+
Tap requires an updated version of RubyGems[http://docs.rubygems.org/] (>= 1.2.0). To check the version and update RubyGems:
|
|
58
109
|
|
|
59
|
-
|
|
110
|
+
% gem --version
|
|
111
|
+
% gem --update system
|
|
60
112
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
Thanks to my advisor {Dr. Kirk Hansen}[http://hsc-proteomics.uchsc.edu/hansenlab/] for his patience in letting me work on this project, and for putting together an awesome lab.
|
|
64
|
-
|
|
65
|
-
Most of all I would like to <b>thank my family</b> for their never-ending support.
|
|
66
|
-
|
|
67
|
-
=== Code
|
|
68
|
-
|
|
69
|
-
Tap uses ActiveSupport for dependencies loading and a variety of other extensions. Tap uses Rails generators and redistributes the code in the gem, to avoid an additional dependency.
|
|
113
|
+
== Info
|
|
70
114
|
|
|
115
|
+
Copyright (c) 2006-2008, Regents of the University of Colorado.
|
|
116
|
+
Developer:: {Simon Chiang}[http://bahuvrihi.wordpress.com], {Biomolecular Structure Program}[http://biomol.uchsc.edu/], {Hansen Lab}[http://hsc-proteomics.uchsc.edu/hansenlab/]
|
|
117
|
+
Support:: CU Denver School of Medicine Deans Academic Enrichment Fund
|
|
118
|
+
Licence:: {MIT-Style}[link:files/MIT-LICENSE.html]
|
|
71
119
|
|
data/bin/tap
CHANGED
|
@@ -8,120 +8,107 @@
|
|
|
8
8
|
# help:
|
|
9
9
|
# tap help # prints this help
|
|
10
10
|
# tap command --help # prints help for 'command'
|
|
11
|
-
#
|
|
11
|
+
#
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
tap_root_dir = File.dirname(__FILE__) + "/.."
|
|
14
|
+
require "#{tap_root_dir}/lib/tap.rb"
|
|
14
15
|
|
|
15
16
|
# setup the environment
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
begin
|
|
18
|
+
|
|
19
|
+
$DEBUG = true if ARGV.delete('-d-')
|
|
20
|
+
before = nil
|
|
21
|
+
after = nil
|
|
22
|
+
aliases = nil
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
app = Tap::App.instance
|
|
25
|
+
env = Tap::Env.instantiate(app, Tap::Env.load_config(Tap::Env::GLOBAL_CONFIG_FILE), app.logger) do |unhandled_configs|
|
|
26
|
+
before = unhandled_configs.delete(:before)
|
|
27
|
+
after = unhandled_configs.delete(:after)
|
|
28
|
+
|
|
29
|
+
aliases = unhandled_configs.delete(:alias)
|
|
30
|
+
Tap::Support::Validation.validate(aliases, [Hash]) if aliases
|
|
24
31
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
puts err.message
|
|
29
|
-
puts
|
|
30
|
-
puts err.backtrace
|
|
31
|
-
when Tap::App.instance.debug? then raise err
|
|
32
|
-
else puts err.message
|
|
32
|
+
unless unhandled_configs.empty?
|
|
33
|
+
local.log(:warn, "ignoring non-env configs: #{unhandled_configs.keys.join(',')}", Logger::DEBUG)
|
|
34
|
+
end
|
|
33
35
|
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# configure the app to tap.yml if it exists
|
|
37
|
-
default_config_file = Tap::Env::DEFAULT_CONFIG_FILE
|
|
38
|
-
begin
|
|
39
36
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
app.reconfigure(non_env_configs)
|
|
37
|
+
# add all gems if no gems are specified (Note this is VERY SLOW ~ 1/3 the overhead for tap)
|
|
38
|
+
if !File.exists?(Tap::Env::DEFAULT_CONFIG_FILE)
|
|
39
|
+
env.gems = Tap::Env.known_gems(true)
|
|
45
40
|
end
|
|
46
41
|
|
|
47
|
-
|
|
42
|
+
tap = Tap::Env.instance_for(tap_root_dir)
|
|
43
|
+
env.push(tap)
|
|
48
44
|
|
|
49
|
-
rescue(
|
|
45
|
+
rescue(Tap::Env::ConfigError)
|
|
50
46
|
# catch errors and exit gracefully
|
|
51
47
|
# (errors usu from gem loading errors)
|
|
52
|
-
puts
|
|
53
|
-
puts $!.backtrace if $DEBUG
|
|
54
|
-
puts "Check #{default_config_file} configurations"
|
|
48
|
+
puts $!.message
|
|
55
49
|
exit(1)
|
|
56
50
|
end
|
|
57
51
|
|
|
58
|
-
#
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
#
|
|
53
|
+
# setup after script
|
|
54
|
+
#
|
|
55
|
+
|
|
56
|
+
at_exit do
|
|
57
|
+
begin
|
|
58
|
+
eval(after) if after != nil
|
|
59
|
+
rescue(Exception)
|
|
60
|
+
puts "Error in after script."
|
|
61
|
+
env.handle_error($!)
|
|
62
|
+
exit(1)
|
|
63
|
+
end
|
|
61
64
|
end
|
|
62
65
|
|
|
63
66
|
#
|
|
64
67
|
# run before script
|
|
65
68
|
#
|
|
69
|
+
|
|
66
70
|
begin
|
|
67
|
-
eval(before
|
|
68
|
-
rescue
|
|
71
|
+
eval(before) if before != nil
|
|
72
|
+
rescue(Exception)
|
|
69
73
|
puts "Error in before script."
|
|
70
|
-
handle_error($!)
|
|
74
|
+
env.handle_error($!)
|
|
71
75
|
exit(1)
|
|
72
|
-
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
#
|
|
79
|
+
# run tap
|
|
80
|
+
#
|
|
73
81
|
|
|
74
82
|
begin
|
|
75
|
-
|
|
83
|
+
env.activate
|
|
84
|
+
|
|
76
85
|
command = ARGV.shift
|
|
86
|
+
if aliases && aliases.has_key?(command)
|
|
87
|
+
aliases[command].reverse_each {|arg| ARGV.unshift(arg)}
|
|
88
|
+
command = ARGV.shift
|
|
89
|
+
end
|
|
77
90
|
|
|
78
91
|
case command
|
|
79
|
-
when
|
|
92
|
+
when nil, '--help'
|
|
80
93
|
# give some help
|
|
81
|
-
|
|
82
|
-
bang_line = true
|
|
83
|
-
file.each_line do |line|
|
|
84
|
-
if bang_line
|
|
85
|
-
bang_line = false
|
|
86
|
-
next
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
break if line !~ /^#\s?(.*)/
|
|
90
|
-
puts $1
|
|
91
|
-
end
|
|
92
|
-
end
|
|
94
|
+
require 'tap/support/command_line'
|
|
93
95
|
|
|
96
|
+
puts Tap::Support::CommandLine.usage(__FILE__)
|
|
94
97
|
puts
|
|
95
98
|
puts "available commands:"
|
|
96
|
-
|
|
97
|
-
commands = available_commands.keys
|
|
98
|
-
commands.unshift("help")
|
|
99
|
-
|
|
100
|
-
print " "
|
|
101
|
-
puts commands.sort.join("\n ")
|
|
99
|
+
puts env.summarize(:commands)
|
|
102
100
|
puts
|
|
103
|
-
puts "version #{Tap::VERSION} -- #{Tap::WEBSITE}"
|
|
101
|
+
puts "version #{Tap::VERSION} -- #{Tap::WEBSITE}"
|
|
104
102
|
else
|
|
105
|
-
if
|
|
106
|
-
# run the command, if it exists
|
|
107
|
-
load available_commands[command]
|
|
103
|
+
if path = env.search(:commands, command)
|
|
104
|
+
load path # run the command, if it exists
|
|
108
105
|
else
|
|
109
106
|
puts "Unknown command: '#{command}'"
|
|
110
107
|
puts "Type 'tap help' for usage information."
|
|
111
108
|
end
|
|
112
109
|
end
|
|
113
110
|
rescue
|
|
114
|
-
handle_error($!)
|
|
115
|
-
puts "Type 'tap #{command} --help' for usage information."
|
|
111
|
+
env.handle_error($!)
|
|
116
112
|
end
|
|
117
113
|
|
|
118
|
-
|
|
119
|
-
# run after script
|
|
120
|
-
#
|
|
121
|
-
begin
|
|
122
|
-
eval(after.to_s)
|
|
123
|
-
rescue
|
|
124
|
-
puts "Error in after script."
|
|
125
|
-
handle_error($!)
|
|
126
|
-
exit(1)
|
|
127
|
-
end
|
|
114
|
+
exit(0)
|
data/cmd/console.rb
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# tap console {options}
|
|
2
|
+
#
|
|
3
|
+
# Opens up an IRB session with Tap initialized to the configurations
|
|
4
|
+
# in tap.yml. Access the Tap::App.instance through 'app'.
|
|
5
|
+
|
|
6
|
+
#
|
|
7
|
+
# handle options
|
|
8
|
+
#
|
|
9
|
+
|
|
10
|
+
OptionParser.new do |opts|
|
|
11
|
+
opts.separator ""
|
|
12
|
+
opts.separator "options:"
|
|
13
|
+
|
|
14
|
+
opts.on("-h", "--help", "Show this message") do
|
|
15
|
+
opts.banner = Tap::Support::CommandLine.usage(__FILE__)
|
|
16
|
+
puts opts
|
|
17
|
+
exit
|
|
18
|
+
end
|
|
19
|
+
end.parse!(ARGV)
|
|
20
|
+
|
|
21
|
+
require "irb"
|
|
22
|
+
|
|
23
|
+
def app
|
|
24
|
+
Tap::App.instance
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def env
|
|
28
|
+
Tap::Env.instance
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
IRB.start
|
|
32
|
+
|
|
33
|
+
# Handles a bug in IRB that causes exit to throw :IRB_EXIT
|
|
34
|
+
# and consequentially make a warning message, even on a
|
|
35
|
+
# clean exit. This module resets exit to the original
|
|
36
|
+
# aliased method.
|
|
37
|
+
module CleanExit # :nodoc:
|
|
38
|
+
def exit(ret = 0)
|
|
39
|
+
__exit__(ret)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
IRB.CurrentContext.extend CleanExit
|