[ARVADOS] updated: d13e0b26fef4777842d92ad3c050d6a662823201
git at public.curoverse.com
git at public.curoverse.com
Tue Oct 14 10:55:14 EDT 2014
Summary of changes:
.../running-external-program.html.textile.liquid | 4 +-
.../tutorial-new-pipeline.html.textile.liquid | 2 +-
sdk/cli/bin/arv | 52 +++++++++++-----------
3 files changed, 29 insertions(+), 29 deletions(-)
via d13e0b26fef4777842d92ad3c050d6a662823201 (commit)
from 585fb54b7f76fce5880eba94e05ea45c7c89f980 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit d13e0b26fef4777842d92ad3c050d6a662823201
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Tue Oct 14 10:54:51 2014 -0400
3656: Alphabetize list of subcommands. Rename tmp -> tmp_file. Small wording change on doc pages.
diff --git a/doc/user/tutorials/running-external-program.html.textile.liquid b/doc/user/tutorials/running-external-program.html.textile.liquid
index debe1db..18f5f7d 100644
--- a/doc/user/tutorials/running-external-program.html.textile.liquid
+++ b/doc/user/tutorials/running-external-program.html.textile.liquid
@@ -8,13 +8,13 @@ This tutorial demonstrates how to construct a two stage pipeline template that u
{% include 'tutorial_expectations' %}
-Use the following command to create a new empty template using @arv create pipeline_template@:
+Use the following command to create an empty template using @arv create pipeline_template@:
<notextile>
<pre><code>~$ <span class="userinput">arv create pipeline_template</span></code></pre>
</notextile>
-This will open the template record in an interactive text editor (as specified by $EDITOR or $VISUAL, otherwise defaults to @nano@). Now add the following content:
+This will open the template record in an interactive text editor (as specified by $EDITOR or $VISUAL, otherwise defaults to @nano@). Now, update the contents of the editor with the following content:
<notextile>{% code 'tutorial_bwa_sortsam_pipeline' as javascript %}</notextile>
diff --git a/doc/user/tutorials/tutorial-new-pipeline.html.textile.liquid b/doc/user/tutorials/tutorial-new-pipeline.html.textile.liquid
index fa8ee44..676c129 100644
--- a/doc/user/tutorials/tutorial-new-pipeline.html.textile.liquid
+++ b/doc/user/tutorials/tutorial-new-pipeline.html.textile.liquid
@@ -9,7 +9,7 @@ A pipeline in Arvados is a collection of crunch scripts, in which the output fro
{% include 'tutorial_expectations' %}
-First, use @arv create pipeline_template@ to create a new empty template. This will open the template record in an interactive text editor (as specified by $EDITOR or $VISUAL, otherwise defaults to @nano@).
+First, use @arv create pipeline_template@ to create an empty template. This will open the template record in an interactive text editor (as specified by $EDITOR or $VISUAL, otherwise defaults to @nano@).
<notextile>
<pre><code>~$ <span class="userinput">arv create pipeline_template</span>
diff --git a/sdk/cli/bin/arv b/sdk/cli/bin/arv
index 2acc626..481cd9e 100755
--- a/sdk/cli/bin/arv
+++ b/sdk/cli/bin/arv
@@ -113,10 +113,14 @@ def init_config
end
end
-subcommands = %w(keep pipeline tag ws edit create)
+subcommands = %w(create edit keep pipeline tag ws)
def check_subcommands client, arvados, subcommand, global_opts, remaining_opts
case subcommand
+ when 'create'
+ arv_create client, arvados, global_opts, remaining_opts
+ when 'edit'
+ arv_edit client, arvados, global_opts, remaining_opts
when 'keep'
@sub = remaining_opts.shift
if ['get', 'put', 'ls', 'normalize'].index @sub then
@@ -147,10 +151,6 @@ def check_subcommands client, arvados, subcommand, global_opts, remaining_opts
exec `which arv-tag`.strip, *remaining_opts
when 'ws'
exec `which arv-ws`.strip, *remaining_opts
- when 'edit'
- arv_edit client, arvados, global_opts, remaining_opts
- when 'create'
- arv_create client, arvados, global_opts, remaining_opts
end
end
@@ -163,7 +163,7 @@ def command_exists?(command)
ENV['PATH'].split(':').each {|folder| File.executable?(File.join(folder, command))}
end
-def run_editor tmp, global_opts
+def run_editor tmp_file, global_opts
need_edit = true
while need_edit
pid = Process::fork
@@ -176,14 +176,14 @@ def run_editor tmp, global_opts
puts "Could not find any editor to use, please set $VISUAL or $EDITOR to your desired editor."
exit 1
end
- exec editor, tmp.path
+ exec editor, tmp_file.path
else
Process.wait pid
end
if $?.exitstatus == 0
- tmp.open
- newcontent = tmp.read()
+ tmp_file.open
+ newcontent = tmp_file.read()
newobj = {}
begin
@@ -207,7 +207,7 @@ def run_editor tmp, global_opts
yn = $stdin.read 1
end
if yn == 'n' or yn == 'N'
- arv_edit_save_tmp tmp
+ arv_edit_save_tmp tmp_file
abort
end
end
@@ -288,11 +288,11 @@ def arv_edit client, arvados, global_opts, remaining_opts
content = results.to_yaml
end
- tmp = Tempfile.new([uuid, "." + global_opts[:format]])
- tmp.write(content)
- tmp.close
+ tmp_file = Tempfile.new([uuid, "." + global_opts[:format]])
+ tmp_file.write(content)
+ tmp_file.close
- newobj = run_editor tmp, global_opts
+ newobj = run_editor tmp_file, global_opts
begin
if newobj != results
@@ -311,14 +311,14 @@ def arv_edit client, arvados, global_opts, remaining_opts
puts "Error communicating with server, error was #{e}"
puts "Update body was:"
puts dumped
- arv_edit_save_tmp tmp
+ arv_edit_save_tmp tmp_file
abort
end
begin
results = JSON.parse result.body
rescue JSON::ParserError => e
- arv_edit_save_tmp tmp
+ arv_edit_save_tmp tmp_file
abort "Failed to parse server response:\n" + e.to_s
end
@@ -326,14 +326,14 @@ def arv_edit client, arvados, global_opts, remaining_opts
puts "Update failed. Server responded #{result.response.status}: #{results['errors']} "
puts "Update body was:"
puts dumped
- arv_edit_save_tmp tmp
+ arv_edit_save_tmp tmp_file
abort
end
else
puts "Object is unchanged, did not update."
end
ensure
- tmp.close(true)
+ tmp_file.close(true)
end
exit 0
@@ -393,11 +393,11 @@ def arv_create client, arvados, global_opts, remaining_opts
content = newobj.to_yaml
end
- tmp = Tempfile.new(["", ".#{global_opts[:format]}"])
- tmp.write(content)
- tmp.close
+ tmp_file = Tempfile.new(["", ".#{global_opts[:format]}"])
+ tmp_file.write(content)
+ tmp_file.close
- newobj = run_editor tmp, global_opts
+ newobj = run_editor tmp_file, global_opts
begin
api_method = 'arvados.' + rsc + '.create'
@@ -414,7 +414,7 @@ def arv_create client, arvados, global_opts, remaining_opts
begin
results = JSON.parse result.body
rescue JSON::ParserError => e
- arv_edit_save_tmp tmp
+ arv_edit_save_tmp tmp_file
abort "Failed to parse server response:\n" + e.to_s
end
@@ -422,18 +422,18 @@ def arv_create client, arvados, global_opts, remaining_opts
puts "Create failed. Server responded #{result.response.status}: #{results['errors']} "
puts "Create body was:"
puts dumped
- arv_edit_save_tmp tmp
+ arv_edit_save_tmp tmp_file
abort
end
begin
puts "Created object #{results['uuid']}"
rescue
- arv_edit_save_tmp tmp
+ arv_edit_save_tmp tmp_file
abort "Unexpected response:\n#{results}"
end
ensure
- tmp.close(true)
+ tmp_file.close(true)
end
exit 0
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list