Sha256: cc4bbdf3a2faaf059657ef7a638146b74741342af68e489d79cca24d3b0e43ad

Contents?: true

Size: 1.4 KB

Versions: 359

Compression:

Stored size: 1.4 KB

Contents

module Fastlane
  module Actions
    module SharedValues
    end

    class RubyVersionAction < Action
      def self.run(params)
        params = nil unless params.kind_of?(Array)
        value = (params || []).first
        defined_version = Gem::Version.new(value) if value

        UI.user_error!("Please pass minimum ruby version as parameter to ruby_version") unless defined_version

        if Gem::Version.new(RUBY_VERSION) < defined_version
          error_message = "The Fastfile requires a ruby version of >= #{defined_version}. You are on #{RUBY_VERSION}."
          UI.user_error!(error_message)
        end

        UI.message("Your ruby version #{RUBY_VERSION} matches the minimum requirement of #{defined_version}  ✅")
      end

      def self.step_text
        "Verifying Ruby version"
      end

      def self.author
        "sebastianvarela"
      end

      def self.description
        "Verifies the minimum ruby version required"
      end

      def self.example_code
        [
          'ruby_version("2.4.0")'
        ]
      end

      def self.details
        [
          "Add this to your `Fastfile` to require a certain version of _ruby_.",
          "Put it at the top of your `Fastfile to ensure that _fastlane_ is executed appropriately."
        ].join("\n")
      end

      def self.category
        :misc
      end

      def self.is_supported?(platform)
        true
      end
    end
  end
end

Version data entries

359 entries across 359 versions & 2 rubygems

Version Path
fastlane-2.136.0 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.135.2 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.135.1 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.135.0 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.134.0 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.133.0 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.132.0 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.132.0.beta.20190930200026 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.132.0.beta.20190929200020 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.132.0.beta.20190928200106 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.132.0.beta.20190927200017 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.132.0.beta.20190926200023 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.132.0.beta.20190925200108 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.132.0.beta.20190924200030 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.132.0.beta.20190923200017 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.132.0.beta.20190922200014 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.132.0.beta.20190921200021 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.132.0.beta.20190920200012 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.132.0.beta.20190919200100 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.132.0.beta.20190918200023 fastlane/lib/fastlane/actions/ruby_version.rb