From: František Dvořák Date: Tue, 14 Jun 2016 12:49:56 +0000 (+0200) Subject: Ruby: ruby way of using parenthesis for methods. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=4d431aa57d0667264ba21457786adccadc79b671;p=now.git Ruby: ruby way of using parenthesis for methods. --- diff --git a/.rubocop.yml b/.rubocop.yml index 7378663..e1913b5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -33,11 +33,6 @@ Style/GlobalVars: - lib/api.rb - lib/nebula.rb -# Omit the parentheses in defs when the method doesn't accept any arguments -# (easy to read) -Style/DefWithParentheses: - Enabled: false - # Extra empty line detected at class body end # (easy to read) Style/EmptyLinesAroundClassBody: diff --git a/lib/nebula.rb b/lib/nebula.rb index 6419da8..a871d9c 100644 --- a/lib/nebula.rb +++ b/lib/nebula.rb @@ -44,7 +44,7 @@ module Now @ctx = @user_ctx end - def switch_server() + def switch_server admin_user = @config['opennebula']['admin_user'] admin_password = @config['opennebula']['admin_password'] logger.debug "Authentication to #{admin_user}" @@ -54,7 +54,7 @@ module Now @ctx = @server_ctx end - def initialize() + def initialize @logger = $logger logger.info "Starting Network Orchestrator Wrapper (NOW #{VERSION})" @config = {} @@ -70,7 +70,7 @@ module Now @url = @config['opennebula']['endpoint'] end - def list_networks() + def list_networks vn_pool = OpenNebula::VirtualNetworkPool.new(@ctx, -1) check(vn_pool.info)