Sha256: 6cf498460d50467799fae12ea980ea0e718bf025005aac90e3c731e0ed8af20d

Contents?: true

Size: 1.39 KB

Versions: 261

Compression:

Stored size: 1.39 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 required 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

261 entries across 261 versions & 1 rubygems

Version Path
fastlane-2.63.0.beta.20171018010003 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.62.0 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.62.0.beta.20171017010003 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.62.0.beta.20171016010004 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.62.0.beta.20171015010003 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.62.0.beta.20171014010003 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.62.0.beta.20171011010003 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.62.0.beta.20171010010004 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.61.0 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.61.0.beta.20171009010003 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.61.0.beta.20171008010003 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.61.0.beta.20171007010004 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.61.0.beta.20171006010004 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.61.0.beta.20171005010003 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.61.0.beta.20171004010004 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.60.1 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.60.0 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.60.0.beta.20171003010003 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.60.0.beta.20171002010004 fastlane/lib/fastlane/actions/ruby_version.rb
fastlane-2.60.0.beta.20171001010003 fastlane/lib/fastlane/actions/ruby_version.rb