Sha256: 8483871809f48274836a699f00af18aabdaa452397ab7925e09ca20e0180c9be

Contents?: true

Size: 1.56 KB

Versions: 11

Compression:

Stored size: 1.56 KB

Contents

module Pantograph
  module Actions
    module SharedValues
    end

    class MinPantographVersionAction < 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 pantograph version as parameter to min_pantograph_version") unless defined_version

        if Gem::Version.new(Pantograph::VERSION) < defined_version
          PantographCore::UpdateChecker.show_update_message('pantograph', Pantograph::VERSION)
          error_message = "The Pantfile requires a pantograph version of >= #{defined_version}. You are on #{Pantograph::VERSION}."
          UI.user_error!(error_message)
        end

        UI.message("Your pantograph version #{Pantograph::VERSION} matches the minimum requirement of #{defined_version}  ✅")
      end

      def self.step_text
        "Verifying pantograph version"
      end

      def self.author
        "KrauseFx"
      end

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

      def self.example_code
        [
          'min_pantograph_version("1.50.0")'
        ]
      end

      def self.details
        [
          "Add this to your `Pantfile` to require a certain version of _pantograph_.",
          "Use it if you use an action that just recently came out and you need it."
        ].join("\n")
      end

      def self.category
        :misc
      end

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pantograph-0.1.14 pantograph/lib/pantograph/actions/min_pantograph_version.rb
pantograph-0.1.13 pantograph/lib/pantograph/actions/min_pantograph_version.rb
pantograph-0.1.12 pantograph/lib/pantograph/actions/min_pantograph_version.rb
pantograph-0.1.10 pantograph/lib/pantograph/actions/min_pantograph_version.rb
pantograph-0.1.8 pantograph/lib/pantograph/actions/min_pantograph_version.rb
pantograph-0.1.7 pantograph/lib/pantograph/actions/min_pantograph_version.rb
pantograph-0.1.6 pantograph/lib/pantograph/actions/min_pantograph_version.rb
pantograph-0.1.4 pantograph/lib/pantograph/actions/min_pantograph_version.rb
pantograph-0.1.3 pantograph/lib/pantograph/actions/min_pantograph_version.rb
pantograph-0.1.1 pantograph/lib/pantograph/actions/min_pantograph_version.rb
pantograph-0.1.0 pantograph/lib/pantograph/actions/min_pantograph_version.rb