Sha256: 3143af1549417ff522b18a88640771c7205c0f740d9f2c10c63d501ab2d5d214

Contents?: true

Size: 814 Bytes

Versions: 5

Compression:

Stored size: 814 Bytes

Contents

class CocoaPodsFixReactNative
  def fix_with_context(context)
    # Get the current version of React Native in your app
    react = nil
    context.umbrella_targets.each do |target|
      react = target.specs.find { |s| s.name == 'React' || s.name.start_with?('React/') }
      react = react if react
    end

    # 0.44.1 -> 0_44_1
    version = react.version.to_s
    file_to_parse = version.tr('.', '_')
    path_to_fix = File.join(File.dirname(__FILE__), 'versions', file_to_parse + '.rb')

    # require 'pry'
    # binding.pry

    if File.exist? path_to_fix
      puts "Patching React Native #{version}"
      require(path_to_fix)
    else
      puts "CP-Fix-React-Native does not support #{version} yet, please send PRs to"
      puts 'https://github.com/orta/cocoapods-fix-react-native'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cocoapods-fix-react-native-2018.04.02.00 lib/cocoapods-fix-react-native/version_resolver.rb
cocoapods-fix-react-native-2018.04.01.19 lib/cocoapods-fix-react-native/version_resolver.rb
cocoapods-fix-react-native-2018.04.01.16 lib/cocoapods-fix-react-native/version_resolver.rb
cocoapods-fix-react-native-2018.04.01.15 lib/cocoapods-fix-react-native/version_resolver.rb
cocoapods-fix-react-native-2018.04.01.11 lib/cocoapods-fix-react-native/version_resolver.rb