Sha256: 1ef2f65b8c5b35bdce06b803ee0919a93bbd4c2c00a6b92f0a394aa55e1bcb13

Contents?: true

Size: 988 Bytes

Versions: 11

Compression:

Stored size: 988 Bytes

Contents


module Pod
  class Podfile
    USE_BINARIES = 'use_binaries'
    USE_SOURCE_PODS = 'use_source_pods'
    USE_BINARIES_SELECTOR = 'use_binaries_selector'
    ALLOW_PRERELEASE = 'allow_prerelease'
    USE_PLUGINS = 'use_plugins'
    CONFIGURATION_ENV = 'configuration_env'

    module ENVExecutor
      def execute_with_bin_plugin(&block)
        execute_with_key(USE_PLUGINS, -> { 'cocoapods-mtxx-bin' }, &block)
      end

      def execute_with_allow_prerelease(allow_prerelease, &block)
        execute_with_key(ALLOW_PRERELEASE, -> { allow_prerelease ? 'true' : 'false' }, &block)
      end

      def execute_with_use_binaries(use_binaries, &block)
        execute_with_key(USE_BINARIES, -> { use_binaries ? 'true' : 'false' }, &block)
      end

      def execute_with_key(key, value_returner)
        origin_value = ENV[key]
        ENV[key] = value_returner.call

        yield if block_given?

        ENV[key] = origin_value
      end
    end

    extend ENVExecutor
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cocoapods-mtxx-bin-0.0.13 lib/cocoapods-mtxx-bin/native/podfile_env.rb
cocoapods-mtxx-bin-0.0.12 lib/cocoapods-mtxx-bin/native/podfile_env.rb
cocoapods-mtxx-bin-0.0.10 lib/cocoapods-mtxx-bin/native/podfile_env.rb
cocoapods-mtxx-bin-0.0.9.1 lib/cocoapods-mtxx-bin/native/podfile_env.rb
cocoapods-mtxx-bin-0.0.9 lib/cocoapods-mtxx-bin/native/podfile_env.rb
cocoapods-mtxx-bin-0.0.8 lib/cocoapods-mtxx-bin/native/podfile_env.rb
cocoapods-mtxx-bin-0.0.7 lib/cocoapods-mtxx-bin/native/podfile_env.rb
cocoapods-mtxx-bin-0.0.6 lib/cocoapods-mtxx-bin/native/podfile_env.rb
cocoapods-mtxx-bin-0.0.4 lib/cocoapods-mtxx-bin/native/podfile_env.rb
cocoapods-mtxx-bin-0.0.3 lib/cocoapods-mtxx-bin/native/podfile_env.rb
cocoapods-mtxx-bin-0.0.1 lib/cocoapods-mtxx-bin/native/podfile_env.rb