aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-05-22 00:01:04 -0700
committerelijah <elijah@riseup.net>2014-05-22 00:01:04 -0700
commita327a0544bb725c668b7bca5bf6618c40a9c9cd2 (patch)
tree2ebaafb3d46aeab8352384c89cb17fe1f7487656
parent300e794099ca2c402618e7f17b7279ad6b6f34c5 (diff)
downloadleap_cli-a327a0544bb725c668b7bca5bf6618c40a9c9cd2.tar.gz
leap_cli-a327a0544bb725c668b7bca5bf6618c40a9c9cd2.tar.bz2
added 'try {}' macro.
-rw-r--r--lib/leap_cli/config/macros.rb11
-rw-r--r--lib/leap_cli/version.rb2
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/leap_cli/config/macros.rb b/lib/leap_cli/config/macros.rb
index 2eabdd0..30381ee 100644
--- a/lib/leap_cli/config/macros.rb
+++ b/lib/leap_cli/config/macros.rb
@@ -415,5 +415,16 @@ module LeapCli; module Config
end
end
+ #
+ # wrap something that might fail in `try`. e.g.
+ #
+ # "= try{ nodes[:services => 'tor'].first.ip_address } "
+ #
+ def try(&block)
+ yield
+ rescue NoMethodError
+ nil
+ end
+
end
end; end
diff --git a/lib/leap_cli/version.rb b/lib/leap_cli/version.rb
index 7c39e05..5ec2523 100644
--- a/lib/leap_cli/version.rb
+++ b/lib/leap_cli/version.rb
@@ -1,6 +1,6 @@
module LeapCli
unless defined?(LeapCli::VERSION)
- VERSION = '1.5.4'
+ VERSION = '1.5.5'
COMPATIBLE_PLATFORM_VERSION = '0.5.2'..'1.99'
SUMMARY = 'Command line interface to the LEAP platform'
DESCRIPTION = 'The command "leap" can be used to manage a bevy of servers running the LEAP platform from the comfort of your own home.'