From 40b7e36746f679c41f97e627f2af0e898963925b Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 14 Oct 2016 20:01:35 +0200 Subject: [PATCH] Use `0`-only prefix for octal numbers. --- Library/Homebrew/cask/lib/hbc/pkg.rb | 2 +- Library/Homebrew/cask/test/cask/pkg_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cask/lib/hbc/pkg.rb b/Library/Homebrew/cask/lib/hbc/pkg.rb index 7f187c9de0..7d4a9251ab 100644 --- a/Library/Homebrew/cask/lib/hbc/pkg.rb +++ b/Library/Homebrew/cask/lib/hbc/pkg.rb @@ -76,7 +76,7 @@ module Hbc end def _with_full_permissions(path) - original_mode = (path.stat.mode % 0o1000).to_s(8) + original_mode = (path.stat.mode % 01000).to_s(8) # TODO: similarly read and restore macOS flags (cf man chflags) @command.run!("/bin/chmod", args: ["--", "777", path], sudo: true) yield diff --git a/Library/Homebrew/cask/test/cask/pkg_test.rb b/Library/Homebrew/cask/test/cask/pkg_test.rb index 5734a58f6a..85a42356e2 100644 --- a/Library/Homebrew/cask/test/cask/pkg_test.rb +++ b/Library/Homebrew/cask/test/cask/pkg_test.rb @@ -75,7 +75,7 @@ describe Hbc::Pkg do fake_file = fake_dir.join("ima_installed_file").tap { |path| FileUtils.touch(path) } - fake_dir.chmod(0o000) + fake_dir.chmod(0000) pkg.stubs(:pkgutil_bom_specials).returns([]) pkg.stubs(:pkgutil_bom_files).returns([fake_file]) @@ -88,7 +88,7 @@ describe Hbc::Pkg do fake_dir.must_be :directory? fake_file.wont_be :file? - (fake_dir.stat.mode % 0o1000).to_s(8).must_equal "0" + (fake_dir.stat.mode % 01000).to_s(8).must_equal "0" end end end