Sha256: 35b89695446308ebccaeb0277a0d6059b8a64fa1d21bd33fdca5f8a753686c24

Contents?: true

Size: 1.9 KB

Versions: 82

Compression:

Stored size: 1.9 KB

Contents

module Fastlane
  module Actions
    class FrameScreenshotsAction < Action
      def self.run(config)
        return if Helper.test?

        require 'frameit'

        UI.message("Framing screenshots at path #{config[:path]} (via frameit)")

        Dir.chdir(config[:path]) do
          Frameit.config = config
          Frameit::Runner.new.run('.')
        end
      end

      def self.description
        "Adds device frames around all screenshots (via _frameit_)"
      end

      def self.details
        [
          "Uses [frameit](https://docs.fastlane.tools/actions/frameit/) to prepare perfect screenshots for the App Store, your website, QA",
          "or emails. You can add background and titles to the framed screenshots as well."
        ].join("\n")
      end

      def self.available_options
        require "frameit"
        require "frameit/options"
        FastlaneCore::CommanderGenerator.new.generate(Frameit::Options.available_options) + [
          FastlaneCore::ConfigItem.new(key: :path,
                                       env_name: "FRAMEIT_SCREENSHOTS_PATH",
                                       description: "The path to the directory containing the screenshots",
                                        default_value: Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] || FastlaneCore::FastlaneFolder.path,
                                       default_value_dynamic: true)
        ]
      end

      def self.author
        "KrauseFx"
      end

      def self.example_code
        [
          'frame_screenshots',
          'frameit # alias for "frame_screenshots"',
          'frame_screenshots(silver: true)',
          'frame_screenshots(path: "/screenshots")',
          'frame_screenshots(rose_gold: true)'
        ]
      end

      def self.category
        :screenshots
      end

      def self.is_supported?(platform)
        [:ios, :mac].include?(platform)
      end
    end
  end
end

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
fastlane-2.94.0.beta.20180425050017 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.93.1 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.94.0.beta.20180424050050 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.93.0 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.93.0.beta.20180423050019 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.93.0.beta.20180422050034 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.93.0.beta.20180421050012 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.93.0.beta.20180420050021 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.93.0.beta.20180419050008 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.93.0.beta.20180418050020 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.92.1 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.93.0.beta.20180417050013 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.92.0 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.92.0.beta.20180416050023 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.92.0.beta.20180415050019 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.92.0.beta.20180414050023 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.91.0 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.91.0.beta.20180413050017 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.90.0 fastlane/lib/fastlane/actions/frame_screenshots.rb
fastlane-2.90.0.beta.20180412050111 fastlane/lib/fastlane/actions/frame_screenshots.rb