summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-02 15:13:58 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-02 15:13:58 -0700
commitd7478e406d0bdcc15c8122fb7b4e39ad3208c9ac (patch)
treefd7eaa3d882d97d7013c57dda2886b9dbe7dd390 /lib/chef
parente71560df5cebbfb209089c6255e37e65f0e34d95 (diff)
downloadchef-d7478e406d0bdcc15c8122fb7b4e39ad3208c9ac.tar.gz
Style/MethodCallWithoutArgsParentheses
zero args methods don't get parens. this certainly reads better than the inverse. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/cookbook/metadata.rb4
-rw-r--r--lib/chef/data_bag_item.rb2
-rw-r--r--lib/chef/file_content_management/deploy.rb4
-rw-r--r--lib/chef/knife/core/cookbook_scm_repo.rb2
-rw-r--r--lib/chef/knife/ssh.rb2
-rw-r--r--lib/chef/mixin/openssl_helper.rb2
-rw-r--r--lib/chef/provider/remote_directory.rb2
-rw-r--r--lib/chef/resource/openssl_x509_certificate.rb2
-rw-r--r--lib/chef/resource/openssl_x509_request.rb2
-rw-r--r--lib/chef/resource_collection.rb2
-rw-r--r--lib/chef/resource_collection/resource_collection_serialization.rb2
-rw-r--r--lib/chef/resource_collection/resource_list.rb2
-rw-r--r--lib/chef/resource_collection/resource_set.rb2
-rw-r--r--lib/chef/util/windows/net_use.rb2
-rw-r--r--lib/chef/util/windows/net_user.rb2
15 files changed, 17 insertions, 17 deletions
diff --git a/lib/chef/cookbook/metadata.rb b/lib/chef/cookbook/metadata.rb
index 1060eaa09c..729a5a4f61 100644
--- a/lib/chef/cookbook/metadata.rb
+++ b/lib/chef/cookbook/metadata.rb
@@ -445,7 +445,7 @@ class Chef
end
def self.from_hash(o)
- cm = new()
+ cm = new
cm.from_hash(o)
cm
end
@@ -478,7 +478,7 @@ class Chef
def self.validate_json(json_str)
o = Chef::JSONCompat.from_json(json_str)
- metadata = new()
+ metadata = new
VERSION_CONSTRAINTS.each do |dependency_type, hash_key|
if dependency_group = o[hash_key]
dependency_group.each do |cb_name, constraints|
diff --git a/lib/chef/data_bag_item.rb b/lib/chef/data_bag_item.rb
index da13b02268..b6b1743277 100644
--- a/lib/chef/data_bag_item.rb
+++ b/lib/chef/data_bag_item.rb
@@ -157,7 +157,7 @@ class Chef
end
end
- def destroy(data_bag = self.data_bag(), databag_item = name)
+ def destroy(data_bag = self.data_bag, databag_item = name)
chef_server_rest.delete("data/#{data_bag}/#{databag_item}")
end
diff --git a/lib/chef/file_content_management/deploy.rb b/lib/chef/file_content_management/deploy.rb
index 2ad3aa19d5..1f158059e6 100644
--- a/lib/chef/file_content_management/deploy.rb
+++ b/lib/chef/file_content_management/deploy.rb
@@ -27,9 +27,9 @@ class Chef
class Deploy
def self.strategy(atomic_update)
if atomic_update
- Chef::Platform.windows? ? MvWindows.new() : MvUnix.new()
+ Chef::Platform.windows? ? MvWindows.new : MvUnix.new
else
- Cp.new()
+ Cp.new
end
end
end
diff --git a/lib/chef/knife/core/cookbook_scm_repo.rb b/lib/chef/knife/core/cookbook_scm_repo.rb
index f97923d96b..62d4ef30c5 100644
--- a/lib/chef/knife/core/cookbook_scm_repo.rb
+++ b/lib/chef/knife/core/cookbook_scm_repo.rb
@@ -50,7 +50,7 @@ class Chef
exit 1
end
if use_current_branch
- @default_branch = get_current_branch()
+ @default_branch = get_current_branch
end
unless branch_exists?(default_branch)
ui.error "The default branch '#{default_branch}' does not exist"
diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb
index c7bf57325f..301839b2b7 100644
--- a/lib/chef/knife/ssh.rb
+++ b/lib/chef/knife/ssh.rb
@@ -360,7 +360,7 @@ class Chef
command.force_encoding("binary") if command.respond_to?(:force_encoding)
subsession.open_channel do |chan|
if config[:on_error] && exit_status != 0
- chan.close()
+ chan.close
else
chan.request_pty
chan.exec command do |ch, success|
diff --git a/lib/chef/mixin/openssl_helper.rb b/lib/chef/mixin/openssl_helper.rb
index 6a8a288451..5a4bd6077a 100644
--- a/lib/chef/mixin/openssl_helper.rb
+++ b/lib/chef/mixin/openssl_helper.rb
@@ -264,7 +264,7 @@ class Chef
cert = ::OpenSSL::X509::Certificate.new
ef = ::OpenSSL::X509::ExtensionFactory.new
- cert.serial = gen_serial()
+ cert.serial = gen_serial
cert.version = 2
cert.subject = request.subject
cert.public_key = request.public_key
diff --git a/lib/chef/provider/remote_directory.rb b/lib/chef/provider/remote_directory.rb
index 933ebe119d..e7d470916b 100644
--- a/lib/chef/provider/remote_directory.rb
+++ b/lib/chef/provider/remote_directory.rb
@@ -102,7 +102,7 @@ class Chef
if purge
Dir.glob(::File.join(Chef::Util::PathHelper.escape_glob_dir(path), "**", "*"), ::File::FNM_DOTMATCH).sort!.reverse!.each do |file|
# skip '.' and '..'
- next if [".", ".."].include?(Pathname.new(file).basename().to_s)
+ next if [".", ".."].include?(Pathname.new(file).basename.to_s)
# Clean the path. This is required because of the ::File.join
file = Chef::Util::PathHelper.cleanpath(file)
diff --git a/lib/chef/resource/openssl_x509_certificate.rb b/lib/chef/resource/openssl_x509_certificate.rb
index 8353f5ad09..54971e421d 100644
--- a/lib/chef/resource/openssl_x509_certificate.rb
+++ b/lib/chef/resource/openssl_x509_certificate.rb
@@ -168,7 +168,7 @@ class Chef
end
def subject
- subject = OpenSSL::X509::Name.new()
+ subject = OpenSSL::X509::Name.new
subject.add_entry("C", new_resource.country) unless new_resource.country.nil?
subject.add_entry("ST", new_resource.state) unless new_resource.state.nil?
subject.add_entry("L", new_resource.city) unless new_resource.city.nil?
diff --git a/lib/chef/resource/openssl_x509_request.rb b/lib/chef/resource/openssl_x509_request.rb
index 6fa3d6db9e..982f29dd75 100644
--- a/lib/chef/resource/openssl_x509_request.rb
+++ b/lib/chef/resource/openssl_x509_request.rb
@@ -130,7 +130,7 @@ class Chef
end
def subject
- csr_subject = OpenSSL::X509::Name.new()
+ csr_subject = OpenSSL::X509::Name.new
csr_subject.add_entry("C", new_resource.country) unless new_resource.country.nil?
csr_subject.add_entry("ST", new_resource.state) unless new_resource.state.nil?
csr_subject.add_entry("L", new_resource.city) unless new_resource.city.nil?
diff --git a/lib/chef/resource_collection.rb b/lib/chef/resource_collection.rb
index 31cc917a9f..54ffd5ae66 100644
--- a/lib/chef/resource_collection.rb
+++ b/lib/chef/resource_collection.rb
@@ -119,7 +119,7 @@ class Chef
end
def self.from_hash(o)
- collection = new()
+ collection = new
{ "@resource_list" => "ResourceList", "@resource_set" => "ResourceSet" }.each_pair do |name, klass|
obj = Chef::ResourceCollection.const_get(klass).from_hash(o["instance_vars"].delete(name))
collection.instance_variable_set(name.to_sym, obj)
diff --git a/lib/chef/resource_collection/resource_collection_serialization.rb b/lib/chef/resource_collection/resource_collection_serialization.rb
index d4609500aa..fb9480a780 100644
--- a/lib/chef/resource_collection/resource_collection_serialization.rb
+++ b/lib/chef/resource_collection/resource_collection_serialization.rb
@@ -45,7 +45,7 @@ class Chef
module ClassMethods
def from_hash(o)
- collection = new()
+ collection = new
o["instance_vars"].each do |k, v|
collection.instance_variable_set(k.to_sym, v)
end
diff --git a/lib/chef/resource_collection/resource_list.rb b/lib/chef/resource_collection/resource_list.rb
index 5f69908a5e..5ea018a3e8 100644
--- a/lib/chef/resource_collection/resource_list.rb
+++ b/lib/chef/resource_collection/resource_list.rb
@@ -98,7 +98,7 @@ class Chef
end
def self.from_hash(o)
- collection = new()
+ collection = new
resources = o["instance_vars"]["@resources"].map { |r| Chef::Resource.from_hash(r) }
collection.instance_variable_set(:@resources, resources)
collection
diff --git a/lib/chef/resource_collection/resource_set.rb b/lib/chef/resource_collection/resource_set.rb
index 9760cf4598..c515e68b38 100644
--- a/lib/chef/resource_collection/resource_set.rb
+++ b/lib/chef/resource_collection/resource_set.rb
@@ -140,7 +140,7 @@ class Chef
end
def self.from_hash(o)
- collection = new()
+ collection = new
rl = o["instance_vars"]["@resources_by_key"]
resources = rl.merge(rl) { |k, r| Chef::Resource.from_hash(r) }
collection.instance_variable_set(:@resources_by_key, resources)
diff --git a/lib/chef/util/windows/net_use.rb b/lib/chef/util/windows/net_use.rb
index 1a2acaed33..0c870b5121 100644
--- a/lib/chef/util/windows/net_use.rb
+++ b/lib/chef/util/windows/net_use.rb
@@ -66,7 +66,7 @@ class Chef::Util::Windows::NetUse < Chef::Util::Windows
end
def device
- get_info()[:remote]
+ get_info[:remote]
end
def delete
diff --git a/lib/chef/util/windows/net_user.rb b/lib/chef/util/windows/net_user.rb
index 78bd1e31a3..5545ff4ca5 100644
--- a/lib/chef/util/windows/net_user.rb
+++ b/lib/chef/util/windows/net_user.rb
@@ -168,6 +168,6 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows
end
def check_enabled
- (get_info()[:flags] & NetUser::UF_ACCOUNTDISABLE) != 0
+ (get_info[:flags] & NetUser::UF_ACCOUNTDISABLE) != 0
end
end