Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

puppet: Reformat custom Ruby modules with Rufo.

Anders Kaseorg29e4c71ec498
diff --git a/puppet/zulip/lib/puppet/parser/functions/zulipconf.rb b/puppet/zulip/lib/puppet/parser/functions/zulipconf.rb
index 0778716ea99..8946a8ffea3 100644
--- a/puppet/zulip/lib/puppet/parser/functions/zulipconf.rb
+++ b/puppet/zulip/lib/puppet/parser/functions/zulipconf.rb
@@ -2,8 +2,8 @@ module Puppet::Parser::Functions
newfunction(:zulipconf, :type => :rvalue, :arity => -2) do |args|
default = args.pop
joined = args.join(" ")
- zulip_conf_path = lookupvar('zulip_conf_path')
- output = `/usr/bin/crudini --get #{zulip_conf_path} #{joined} 2>&1`; result=$?.success?
+ zulip_conf_path = lookupvar("zulip_conf_path")
+ output = `/usr/bin/crudini --get #{zulip_conf_path} #{joined} 2>&1`; result = $?.success?
if result
output.strip()
else
@@ -12,8 +12,8 @@ module Puppet::Parser::Functions
end
newfunction(:zulipconf_keys, :type => :rvalue, :arity => 1) do |args|
- zulip_conf_path = lookupvar('zulip_conf_path')
- output = `/usr/bin/crudini --get #{zulip_conf_path} #{args[0]} 2>&1`; result=$?.success?
+ zulip_conf_path = lookupvar("zulip_conf_path")
+ output = `/usr/bin/crudini --get #{zulip_conf_path} #{args[0]} 2>&1`; result = $?.success?
if result
return output.lines.map { |l| l.strip }
else
@@ -25,14 +25,14 @@ module Puppet::Parser::Functions
section = "nagios"
prefix = "hosts_"
ignore_key = "hosts_fullstack"
- zulip_conf_path = lookupvar('zulip_conf_path')
- keys = `/usr/bin/crudini --get #{zulip_conf_path} #{section} 2>&1`; result=$?.success?
+ zulip_conf_path = lookupvar("zulip_conf_path")
+ keys = `/usr/bin/crudini --get #{zulip_conf_path} #{section} 2>&1`; result = $?.success?
if result
keys = keys.lines.map { |l| l.strip }
filtered_keys = keys.select { |l| l.start_with?(prefix) }.reject { |k| k == ignore_key }
all_values = []
filtered_keys.each do |key|
- values = `/usr/bin/crudini --get #{zulip_conf_path} #{section} #{key} 2>&1`; result=$?.success?
+ values = `/usr/bin/crudini --get #{zulip_conf_path} #{section} #{key} 2>&1`; result = $?.success?
if result
all_values += values.strip.split(/,\s*/)
end
diff --git a/puppet/zulip/lib/puppet/parser/functions/zulipsecret.rb b/puppet/zulip/lib/puppet/parser/functions/zulipsecret.rb
index b23dc982794..c796e9f9e42 100644
--- a/puppet/zulip/lib/puppet/parser/functions/zulipsecret.rb
+++ b/puppet/zulip/lib/puppet/parser/functions/zulipsecret.rb
@@ -2,7 +2,7 @@ module Puppet::Parser::Functions
newfunction(:zulipsecret, :type => :rvalue) do |args|
default = args.pop
joined = args.join(" ")
- output = `/usr/bin/crudini --get /etc/zulip/zulip-secrets.conf #{joined} 2>&1`; result=$?.success?
+ output = `/usr/bin/crudini --get /etc/zulip/zulip-secrets.conf #{joined} 2>&1`; result = $?.success?
if result
output.strip()
else
diff --git a/puppet/zulip/lib/puppet/type/apache2conf.rb b/puppet/zulip/lib/puppet/type/apache2conf.rb
index 6e8c014f7a0..b82c0995d40 100644
--- a/puppet/zulip/lib/puppet/type/apache2conf.rb
+++ b/puppet/zulip/lib/puppet/type/apache2conf.rb
@@ -1,9 +1,9 @@
Puppet::Type.newtype(:apache2conf) do
- ensurable
- newparam(:name) do
- desc "The name of the conf to enable"
- isnamevar
- end
+ ensurable
+ newparam(:name) do
+ desc "The name of the conf to enable"
+ isnamevar
+ end
end
Puppet::Type.type(:apache2conf).provide(:apache2conf) do
diff --git a/puppet/zulip/lib/puppet/type/apache2mod.rb b/puppet/zulip/lib/puppet/type/apache2mod.rb
index 7aa1504949d..0e87cf2affc 100644
--- a/puppet/zulip/lib/puppet/type/apache2mod.rb
+++ b/puppet/zulip/lib/puppet/type/apache2mod.rb
@@ -1,9 +1,9 @@
Puppet::Type.newtype(:apache2mod) do
- ensurable
- newparam(:name) do
- desc "The name of the module to enable"
- isnamevar
- end
+ ensurable
+ newparam(:name) do
+ desc "The name of the module to enable"
+ isnamevar
+ end
end
Puppet::Type.type(:apache2mod).provide(:apache2mod) do
diff --git a/puppet/zulip/lib/puppet/type/apache2site.rb b/puppet/zulip/lib/puppet/type/apache2site.rb
index 40ec5795e04..3e3bc850f4a 100644
--- a/puppet/zulip/lib/puppet/type/apache2site.rb
+++ b/puppet/zulip/lib/puppet/type/apache2site.rb
@@ -1,9 +1,9 @@
Puppet::Type.newtype(:apache2site) do
- ensurable
- newparam(:name) do
- desc "The name of the site to enable"
- isnamevar
- end
+ ensurable
+ newparam(:name) do
+ desc "The name of the site to enable"
+ isnamevar
+ end
end
Puppet::Type.type(:apache2site).provide(:apache2site) do
diff --git a/puppet/zulip/lib/puppet/type/chroot.rb b/puppet/zulip/lib/puppet/type/chroot.rb
index cd7f500a277..3718e43c0df 100644
--- a/puppet/zulip/lib/puppet/type/chroot.rb
+++ b/puppet/zulip/lib/puppet/type/chroot.rb
@@ -1,12 +1,12 @@
Puppet::Type.newtype(:chroot) do
- ensurable
- newparam(:release) do
- desc "The name of the release"
- isnamevar
- end
- newparam(:distro) do
- desc "The name of the Linux distribution (Debian, Ubuntu)"
- end
+ ensurable
+ newparam(:release) do
+ desc "The name of the release"
+ isnamevar
+ end
+ newparam(:distro) do
+ desc "The name of the Linux distribution (Debian, Ubuntu)"
+ end
end
Puppet::Type.type(:chroot).provide(:chroot) do
@@ -16,12 +16,12 @@ Puppet::Type.type(:chroot).provide(:chroot) do
def create
if @resource[:distro] == "ubuntu"
- mirror = "http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/"
+ mirror = "http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/"
else
- mirror = "http://mirror.cc.columbia.edu/debian"
+ mirror = "http://mirror.cc.columbia.edu/debian"
end
["amd64", "i386"].each { |x|
- system("mk-sbuild #{@resource[:release]} --arch=#{x} --debootstrap-mirror=#{mirror} --distro=#{@resource[:distro]}")
+ system("mk-sbuild #{@resource[:release]} --arch=#{x} --debootstrap-mirror=#{mirror} --distro=#{@resource[:distro]}")
}
end