<commit_before>require 'shellwords'

module Travis
  module Build
    class Script
      class ObjectiveC < Script
        DEFAULTS = {
          rvm:     'default'
        }

        include RVM

        def announce
          super
          cmd 'xcodebuild -version -sdk', fold: 'announce'
          uses_rubymotion? then: 'motion --version'
          has_podfile? then: 'pod --version'
        end

        def export
          super

          set 'TRAVIS_XCODE_SDK', config[:xcode_sdk], echo: false
          set 'TRAVIS_XCODE_SCHEME', config[:xcode_scheme], echo: false
          set 'TRAVIS_XCODE_PROJECT', config[:xcode_project], echo: false
          set 'TRAVIS_XCODE_WORKSPACE', config[:xcode_workspace], echo: false
        end

        def setup
          super

          cmd "echo '#!/bin/bash\n# no-op' > /usr/local/bin/actool", echo: false
          cmd "chmod +x /usr/local/bin/actool", echo: false

          cmd "osascript -e 'set simpath to \"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator\" as POSIX file' -e 'tell application \"Finder\"' -e 'open simpath' -e 'end tell'"
        end

        def install
          has_gemfile? then: 'bundle install', fold: 'install.bundler', retry: true
          has_podfile? then: 'pod install', fold: 'install.cocoapods', retry: true
        end

        def script
          uses_rubymotion?(with_bundler: true, then: 'bundle exec rake spec')
          uses_rubymotion?(elif: true, then: 'rake spec')
          self.else do |script|
            if config[:xcode_scheme] && (config[:xcode_project] || config[:xcode_workspace])<commit_msg>objective-c: shellescape TRAVIS_XCODE_* environment variables<commit_after>require 'shellwords'

module Travis
  module Build
    class Script
      class ObjectiveC < Script
        DEFAULTS = {
          rvm:     'default'
        }

        include RVM

        def announce
          super
          cmd 'xcodebuild -version -sdk', fold: 'announce'
          uses_rubymotion? then: 'motion --version'
          has_podfile? then: 'pod --version'
        end

        def export
          super

          set 'TRAVIS_XCODE_SDK', config[:xcode_sdk].shellescape, echo: false
          set 'TRAVIS_XCODE_SCHEME', config[:xcode_scheme].shellescape, echo: false
          set 'TRAVIS_XCODE_PROJECT', config[:xcode_project].shellescape, echo: false
          set 'TRAVIS_XCODE_WORKSPACE', config[:xcode_workspace].shellescape, echo: false
        end

        def setup
          super

          cmd "echo '#!/bin/bash\n# no-op' > /usr/local/bin/actool", echo: false
          cmd "chmod +x /usr/local/bin/actool", echo: false

          cmd "osascript -e 'set simpath to \"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator\" as POSIX file' -e 'tell application \"Finder\"' -e 'open simpath' -e 'end tell'"
        end

        def install
          has_gemfile? then: 'bundle install', fold: 'install.bundler', retry: true
          has_podfile? then: 'pod install', fold: 'install.cocoapods', retry: true
        end

        def script
          uses_rubymotion?(with_bundler: true, then: 'bundle exec rake spec')
          uses_rubymotion?(elif: true, then: 'rake spec')
          self.else do |script|
            if config[:xcode_scheme] && (config[:xcode_project] || config[:xcode_workspace])
{'fraction_non_alphanumeric': 0.10689851767388825, 'fraction_numerical': 0.0, 'mean_word_length': 2.4001937984496124, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '960391', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1044, 'n_words': 277}