Sha256: 8f65a1c66fbd133715a67fede8cf3132a223d02dbc36aafd7625f953849f55fe

Contents?: true

Size: 987 Bytes

Versions: 7

Compression:

Stored size: 987 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-tdf-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

7 entries across 7 versions & 1 rubygems

Version Path
cocoapods-tdf-bin-0.0.16 lib/cocoapods-tdf-bin/native/podfile_env.rb
cocoapods-tdf-bin-0.0.15 lib/cocoapods-tdf-bin/native/podfile_env.rb
cocoapods-tdf-bin-0.0.14 lib/cocoapods-tdf-bin/native/podfile_env.rb
cocoapods-tdf-bin-0.0.13 lib/cocoapods-tdf-bin/native/podfile_env.rb
cocoapods-tdf-bin-0.0.12 lib/cocoapods-tdf-bin/native/podfile_env.rb
cocoapods-tdf-bin-0.0.11 lib/cocoapods-tdf-bin/native/podfile_env.rb
cocoapods-tdf-bin-0.0.1.1 lib/cocoapods-tdf-bin/native/podfile_env.rb