]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
added 'try {}' macro.
authorelijah <elijah@riseup.net>
Thu, 22 May 2014 07:01:04 +0000 (00:01 -0700)
committerelijah <elijah@riseup.net>
Thu, 22 May 2014 07:01:04 +0000 (00:01 -0700)
lib/leap_cli/config/macros.rb
lib/leap_cli/version.rb

index 2eabdd01badc338408e2f68f2f533ae07e60e07c..30381ee17d61bd2b25aca7f936d7a63f7a31d0d9 100644 (file)
@@ -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
index 7c39e05ddb5a7507c3b56a10f6a46bf71f19ec17..5ec2523f9b52861bf5cb01bac29d491037327b4f 100644 (file)
@@ -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.'