Skip to content
Snippets Groups Projects
Commit 1edb50b3 authored by Eric Franz's avatar Eric Franz
Browse files

rename method to follow ruby conventions

parent 1d82f88e
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,7 @@ module AweSim ...@@ -36,7 +36,7 @@ module AweSim
def restart def restart
abort_if_app_not_shared_app abort_if_app_not_shared_app
unless AweSim::PosixACL.rx_other(app.restart_dir) unless AweSim::PosixACL.rx_other?(app.restart_dir)
say ["Everybody does not have read and execute access to restart directory: #{app.restart_dir}.", say ["Everybody does not have read and execute access to restart directory: #{app.restart_dir}.",
"Running this command might fix it:\n", "Running this command might fix it:\n",
" chmod 755 ~ ~/awesim_shared_apps ~/awesim_shared_apps/.tmp #{app.restart_dir}\n", " chmod 755 ~ ~/awesim_shared_apps ~/awesim_shared_apps/.tmp #{app.restart_dir}\n",
......
...@@ -29,7 +29,7 @@ module AweSim ...@@ -29,7 +29,7 @@ module AweSim
# and make sure that all of those users have rx to the restart directory # and make sure that all of those users have rx to the restart directory
# But that would take more thought and might be expensive computationally # But that would take more thought and might be expensive computationally
# (but this is just for awesim lint, so thats okay) # (but this is just for awesim lint, so thats okay)
def self.rx_other(path) def self.rx_other?(path)
paths = [] paths = []
Pathname.new(path).realpath.ascend { |p| paths << p } Pathname.new(path).realpath.ascend { |p| paths << p }
paths.all? do |p| paths.all? do |p|
......
...@@ -14,7 +14,7 @@ class TestPosixACL < Minitest::Test ...@@ -14,7 +14,7 @@ class TestPosixACL < Minitest::Test
# test that you can check the real rx on a directory # test that you can check the real rx on a directory
# for everyone # for everyone
def test_rx_other def test_rx_other?
skip if Gem::Platform.local.os == "darwin" # OS X doesn't have ACLs skip if Gem::Platform.local.os == "darwin" # OS X doesn't have ACLs
@dir_shared = @tmpdir.join("awesim_shared_apps") @dir_shared = @tmpdir.join("awesim_shared_apps")
...@@ -23,22 +23,22 @@ class TestPosixACL < Minitest::Test ...@@ -23,22 +23,22 @@ class TestPosixACL < Minitest::Test
@dir_restart.mkpath @dir_restart.mkpath
FileUtils.chmod_R "o+rx", @tmpdir FileUtils.chmod_R "o+rx", @tmpdir
assert AweSim::PosixACL.rx_other(@dir_restart) assert AweSim::PosixACL.rx_other?(@dir_restart)
rm_rx_other @tmpdir rm_rx_other @tmpdir
assert ! AweSim::PosixACL.rx_other(@dir_restart) assert ! AweSim::PosixACL.rx_other?(@dir_restart)
add_rx_other @tmpdir add_rx_other @tmpdir
assert AweSim::PosixACL.rx_other(@dir_restart) assert AweSim::PosixACL.rx_other?(@dir_restart)
rm_rx_other @dir_shared rm_rx_other @dir_shared
assert ! AweSim::PosixACL.rx_other(@dir_restart) assert ! AweSim::PosixACL.rx_other?(@dir_restart)
add_rx_other @dir_shared add_rx_other @dir_shared
assert AweSim::PosixACL.rx_other(@dir_restart) assert AweSim::PosixACL.rx_other?(@dir_restart)
rm_rx_other @dir_restart rm_rx_other @dir_restart
assert ! AweSim::PosixACL.rx_other(@dir_restart) assert ! AweSim::PosixACL.rx_other?(@dir_restart)
add_rx_other @dir_restart add_rx_other @dir_restart
assert AweSim::PosixACL.rx_other(@dir_restart) assert AweSim::PosixACL.rx_other?(@dir_restart)
end end
def add_rx_other(path) def add_rx_other(path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment