sprout 1.0.32.pre → 1.0.35.pre
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sprout might be problematic. Click here for more details.
- data/Gemfile +2 -1
- data/Gemfile.lock +4 -2
- data/README.textile +12 -13
- data/VERSION +1 -0
- data/doc/Dir.html +288 -0
- data/doc/Rake/Task.html +184 -0
- data/doc/Sprout.html +144 -0
- data/doc/Sprout/ArchiveUnpacker.html +1246 -0
- data/doc/Sprout/Base.html +126 -0
- data/doc/Sprout/Base/ClassMethods.html +434 -0
- data/doc/Sprout/Concern.html +353 -0
- data/doc/Sprout/Daemon.html +166 -0
- data/doc/Sprout/Daemon/ClassMethods.html +244 -0
- data/doc/Sprout/Daemon/InstanceMethods.html +601 -0
- data/doc/Sprout/Errors.html +101 -0
- data/doc/Sprout/Errors/ArchiveUnpackerError.html +125 -0
- data/doc/Sprout/Errors/DestinationExistsError.html +133 -0
- data/doc/Sprout/Errors/DuplicateMemberError.html +132 -0
- data/doc/Sprout/Errors/ExecutableError.html +125 -0
- data/doc/Sprout/Errors/ExecutableRegistrationError.html +132 -0
- data/doc/Sprout/Errors/ExecutionError.html +121 -0
- data/doc/Sprout/Errors/GeneratorError.html +125 -0
- data/doc/Sprout/Errors/InvalidArgumentError.html +132 -0
- data/doc/Sprout/Errors/LoadError.html +121 -0
- data/doc/Sprout/Errors/MissingArgumentError.html +132 -0
- data/doc/Sprout/Errors/MissingExecutableError.html +132 -0
- data/doc/Sprout/Errors/MissingGeneratorError.html +132 -0
- data/doc/Sprout/Errors/MissingTemplateError.html +132 -0
- data/doc/Sprout/Errors/ProcessRunnerError.html +121 -0
- data/doc/Sprout/Errors/RemoteFileLoaderError.html +110 -0
- data/doc/Sprout/Errors/SproutError.html +114 -0
- data/doc/Sprout/Errors/UnknownArchiveType.html +122 -0
- data/doc/Sprout/Errors/UsageError.html +121 -0
- data/doc/Sprout/Errors/ValidationError.html +121 -0
- data/doc/Sprout/Errors/VersionRequirementNotMetError.html +121 -0
- data/doc/Sprout/Executable.html +173 -0
- data/doc/Sprout/Executable/Boolean.html +483 -0
- data/doc/Sprout/Executable/ClassMethods.html +417 -0
- data/doc/Sprout/Executable/CollectionParam.html +483 -0
- data/doc/Sprout/Executable/FileParam.html +484 -0
- data/doc/Sprout/Executable/Files.html +292 -0
- data/doc/Sprout/Executable/InstanceMethods.html +2006 -0
- data/doc/Sprout/Executable/Number.html +141 -0
- data/doc/Sprout/Executable/Param.html +2818 -0
- data/doc/Sprout/Executable/ParameterFactory.html +232 -0
- data/doc/Sprout/Executable/Path.html +223 -0
- data/doc/Sprout/Executable/Paths.html +253 -0
- data/doc/Sprout/Executable/StringParam.html +213 -0
- data/doc/Sprout/Executable/Strings.html +167 -0
- data/doc/Sprout/Executable/Url.html +160 -0
- data/doc/Sprout/Executable/Urls.html +170 -0
- data/doc/Sprout/FileTarget.html +1109 -0
- data/doc/Sprout/Generator.html +689 -0
- data/doc/Sprout/Generator/Base.html +1626 -0
- data/doc/Sprout/Generator/Command.html +690 -0
- data/doc/Sprout/Generator/DirectoryManifest.html +476 -0
- data/doc/Sprout/Generator/FileManifest.html +572 -0
- data/doc/Sprout/Generator/Manifest.html +377 -0
- data/doc/Sprout/Generator/TemplateManifest.html +196 -0
- data/doc/Sprout/GeneratorGenerator.html +1018 -0
- data/doc/Sprout/Library.html +1141 -0
- data/doc/Sprout/LibraryGenerator.html +309 -0
- data/doc/Sprout/Log.html +496 -0
- data/doc/Sprout/MXMLC.html +6373 -0
- data/doc/Sprout/Platform.html +714 -0
- data/doc/Sprout/ProcessRunner.html +1352 -0
- data/doc/Sprout/ProgressBar.html +376 -0
- data/doc/Sprout/ProgressBarImpl.html +2119 -0
- data/doc/Sprout/ProgressBarManager.html +434 -0
- data/doc/Sprout/ProgressBarOutputStream.html +416 -0
- data/doc/Sprout/RDocParser.html +211 -0
- data/doc/Sprout/RemoteFileLoader.html +172 -0
- data/doc/Sprout/RemoteFileTarget.html +679 -0
- data/doc/Sprout/ReversedProgressBar.html +194 -0
- data/doc/Sprout/RubyFeature.html +155 -0
- data/doc/Sprout/RubyFeature/ClassMethods.html +1065 -0
- data/doc/Sprout/RubyGenerator.html +764 -0
- data/doc/Sprout/Specification.html +767 -0
- data/doc/Sprout/System.html +191 -0
- data/doc/Sprout/System/BaseSystem.html +1455 -0
- data/doc/Sprout/System/JavaSystem.html +122 -0
- data/doc/Sprout/System/OSXSystem.html +335 -0
- data/doc/Sprout/System/ThreadMock.html +193 -0
- data/doc/Sprout/System/UnixSystem.html +584 -0
- data/doc/Sprout/System/VistaSystem.html +251 -0
- data/doc/Sprout/System/WinNixSystem.html +325 -0
- data/doc/Sprout/System/WinSystem.html +571 -0
- data/doc/Sprout/ToolGenerator.html +931 -0
- data/doc/Sprout/VERSION.html +128 -0
- data/doc/SproutTestCase.html +1412 -0
- data/doc/String.html +286 -0
- data/doc/_index.html +1035 -0
- data/doc/class_list.html +36 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +53 -0
- data/doc/css/style.css +310 -0
- data/doc/file.README.html +96 -0
- data/doc/file.archive_unpacker.html +288 -0
- data/doc/file.base.html +208 -0
- data/doc/file.base_system.html +278 -0
- data/doc/file.boolean.html +135 -0
- data/doc/file.collection_param.html +139 -0
- data/doc/file.command.html +126 -0
- data/doc/file.concern.html +136 -0
- data/doc/file.daemon.html +309 -0
- data/doc/file.dir.html +76 -0
- data/doc/file.directory_manifest.html +122 -0
- data/doc/file.errors.html +147 -0
- data/doc/file.executable.html +638 -0
- data/doc/file.file_manifest.html +109 -0
- data/doc/file.file_param.html +120 -0
- data/doc/file.file_target.html +140 -0
- data/doc/file.files.html +85 -0
- data/doc/file.generator.html +296 -0
- data/doc/file.generator_class.html +72 -0
- data/doc/file.generator_generator.html +137 -0
- data/doc/file.generator_test.html +92 -0
- data/doc/file.generator_test_helper.html +67 -0
- data/doc/file.java_system.html +62 -0
- data/doc/file.library.html +291 -0
- data/doc/file.library_generator.html +74 -0
- data/doc/file.log.html +100 -0
- data/doc/file.manifest.html +67 -0
- data/doc/file.mxmlc.html +740 -0
- data/doc/file.number.html +67 -0
- data/doc/file.osx_system.html +79 -0
- data/doc/file.param.html +491 -0
- data/doc/file.parameter_factory.html +119 -0
- data/doc/file.path.html +81 -0
- data/doc/file.paths.html +80 -0
- data/doc/file.platform.html +124 -0
- data/doc/file.process_runner.html +224 -0
- data/doc/file.progress_bar.html +390 -0
- data/doc/file.rdoc_parser.html +145 -0
- data/doc/file.remote_file_loader.html +117 -0
- data/doc/file.remote_file_target.html +176 -0
- data/doc/file.ruby_base.html +64 -0
- data/doc/file.ruby_feature.html +244 -0
- data/doc/file.ruby_generator.html +118 -0
- data/doc/file.ruby_input.html +62 -0
- data/doc/file.ruby_test_case.html +78 -0
- data/doc/file.ruby_test_helper.html +61 -0
- data/doc/file.specification.html +248 -0
- data/doc/file.sprout.html +64 -0
- data/doc/file.sprout_test_case.html +280 -0
- data/doc/file.string.html +72 -0
- data/doc/file.string_param.html +76 -0
- data/doc/file.strings.html +71 -0
- data/doc/file.system.html +86 -0
- data/doc/file.template_manifest.html +67 -0
- data/doc/file.tool.html +92 -0
- data/doc/file.tool_generator.html +90 -0
- data/doc/file.unix_system.html +128 -0
- data/doc/file.url.html +71 -0
- data/doc/file.urls.html +70 -0
- data/doc/file.version.html +71 -0
- data/doc/file.vista_system.html +69 -0
- data/doc/file.win_nix_system.html +88 -0
- data/doc/file.win_system.html +129 -0
- data/doc/file_list.html +230 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +96 -0
- data/doc/js/app.js +202 -0
- data/doc/js/full_list.js +149 -0
- data/doc/js/jquery.js +154 -0
- data/doc/method_list.html +3355 -0
- data/doc/top-level-namespace.html +192 -0
- data/lib/sprout/archive_unpacker.rb +203 -137
- data/lib/sprout/base.rb +38 -11
- data/lib/sprout/concern.rb +51 -0
- data/lib/sprout/daemon.rb +256 -0
- data/lib/sprout/executable.rb +40 -11
- data/lib/sprout/executable/boolean.rb +47 -1
- data/lib/sprout/executable/collection_param.rb +33 -1
- data/lib/sprout/executable/file_param.rb +16 -3
- data/lib/sprout/executable/files.rb +5 -0
- data/lib/sprout/executable/number.rb +5 -1
- data/lib/sprout/executable/param.rb +232 -16
- data/lib/sprout/executable/parameter_factory.rb +39 -1
- data/lib/sprout/executable/path.rb +7 -1
- data/lib/sprout/executable/paths.rb +6 -1
- data/lib/sprout/executable/string_param.rb +8 -1
- data/lib/sprout/executable/strings.rb +7 -1
- data/lib/sprout/executable/url.rb +8 -1
- data/lib/sprout/executable/urls.rb +7 -1
- data/lib/sprout/file_target.rb +11 -11
- data/lib/sprout/generator.rb +244 -0
- data/lib/sprout/generator/base.rb +0 -94
- data/lib/sprout/generators/generator/generator_generator.rb +35 -1
- data/lib/sprout/generators/generator/templates/generator_class.rb +3 -3
- data/lib/sprout/library.rb +75 -0
- data/lib/sprout/log.rb +11 -12
- data/lib/sprout/process_runner.rb +29 -9
- data/lib/sprout/remote_file_target.rb +20 -9
- data/lib/sprout/system/base_system.rb +11 -3
- data/lib/sprout/test/sprout_test_case.rb +1 -0
- data/lib/sprout/version.rb +7 -11
- data/rakefile.rb +7 -12
- data/script/add_param_handler.rb +43 -0
- data/sprout.gemspec +2 -3
- data/test/fixtures/executable/fdb.rb +764 -0
- data/test/fixtures/executable/flex3sdk_gem/fdb +60 -0
- data/test/fixtures/executable/mxmlc.rb +9 -11
- data/test/unit/daemon_test.rb +61 -0
- data/test/unit/process_runner_test.rb +21 -0
- data/test/unit/remote_file_target_test.rb +45 -11
- data/test/unit/sprout_test_helper.rb +1 -1
- metadata +210 -29
@@ -0,0 +1,141 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>Class: Sprout::Executable::Number</title>
|
7
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
+
|
10
|
+
<script type="text/javascript" charset="utf-8">
|
11
|
+
relpath = '../..';
|
12
|
+
if (relpath != '') relpath += '/';
|
13
|
+
</script>
|
14
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<script type="text/javascript" charset="utf-8">
|
20
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
21
|
+
</script>
|
22
|
+
|
23
|
+
<div id="header">
|
24
|
+
<div id="menu">
|
25
|
+
|
26
|
+
<a href="../../_index.html">Index (N)</a> »
|
27
|
+
<span class='title'><span class='object_link'><a href="../../Sprout.html" title="Sprout (module)">Sprout</a></span></span> » <span class='title'><span class='object_link'><a href="../Executable.html" title="Sprout::Executable (module)">Executable</a></span></span>
|
28
|
+
»
|
29
|
+
<span class="title">Number</span>
|
30
|
+
|
31
|
+
|
32
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="search">
|
36
|
+
<a id="class_list_link" href="#">Class List</a>
|
37
|
+
<a id="method_list_link" href="#">Method List</a>
|
38
|
+
<a id ="file_list_link" href="#">File List</a>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div class="clear"></div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<iframe id="search_frame"></iframe>
|
45
|
+
|
46
|
+
<div id="content"><h1>Class: Sprout::Executable::Number
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
</h1>
|
51
|
+
|
52
|
+
<dl class="box">
|
53
|
+
|
54
|
+
<dt class="r1">Inherits:</dt>
|
55
|
+
<dd class="r1">
|
56
|
+
<span class="inheritName"><span class='object_link'><a href="Param.html" title="Sprout::Executable::Param (class)">Param</a></span></span>
|
57
|
+
|
58
|
+
<ul class="fullTree">
|
59
|
+
<li>Object</li>
|
60
|
+
|
61
|
+
<li class="next"><span class='object_link'><a href="Param.html" title="Sprout::Executable::Param (class)">Param</a></span></li>
|
62
|
+
|
63
|
+
<li class="next">Sprout::Executable::Number</li>
|
64
|
+
|
65
|
+
</ul>
|
66
|
+
<a href="#" class="inheritanceTree">show all</a>
|
67
|
+
|
68
|
+
</dd>
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
<dt class="r2 last">Defined in:</dt>
|
79
|
+
<dd class="r2 last">lib/sprout/executable/number.rb</dd>
|
80
|
+
|
81
|
+
</dl>
|
82
|
+
<div class="clear"></div>
|
83
|
+
|
84
|
+
<h2>Overview</h2><div class="docstring">
|
85
|
+
<div class="discussion">
|
86
|
+
|
87
|
+
<p>Concrete Sprout::Executable::Param object for numeric values.</p>
|
88
|
+
|
89
|
+
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
<div class="tags">
|
93
|
+
|
94
|
+
<h3>See Also:</h3>
|
95
|
+
<ul class="see">
|
96
|
+
|
97
|
+
<li><span class='object_link'><a href="Param.html" title="Sprout::Executable::Param (class)">Param</a></span></li>
|
98
|
+
|
99
|
+
</ul>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
<h2>Constant Summary</h2>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<h3 class="inherited">Constants inherited from <span class='object_link'><a href="Param.html" title="Sprout::Executable::Param (class)">Param</a></span></h3>
|
111
|
+
<p class="inherited"><span class='object_link'><a href="Param.html#DEFAULT_DELIMITER-constant" title="Sprout::Executable::Param::DEFAULT_DELIMITER (constant)">DEFAULT_DELIMITER</a></span>, <span class='object_link'><a href="Param.html#DEFAULT_OPTION_PARSER_TYPE_NAME-constant" title="Sprout::Executable::Param::DEFAULT_OPTION_PARSER_TYPE_NAME (constant)">DEFAULT_OPTION_PARSER_TYPE_NAME</a></span>, <span class='object_link'><a href="Param.html#DEFAULT_PREFIX-constant" title="Sprout::Executable::Param::DEFAULT_PREFIX (constant)">DEFAULT_PREFIX</a></span>, <span class='object_link'><a href="Param.html#DEFAULT_SHORT_PREFIX-constant" title="Sprout::Executable::Param::DEFAULT_SHORT_PREFIX (constant)">DEFAULT_SHORT_PREFIX</a></span></p>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<h2>Method Summary</h2>
|
121
|
+
|
122
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Param.html" title="Sprout::Executable::Param (class)">Param</a></span></h3>
|
123
|
+
<p class="inherited"><span class='object_link'><a href="Param.html#clean_path-instance_method" title="Sprout::Executable::Param#clean_path (method)">#clean_path</a></span>, <span class='object_link'><a href="Param.html#default-instance_method" title="Sprout::Executable::Param#default (method)">#default</a></span>, <span class='object_link'><a href="Param.html#default%3D-instance_method" title="Sprout::Executable::Param#default= (method)">#default=</a></span>, <span class='object_link'><a href="Param.html#file_is_output%3F-instance_method" title="Sprout::Executable::Param#file_is_output? (method)">#file_is_output?</a></span>, <span class='object_link'><a href="Param.html#hidden_name%3F-instance_method" title="Sprout::Executable::Param#hidden_name? (method)">#hidden_name?</a></span>, <span class='object_link'><a href="Param.html#hidden_value%3F-instance_method" title="Sprout::Executable::Param#hidden_value? (method)">#hidden_value?</a></span>, <span class='object_link'><a href="Param.html#initialize-instance_method" title="Sprout::Executable::Param#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Param.html#option_parser_declaration-instance_method" title="Sprout::Executable::Param#option_parser_declaration (method)">#option_parser_declaration</a></span>, <span class='object_link'><a href="Param.html#option_parser_name-instance_method" title="Sprout::Executable::Param#option_parser_name (method)">#option_parser_name</a></span>, <span class='object_link'><a href="Param.html#option_parser_short_name-instance_method" title="Sprout::Executable::Param#option_parser_short_name (method)">#option_parser_short_name</a></span>, <span class='object_link'><a href="Param.html#option_parser_type_name-instance_method" title="Sprout::Executable::Param#option_parser_type_name (method)">#option_parser_type_name</a></span>, <span class='object_link'><a href="Param.html#option_parser_type_output-instance_method" title="Sprout::Executable::Param#option_parser_type_output (method)">#option_parser_type_output</a></span>, <span class='object_link'><a href="Param.html#prepare-instance_method" title="Sprout::Executable::Param#prepare (method)">#prepare</a></span>, <span class='object_link'><a href="Param.html#prepare_prerequisites-instance_method" title="Sprout::Executable::Param#prepare_prerequisites (method)">#prepare_prerequisites</a></span>, <span class='object_link'><a href="Param.html#prepared%3F-instance_method" title="Sprout::Executable::Param#prepared? (method)">#prepared?</a></span>, <span class='object_link'><a href="Param.html#required%3F-instance_method" title="Sprout::Executable::Param#required? (method)">#required?</a></span>, <span class='object_link'><a href="Param.html#shell_value-instance_method" title="Sprout::Executable::Param#shell_value (method)">#shell_value</a></span>, <span class='object_link'><a href="Param.html#short_prefix-instance_method" title="Sprout::Executable::Param#short_prefix (method)">#short_prefix</a></span>, <span class='object_link'><a href="Param.html#to_rdoc-instance_method" title="Sprout::Executable::Param#to_rdoc (method)">#to_rdoc</a></span>, <span class='object_link'><a href="Param.html#to_shell-instance_method" title="Sprout::Executable::Param#to_shell (method)">#to_shell</a></span>, <span class='object_link'><a href="Param.html#validate-instance_method" title="Sprout::Executable::Param#validate (method)">#validate</a></span>, <span class='object_link'><a href="Param.html#visible%3F-instance_method" title="Sprout::Executable::Param#visible? (method)">#visible?</a></span></p>
|
124
|
+
<div id="constructor_details" class="method_details_list">
|
125
|
+
<h2>Constructor Details</h2>
|
126
|
+
|
127
|
+
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Param.html#initialize-instance_method" title="Sprout::Executable::Param#initialize (method)">Sprout::Executable::Param</a></span></p>
|
128
|
+
|
129
|
+
</div>
|
130
|
+
|
131
|
+
|
132
|
+
</div>
|
133
|
+
|
134
|
+
<div id="footer">
|
135
|
+
Generated on Wed Dec 22 11:58:35 2010 by
|
136
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
137
|
+
0.6.3 (ruby-1.9.2).
|
138
|
+
</div>
|
139
|
+
|
140
|
+
</body>
|
141
|
+
</html>
|
@@ -0,0 +1,2818 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>Class: Sprout::Executable::Param</title>
|
7
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
+
|
10
|
+
<script type="text/javascript" charset="utf-8">
|
11
|
+
relpath = '../..';
|
12
|
+
if (relpath != '') relpath += '/';
|
13
|
+
</script>
|
14
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<script type="text/javascript" charset="utf-8">
|
20
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
21
|
+
</script>
|
22
|
+
|
23
|
+
<div id="header">
|
24
|
+
<div id="menu">
|
25
|
+
|
26
|
+
<a href="../../_index.html">Index (P)</a> »
|
27
|
+
<span class='title'><span class='object_link'><a href="../../Sprout.html" title="Sprout (module)">Sprout</a></span></span> » <span class='title'><span class='object_link'><a href="../Executable.html" title="Sprout::Executable (module)">Executable</a></span></span>
|
28
|
+
»
|
29
|
+
<span class="title">Param</span>
|
30
|
+
|
31
|
+
|
32
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="search">
|
36
|
+
<a id="class_list_link" href="#">Class List</a>
|
37
|
+
<a id="method_list_link" href="#">Method List</a>
|
38
|
+
<a id ="file_list_link" href="#">File List</a>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div class="clear"></div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<iframe id="search_frame"></iframe>
|
45
|
+
|
46
|
+
<div id="content"><h1>Class: Sprout::Executable::Param
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
</h1>
|
51
|
+
|
52
|
+
<dl class="box">
|
53
|
+
|
54
|
+
<dt class="r1">Inherits:</dt>
|
55
|
+
<dd class="r1">
|
56
|
+
<span class="inheritName">Object</span>
|
57
|
+
|
58
|
+
<ul class="fullTree">
|
59
|
+
<li>Object</li>
|
60
|
+
|
61
|
+
<li class="next">Sprout::Executable::Param</li>
|
62
|
+
|
63
|
+
</ul>
|
64
|
+
<a href="#" class="inheritanceTree">show all</a>
|
65
|
+
|
66
|
+
</dd>
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
<dt class="r2 last">Defined in:</dt>
|
77
|
+
<dd class="r2 last">lib/sprout/executable/param.rb</dd>
|
78
|
+
|
79
|
+
</dl>
|
80
|
+
<div class="clear"></div>
|
81
|
+
|
82
|
+
<h2>Overview</h2><div class="docstring">
|
83
|
+
<div class="discussion">
|
84
|
+
|
85
|
+
<p>The abstract base class for all Executable parameters.</p>
|
86
|
+
|
87
|
+
<p>This class provides a variety of template methods and general functionality
|
88
|
+
to the different executable parameter types.</p>
|
89
|
+
|
90
|
+
<p>Many of these parameter attributes are exposed to Sprout::Executable
|
91
|
+
concrete classes as the options hash like:</p>
|
92
|
+
|
93
|
+
<pre class="code"><span class='kw'>class</span> <span class='const'>Foo</span>
|
94
|
+
<span class='id include'>include</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Executable</span>
|
95
|
+
|
96
|
+
<span class='id add_param'>add_param</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='const'>String</span><span class='comma'>,</span> <span class='symbol'>:hidden_name</span> <span class='op'>=></span> <span class='kw'>true</span>
|
97
|
+
<span class='kw'>end</span></pre>
|
98
|
+
|
99
|
+
|
100
|
+
</div>
|
101
|
+
</div>
|
102
|
+
<div class="tags">
|
103
|
+
|
104
|
+
<h3>See Also:</h3>
|
105
|
+
<ul class="see">
|
106
|
+
|
107
|
+
<li><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></li>
|
108
|
+
|
109
|
+
<li><span class='object_link'><a href="FileParam.html" title="Sprout::Executable::FileParam (class)">FileParam</a></span></li>
|
110
|
+
|
111
|
+
<li><span class='object_link'><a href="Files.html" title="Sprout::Executable::Files (class)">Files</a></span></li>
|
112
|
+
|
113
|
+
<li><span class='object_link'><a href="Number.html" title="Sprout::Executable::Number (class)">Number</a></span></li>
|
114
|
+
|
115
|
+
<li><span class='object_link'><a href="ParameterFactory.html" title="Sprout::Executable::ParameterFactory (class)">ParameterFactory</a></span></li>
|
116
|
+
|
117
|
+
<li><span class='object_link'><a href="Path.html" title="Sprout::Executable::Path (class)">Path</a></span></li>
|
118
|
+
|
119
|
+
<li><span class='object_link'><a href="Paths.html" title="Sprout::Executable::Paths (class)">Paths</a></span></li>
|
120
|
+
|
121
|
+
<li><span class='object_link'><a href="StringParam.html" title="Sprout::Executable::StringParam (class)">StringParam</a></span></li>
|
122
|
+
|
123
|
+
<li><span class='object_link'><a href="Strings.html" title="Sprout::Executable::Strings (class)">Strings</a></span></li>
|
124
|
+
|
125
|
+
<li><span class='object_link'><a href="Url.html" title="Sprout::Executable::Url (class)">Url</a></span></li>
|
126
|
+
|
127
|
+
<li><span class='object_link'><a href="Urls.html" title="Sprout::Executable::Urls (class)">Urls</a></span></li>
|
128
|
+
|
129
|
+
</ul>
|
130
|
+
|
131
|
+
</div><div id="subclasses">
|
132
|
+
<h2>Direct Known Subclasses</h2>
|
133
|
+
<p class="children"><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span>, <span class='object_link'><a href="FileParam.html" title="Sprout::Executable::FileParam (class)">FileParam</a></span>, <span class='object_link'><a href="Files.html" title="Sprout::Executable::Files (class)">Files</a></span>, <span class='object_link'><a href="Number.html" title="Sprout::Executable::Number (class)">Number</a></span>, <span class='object_link'><a href="Path.html" title="Sprout::Executable::Path (class)">Path</a></span>, <span class='object_link'><a href="StringParam.html" title="Sprout::Executable::StringParam (class)">StringParam</a></span>, <span class='object_link'><a href="Strings.html" title="Sprout::Executable::Strings (class)">Strings</a></span></p>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
<h2>Constant Summary</h2>
|
137
|
+
|
138
|
+
<dl class="constants">
|
139
|
+
|
140
|
+
<dt id="DEFAULT_DELIMITER-constant" class="">DEFAULT_DELIMITER =
|
141
|
+
<div class="docstring">
|
142
|
+
<div class="discussion">
|
143
|
+
|
144
|
+
<p>Default value for the delimiter that will separate parameter names from
|
145
|
+
their values.</p>
|
146
|
+
|
147
|
+
|
148
|
+
</div>
|
149
|
+
</div>
|
150
|
+
<div class="tags">
|
151
|
+
|
152
|
+
</div>
|
153
|
+
</dt>
|
154
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>=</span><span class='tstring_end'>'</span></span></pre></dd>
|
155
|
+
|
156
|
+
<dt id="DEFAULT_OPTION_PARSER_TYPE_NAME-constant" class="">DEFAULT_OPTION_PARSER_TYPE_NAME =
|
157
|
+
<div class="docstring">
|
158
|
+
<div class="discussion">
|
159
|
+
|
160
|
+
<p>Defaut TYPE assumed for parameters when creating documentation for the
|
161
|
+
OptionParser.</p>
|
162
|
+
|
163
|
+
|
164
|
+
</div>
|
165
|
+
</div>
|
166
|
+
<div class="tags">
|
167
|
+
|
168
|
+
</div>
|
169
|
+
</dt>
|
170
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>STRING</span><span class='tstring_end'>'</span></span></pre></dd>
|
171
|
+
|
172
|
+
<dt id="DEFAULT_PREFIX-constant" class="">DEFAULT_PREFIX =
|
173
|
+
<div class="docstring">
|
174
|
+
<div class="discussion">
|
175
|
+
|
176
|
+
<p>Default value for the parameter prefix. Should usually be pulled from the
|
177
|
+
<tt>belongs_to</tt> Sprout::Executable.</p>
|
178
|
+
|
179
|
+
|
180
|
+
</div>
|
181
|
+
</div>
|
182
|
+
<div class="tags">
|
183
|
+
|
184
|
+
</div>
|
185
|
+
</dt>
|
186
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>--</span><span class='tstring_end'>'</span></span></pre></dd>
|
187
|
+
|
188
|
+
<dt id="DEFAULT_SHORT_PREFIX-constant" class="">DEFAULT_SHORT_PREFIX =
|
189
|
+
<div class="docstring">
|
190
|
+
<div class="discussion">
|
191
|
+
|
192
|
+
<p>Default prefix for truncated parameters. Should usually be pulled from the
|
193
|
+
<tt>belongs_to</tt> Sprout::Executable.</p>
|
194
|
+
|
195
|
+
|
196
|
+
</div>
|
197
|
+
</div>
|
198
|
+
<div class="tags">
|
199
|
+
|
200
|
+
</div>
|
201
|
+
</dt>
|
202
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-</span><span class='tstring_end'>'</span></span></pre></dd>
|
203
|
+
|
204
|
+
</dl>
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
209
|
+
<ul class="summary">
|
210
|
+
|
211
|
+
<li class="public ">
|
212
|
+
<span class="summary_signature">
|
213
|
+
|
214
|
+
<a href="#belongs_to-instance_method" title="#belongs_to (instance method)">- (Object) <strong>belongs_to</strong> </a>
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
</span>
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
<span class="summary_desc"><div class='inline'>
|
231
|
+
<p>The Sprout::Executable that this parameter instance belongs to.</p>
|
232
|
+
</div></span>
|
233
|
+
|
234
|
+
</li>
|
235
|
+
|
236
|
+
|
237
|
+
<li class="public ">
|
238
|
+
<span class="summary_signature">
|
239
|
+
|
240
|
+
<a href="#delimiter-instance_method" title="#delimiter (instance method)">- (Object) <strong>delimiter</strong> </a>
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
</span>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
<span class="summary_desc"><div class='inline'>
|
257
|
+
<p>Executable::Params join their name/value pair with an equals sign by
|
258
|
+
default, this can be modified To a space or whatever you wish.</p>
|
259
|
+
</div></span>
|
260
|
+
|
261
|
+
</li>
|
262
|
+
|
263
|
+
|
264
|
+
<li class="public ">
|
265
|
+
<span class="summary_signature">
|
266
|
+
|
267
|
+
<a href="#description-instance_method" title="#description (instance method)">- (Object) <strong>description</strong> </a>
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
</span>
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
<span class="summary_desc"><div class='inline'>
|
284
|
+
<p>The String description that will be used for RDoc documentation and user
|
285
|
+
help.</p>
|
286
|
+
</div></span>
|
287
|
+
|
288
|
+
</li>
|
289
|
+
|
290
|
+
|
291
|
+
<li class="public ">
|
292
|
+
<span class="summary_signature">
|
293
|
+
|
294
|
+
<a href="#file_expression-instance_method" title="#file_expression (instance method)">- (Object) <strong>file_expression</strong> </a>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
</span>
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
311
|
+
|
312
|
+
</li>
|
313
|
+
|
314
|
+
|
315
|
+
<li class="public ">
|
316
|
+
<span class="summary_signature">
|
317
|
+
|
318
|
+
<a href="#hidden_name-instance_method" title="#hidden_name (instance method)">- (Object) <strong>hidden_name</strong> </a>
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
</span>
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
<span class="summary_desc"><div class='inline'>
|
335
|
+
<p>Boolean value that hides the name parameter from the shell execution.</p>
|
336
|
+
</div></span>
|
337
|
+
|
338
|
+
</li>
|
339
|
+
|
340
|
+
|
341
|
+
<li class="public ">
|
342
|
+
<span class="summary_signature">
|
343
|
+
|
344
|
+
<a href="#hidden_value-instance_method" title="#hidden_value (instance method)">- (Object) <strong>hidden_value</strong> </a>
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
</span>
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
<span class="summary_desc"><div class='inline'>
|
361
|
+
<p>Boolean value that hides the value parameter from the shell execution.</p>
|
362
|
+
</div></span>
|
363
|
+
|
364
|
+
</li>
|
365
|
+
|
366
|
+
|
367
|
+
<li class="public ">
|
368
|
+
<span class="summary_signature">
|
369
|
+
|
370
|
+
<a href="#name-instance_method" title="#name (instance method)">- (Object) <strong>name</strong> </a>
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
</span>
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
<span class="summary_desc"><div class='inline'>
|
387
|
+
<p>The String (or Symbol) name of the parameter.</p>
|
388
|
+
</div></span>
|
389
|
+
|
390
|
+
</li>
|
391
|
+
|
392
|
+
|
393
|
+
<li class="public ">
|
394
|
+
<span class="summary_signature">
|
395
|
+
|
396
|
+
<a href="#prefix-instance_method" title="#prefix (instance method)">- (Object) <strong>prefix</strong> </a>
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
</span>
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
<span class="summary_desc"><div class='inline'>
|
413
|
+
<p>Leading character for each parameter Can sometimes be an empty string,
|
414
|
+
other times it's a double dash '--' but usually it's just a single dash
|
415
|
+
'-'.</p>
|
416
|
+
</div></span>
|
417
|
+
|
418
|
+
</li>
|
419
|
+
|
420
|
+
|
421
|
+
<li class="public ">
|
422
|
+
<span class="summary_signature">
|
423
|
+
|
424
|
+
<a href="#reader-instance_method" title="#reader (instance method)">- (Object) <strong>reader</strong> </a>
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
</span>
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
<span class="summary_desc"><div class='inline'>
|
441
|
+
<p>A Symbol that refers to a custom attribute reader that is available to
|
442
|
+
instance methods on the Sprout::Executable that uses it.</p>
|
443
|
+
</div></span>
|
444
|
+
|
445
|
+
</li>
|
446
|
+
|
447
|
+
|
448
|
+
<li class="public ">
|
449
|
+
<span class="summary_signature">
|
450
|
+
|
451
|
+
<a href="#required-instance_method" title="#required (instance method)">- (Object) <strong>required</strong> </a>
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
</span>
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
<span class="summary_desc"><div class='inline'>
|
468
|
+
<p>Boolean value that will cause a Sprout::Errors::UsageError if the
|
469
|
+
executable is invoked without this parameter first being set.</p>
|
470
|
+
</div></span>
|
471
|
+
|
472
|
+
</li>
|
473
|
+
|
474
|
+
|
475
|
+
<li class="public ">
|
476
|
+
<span class="summary_signature">
|
477
|
+
|
478
|
+
<a href="#shell_name-instance_method" title="#shell_name (instance method)">- (Object) <strong>shell_name</strong> </a>
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
</span>
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
495
|
+
|
496
|
+
</li>
|
497
|
+
|
498
|
+
|
499
|
+
<li class="public ">
|
500
|
+
<span class="summary_signature">
|
501
|
+
|
502
|
+
<a href="#short_name-instance_method" title="#short_name (instance method)">- (Object) <strong>short_name</strong> </a>
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
</span>
|
507
|
+
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
|
518
|
+
<span class="summary_desc"><div class='inline'>
|
519
|
+
<p>The short name for this parameter.</p>
|
520
|
+
</div></span>
|
521
|
+
|
522
|
+
</li>
|
523
|
+
|
524
|
+
|
525
|
+
<li class="public ">
|
526
|
+
<span class="summary_signature">
|
527
|
+
|
528
|
+
<a href="#to_shell_proc-instance_method" title="#to_shell_proc (instance method)">- (Object) <strong>to_shell_proc</strong> </a>
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
</span>
|
533
|
+
|
534
|
+
|
535
|
+
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
<span class="summary_desc"><div class='inline'>
|
545
|
+
<p>An optional Proc that should be called when this parameter is serialized to
|
546
|
+
shell output.</p>
|
547
|
+
</div></span>
|
548
|
+
|
549
|
+
</li>
|
550
|
+
|
551
|
+
|
552
|
+
<li class="public ">
|
553
|
+
<span class="summary_signature">
|
554
|
+
|
555
|
+
<a href="#type-instance_method" title="#type (instance method)">- (Object) <strong>type</strong> </a>
|
556
|
+
|
557
|
+
|
558
|
+
|
559
|
+
</span>
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
|
570
|
+
|
571
|
+
<span class="summary_desc"><div class='inline'>
|
572
|
+
<p>The data type of the parameter, used to generate more appropriate RDoc
|
573
|
+
content for the concrete Sprout::Executable.</p>
|
574
|
+
</div></span>
|
575
|
+
|
576
|
+
</li>
|
577
|
+
|
578
|
+
|
579
|
+
<li class="public ">
|
580
|
+
<span class="summary_signature">
|
581
|
+
|
582
|
+
<a href="#value-instance_method" title="#value (instance method)">- (Object) <strong>value</strong> </a>
|
583
|
+
|
584
|
+
|
585
|
+
|
586
|
+
</span>
|
587
|
+
|
588
|
+
|
589
|
+
|
590
|
+
|
591
|
+
|
592
|
+
|
593
|
+
|
594
|
+
|
595
|
+
|
596
|
+
|
597
|
+
|
598
|
+
<span class="summary_desc"><div class='inline'>
|
599
|
+
<p>The value that was assigned to this parameter when the concrete
|
600
|
+
Sprout::Executable was instantiated and configured.</p>
|
601
|
+
</div></span>
|
602
|
+
|
603
|
+
</li>
|
604
|
+
|
605
|
+
|
606
|
+
<li class="public ">
|
607
|
+
<span class="summary_signature">
|
608
|
+
|
609
|
+
<a href="#writer-instance_method" title="#writer (instance method)">- (Object) <strong>writer</strong> </a>
|
610
|
+
|
611
|
+
|
612
|
+
|
613
|
+
</span>
|
614
|
+
|
615
|
+
|
616
|
+
|
617
|
+
|
618
|
+
|
619
|
+
|
620
|
+
|
621
|
+
|
622
|
+
|
623
|
+
|
624
|
+
|
625
|
+
<span class="summary_desc"><div class='inline'>
|
626
|
+
<p>A Symbol that refers to a custom attribute writer that is available to
|
627
|
+
instance methods on the Sprout::Executable that uses it.</p>
|
628
|
+
</div></span>
|
629
|
+
|
630
|
+
</li>
|
631
|
+
|
632
|
+
|
633
|
+
</ul>
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
<h2>
|
638
|
+
Instance Method Summary
|
639
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
640
|
+
</h2>
|
641
|
+
|
642
|
+
<ul class="summary">
|
643
|
+
|
644
|
+
<li class="protected ">
|
645
|
+
<span class="summary_signature">
|
646
|
+
|
647
|
+
<a href="#clean_path-instance_method" title="#clean_path (instance method)">- (Object) <strong>clean_path</strong>(path) </a>
|
648
|
+
|
649
|
+
|
650
|
+
|
651
|
+
</span>
|
652
|
+
|
653
|
+
|
654
|
+
<span class="note title protected">protected</span>
|
655
|
+
|
656
|
+
|
657
|
+
|
658
|
+
|
659
|
+
|
660
|
+
<span class="summary_desc"><div class='inline'>
|
661
|
+
<p>Clean the provided path using the current Sprout::System.</p>
|
662
|
+
</div></span>
|
663
|
+
|
664
|
+
</li>
|
665
|
+
|
666
|
+
|
667
|
+
<li class="public ">
|
668
|
+
<span class="summary_signature">
|
669
|
+
|
670
|
+
<a href="#default-instance_method" title="#default (instance method)">- (Object) <strong>default</strong> </a>
|
671
|
+
|
672
|
+
|
673
|
+
|
674
|
+
</span>
|
675
|
+
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
|
682
|
+
|
683
|
+
<span class="summary_desc"><div class='inline'>
|
684
|
+
<p>Return the default value or nil if none was provided.</p>
|
685
|
+
</div></span>
|
686
|
+
|
687
|
+
</li>
|
688
|
+
|
689
|
+
|
690
|
+
<li class="public ">
|
691
|
+
<span class="summary_signature">
|
692
|
+
|
693
|
+
<a href="#default%3D-instance_method" title="#default= (instance method)">- (Object) <strong>default=</strong>(value) </a>
|
694
|
+
|
695
|
+
|
696
|
+
|
697
|
+
</span>
|
698
|
+
|
699
|
+
|
700
|
+
|
701
|
+
|
702
|
+
|
703
|
+
|
704
|
+
|
705
|
+
|
706
|
+
<span class="summary_desc"><div class='inline'>
|
707
|
+
<p>Set the default value of the parameter.</p>
|
708
|
+
</div></span>
|
709
|
+
|
710
|
+
</li>
|
711
|
+
|
712
|
+
|
713
|
+
<li class="protected ">
|
714
|
+
<span class="summary_signature">
|
715
|
+
|
716
|
+
<a href="#file_is_output%3F-instance_method" title="#file_is_output? (instance method)">- (Boolean) <strong>file_is_output?</strong>(file) </a>
|
717
|
+
|
718
|
+
|
719
|
+
|
720
|
+
</span>
|
721
|
+
|
722
|
+
|
723
|
+
<span class="note title protected">protected</span>
|
724
|
+
|
725
|
+
|
726
|
+
|
727
|
+
|
728
|
+
|
729
|
+
<span class="summary_desc"><div class='inline'>
|
730
|
+
<p>Return true if the Sprout::Executable that this parameter
|
731
|
+
<tt>belongs_to</tt> has an <tt>output</tt> method (or parameter), and if
|
732
|
+
the provided <tt>file</tt> matches the value of that parameter.</p>
|
733
|
+
</div></span>
|
734
|
+
|
735
|
+
</li>
|
736
|
+
|
737
|
+
|
738
|
+
<li class="public ">
|
739
|
+
<span class="summary_signature">
|
740
|
+
|
741
|
+
<a href="#hidden_name%3F-instance_method" title="#hidden_name? (instance method)">- (Boolean) <strong>hidden_name?</strong> </a>
|
742
|
+
|
743
|
+
|
744
|
+
|
745
|
+
</span>
|
746
|
+
|
747
|
+
|
748
|
+
|
749
|
+
|
750
|
+
|
751
|
+
|
752
|
+
|
753
|
+
|
754
|
+
<span class="summary_desc"><div class='inline'>
|
755
|
+
<p>Should the param name be hidden from the shell? Used for params like
|
756
|
+
'input' on mxmlc.</p>
|
757
|
+
</div></span>
|
758
|
+
|
759
|
+
</li>
|
760
|
+
|
761
|
+
|
762
|
+
<li class="public ">
|
763
|
+
<span class="summary_signature">
|
764
|
+
|
765
|
+
<a href="#hidden_value%3F-instance_method" title="#hidden_value? (instance method)">- (Boolean) <strong>hidden_value?</strong> </a>
|
766
|
+
|
767
|
+
|
768
|
+
|
769
|
+
</span>
|
770
|
+
|
771
|
+
|
772
|
+
|
773
|
+
|
774
|
+
|
775
|
+
|
776
|
+
|
777
|
+
|
778
|
+
<span class="summary_desc"><div class='inline'>
|
779
|
+
<p>Should the param value be hidden from the shell? Usually used for Boolean
|
780
|
+
toggles like '-debug'.</p>
|
781
|
+
</div></span>
|
782
|
+
|
783
|
+
</li>
|
784
|
+
|
785
|
+
|
786
|
+
<li class="public ">
|
787
|
+
<span class="summary_signature">
|
788
|
+
|
789
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Param) <strong>initialize</strong> </a>
|
790
|
+
|
791
|
+
|
792
|
+
|
793
|
+
</span>
|
794
|
+
|
795
|
+
<span class="note title constructor">constructor</span>
|
796
|
+
|
797
|
+
|
798
|
+
|
799
|
+
|
800
|
+
|
801
|
+
|
802
|
+
|
803
|
+
|
804
|
+
<span class="summary_desc"><div class='inline'>
|
805
|
+
<p>Default constructor for Params, if you create a new concrete type, be sure
|
806
|
+
to call <tt>super()</tt> in your own constructor.</p>
|
807
|
+
</div></span>
|
808
|
+
|
809
|
+
</li>
|
810
|
+
|
811
|
+
|
812
|
+
<li class="public ">
|
813
|
+
<span class="summary_signature">
|
814
|
+
|
815
|
+
<a href="#option_parser_declaration-instance_method" title="#option_parser_declaration (instance method)">- (Object) <strong>option_parser_declaration</strong> </a>
|
816
|
+
|
817
|
+
|
818
|
+
|
819
|
+
</span>
|
820
|
+
|
821
|
+
|
822
|
+
|
823
|
+
|
824
|
+
|
825
|
+
|
826
|
+
|
827
|
+
|
828
|
+
<span class="summary_desc"><div class='inline'>
|
829
|
+
<p>How this parameter is provided to the Ruby OptionParser when being exposed
|
830
|
+
as a Ruby Executable.</p>
|
831
|
+
</div></span>
|
832
|
+
|
833
|
+
</li>
|
834
|
+
|
835
|
+
|
836
|
+
<li class="protected ">
|
837
|
+
<span class="summary_signature">
|
838
|
+
|
839
|
+
<a href="#option_parser_name-instance_method" title="#option_parser_name (instance method)">- (Object) <strong>option_parser_name</strong> </a>
|
840
|
+
|
841
|
+
|
842
|
+
|
843
|
+
</span>
|
844
|
+
|
845
|
+
|
846
|
+
<span class="note title protected">protected</span>
|
847
|
+
|
848
|
+
|
849
|
+
|
850
|
+
|
851
|
+
|
852
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
853
|
+
|
854
|
+
</li>
|
855
|
+
|
856
|
+
|
857
|
+
<li class="public ">
|
858
|
+
<span class="summary_signature">
|
859
|
+
|
860
|
+
<a href="#option_parser_short_name-instance_method" title="#option_parser_short_name (instance method)">- (Object) <strong>option_parser_short_name</strong> </a>
|
861
|
+
|
862
|
+
|
863
|
+
|
864
|
+
</span>
|
865
|
+
|
866
|
+
|
867
|
+
|
868
|
+
|
869
|
+
|
870
|
+
|
871
|
+
|
872
|
+
|
873
|
+
<span class="summary_desc"><div class='inline'>
|
874
|
+
<p>The Ruby OptionParser short name with prefix.</p>
|
875
|
+
</div></span>
|
876
|
+
|
877
|
+
</li>
|
878
|
+
|
879
|
+
|
880
|
+
<li class="protected ">
|
881
|
+
<span class="summary_signature">
|
882
|
+
|
883
|
+
<a href="#option_parser_type_name-instance_method" title="#option_parser_type_name (instance method)">- (Object) <strong>option_parser_type_name</strong> </a>
|
884
|
+
|
885
|
+
|
886
|
+
|
887
|
+
</span>
|
888
|
+
|
889
|
+
|
890
|
+
<span class="note title protected">protected</span>
|
891
|
+
|
892
|
+
|
893
|
+
|
894
|
+
|
895
|
+
|
896
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
897
|
+
|
898
|
+
</li>
|
899
|
+
|
900
|
+
|
901
|
+
<li class="protected ">
|
902
|
+
<span class="summary_signature">
|
903
|
+
|
904
|
+
<a href="#option_parser_type_output-instance_method" title="#option_parser_type_output (instance method)">- (Object) <strong>option_parser_type_output</strong> </a>
|
905
|
+
|
906
|
+
|
907
|
+
|
908
|
+
</span>
|
909
|
+
|
910
|
+
|
911
|
+
<span class="note title protected">protected</span>
|
912
|
+
|
913
|
+
|
914
|
+
|
915
|
+
|
916
|
+
|
917
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
918
|
+
|
919
|
+
</li>
|
920
|
+
|
921
|
+
|
922
|
+
<li class="public ">
|
923
|
+
<span class="summary_signature">
|
924
|
+
|
925
|
+
<a href="#prepare-instance_method" title="#prepare (instance method)">- (Object) <strong>prepare</strong> </a>
|
926
|
+
|
927
|
+
|
928
|
+
|
929
|
+
</span>
|
930
|
+
|
931
|
+
|
932
|
+
|
933
|
+
|
934
|
+
|
935
|
+
|
936
|
+
|
937
|
+
|
938
|
+
<span class="summary_desc"><div class='inline'>
|
939
|
+
<p>Prepare the parameter for execution or delegation, depending on what
|
940
|
+
context we're in.</p>
|
941
|
+
</div></span>
|
942
|
+
|
943
|
+
</li>
|
944
|
+
|
945
|
+
|
946
|
+
<li class="protected ">
|
947
|
+
<span class="summary_signature">
|
948
|
+
|
949
|
+
<a href="#prepare_prerequisites-instance_method" title="#prepare_prerequisites (instance method)">- (Object) <strong>prepare_prerequisites</strong> </a>
|
950
|
+
|
951
|
+
|
952
|
+
|
953
|
+
</span>
|
954
|
+
|
955
|
+
|
956
|
+
<span class="note title protected">protected</span>
|
957
|
+
|
958
|
+
|
959
|
+
|
960
|
+
|
961
|
+
|
962
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
963
|
+
|
964
|
+
</li>
|
965
|
+
|
966
|
+
|
967
|
+
<li class="public ">
|
968
|
+
<span class="summary_signature">
|
969
|
+
|
970
|
+
<a href="#prepared%3F-instance_method" title="#prepared? (instance method)">- (Boolean) <strong>prepared?</strong> </a>
|
971
|
+
|
972
|
+
|
973
|
+
|
974
|
+
</span>
|
975
|
+
|
976
|
+
|
977
|
+
|
978
|
+
|
979
|
+
|
980
|
+
|
981
|
+
|
982
|
+
|
983
|
+
<span class="summary_desc"><div class='inline'>
|
984
|
+
<p>Returns true if this parameter has already been prepared.</p>
|
985
|
+
</div></span>
|
986
|
+
|
987
|
+
</li>
|
988
|
+
|
989
|
+
|
990
|
+
<li class="public ">
|
991
|
+
<span class="summary_signature">
|
992
|
+
|
993
|
+
<a href="#required%3F-instance_method" title="#required? (instance method)">- (Boolean) <strong>required?</strong> </a>
|
994
|
+
|
995
|
+
|
996
|
+
|
997
|
+
</span>
|
998
|
+
|
999
|
+
|
1000
|
+
|
1001
|
+
|
1002
|
+
|
1003
|
+
|
1004
|
+
|
1005
|
+
|
1006
|
+
<span class="summary_desc"><div class='inline'>
|
1007
|
+
<p>Returns Boolean value if this parameter is required.</p>
|
1008
|
+
</div></span>
|
1009
|
+
|
1010
|
+
</li>
|
1011
|
+
|
1012
|
+
|
1013
|
+
<li class="public ">
|
1014
|
+
<span class="summary_signature">
|
1015
|
+
|
1016
|
+
<a href="#shell_value-instance_method" title="#shell_value (instance method)">- (Object) <strong>shell_value</strong> </a>
|
1017
|
+
|
1018
|
+
|
1019
|
+
|
1020
|
+
</span>
|
1021
|
+
|
1022
|
+
|
1023
|
+
|
1024
|
+
|
1025
|
+
|
1026
|
+
|
1027
|
+
|
1028
|
+
|
1029
|
+
<span class="summary_desc"><div class='inline'>
|
1030
|
+
<p>The String representation of the value in a format that is appropriate for
|
1031
|
+
the terminal.</p>
|
1032
|
+
</div></span>
|
1033
|
+
|
1034
|
+
</li>
|
1035
|
+
|
1036
|
+
|
1037
|
+
<li class="public ">
|
1038
|
+
<span class="summary_signature">
|
1039
|
+
|
1040
|
+
<a href="#short_prefix-instance_method" title="#short_prefix (instance method)">- (Object) <strong>short_prefix</strong> </a>
|
1041
|
+
|
1042
|
+
|
1043
|
+
|
1044
|
+
</span>
|
1045
|
+
|
1046
|
+
|
1047
|
+
|
1048
|
+
|
1049
|
+
|
1050
|
+
|
1051
|
+
|
1052
|
+
|
1053
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
1054
|
+
|
1055
|
+
</li>
|
1056
|
+
|
1057
|
+
|
1058
|
+
<li class="public ">
|
1059
|
+
<span class="summary_signature">
|
1060
|
+
|
1061
|
+
<a href="#to_rdoc-instance_method" title="#to_rdoc (instance method)">- (Object) <strong>to_rdoc</strong> </a>
|
1062
|
+
|
1063
|
+
|
1064
|
+
|
1065
|
+
</span>
|
1066
|
+
|
1067
|
+
|
1068
|
+
|
1069
|
+
|
1070
|
+
|
1071
|
+
|
1072
|
+
|
1073
|
+
|
1074
|
+
<span class="summary_desc"><div class='inline'>
|
1075
|
+
<p>Create a string that can be turned into a file that rdoc can parse to
|
1076
|
+
describe the customized or generated task using param name, type and
|
1077
|
+
description.</p>
|
1078
|
+
</div></span>
|
1079
|
+
|
1080
|
+
</li>
|
1081
|
+
|
1082
|
+
|
1083
|
+
<li class="public ">
|
1084
|
+
<span class="summary_signature">
|
1085
|
+
|
1086
|
+
<a href="#to_shell-instance_method" title="#to_shell (instance method)">- (Object) <strong>to_shell</strong> </a>
|
1087
|
+
|
1088
|
+
|
1089
|
+
|
1090
|
+
</span>
|
1091
|
+
|
1092
|
+
|
1093
|
+
|
1094
|
+
|
1095
|
+
|
1096
|
+
|
1097
|
+
|
1098
|
+
|
1099
|
+
<span class="summary_desc"><div class='inline'>
|
1100
|
+
<p>Prepare and serialize this parameter to a string that is appropriate for
|
1101
|
+
shell execution on the current platform.</p>
|
1102
|
+
</div></span>
|
1103
|
+
|
1104
|
+
</li>
|
1105
|
+
|
1106
|
+
|
1107
|
+
<li class="public ">
|
1108
|
+
<span class="summary_signature">
|
1109
|
+
|
1110
|
+
<a href="#validate-instance_method" title="#validate (instance method)">- (Object) <strong>validate</strong> </a>
|
1111
|
+
|
1112
|
+
|
1113
|
+
|
1114
|
+
</span>
|
1115
|
+
|
1116
|
+
|
1117
|
+
|
1118
|
+
|
1119
|
+
|
1120
|
+
|
1121
|
+
|
1122
|
+
|
1123
|
+
<span class="summary_desc"><div class='inline'>
|
1124
|
+
<p>Ensure this parameter is in a valid state, raise a
|
1125
|
+
Sprout::Errors::MissingArgumentError if it is not.</p>
|
1126
|
+
</div></span>
|
1127
|
+
|
1128
|
+
</li>
|
1129
|
+
|
1130
|
+
|
1131
|
+
<li class="public ">
|
1132
|
+
<span class="summary_signature">
|
1133
|
+
|
1134
|
+
<a href="#visible%3F-instance_method" title="#visible? (instance method)">- (Boolean) <strong>visible?</strong> </a>
|
1135
|
+
|
1136
|
+
|
1137
|
+
|
1138
|
+
</span>
|
1139
|
+
|
1140
|
+
|
1141
|
+
|
1142
|
+
|
1143
|
+
|
1144
|
+
|
1145
|
+
|
1146
|
+
|
1147
|
+
<span class="summary_desc"><div class='inline'>
|
1148
|
+
<p>By default, Executable::Params only appear in the shell output when they
|
1149
|
+
are not nil.</p>
|
1150
|
+
</div></span>
|
1151
|
+
|
1152
|
+
</li>
|
1153
|
+
|
1154
|
+
|
1155
|
+
</ul>
|
1156
|
+
|
1157
|
+
|
1158
|
+
<div id="constructor_details" class="method_details_list">
|
1159
|
+
<h2>Constructor Details</h2>
|
1160
|
+
|
1161
|
+
<div class="method_details first">
|
1162
|
+
<p class="signature first" id="initialize-instance_method">
|
1163
|
+
|
1164
|
+
- (<tt><span class='object_link'><a href="" title="Sprout::Executable::Param (class)">Param</a></span></tt>) <strong>initialize</strong>
|
1165
|
+
|
1166
|
+
|
1167
|
+
|
1168
|
+
</p><div class="docstring">
|
1169
|
+
<div class="discussion">
|
1170
|
+
|
1171
|
+
<p>Default constructor for Params, if you create a new concrete type, be sure
|
1172
|
+
to call <tt>super()</tt> in your own constructor.</p>
|
1173
|
+
|
1174
|
+
|
1175
|
+
</div>
|
1176
|
+
</div>
|
1177
|
+
<div class="tags">
|
1178
|
+
|
1179
|
+
</div><table class="source_code">
|
1180
|
+
<tr>
|
1181
|
+
<td>
|
1182
|
+
<pre class="lines">
|
1183
|
+
|
1184
|
+
|
1185
|
+
227
|
1186
|
+
228
|
1187
|
+
229
|
1188
|
+
230
|
1189
|
+
231
|
1190
|
+
232
|
1191
|
+
233</pre>
|
1192
|
+
</td>
|
1193
|
+
<td>
|
1194
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 227</span>
|
1195
|
+
|
1196
|
+
<span class='kw'>def</span> <span class='id initialize'>initialize</span>
|
1197
|
+
<span class='ivar'>@description</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Default Description</span><span class='tstring_end'>'</span></span>
|
1198
|
+
<span class='ivar'>@hidden_value</span> <span class='op'>=</span> <span class='kw'>false</span>
|
1199
|
+
<span class='ivar'>@hidden_name</span> <span class='op'>=</span> <span class='kw'>false</span>
|
1200
|
+
<span class='ivar'>@delimiter</span> <span class='op'>=</span> <span class='const'>DEFAULT_DELIMITER</span>
|
1201
|
+
<span class='ivar'>@option_parser_type_name</span> <span class='op'>=</span> <span class='const'>DEFAULT_OPTION_PARSER_TYPE_NAME</span>
|
1202
|
+
<span class='kw'>end</span></pre>
|
1203
|
+
</td>
|
1204
|
+
</tr>
|
1205
|
+
</table>
|
1206
|
+
</div>
|
1207
|
+
|
1208
|
+
</div>
|
1209
|
+
|
1210
|
+
<div id="instance_attr_details" class="attr_details">
|
1211
|
+
<h2>Instance Attribute Details</h2>
|
1212
|
+
|
1213
|
+
|
1214
|
+
<span id="belongs_to=-instance_method"></span>
|
1215
|
+
<span id="belongs_to-instance_method"></span>
|
1216
|
+
<div class="method_details first">
|
1217
|
+
<p class="signature first" id="belongs_to-instance_method">
|
1218
|
+
|
1219
|
+
- (<tt>Object</tt>) <strong>belongs_to</strong>
|
1220
|
+
|
1221
|
+
|
1222
|
+
|
1223
|
+
</p><div class="docstring">
|
1224
|
+
<div class="discussion">
|
1225
|
+
|
1226
|
+
<p>The Sprout::Executable that this parameter instance belongs to.</p>
|
1227
|
+
|
1228
|
+
|
1229
|
+
</div>
|
1230
|
+
</div>
|
1231
|
+
<div class="tags">
|
1232
|
+
|
1233
|
+
</div><table class="source_code">
|
1234
|
+
<tr>
|
1235
|
+
<td>
|
1236
|
+
<pre class="lines">
|
1237
|
+
|
1238
|
+
|
1239
|
+
60
|
1240
|
+
61
|
1241
|
+
62</pre>
|
1242
|
+
</td>
|
1243
|
+
<td>
|
1244
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 60</span>
|
1245
|
+
|
1246
|
+
<span class='kw'>def</span> <span class='id belongs_to'>belongs_to</span>
|
1247
|
+
<span class='ivar'>@belongs_to</span>
|
1248
|
+
<span class='kw'>end</span></pre>
|
1249
|
+
</td>
|
1250
|
+
</tr>
|
1251
|
+
</table>
|
1252
|
+
</div>
|
1253
|
+
|
1254
|
+
|
1255
|
+
<span id="delimiter=-instance_method"></span>
|
1256
|
+
<span id="delimiter-instance_method"></span>
|
1257
|
+
<div class="method_details ">
|
1258
|
+
<p class="signature " id="delimiter-instance_method">
|
1259
|
+
|
1260
|
+
- (<tt>Object</tt>) <strong>delimiter</strong>
|
1261
|
+
|
1262
|
+
|
1263
|
+
|
1264
|
+
</p><div class="docstring">
|
1265
|
+
<div class="discussion">
|
1266
|
+
|
1267
|
+
<p>Executable::Params join their name/value pair with an equals sign by
|
1268
|
+
default, this can be modified To a space or whatever you wish.</p>
|
1269
|
+
|
1270
|
+
|
1271
|
+
</div>
|
1272
|
+
</div>
|
1273
|
+
<div class="tags">
|
1274
|
+
|
1275
|
+
</div><table class="source_code">
|
1276
|
+
<tr>
|
1277
|
+
<td>
|
1278
|
+
<pre class="lines">
|
1279
|
+
|
1280
|
+
|
1281
|
+
66
|
1282
|
+
67
|
1283
|
+
68</pre>
|
1284
|
+
</td>
|
1285
|
+
<td>
|
1286
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 66</span>
|
1287
|
+
|
1288
|
+
<span class='kw'>def</span> <span class='id delimiter'>delimiter</span>
|
1289
|
+
<span class='ivar'>@delimiter</span>
|
1290
|
+
<span class='kw'>end</span></pre>
|
1291
|
+
</td>
|
1292
|
+
</tr>
|
1293
|
+
</table>
|
1294
|
+
</div>
|
1295
|
+
|
1296
|
+
|
1297
|
+
<span id="description=-instance_method"></span>
|
1298
|
+
<span id="description-instance_method"></span>
|
1299
|
+
<div class="method_details ">
|
1300
|
+
<p class="signature " id="description-instance_method">
|
1301
|
+
|
1302
|
+
- (<tt>Object</tt>) <strong>description</strong>
|
1303
|
+
|
1304
|
+
|
1305
|
+
|
1306
|
+
</p><div class="docstring">
|
1307
|
+
<div class="discussion">
|
1308
|
+
|
1309
|
+
<p>The String description that will be used for RDoc documentation and user
|
1310
|
+
help.</p>
|
1311
|
+
|
1312
|
+
|
1313
|
+
</div>
|
1314
|
+
</div>
|
1315
|
+
<div class="tags">
|
1316
|
+
|
1317
|
+
</div><table class="source_code">
|
1318
|
+
<tr>
|
1319
|
+
<td>
|
1320
|
+
<pre class="lines">
|
1321
|
+
|
1322
|
+
|
1323
|
+
71
|
1324
|
+
72
|
1325
|
+
73</pre>
|
1326
|
+
</td>
|
1327
|
+
<td>
|
1328
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 71</span>
|
1329
|
+
|
1330
|
+
<span class='kw'>def</span> <span class='id description'>description</span>
|
1331
|
+
<span class='ivar'>@description</span>
|
1332
|
+
<span class='kw'>end</span></pre>
|
1333
|
+
</td>
|
1334
|
+
</tr>
|
1335
|
+
</table>
|
1336
|
+
</div>
|
1337
|
+
|
1338
|
+
|
1339
|
+
<span id="file_expression=-instance_method"></span>
|
1340
|
+
<span id="file_expression-instance_method"></span>
|
1341
|
+
<div class="method_details ">
|
1342
|
+
<p class="signature " id="file_expression-instance_method">
|
1343
|
+
|
1344
|
+
- (<tt>Object</tt>) <strong>file_expression</strong>
|
1345
|
+
|
1346
|
+
|
1347
|
+
|
1348
|
+
</p><table class="source_code">
|
1349
|
+
<tr>
|
1350
|
+
<td>
|
1351
|
+
<pre class="lines">
|
1352
|
+
|
1353
|
+
|
1354
|
+
360
|
1355
|
+
361
|
1356
|
+
362</pre>
|
1357
|
+
</td>
|
1358
|
+
<td>
|
1359
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 360</span>
|
1360
|
+
|
1361
|
+
<span class='kw'>def</span> <span class='id file_expression'>file_expression</span>
|
1362
|
+
<span class='ivar'>@file_expression</span> <span class='op'>||=</span> <span class='id belongs_to'>belongs_to</span><span class='period'>.</span><span class='id default_file_expression'>default_file_expression</span>
|
1363
|
+
<span class='kw'>end</span></pre>
|
1364
|
+
</td>
|
1365
|
+
</tr>
|
1366
|
+
</table>
|
1367
|
+
</div>
|
1368
|
+
|
1369
|
+
|
1370
|
+
<span id="hidden_name=-instance_method"></span>
|
1371
|
+
<span id="hidden_name-instance_method"></span>
|
1372
|
+
<div class="method_details ">
|
1373
|
+
<p class="signature " id="hidden_name-instance_method">
|
1374
|
+
|
1375
|
+
- (<tt>Object</tt>) <strong>hidden_name</strong>
|
1376
|
+
|
1377
|
+
|
1378
|
+
|
1379
|
+
</p><div class="docstring">
|
1380
|
+
<div class="discussion">
|
1381
|
+
|
1382
|
+
<p>Boolean value that hides the name parameter from the shell execution.</p>
|
1383
|
+
|
1384
|
+
<pre class="code"><span class='id add_param'>add_param</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='const'>String</span><span class='comma'>,</span> <span class='symbol'>:hidden_name</span> <span class='op'>=></span> <span class='kw'>true</span></pre>
|
1385
|
+
|
1386
|
+
<p>Without this option, the above parameter would serialize to the process
|
1387
|
+
like:</p>
|
1388
|
+
|
1389
|
+
<pre class="code"><span class='id foo'>foo</span> <span class='op'>-</span><span class='op'>-</span><span class='id name'>name</span><span class='op'>=</span><span class='const'>Value</span></pre>
|
1390
|
+
|
1391
|
+
<p>But with this option, the above parameter would serialize to the process
|
1392
|
+
like:</p>
|
1393
|
+
|
1394
|
+
<pre class="code"><span class='id foo'>foo</span> <span class='const'>Value</span></pre>
|
1395
|
+
|
1396
|
+
|
1397
|
+
</div>
|
1398
|
+
</div>
|
1399
|
+
<div class="tags">
|
1400
|
+
|
1401
|
+
</div><table class="source_code">
|
1402
|
+
<tr>
|
1403
|
+
<td>
|
1404
|
+
<pre class="lines">
|
1405
|
+
|
1406
|
+
|
1407
|
+
89
|
1408
|
+
90
|
1409
|
+
91</pre>
|
1410
|
+
</td>
|
1411
|
+
<td>
|
1412
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 89</span>
|
1413
|
+
|
1414
|
+
<span class='kw'>def</span> <span class='id hidden_name'>hidden_name</span>
|
1415
|
+
<span class='ivar'>@hidden_name</span>
|
1416
|
+
<span class='kw'>end</span></pre>
|
1417
|
+
</td>
|
1418
|
+
</tr>
|
1419
|
+
</table>
|
1420
|
+
</div>
|
1421
|
+
|
1422
|
+
|
1423
|
+
<span id="hidden_value=-instance_method"></span>
|
1424
|
+
<span id="hidden_value-instance_method"></span>
|
1425
|
+
<div class="method_details ">
|
1426
|
+
<p class="signature " id="hidden_value-instance_method">
|
1427
|
+
|
1428
|
+
- (<tt>Object</tt>) <strong>hidden_value</strong>
|
1429
|
+
|
1430
|
+
|
1431
|
+
|
1432
|
+
</p><div class="docstring">
|
1433
|
+
<div class="discussion">
|
1434
|
+
|
1435
|
+
<p>Boolean value that hides the value parameter from the shell execution.</p>
|
1436
|
+
|
1437
|
+
<pre class="code"><span class='id add_param'>add_param</span> <span class='symbol'>:visible</span><span class='comma'>,</span> <span class='const'>Boolean</span><span class='comma'>,</span> <span class='symbol'>:hidden_value</span> <span class='op'>=></span> <span class='kw'>true</span></pre>
|
1438
|
+
|
1439
|
+
<p>Without this option, the above parameter would serialize to the process
|
1440
|
+
like:</p>
|
1441
|
+
|
1442
|
+
<pre class="code"><span class='id foo'>foo</span> <span class='op'>-</span><span class='op'>-</span><span class='id visible'>visible</span><span class='op'>=</span><span class='kw'>true</span></pre>
|
1443
|
+
|
1444
|
+
<p>But with this option, the above parameter would serialize to the process
|
1445
|
+
like:</p>
|
1446
|
+
|
1447
|
+
<pre class="code"><span class='id foo'>foo</span> <span class='op'>-</span><span class='op'>-</span><span class='id visible'>visible</span></pre>
|
1448
|
+
|
1449
|
+
|
1450
|
+
</div>
|
1451
|
+
</div>
|
1452
|
+
<div class="tags">
|
1453
|
+
|
1454
|
+
</div><table class="source_code">
|
1455
|
+
<tr>
|
1456
|
+
<td>
|
1457
|
+
<pre class="lines">
|
1458
|
+
|
1459
|
+
|
1460
|
+
107
|
1461
|
+
108
|
1462
|
+
109</pre>
|
1463
|
+
</td>
|
1464
|
+
<td>
|
1465
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 107</span>
|
1466
|
+
|
1467
|
+
<span class='kw'>def</span> <span class='id hidden_value'>hidden_value</span>
|
1468
|
+
<span class='ivar'>@hidden_value</span>
|
1469
|
+
<span class='kw'>end</span></pre>
|
1470
|
+
</td>
|
1471
|
+
</tr>
|
1472
|
+
</table>
|
1473
|
+
</div>
|
1474
|
+
|
1475
|
+
|
1476
|
+
<span id="name=-instance_method"></span>
|
1477
|
+
<span id="name-instance_method"></span>
|
1478
|
+
<div class="method_details ">
|
1479
|
+
<p class="signature " id="name-instance_method">
|
1480
|
+
|
1481
|
+
- (<tt>Object</tt>) <strong>name</strong>
|
1482
|
+
|
1483
|
+
|
1484
|
+
|
1485
|
+
</p><div class="docstring">
|
1486
|
+
<div class="discussion">
|
1487
|
+
|
1488
|
+
<p>The String (or Symbol) name of the parameter.</p>
|
1489
|
+
|
1490
|
+
|
1491
|
+
</div>
|
1492
|
+
</div>
|
1493
|
+
<div class="tags">
|
1494
|
+
|
1495
|
+
</div><table class="source_code">
|
1496
|
+
<tr>
|
1497
|
+
<td>
|
1498
|
+
<pre class="lines">
|
1499
|
+
|
1500
|
+
|
1501
|
+
111
|
1502
|
+
112
|
1503
|
+
113</pre>
|
1504
|
+
</td>
|
1505
|
+
<td>
|
1506
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 111</span>
|
1507
|
+
|
1508
|
+
<span class='kw'>def</span> <span class='id name'>name</span>
|
1509
|
+
<span class='ivar'>@name</span>
|
1510
|
+
<span class='kw'>end</span></pre>
|
1511
|
+
</td>
|
1512
|
+
</tr>
|
1513
|
+
</table>
|
1514
|
+
</div>
|
1515
|
+
|
1516
|
+
|
1517
|
+
<span id="prefix=-instance_method"></span>
|
1518
|
+
<span id="prefix-instance_method"></span>
|
1519
|
+
<div class="method_details ">
|
1520
|
+
<p class="signature " id="prefix-instance_method">
|
1521
|
+
|
1522
|
+
- (<tt>Object</tt>) <strong>prefix</strong>
|
1523
|
+
|
1524
|
+
|
1525
|
+
|
1526
|
+
</p><div class="docstring">
|
1527
|
+
<div class="discussion">
|
1528
|
+
|
1529
|
+
<p>Leading character for each parameter Can sometimes be an empty string,
|
1530
|
+
other times it's a double dash '--' but usually it's just a single dash '-'</p>
|
1531
|
+
|
1532
|
+
|
1533
|
+
</div>
|
1534
|
+
</div>
|
1535
|
+
<div class="tags">
|
1536
|
+
|
1537
|
+
</div><table class="source_code">
|
1538
|
+
<tr>
|
1539
|
+
<td>
|
1540
|
+
<pre class="lines">
|
1541
|
+
|
1542
|
+
|
1543
|
+
121
|
1544
|
+
122
|
1545
|
+
123</pre>
|
1546
|
+
</td>
|
1547
|
+
<td>
|
1548
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 121</span>
|
1549
|
+
|
1550
|
+
<span class='kw'>def</span> <span class='id prefix'>prefix</span>
|
1551
|
+
<span class='ivar'>@prefix</span> <span class='op'>||=</span> <span class='lparen'>(</span><span class='id belongs_to'>belongs_to</span><span class='period'>.</span><span class='id nil?'>nil?</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>DEFAULT_PREFIX</span> <span class='op'>:</span> <span class='id belongs_to'>belongs_to</span><span class='period'>.</span><span class='id default_prefix'>default_prefix</span>
|
1552
|
+
<span class='kw'>end</span></pre>
|
1553
|
+
</td>
|
1554
|
+
</tr>
|
1555
|
+
</table>
|
1556
|
+
</div>
|
1557
|
+
|
1558
|
+
|
1559
|
+
<span id="reader=-instance_method"></span>
|
1560
|
+
<span id="reader-instance_method"></span>
|
1561
|
+
<div class="method_details ">
|
1562
|
+
<p class="signature " id="reader-instance_method">
|
1563
|
+
|
1564
|
+
- (<tt>Object</tt>) <strong>reader</strong>
|
1565
|
+
|
1566
|
+
|
1567
|
+
|
1568
|
+
</p><div class="docstring">
|
1569
|
+
<div class="discussion">
|
1570
|
+
|
1571
|
+
<p>A Symbol that refers to a custom attribute reader that is available to
|
1572
|
+
instance methods on the Sprout::Executable that uses it.</p>
|
1573
|
+
|
1574
|
+
<pre class="code"><span class='id add_param'>add_param</span> <span class='symbol'>:visible</span><span class='comma'>,</span> <span class='const'>Boolean</span><span class='comma'>,</span> <span class='symbol'>:reader</span> <span class='op'>=></span> <span class='symbol'>:get_visible</span>
|
1575
|
+
|
1576
|
+
<span class='kw'>def</span> <span class='id get_visible'>get_visible</span>
|
1577
|
+
<span class='kw'>return</span> <span class='ivar'>@visible</span>
|
1578
|
+
<span class='kw'>end</span></pre>
|
1579
|
+
|
1580
|
+
|
1581
|
+
</div>
|
1582
|
+
</div>
|
1583
|
+
<div class="tags">
|
1584
|
+
|
1585
|
+
</div><table class="source_code">
|
1586
|
+
<tr>
|
1587
|
+
<td>
|
1588
|
+
<pre class="lines">
|
1589
|
+
|
1590
|
+
|
1591
|
+
134
|
1592
|
+
135
|
1593
|
+
136</pre>
|
1594
|
+
</td>
|
1595
|
+
<td>
|
1596
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 134</span>
|
1597
|
+
|
1598
|
+
<span class='kw'>def</span> <span class='id reader'>reader</span>
|
1599
|
+
<span class='ivar'>@reader</span>
|
1600
|
+
<span class='kw'>end</span></pre>
|
1601
|
+
</td>
|
1602
|
+
</tr>
|
1603
|
+
</table>
|
1604
|
+
</div>
|
1605
|
+
|
1606
|
+
|
1607
|
+
<span id="required=-instance_method"></span>
|
1608
|
+
<span id="required-instance_method"></span>
|
1609
|
+
<div class="method_details ">
|
1610
|
+
<p class="signature " id="required-instance_method">
|
1611
|
+
|
1612
|
+
- (<tt>Object</tt>) <strong>required</strong>
|
1613
|
+
|
1614
|
+
|
1615
|
+
|
1616
|
+
</p><div class="docstring">
|
1617
|
+
<div class="discussion">
|
1618
|
+
|
1619
|
+
<p>Boolean value that will cause a Sprout::Errors::UsageError if the
|
1620
|
+
executable is invoked without this parameter first being set.</p>
|
1621
|
+
|
1622
|
+
<pre class="code">add_param :visible, Boolean :required => true</pre>
|
1623
|
+
|
1624
|
+
<p>Default false</p>
|
1625
|
+
|
1626
|
+
|
1627
|
+
</div>
|
1628
|
+
</div>
|
1629
|
+
<div class="tags">
|
1630
|
+
|
1631
|
+
</div><table class="source_code">
|
1632
|
+
<tr>
|
1633
|
+
<td>
|
1634
|
+
<pre class="lines">
|
1635
|
+
|
1636
|
+
|
1637
|
+
145
|
1638
|
+
146
|
1639
|
+
147</pre>
|
1640
|
+
</td>
|
1641
|
+
<td>
|
1642
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 145</span>
|
1643
|
+
|
1644
|
+
<span class='kw'>def</span> <span class='id required'>required</span>
|
1645
|
+
<span class='ivar'>@required</span>
|
1646
|
+
<span class='kw'>end</span></pre>
|
1647
|
+
</td>
|
1648
|
+
</tr>
|
1649
|
+
</table>
|
1650
|
+
</div>
|
1651
|
+
|
1652
|
+
|
1653
|
+
<span id="shell_name=-instance_method"></span>
|
1654
|
+
<span id="shell_name-instance_method"></span>
|
1655
|
+
<div class="method_details ">
|
1656
|
+
<p class="signature " id="shell_name-instance_method">
|
1657
|
+
|
1658
|
+
- (<tt>Object</tt>) <strong>shell_name</strong>
|
1659
|
+
|
1660
|
+
|
1661
|
+
|
1662
|
+
</p><table class="source_code">
|
1663
|
+
<tr>
|
1664
|
+
<td>
|
1665
|
+
<pre class="lines">
|
1666
|
+
|
1667
|
+
|
1668
|
+
364
|
1669
|
+
365
|
1670
|
+
366</pre>
|
1671
|
+
</td>
|
1672
|
+
<td>
|
1673
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 364</span>
|
1674
|
+
|
1675
|
+
<span class='kw'>def</span> <span class='id shell_name'>shell_name</span>
|
1676
|
+
<span class='ivar'>@shell_name</span> <span class='op'>||=</span> <span class='id prefix'>prefix</span> <span class='op'>+</span> <span class='id name'>name</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='period'>.</span><span class='id split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>_</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
1677
|
+
<span class='kw'>end</span></pre>
|
1678
|
+
</td>
|
1679
|
+
</tr>
|
1680
|
+
</table>
|
1681
|
+
</div>
|
1682
|
+
|
1683
|
+
|
1684
|
+
<span id="short_name=-instance_method"></span>
|
1685
|
+
<span id="short_name-instance_method"></span>
|
1686
|
+
<div class="method_details ">
|
1687
|
+
<p class="signature " id="short_name-instance_method">
|
1688
|
+
|
1689
|
+
- (<tt>Object</tt>) <strong>short_name</strong>
|
1690
|
+
|
1691
|
+
|
1692
|
+
|
1693
|
+
</p><div class="docstring">
|
1694
|
+
<div class="discussion">
|
1695
|
+
|
1696
|
+
<p>The short name for this parameter. If it's not explicitly, the first
|
1697
|
+
character of the parameter name will be used. When multiple parameters have
|
1698
|
+
the same first character, the first one encountered will win.</p>
|
1699
|
+
|
1700
|
+
|
1701
|
+
</div>
|
1702
|
+
</div>
|
1703
|
+
<div class="tags">
|
1704
|
+
|
1705
|
+
</div><table class="source_code">
|
1706
|
+
<tr>
|
1707
|
+
<td>
|
1708
|
+
<pre class="lines">
|
1709
|
+
|
1710
|
+
|
1711
|
+
345
|
1712
|
+
346
|
1713
|
+
347</pre>
|
1714
|
+
</td>
|
1715
|
+
<td>
|
1716
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 345</span>
|
1717
|
+
|
1718
|
+
<span class='kw'>def</span> <span class='id short_name'>short_name</span>
|
1719
|
+
<span class='ivar'>@short_name</span> <span class='op'>||=</span> <span class='id name'>name</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='period'>.</span><span class='id split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id shift'>shift</span>
|
1720
|
+
<span class='kw'>end</span></pre>
|
1721
|
+
</td>
|
1722
|
+
</tr>
|
1723
|
+
</table>
|
1724
|
+
</div>
|
1725
|
+
|
1726
|
+
|
1727
|
+
<span id="to_shell_proc=-instance_method"></span>
|
1728
|
+
<span id="to_shell_proc-instance_method"></span>
|
1729
|
+
<div class="method_details ">
|
1730
|
+
<p class="signature " id="to_shell_proc-instance_method">
|
1731
|
+
|
1732
|
+
- (<tt>Object</tt>) <strong>to_shell_proc</strong>
|
1733
|
+
|
1734
|
+
|
1735
|
+
|
1736
|
+
</p><div class="docstring">
|
1737
|
+
<div class="discussion">
|
1738
|
+
|
1739
|
+
<p>An optional Proc that should be called when this parameter is serialized to
|
1740
|
+
shell output. The Proc should return a String value that makes sense to
|
1741
|
+
the underlying process.</p>
|
1742
|
+
|
1743
|
+
<pre class="code"><span class='id add_param'>add_param</span> <span class='symbol'>:visible</span><span class='comma'>,</span> <span class='const'>Boolean</span><span class='comma'>,</span> <span class='symbol'>:to_shell_proc</span> <span class='op'>=></span> <span class='const'>Proc</span><span class='period'>.</span><span class='id new'>new</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id p'>p</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>---result</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span></pre>
|
1744
|
+
|
1745
|
+
|
1746
|
+
</div>
|
1747
|
+
</div>
|
1748
|
+
<div class="tags">
|
1749
|
+
|
1750
|
+
</div><table class="source_code">
|
1751
|
+
<tr>
|
1752
|
+
<td>
|
1753
|
+
<pre class="lines">
|
1754
|
+
|
1755
|
+
|
1756
|
+
154
|
1757
|
+
155
|
1758
|
+
156</pre>
|
1759
|
+
</td>
|
1760
|
+
<td>
|
1761
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 154</span>
|
1762
|
+
|
1763
|
+
<span class='kw'>def</span> <span class='id to_shell_proc'>to_shell_proc</span>
|
1764
|
+
<span class='ivar'>@to_shell_proc</span>
|
1765
|
+
<span class='kw'>end</span></pre>
|
1766
|
+
</td>
|
1767
|
+
</tr>
|
1768
|
+
</table>
|
1769
|
+
</div>
|
1770
|
+
|
1771
|
+
|
1772
|
+
<span id="type=-instance_method"></span>
|
1773
|
+
<span id="type-instance_method"></span>
|
1774
|
+
<div class="method_details ">
|
1775
|
+
<p class="signature " id="type-instance_method">
|
1776
|
+
|
1777
|
+
- (<tt>Object</tt>) <strong>type</strong>
|
1778
|
+
|
1779
|
+
|
1780
|
+
|
1781
|
+
</p><div class="docstring">
|
1782
|
+
<div class="discussion">
|
1783
|
+
|
1784
|
+
<p>The data type of the parameter, used to generate more appropriate RDoc
|
1785
|
+
content for the concrete Sprout::Executable.</p>
|
1786
|
+
|
1787
|
+
|
1788
|
+
</div>
|
1789
|
+
</div>
|
1790
|
+
<div class="tags">
|
1791
|
+
|
1792
|
+
</div><table class="source_code">
|
1793
|
+
<tr>
|
1794
|
+
<td>
|
1795
|
+
<pre class="lines">
|
1796
|
+
|
1797
|
+
|
1798
|
+
159
|
1799
|
+
160
|
1800
|
+
161</pre>
|
1801
|
+
</td>
|
1802
|
+
<td>
|
1803
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 159</span>
|
1804
|
+
|
1805
|
+
<span class='kw'>def</span> <span class='id type'>type</span>
|
1806
|
+
<span class='ivar'>@type</span>
|
1807
|
+
<span class='kw'>end</span></pre>
|
1808
|
+
</td>
|
1809
|
+
</tr>
|
1810
|
+
</table>
|
1811
|
+
</div>
|
1812
|
+
|
1813
|
+
|
1814
|
+
<span id="value=-instance_method"></span>
|
1815
|
+
<span id="value-instance_method"></span>
|
1816
|
+
<div class="method_details ">
|
1817
|
+
<p class="signature " id="value-instance_method">
|
1818
|
+
|
1819
|
+
- (<tt>Object</tt>) <strong>value</strong>
|
1820
|
+
|
1821
|
+
|
1822
|
+
|
1823
|
+
</p><div class="docstring">
|
1824
|
+
<div class="discussion">
|
1825
|
+
|
1826
|
+
<p>The value that was assigned to this parameter when the concrete
|
1827
|
+
Sprout::Executable was instantiated and configured.</p>
|
1828
|
+
|
1829
|
+
|
1830
|
+
</div>
|
1831
|
+
</div>
|
1832
|
+
<div class="tags">
|
1833
|
+
|
1834
|
+
</div><table class="source_code">
|
1835
|
+
<tr>
|
1836
|
+
<td>
|
1837
|
+
<pre class="lines">
|
1838
|
+
|
1839
|
+
|
1840
|
+
164
|
1841
|
+
165
|
1842
|
+
166</pre>
|
1843
|
+
</td>
|
1844
|
+
<td>
|
1845
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 164</span>
|
1846
|
+
|
1847
|
+
<span class='kw'>def</span> <span class='id value'>value</span>
|
1848
|
+
<span class='ivar'>@value</span>
|
1849
|
+
<span class='kw'>end</span></pre>
|
1850
|
+
</td>
|
1851
|
+
</tr>
|
1852
|
+
</table>
|
1853
|
+
</div>
|
1854
|
+
|
1855
|
+
|
1856
|
+
<span id="writer=-instance_method"></span>
|
1857
|
+
<span id="writer-instance_method"></span>
|
1858
|
+
<div class="method_details ">
|
1859
|
+
<p class="signature " id="writer-instance_method">
|
1860
|
+
|
1861
|
+
- (<tt>Object</tt>) <strong>writer</strong>
|
1862
|
+
|
1863
|
+
|
1864
|
+
|
1865
|
+
</p><div class="docstring">
|
1866
|
+
<div class="discussion">
|
1867
|
+
|
1868
|
+
<p>A Symbol that refers to a custom attribute writer that is available to
|
1869
|
+
instance methods on the Sprout::Executable that uses it.</p>
|
1870
|
+
|
1871
|
+
<pre class="code"><span class='id add_param'>add_param</span> <span class='symbol'>:visible</span><span class='comma'>,</span> <span class='const'>Boolean</span><span class='comma'>,</span> <span class='symbol'>:writer</span> <span class='op'>=></span> <span class='symbol'>:set_visible</span>
|
1872
|
+
|
1873
|
+
<span class='kw'>def</span> <span class='id set_visible='>set_visible=</span><span class='lparen'>(</span><span class='id vis'>vis</span><span class='rparen'>)</span>
|
1874
|
+
<span class='ivar'>@visible</span> <span class='op'>=</span> <span class='id vis'>vis</span>
|
1875
|
+
<span class='kw'>end</span></pre>
|
1876
|
+
|
1877
|
+
|
1878
|
+
</div>
|
1879
|
+
</div>
|
1880
|
+
<div class="tags">
|
1881
|
+
|
1882
|
+
</div><table class="source_code">
|
1883
|
+
<tr>
|
1884
|
+
<td>
|
1885
|
+
<pre class="lines">
|
1886
|
+
|
1887
|
+
|
1888
|
+
177
|
1889
|
+
178
|
1890
|
+
179</pre>
|
1891
|
+
</td>
|
1892
|
+
<td>
|
1893
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 177</span>
|
1894
|
+
|
1895
|
+
<span class='kw'>def</span> <span class='id writer'>writer</span>
|
1896
|
+
<span class='ivar'>@writer</span>
|
1897
|
+
<span class='kw'>end</span></pre>
|
1898
|
+
</td>
|
1899
|
+
</tr>
|
1900
|
+
</table>
|
1901
|
+
</div>
|
1902
|
+
|
1903
|
+
</div>
|
1904
|
+
|
1905
|
+
|
1906
|
+
<div id="instance_method_details" class="method_details_list">
|
1907
|
+
<h2>Instance Method Details</h2>
|
1908
|
+
|
1909
|
+
|
1910
|
+
<div class="method_details first">
|
1911
|
+
<p class="signature first" id="clean_path-instance_method">
|
1912
|
+
|
1913
|
+
- (<tt>Object</tt>) <strong>clean_path</strong>(path) <span class="extras">(protected)</span>
|
1914
|
+
|
1915
|
+
|
1916
|
+
|
1917
|
+
</p><div class="docstring">
|
1918
|
+
<div class="discussion">
|
1919
|
+
|
1920
|
+
<p>Clean the provided path using the current Sprout::System.</p>
|
1921
|
+
|
1922
|
+
|
1923
|
+
</div>
|
1924
|
+
</div>
|
1925
|
+
<div class="tags">
|
1926
|
+
|
1927
|
+
</div><table class="source_code">
|
1928
|
+
<tr>
|
1929
|
+
<td>
|
1930
|
+
<pre class="lines">
|
1931
|
+
|
1932
|
+
|
1933
|
+
417
|
1934
|
+
418
|
1935
|
+
419</pre>
|
1936
|
+
</td>
|
1937
|
+
<td>
|
1938
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 417</span>
|
1939
|
+
|
1940
|
+
<span class='kw'>def</span> <span class='id clean_path'>clean_path</span> <span class='id path'>path</span>
|
1941
|
+
<span class='const'>Sprout</span><span class='op'>::</span><span class='const'>System</span><span class='period'>.</span><span class='id create'>create</span><span class='period'>.</span><span class='id clean_path'>clean_path</span> <span class='id path'>path</span>
|
1942
|
+
<span class='kw'>end</span></pre>
|
1943
|
+
</td>
|
1944
|
+
</tr>
|
1945
|
+
</table>
|
1946
|
+
</div>
|
1947
|
+
|
1948
|
+
<div class="method_details ">
|
1949
|
+
<p class="signature " id="default-instance_method">
|
1950
|
+
|
1951
|
+
- (<tt>Object</tt>) <strong>default</strong>
|
1952
|
+
|
1953
|
+
|
1954
|
+
|
1955
|
+
</p><div class="docstring">
|
1956
|
+
<div class="discussion">
|
1957
|
+
|
1958
|
+
<p>Return the default value or nil if none was provided.</p>
|
1959
|
+
|
1960
|
+
|
1961
|
+
</div>
|
1962
|
+
</div>
|
1963
|
+
<div class="tags">
|
1964
|
+
|
1965
|
+
</div><table class="source_code">
|
1966
|
+
<tr>
|
1967
|
+
<td>
|
1968
|
+
<pre class="lines">
|
1969
|
+
|
1970
|
+
|
1971
|
+
272
|
1972
|
+
273
|
1973
|
+
274</pre>
|
1974
|
+
</td>
|
1975
|
+
<td>
|
1976
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 272</span>
|
1977
|
+
|
1978
|
+
<span class='kw'>def</span> <span class='id default'>default</span>
|
1979
|
+
<span class='ivar'>@default</span>
|
1980
|
+
<span class='kw'>end</span></pre>
|
1981
|
+
</td>
|
1982
|
+
</tr>
|
1983
|
+
</table>
|
1984
|
+
</div>
|
1985
|
+
|
1986
|
+
<div class="method_details ">
|
1987
|
+
<p class="signature " id="default=-instance_method">
|
1988
|
+
|
1989
|
+
- (<tt>Object</tt>) <strong>default=</strong>(value)
|
1990
|
+
|
1991
|
+
|
1992
|
+
|
1993
|
+
</p><div class="docstring">
|
1994
|
+
<div class="discussion">
|
1995
|
+
|
1996
|
+
<p>Set the default value of the parameter. Using this option will ensure that
|
1997
|
+
required parameters are not nil, and default values can be overridden on
|
1998
|
+
instances.</p>
|
1999
|
+
|
2000
|
+
<pre class="code"><span class='id add_param'>add_param</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='const'>String</span><span class='comma'>,</span> <span class='symbol'>:default</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Bob</span><span class='tstring_end'>'</span></span></pre>
|
2001
|
+
|
2002
|
+
|
2003
|
+
</div>
|
2004
|
+
</div>
|
2005
|
+
<div class="tags">
|
2006
|
+
|
2007
|
+
</div><table class="source_code">
|
2008
|
+
<tr>
|
2009
|
+
<td>
|
2010
|
+
<pre class="lines">
|
2011
|
+
|
2012
|
+
|
2013
|
+
265
|
2014
|
+
266
|
2015
|
+
267
|
2016
|
+
268</pre>
|
2017
|
+
</td>
|
2018
|
+
<td>
|
2019
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 265</span>
|
2020
|
+
|
2021
|
+
<span class='kw'>def</span> <span class='id default='>default=</span><span class='lparen'>(</span><span class='id value'>value</span><span class='rparen'>)</span>
|
2022
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id value'>value</span> <span class='op'>=</span> <span class='id value'>value</span>
|
2023
|
+
<span class='ivar'>@default</span> <span class='op'>=</span> <span class='id value'>value</span>
|
2024
|
+
<span class='kw'>end</span></pre>
|
2025
|
+
</td>
|
2026
|
+
</tr>
|
2027
|
+
</table>
|
2028
|
+
</div>
|
2029
|
+
|
2030
|
+
<div class="method_details ">
|
2031
|
+
<p class="signature " id="file_is_output?-instance_method">
|
2032
|
+
|
2033
|
+
- (<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>) <strong>file_is_output?</strong>(file) <span class="extras">(protected)</span>
|
2034
|
+
|
2035
|
+
|
2036
|
+
|
2037
|
+
</p><div class="docstring">
|
2038
|
+
<div class="discussion">
|
2039
|
+
|
2040
|
+
<p>Return true if the Sprout::Executable that this parameter
|
2041
|
+
<tt>belongs_to</tt> has an <tt>output</tt> method (or parameter), and if
|
2042
|
+
the provided <tt>file</tt> matches the value of that parameter.</p>
|
2043
|
+
|
2044
|
+
<p>This method (convention) is used to avoid creating circular prerequisites
|
2045
|
+
in Rake. For most types of File parameters we want to make them into
|
2046
|
+
prerequisites, but not if the File is the one being created by the outer
|
2047
|
+
Sprout::Executable.</p>
|
2048
|
+
|
2049
|
+
|
2050
|
+
</div>
|
2051
|
+
</div>
|
2052
|
+
<div class="tags">
|
2053
|
+
<h3>Returns:</h3>
|
2054
|
+
<ul class="return">
|
2055
|
+
|
2056
|
+
<li>
|
2057
|
+
|
2058
|
+
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>)</span>
|
2059
|
+
|
2060
|
+
|
2061
|
+
|
2062
|
+
|
2063
|
+
</li>
|
2064
|
+
|
2065
|
+
</ul>
|
2066
|
+
|
2067
|
+
</div><table class="source_code">
|
2068
|
+
<tr>
|
2069
|
+
<td>
|
2070
|
+
<pre class="lines">
|
2071
|
+
|
2072
|
+
|
2073
|
+
431
|
2074
|
+
432
|
2075
|
+
433</pre>
|
2076
|
+
</td>
|
2077
|
+
<td>
|
2078
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 431</span>
|
2079
|
+
|
2080
|
+
<span class='kw'>def</span> <span class='id file_is_output?'>file_is_output?</span> <span class='id file'>file</span>
|
2081
|
+
<span class='id belongs_to'>belongs_to</span><span class='period'>.</span><span class='id respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:output</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id belongs_to'>belongs_to</span><span class='period'>.</span><span class='id output'>output</span><span class='period'>.</span><span class='id to_s'>to_s</span> <span class='op'>==</span> <span class='id file'>file</span>
|
2082
|
+
<span class='kw'>end</span></pre>
|
2083
|
+
</td>
|
2084
|
+
</tr>
|
2085
|
+
</table>
|
2086
|
+
</div>
|
2087
|
+
|
2088
|
+
<div class="method_details ">
|
2089
|
+
<p class="signature " id="hidden_name?-instance_method">
|
2090
|
+
|
2091
|
+
- (<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>) <strong>hidden_name?</strong>
|
2092
|
+
|
2093
|
+
|
2094
|
+
|
2095
|
+
</p><div class="docstring">
|
2096
|
+
<div class="discussion">
|
2097
|
+
|
2098
|
+
<p>Should the param name be hidden from the shell? Used for params like
|
2099
|
+
'input' on mxmlc</p>
|
2100
|
+
|
2101
|
+
|
2102
|
+
</div>
|
2103
|
+
</div>
|
2104
|
+
<div class="tags">
|
2105
|
+
<h3>Returns:</h3>
|
2106
|
+
<ul class="return">
|
2107
|
+
|
2108
|
+
<li>
|
2109
|
+
|
2110
|
+
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>)</span>
|
2111
|
+
|
2112
|
+
|
2113
|
+
|
2114
|
+
|
2115
|
+
</li>
|
2116
|
+
|
2117
|
+
</ul>
|
2118
|
+
|
2119
|
+
</div><table class="source_code">
|
2120
|
+
<tr>
|
2121
|
+
<td>
|
2122
|
+
<pre class="lines">
|
2123
|
+
|
2124
|
+
|
2125
|
+
293
|
2126
|
+
294
|
2127
|
+
295</pre>
|
2128
|
+
</td>
|
2129
|
+
<td>
|
2130
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 293</span>
|
2131
|
+
|
2132
|
+
<span class='kw'>def</span> <span class='id hidden_name?'>hidden_name?</span>
|
2133
|
+
<span class='ivar'>@hidden_name</span>
|
2134
|
+
<span class='kw'>end</span></pre>
|
2135
|
+
</td>
|
2136
|
+
</tr>
|
2137
|
+
</table>
|
2138
|
+
</div>
|
2139
|
+
|
2140
|
+
<div class="method_details ">
|
2141
|
+
<p class="signature " id="hidden_value?-instance_method">
|
2142
|
+
|
2143
|
+
- (<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>) <strong>hidden_value?</strong>
|
2144
|
+
|
2145
|
+
|
2146
|
+
|
2147
|
+
</p><div class="docstring">
|
2148
|
+
<div class="discussion">
|
2149
|
+
|
2150
|
+
<p>Should the param value be hidden from the shell? Usually used for Boolean
|
2151
|
+
toggles like '-debug'</p>
|
2152
|
+
|
2153
|
+
|
2154
|
+
</div>
|
2155
|
+
</div>
|
2156
|
+
<div class="tags">
|
2157
|
+
<h3>Returns:</h3>
|
2158
|
+
<ul class="return">
|
2159
|
+
|
2160
|
+
<li>
|
2161
|
+
|
2162
|
+
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>)</span>
|
2163
|
+
|
2164
|
+
|
2165
|
+
|
2166
|
+
|
2167
|
+
</li>
|
2168
|
+
|
2169
|
+
</ul>
|
2170
|
+
|
2171
|
+
</div><table class="source_code">
|
2172
|
+
<tr>
|
2173
|
+
<td>
|
2174
|
+
<pre class="lines">
|
2175
|
+
|
2176
|
+
|
2177
|
+
300
|
2178
|
+
301
|
2179
|
+
302</pre>
|
2180
|
+
</td>
|
2181
|
+
<td>
|
2182
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 300</span>
|
2183
|
+
|
2184
|
+
<span class='kw'>def</span> <span class='id hidden_value?'>hidden_value?</span>
|
2185
|
+
<span class='ivar'>@hidden_value</span>
|
2186
|
+
<span class='kw'>end</span></pre>
|
2187
|
+
</td>
|
2188
|
+
</tr>
|
2189
|
+
</table>
|
2190
|
+
</div>
|
2191
|
+
|
2192
|
+
<div class="method_details ">
|
2193
|
+
<p class="signature " id="option_parser_declaration-instance_method">
|
2194
|
+
|
2195
|
+
- (<tt>Object</tt>) <strong>option_parser_declaration</strong>
|
2196
|
+
|
2197
|
+
|
2198
|
+
|
2199
|
+
</p><div class="docstring">
|
2200
|
+
<div class="discussion">
|
2201
|
+
|
2202
|
+
<p>How this parameter is provided to the Ruby OptionParser when being exposed
|
2203
|
+
as a Ruby Executable.</p>
|
2204
|
+
|
2205
|
+
|
2206
|
+
</div>
|
2207
|
+
</div>
|
2208
|
+
<div class="tags">
|
2209
|
+
|
2210
|
+
</div><table class="source_code">
|
2211
|
+
<tr>
|
2212
|
+
<td>
|
2213
|
+
<pre class="lines">
|
2214
|
+
|
2215
|
+
|
2216
|
+
320
|
2217
|
+
321
|
2218
|
+
322
|
2219
|
+
323
|
2220
|
+
324
|
2221
|
+
325
|
2222
|
+
326
|
2223
|
+
327
|
2224
|
+
328
|
2225
|
+
329
|
2226
|
+
330</pre>
|
2227
|
+
</td>
|
2228
|
+
<td>
|
2229
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 320</span>
|
2230
|
+
|
2231
|
+
<span class='kw'>def</span> <span class='id option_parser_declaration'>option_parser_declaration</span>
|
2232
|
+
<span class='id declaration'>declaration</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='id prefix'>prefix</span><span class='comma'>,</span> <span class='id option_parser_name'>option_parser_name</span> <span class='rbracket'>]</span>
|
2233
|
+
<span class='comment'># TODO: Need to figure out how to support hidden name inputs...
|
2234
|
+
</span> <span class='comment'>#if(hidden_name?)
|
2235
|
+
</span> <span class='comment'>#declaration = [option_parser_type_output]
|
2236
|
+
</span> <span class='comment'>#
|
2237
|
+
</span> <span class='kw'>if</span><span class='lparen'>(</span><span class='op'>!</span><span class='id hidden_value?'>hidden_value?</span><span class='rparen'>)</span>
|
2238
|
+
<span class='id declaration'>declaration</span> <span class='op'><<</span> <span class='id delimiter'>delimiter</span> <span class='op'><<</span> <span class='id option_parser_type_output'>option_parser_type_output</span>
|
2239
|
+
<span class='kw'>end</span>
|
2240
|
+
<span class='id declaration'>declaration</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
2241
|
+
<span class='kw'>end</span></pre>
|
2242
|
+
</td>
|
2243
|
+
</tr>
|
2244
|
+
</table>
|
2245
|
+
</div>
|
2246
|
+
|
2247
|
+
<div class="method_details ">
|
2248
|
+
<p class="signature " id="option_parser_name-instance_method">
|
2249
|
+
|
2250
|
+
- (<tt>Object</tt>) <strong>option_parser_name</strong> <span class="extras">(protected)</span>
|
2251
|
+
|
2252
|
+
|
2253
|
+
|
2254
|
+
</p><table class="source_code">
|
2255
|
+
<tr>
|
2256
|
+
<td>
|
2257
|
+
<pre class="lines">
|
2258
|
+
|
2259
|
+
|
2260
|
+
399
|
2261
|
+
400
|
2262
|
+
401</pre>
|
2263
|
+
</td>
|
2264
|
+
<td>
|
2265
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 399</span>
|
2266
|
+
|
2267
|
+
<span class='kw'>def</span> <span class='id option_parser_name'>option_parser_name</span>
|
2268
|
+
<span class='id name'>name</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='period'>.</span><span class='id gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>_</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
2269
|
+
<span class='kw'>end</span></pre>
|
2270
|
+
</td>
|
2271
|
+
</tr>
|
2272
|
+
</table>
|
2273
|
+
</div>
|
2274
|
+
|
2275
|
+
<div class="method_details ">
|
2276
|
+
<p class="signature " id="option_parser_short_name-instance_method">
|
2277
|
+
|
2278
|
+
- (<tt>Object</tt>) <strong>option_parser_short_name</strong>
|
2279
|
+
|
2280
|
+
|
2281
|
+
|
2282
|
+
</p><div class="docstring">
|
2283
|
+
<div class="discussion">
|
2284
|
+
|
2285
|
+
<p>The Ruby OptionParser short name with prefix.</p>
|
2286
|
+
|
2287
|
+
|
2288
|
+
</div>
|
2289
|
+
</div>
|
2290
|
+
<div class="tags">
|
2291
|
+
|
2292
|
+
</div><table class="source_code">
|
2293
|
+
<tr>
|
2294
|
+
<td>
|
2295
|
+
<pre class="lines">
|
2296
|
+
|
2297
|
+
|
2298
|
+
334
|
2299
|
+
335
|
2300
|
+
336</pre>
|
2301
|
+
</td>
|
2302
|
+
<td>
|
2303
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 334</span>
|
2304
|
+
|
2305
|
+
<span class='kw'>def</span> <span class='id option_parser_short_name'>option_parser_short_name</span>
|
2306
|
+
<span class='lbracket'>[</span> <span class='id short_prefix'>short_prefix</span><span class='comma'>,</span> <span class='id short_name'>short_name</span> <span class='rbracket'>]</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
2307
|
+
<span class='kw'>end</span></pre>
|
2308
|
+
</td>
|
2309
|
+
</tr>
|
2310
|
+
</table>
|
2311
|
+
</div>
|
2312
|
+
|
2313
|
+
<div class="method_details ">
|
2314
|
+
<p class="signature " id="option_parser_type_name-instance_method">
|
2315
|
+
|
2316
|
+
- (<tt>Object</tt>) <strong>option_parser_type_name</strong> <span class="extras">(protected)</span>
|
2317
|
+
|
2318
|
+
|
2319
|
+
|
2320
|
+
</p><table class="source_code">
|
2321
|
+
<tr>
|
2322
|
+
<td>
|
2323
|
+
<pre class="lines">
|
2324
|
+
|
2325
|
+
|
2326
|
+
403
|
2327
|
+
404
|
2328
|
+
405</pre>
|
2329
|
+
</td>
|
2330
|
+
<td>
|
2331
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 403</span>
|
2332
|
+
|
2333
|
+
<span class='kw'>def</span> <span class='id option_parser_type_name'>option_parser_type_name</span>
|
2334
|
+
<span class='ivar'>@option_parser_type_name</span>
|
2335
|
+
<span class='kw'>end</span></pre>
|
2336
|
+
</td>
|
2337
|
+
</tr>
|
2338
|
+
</table>
|
2339
|
+
</div>
|
2340
|
+
|
2341
|
+
<div class="method_details ">
|
2342
|
+
<p class="signature " id="option_parser_type_output-instance_method">
|
2343
|
+
|
2344
|
+
- (<tt>Object</tt>) <strong>option_parser_type_output</strong> <span class="extras">(protected)</span>
|
2345
|
+
|
2346
|
+
|
2347
|
+
|
2348
|
+
</p><table class="source_code">
|
2349
|
+
<tr>
|
2350
|
+
<td>
|
2351
|
+
<pre class="lines">
|
2352
|
+
|
2353
|
+
|
2354
|
+
407
|
2355
|
+
408
|
2356
|
+
409
|
2357
|
+
410</pre>
|
2358
|
+
</td>
|
2359
|
+
<td>
|
2360
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 407</span>
|
2361
|
+
|
2362
|
+
<span class='kw'>def</span> <span class='id option_parser_type_output'>option_parser_type_output</span>
|
2363
|
+
<span class='id type'>type</span> <span class='op'>=</span> <span class='id hidden_value?'>hidden_value?</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='id option_parser_type_name'>option_parser_type_name</span>
|
2364
|
+
<span class='id required?'>required?</span> <span class='op'>?</span> <span class='id type'>type</span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>[</span><span class='embexpr_beg'>#{</span><span class='id type'>type</span><span class='rbrace'>}</span><span class='tstring_content'>]</span><span class='tstring_end'>"</span></span>
|
2365
|
+
<span class='kw'>end</span></pre>
|
2366
|
+
</td>
|
2367
|
+
</tr>
|
2368
|
+
</table>
|
2369
|
+
</div>
|
2370
|
+
|
2371
|
+
<div class="method_details ">
|
2372
|
+
<p class="signature " id="prepare-instance_method">
|
2373
|
+
|
2374
|
+
- (<tt>Object</tt>) <strong>prepare</strong>
|
2375
|
+
|
2376
|
+
|
2377
|
+
|
2378
|
+
</p><div class="docstring">
|
2379
|
+
<div class="discussion">
|
2380
|
+
|
2381
|
+
<p>Prepare the parameter for execution or delegation, depending on what
|
2382
|
+
context we're in.</p>
|
2383
|
+
|
2384
|
+
|
2385
|
+
</div>
|
2386
|
+
</div>
|
2387
|
+
<div class="tags">
|
2388
|
+
|
2389
|
+
</div><table class="source_code">
|
2390
|
+
<tr>
|
2391
|
+
<td>
|
2392
|
+
<pre class="lines">
|
2393
|
+
|
2394
|
+
|
2395
|
+
279
|
2396
|
+
280
|
2397
|
+
281
|
2398
|
+
282</pre>
|
2399
|
+
</td>
|
2400
|
+
<td>
|
2401
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 279</span>
|
2402
|
+
|
2403
|
+
<span class='kw'>def</span> <span class='id prepare'>prepare</span>
|
2404
|
+
<span class='id prepare_prerequisites'>prepare_prerequisites</span>
|
2405
|
+
<span class='ivar'>@prepared</span> <span class='op'>=</span> <span class='kw'>true</span>
|
2406
|
+
<span class='kw'>end</span></pre>
|
2407
|
+
</td>
|
2408
|
+
</tr>
|
2409
|
+
</table>
|
2410
|
+
</div>
|
2411
|
+
|
2412
|
+
<div class="method_details ">
|
2413
|
+
<p class="signature " id="prepare_prerequisites-instance_method">
|
2414
|
+
|
2415
|
+
- (<tt>Object</tt>) <strong>prepare_prerequisites</strong> <span class="extras">(protected)</span>
|
2416
|
+
|
2417
|
+
|
2418
|
+
|
2419
|
+
</p><table class="source_code">
|
2420
|
+
<tr>
|
2421
|
+
<td>
|
2422
|
+
<pre class="lines">
|
2423
|
+
|
2424
|
+
|
2425
|
+
412
|
2426
|
+
413</pre>
|
2427
|
+
</td>
|
2428
|
+
<td>
|
2429
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 412</span>
|
2430
|
+
|
2431
|
+
<span class='kw'>def</span> <span class='id prepare_prerequisites'>prepare_prerequisites</span>
|
2432
|
+
<span class='kw'>end</span></pre>
|
2433
|
+
</td>
|
2434
|
+
</tr>
|
2435
|
+
</table>
|
2436
|
+
</div>
|
2437
|
+
|
2438
|
+
<div class="method_details ">
|
2439
|
+
<p class="signature " id="prepared?-instance_method">
|
2440
|
+
|
2441
|
+
- (<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>) <strong>prepared?</strong>
|
2442
|
+
|
2443
|
+
|
2444
|
+
|
2445
|
+
</p><div class="docstring">
|
2446
|
+
<div class="discussion">
|
2447
|
+
|
2448
|
+
<p>Returns true if this parameter has already been prepared.</p>
|
2449
|
+
|
2450
|
+
|
2451
|
+
</div>
|
2452
|
+
</div>
|
2453
|
+
<div class="tags">
|
2454
|
+
<h3>Returns:</h3>
|
2455
|
+
<ul class="return">
|
2456
|
+
|
2457
|
+
<li>
|
2458
|
+
|
2459
|
+
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>)</span>
|
2460
|
+
|
2461
|
+
|
2462
|
+
|
2463
|
+
|
2464
|
+
</li>
|
2465
|
+
|
2466
|
+
</ul>
|
2467
|
+
|
2468
|
+
</div><table class="source_code">
|
2469
|
+
<tr>
|
2470
|
+
<td>
|
2471
|
+
<pre class="lines">
|
2472
|
+
|
2473
|
+
|
2474
|
+
286
|
2475
|
+
287
|
2476
|
+
288</pre>
|
2477
|
+
</td>
|
2478
|
+
<td>
|
2479
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 286</span>
|
2480
|
+
|
2481
|
+
<span class='kw'>def</span> <span class='id prepared?'>prepared?</span>
|
2482
|
+
<span class='ivar'>@prepared</span>
|
2483
|
+
<span class='kw'>end</span></pre>
|
2484
|
+
</td>
|
2485
|
+
</tr>
|
2486
|
+
</table>
|
2487
|
+
</div>
|
2488
|
+
|
2489
|
+
<div class="method_details ">
|
2490
|
+
<p class="signature " id="required?-instance_method">
|
2491
|
+
|
2492
|
+
- (<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>) <strong>required?</strong>
|
2493
|
+
|
2494
|
+
|
2495
|
+
|
2496
|
+
</p><div class="docstring">
|
2497
|
+
<div class="discussion">
|
2498
|
+
|
2499
|
+
<p>Returns Boolean value if this parameter is required.</p>
|
2500
|
+
|
2501
|
+
|
2502
|
+
</div>
|
2503
|
+
</div>
|
2504
|
+
<div class="tags">
|
2505
|
+
<h3>Returns:</h3>
|
2506
|
+
<ul class="return">
|
2507
|
+
|
2508
|
+
<li>
|
2509
|
+
|
2510
|
+
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>)</span>
|
2511
|
+
|
2512
|
+
|
2513
|
+
|
2514
|
+
|
2515
|
+
</li>
|
2516
|
+
|
2517
|
+
</ul>
|
2518
|
+
|
2519
|
+
</div><table class="source_code">
|
2520
|
+
<tr>
|
2521
|
+
<td>
|
2522
|
+
<pre class="lines">
|
2523
|
+
|
2524
|
+
|
2525
|
+
244
|
2526
|
+
245
|
2527
|
+
246</pre>
|
2528
|
+
</td>
|
2529
|
+
<td>
|
2530
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 244</span>
|
2531
|
+
|
2532
|
+
<span class='kw'>def</span> <span class='id required?'>required?</span>
|
2533
|
+
<span class='lparen'>(</span><span class='id required'>required</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
2534
|
+
<span class='kw'>end</span></pre>
|
2535
|
+
</td>
|
2536
|
+
</tr>
|
2537
|
+
</table>
|
2538
|
+
</div>
|
2539
|
+
|
2540
|
+
<div class="method_details ">
|
2541
|
+
<p class="signature " id="shell_value-instance_method">
|
2542
|
+
|
2543
|
+
- (<tt>Object</tt>) <strong>shell_value</strong>
|
2544
|
+
|
2545
|
+
|
2546
|
+
|
2547
|
+
</p><div class="docstring">
|
2548
|
+
<div class="discussion">
|
2549
|
+
|
2550
|
+
<p>The String representation of the value in a format that is appropriate for
|
2551
|
+
the terminal.</p>
|
2552
|
+
|
2553
|
+
<p>For certain types of parameters, like File, spaces may be escaped on some
|
2554
|
+
platforms.</p>
|
2555
|
+
|
2556
|
+
|
2557
|
+
</div>
|
2558
|
+
</div>
|
2559
|
+
<div class="tags">
|
2560
|
+
|
2561
|
+
</div><table class="source_code">
|
2562
|
+
<tr>
|
2563
|
+
<td>
|
2564
|
+
<pre class="lines">
|
2565
|
+
|
2566
|
+
|
2567
|
+
356
|
2568
|
+
357
|
2569
|
+
358</pre>
|
2570
|
+
</td>
|
2571
|
+
<td>
|
2572
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 356</span>
|
2573
|
+
|
2574
|
+
<span class='kw'>def</span> <span class='id shell_value'>shell_value</span>
|
2575
|
+
<span class='id value'>value</span><span class='period'>.</span><span class='id to_s'>to_s</span>
|
2576
|
+
<span class='kw'>end</span></pre>
|
2577
|
+
</td>
|
2578
|
+
</tr>
|
2579
|
+
</table>
|
2580
|
+
</div>
|
2581
|
+
|
2582
|
+
<div class="method_details ">
|
2583
|
+
<p class="signature " id="short_prefix-instance_method">
|
2584
|
+
|
2585
|
+
- (<tt>Object</tt>) <strong>short_prefix</strong>
|
2586
|
+
|
2587
|
+
|
2588
|
+
|
2589
|
+
</p><table class="source_code">
|
2590
|
+
<tr>
|
2591
|
+
<td>
|
2592
|
+
<pre class="lines">
|
2593
|
+
|
2594
|
+
|
2595
|
+
313
|
2596
|
+
314
|
2597
|
+
315</pre>
|
2598
|
+
</td>
|
2599
|
+
<td>
|
2600
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 313</span>
|
2601
|
+
|
2602
|
+
<span class='kw'>def</span> <span class='id short_prefix'>short_prefix</span>
|
2603
|
+
<span class='ivar'>@short_prefix</span> <span class='op'>||=</span> <span class='lparen'>(</span><span class='id belongs_to'>belongs_to</span><span class='period'>.</span><span class='id nil?'>nil?</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>DEFAULT_SHORT_PREFIX</span> <span class='op'>:</span> <span class='id belongs_to'>belongs_to</span><span class='period'>.</span><span class='id default_short_prefix'>default_short_prefix</span>
|
2604
|
+
<span class='kw'>end</span></pre>
|
2605
|
+
</td>
|
2606
|
+
</tr>
|
2607
|
+
</table>
|
2608
|
+
</div>
|
2609
|
+
|
2610
|
+
<div class="method_details ">
|
2611
|
+
<p class="signature " id="to_rdoc-instance_method">
|
2612
|
+
|
2613
|
+
- (<tt>Object</tt>) <strong>to_rdoc</strong>
|
2614
|
+
|
2615
|
+
|
2616
|
+
|
2617
|
+
</p><div class="docstring">
|
2618
|
+
<div class="discussion">
|
2619
|
+
|
2620
|
+
<p>Create a string that can be turned into a file that rdoc can parse to
|
2621
|
+
describe the customized or generated task using param name, type and
|
2622
|
+
description</p>
|
2623
|
+
|
2624
|
+
|
2625
|
+
</div>
|
2626
|
+
</div>
|
2627
|
+
<div class="tags">
|
2628
|
+
|
2629
|
+
</div><table class="source_code">
|
2630
|
+
<tr>
|
2631
|
+
<td>
|
2632
|
+
<pre class="lines">
|
2633
|
+
|
2634
|
+
|
2635
|
+
389
|
2636
|
+
390
|
2637
|
+
391
|
2638
|
+
392
|
2639
|
+
393
|
2640
|
+
394
|
2641
|
+
395</pre>
|
2642
|
+
</td>
|
2643
|
+
<td>
|
2644
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 389</span>
|
2645
|
+
|
2646
|
+
<span class='kw'>def</span> <span class='id to_rdoc'>to_rdoc</span>
|
2647
|
+
<span class='id result'>result</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
2648
|
+
<span class='id parts'>parts</span> <span class='op'>=</span> <span class='id description'>description</span><span class='period'>.</span><span class='id split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id description'>description</span><span class='period'>.</span><span class='id nil?'>nil?</span>
|
2649
|
+
<span class='id result'>result</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'># </span><span class='embexpr_beg'>#{</span><span class='id parts'>parts</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n# </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id description'>description</span><span class='period'>.</span><span class='id nil?'>nil?</span>
|
2650
|
+
<span class='id result'>result</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>def </span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>=(</span><span class='embexpr_beg'>#{</span><span class='id type'>type</span><span class='rbrace'>}</span><span class='tstring_content'>)\n @</span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> = </span><span class='embexpr_beg'>#{</span><span class='id type'>type</span><span class='rbrace'>}</span><span class='tstring_content'>\nend\n\n</span><span class='tstring_end'>"</span></span>
|
2651
|
+
<span class='kw'>return</span> <span class='id result'>result</span>
|
2652
|
+
<span class='kw'>end</span></pre>
|
2653
|
+
</td>
|
2654
|
+
</tr>
|
2655
|
+
</table>
|
2656
|
+
</div>
|
2657
|
+
|
2658
|
+
<div class="method_details ">
|
2659
|
+
<p class="signature " id="to_shell-instance_method">
|
2660
|
+
|
2661
|
+
- (<tt>Object</tt>) <strong>to_shell</strong>
|
2662
|
+
|
2663
|
+
|
2664
|
+
|
2665
|
+
</p><div class="docstring">
|
2666
|
+
<div class="discussion">
|
2667
|
+
|
2668
|
+
<p>Prepare and serialize this parameter to a string that is appropriate for
|
2669
|
+
shell execution on the current platform.</p>
|
2670
|
+
|
2671
|
+
<p>Calling <tt>to_shell</tt> will first trigger a call to the <tt>prepare</tt>
|
2672
|
+
template method unless <tt>prepared?</tt> returns <tt>true</tt>.</p>
|
2673
|
+
|
2674
|
+
|
2675
|
+
</div>
|
2676
|
+
</div>
|
2677
|
+
<div class="tags">
|
2678
|
+
|
2679
|
+
</div><table class="source_code">
|
2680
|
+
<tr>
|
2681
|
+
<td>
|
2682
|
+
<pre class="lines">
|
2683
|
+
|
2684
|
+
|
2685
|
+
375
|
2686
|
+
376
|
2687
|
+
377
|
2688
|
+
378
|
2689
|
+
379
|
2690
|
+
380
|
2691
|
+
381
|
2692
|
+
382
|
2693
|
+
383</pre>
|
2694
|
+
</td>
|
2695
|
+
<td>
|
2696
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 375</span>
|
2697
|
+
|
2698
|
+
<span class='kw'>def</span> <span class='id to_shell'>to_shell</span>
|
2699
|
+
<span class='id prepare'>prepare</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id prepared?'>prepared?</span>
|
2700
|
+
<span class='id validate'>validate</span>
|
2701
|
+
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='op'>!</span><span class='id visible?'>visible?</span>
|
2702
|
+
<span class='kw'>return</span> <span class='ivar'>@to_shell_proc</span><span class='period'>.</span><span class='id call'>call</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='ivar'>@to_shell_proc</span><span class='period'>.</span><span class='id nil?'>nil?</span>
|
2703
|
+
<span class='kw'>return</span> <span class='id shell_value'>shell_value</span> <span class='kw'>if</span> <span class='id hidden_name?'>hidden_name?</span>
|
2704
|
+
<span class='kw'>return</span> <span class='id shell_name'>shell_name</span> <span class='kw'>if</span> <span class='id hidden_value?'>hidden_value?</span>
|
2705
|
+
<span class='kw'>return</span> <span class='lbracket'>[</span><span class='id shell_name'>shell_name</span><span class='comma'>,</span> <span class='id delimiter'>delimiter</span><span class='comma'>,</span> <span class='id shell_value'>shell_value</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id join'>join</span>
|
2706
|
+
<span class='kw'>end</span></pre>
|
2707
|
+
</td>
|
2708
|
+
</tr>
|
2709
|
+
</table>
|
2710
|
+
</div>
|
2711
|
+
|
2712
|
+
<div class="method_details ">
|
2713
|
+
<p class="signature " id="validate-instance_method">
|
2714
|
+
|
2715
|
+
- (<tt>Object</tt>) <strong>validate</strong>
|
2716
|
+
|
2717
|
+
|
2718
|
+
|
2719
|
+
</p><div class="docstring">
|
2720
|
+
<div class="discussion">
|
2721
|
+
|
2722
|
+
<p>Ensure this parameter is in a valid state, raise a
|
2723
|
+
Sprout::Errors::MissingArgumentError if it is not.</p>
|
2724
|
+
|
2725
|
+
|
2726
|
+
</div>
|
2727
|
+
</div>
|
2728
|
+
<div class="tags">
|
2729
|
+
|
2730
|
+
</div><table class="source_code">
|
2731
|
+
<tr>
|
2732
|
+
<td>
|
2733
|
+
<pre class="lines">
|
2734
|
+
|
2735
|
+
|
2736
|
+
251
|
2737
|
+
252
|
2738
|
+
253
|
2739
|
+
254
|
2740
|
+
255</pre>
|
2741
|
+
</td>
|
2742
|
+
<td>
|
2743
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 251</span>
|
2744
|
+
|
2745
|
+
<span class='kw'>def</span> <span class='id validate'>validate</span>
|
2746
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id required?'>required?</span> <span class='op'>&&</span> <span class='id value'>value</span><span class='period'>.</span><span class='id nil?'>nil?</span><span class='rparen'>)</span>
|
2747
|
+
<span class='id raise'>raise</span> <span class='const'>Sprout</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>MissingArgumentError</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> is required and must not be nil</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
2748
|
+
<span class='kw'>end</span>
|
2749
|
+
<span class='kw'>end</span></pre>
|
2750
|
+
</td>
|
2751
|
+
</tr>
|
2752
|
+
</table>
|
2753
|
+
</div>
|
2754
|
+
|
2755
|
+
<div class="method_details ">
|
2756
|
+
<p class="signature " id="visible?-instance_method">
|
2757
|
+
|
2758
|
+
- (<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>) <strong>visible?</strong>
|
2759
|
+
|
2760
|
+
|
2761
|
+
|
2762
|
+
</p><div class="docstring">
|
2763
|
+
<div class="discussion">
|
2764
|
+
|
2765
|
+
<p>By default, Executable::Params only appear in the shell output when they
|
2766
|
+
are not nil</p>
|
2767
|
+
|
2768
|
+
|
2769
|
+
</div>
|
2770
|
+
</div>
|
2771
|
+
<div class="tags">
|
2772
|
+
<h3>Returns:</h3>
|
2773
|
+
<ul class="return">
|
2774
|
+
|
2775
|
+
<li>
|
2776
|
+
|
2777
|
+
<span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Sprout::Executable::Boolean (class)">Boolean</a></span></tt>)</span>
|
2778
|
+
|
2779
|
+
|
2780
|
+
|
2781
|
+
|
2782
|
+
</li>
|
2783
|
+
|
2784
|
+
</ul>
|
2785
|
+
|
2786
|
+
</div><table class="source_code">
|
2787
|
+
<tr>
|
2788
|
+
<td>
|
2789
|
+
<pre class="lines">
|
2790
|
+
|
2791
|
+
|
2792
|
+
238
|
2793
|
+
239
|
2794
|
+
240</pre>
|
2795
|
+
</td>
|
2796
|
+
<td>
|
2797
|
+
<pre class="code"><span class="info file"># File 'lib/sprout/executable/param.rb', line 238</span>
|
2798
|
+
|
2799
|
+
<span class='kw'>def</span> <span class='id visible?'>visible?</span>
|
2800
|
+
<span class='op'>!</span><span class='id value'>value</span><span class='period'>.</span><span class='id nil?'>nil?</span>
|
2801
|
+
<span class='kw'>end</span></pre>
|
2802
|
+
</td>
|
2803
|
+
</tr>
|
2804
|
+
</table>
|
2805
|
+
</div>
|
2806
|
+
|
2807
|
+
</div>
|
2808
|
+
|
2809
|
+
</div>
|
2810
|
+
|
2811
|
+
<div id="footer">
|
2812
|
+
Generated on Wed Dec 22 11:58:35 2010 by
|
2813
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2814
|
+
0.6.3 (ruby-1.9.2).
|
2815
|
+
</div>
|
2816
|
+
|
2817
|
+
</body>
|
2818
|
+
</html>
|