module CrossplatformShellwords
Here be helper
Public Class Methods
Source
# File fastlane_core/lib/fastlane_core/core_ext/shellwords.rb, line 23 def shellescape(str) if FastlaneCore::Helper.windows? WindowsShellwords.shellescape(str) else # using `escape` instead of expected `shellescape` here # which corresponds to Shellword's `String.shellescape` implementation # https://github.com/ruby/ruby/blob/1cf2bb4b2085758112503e7da7414d1ef52d4f48/lib/shellwords.rb#L216 Shellwords.escape(str) end end
handle switching between implementations of shellescape
Source
# File fastlane_core/lib/fastlane_core/core_ext/shellwords.rb, line 36 def shelljoin(array) array.map { |arg| shellescape(arg) }.join(' ') end
make sure local implementation is also used in shelljoin
Private Instance Methods
Source
# File fastlane_core/lib/fastlane_core/core_ext/shellwords.rb, line 23 def shellescape(str) if FastlaneCore::Helper.windows? WindowsShellwords.shellescape(str) else # using `escape` instead of expected `shellescape` here # which corresponds to Shellword's `String.shellescape` implementation # https://github.com/ruby/ruby/blob/1cf2bb4b2085758112503e7da7414d1ef52d4f48/lib/shellwords.rb#L216 Shellwords.escape(str) end end
handle switching between implementations of shellescape
Source
# File fastlane_core/lib/fastlane_core/core_ext/shellwords.rb, line 36 def shelljoin(array) array.map { |arg| shellescape(arg) }.join(' ') end
make sure local implementation is also used in shelljoin