module CrossplatformShellwords
Here be helper
Public Class Methods
shellescape(str)
click to toggle source
handle switching between implementations of shellescape
# 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
shelljoin(array)
click to toggle source
make sure local implementation is also used in shelljoin
# File fastlane_core/lib/fastlane_core/core_ext/shellwords.rb, line 36 def shelljoin(array) array.map { |arg| shellescape(arg) }.join(' ') end
Private Instance Methods
shellescape(str)
click to toggle source
handle switching between implementations of shellescape
# 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
shelljoin(array)
click to toggle source
make sure local implementation is also used in shelljoin
# File fastlane_core/lib/fastlane_core/core_ext/shellwords.rb, line 36 def shelljoin(array) array.map { |arg| shellescape(arg) }.join(' ') end