# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
-# Offense count: 15
-# Configuration parameters: AllowSafeAssignment.
-Lint/AssignmentInCondition:
- Enabled: false
-
# Offense count: 2
Lint/HandleExceptions:
Enabled: false
Metrics/PerceivedComplexity:
Max: 9
-# Offense count: 2
-# Cop supports --auto-correct.
-# Configuration parameters: SupportedStyles.
-Style/AccessModifierIndentation:
- EnforcedStyle: outdent
-
# Offense count: 14
Style/Documentation:
Enabled: false
if attributes[:ignore]
results << "ignore #{sensor}"
else
- if label = attributes[:label]
- resuls << "label #{sensor} \"#{label}\""
- end
-
- if compute = attributes[:compute]
- resuls << "compute #{sensor} #{compute}"
- end
+ results << "label #{sensor} \"#{attributes[:label]}\"" if attributes[:label]
+ results << "compute #{sensor} #{attributes[:compute]}" if attributes[:compute]
attribute_names.each do |name|
- if value = attributes[name]
- results << "set #{sensor}_#{name} #{value}"
- end
+ results << "set #{sensor}_#{name} #{attributes[name]}" if attributes[name]
end
end
end
end
query("SELECT * FROM db").each do |record|
- next unless database = @databases[record[:db]]
+ database = @databases[record[:db]]
+
+ next unless database
user = "'#{record[:user]}'@'#{record[:host]}'"
@current_resource = Chef::Resource::MysqlDatabase.new(new_resource.name)
@current_resource.database(new_resource.database)
- if mysql_database = @mysql.databases[@current_resource.database]
+ if (mysql_database = @mysql.databases[@current_resource.database])
@current_resource.permissions(mysql_database[:permissions])
end
@current_resource
@current_resource = Chef::Resource::MysqlUser.new(new_resource.name)
@current_resource.user(new_resource.user)
- if mysql_user = @mysql.users[@current_resource.user]
+ if (mysql_user = @mysql.users[@current_resource.user])
Chef::MySQL::USER_PRIVILEGES.each do |privilege|
@current_resource.send(privilege, mysql_user[privilege])
end
@current_resource = Chef::Resource::NodejsPackage.new(new_resource.name)
@current_resource.package_name(new_resource.package_name)
- if package = @packages[@current_resource.package_name]
+ if (package = @packages[@current_resource.package_name])
@current_resource.version(package["version"])
end
@current_resource
end
node[:openvpn][:tunnels].each do |name, details|
- if peer = search(:node, "fqdn:#{details[:peer][:host]}").first
+ peer = search(:node, "fqdn:#{details[:peer][:host]}").first
+
+ if peer
if peer[:openvpn] && !details[:peer][:address]
node.default[:openvpn][:tunnels][name][:peer][:address] = peer[:openvpn][:address]
end
end
end
- private
+ private
def parse_acl(acl)
acl.sub(/^\{(.*)\}$/, "\\1").split(",").each_with_object({}) do |entry, permissions|
@current_resource = Chef::Resource::PostgresqlDatabase.new(new_resource.name)
@current_resource.database(new_resource.database)
@current_resource.cluster(new_resource.cluster)
- if pg_database = @pg.databases[@current_resource.database]
+ if (pg_database = @pg.databases[@current_resource.database])
@current_resource.owner(pg_database[:owner])
@current_resource.encoding(pg_database[:encoding])
@current_resource.encoding(pg_database[:collate])
@current_resource.cluster(new_resource.cluster)
@current_resource.database(new_resource.database)
@current_resource.schema(new_resource.schema)
- if pg_table = @tables[@name]
+ if (pg_table = @tables[@name])
@current_resource.owner(pg_table[:owner])
@current_resource.permissions(pg_table[:permissions])
end
@current_resource = Chef::Resource::PostgresqlUser.new(new_resource.name)
@current_resource.user(new_resource.user)
@current_resource.cluster(new_resource.cluster)
- if pg_user = @pg.users[@current_resource.user]
+ if (pg_user = @pg.users[@current_resource.user])
@current_resource.superuser(pg_user[:superuser])
@current_resource.createdb(pg_user[:createdb])
@current_resource.createrole(pg_user[:createrole])
# this is a node referenced but not added, modified or deleted, so it should
# still be in the node cache.
- if entry = node_cache[node_id]
+ if (entry = node_cache[node_id])
point = Proj4::Point.new(entry.lon, entry.lat)
nodes[node_id] = tile_from_merc(point, max_zoom)
end
files_mode 0755
end
else
- unless repository = params[:repository]
+ repository = params[:repository]
+
+ unless params
version = params[:version] || Chef::Wordpress.current_plugin_version(name)
if version =~ /trunk/
files_mode 0644
end
else
- unless repository = params[:repository]
+ repository = params[:repository]
+
+ unless repository
version = params[:version] || node[:wordpress][:plugins][name][:version]
repository = "http://themes.svn.wordpress.org/#{name}/#{version}"
end
end
end
- private
+ private
def self.core_version_check
api_get("http://api.wordpress.org/core/version-check/1.6")