b0VIM 8.2DÁÓ`<É,ÕfjoshholtzJoshs-MacBook-Air.local~joshholtz/Developer/fastlane/fastlane/frameit/lib/frameit/screenshot.rb 3210#"! Utp[+\adŸ[æȨŽtsdF3·\  ì Ä Š 4  é è § ’  ñ Ë ’ d î Î € B Õ º ˆ ^ þBÌ…(Œ„ƒ7#ÏÇÆ°”Œ‹qQIHðµ­¬‰{@87* ­”\80/å®­•j&ª Ÿž end UI.user_error("orientation_block must return #{valid[0..-2].join(', ')} or nil") unless valid.include?(orientation) valid = [:landscape_left, :landscape_right, :portrait, nil] orientation = block.call(filename) unless block.nil? block = Frameit.config[:force_orientation_block] filename = File.basename(self.path, ".*") def frame_orientation end return Orientation::LANDSCAPE return Orientation::PORTRAIT if size[0] < size[1] def orientation_name # The name of the orientation of a screenshot. Used to find the correct template end device_name == 'MacBook' def mac? end !device.density_ppi.nil? && device.density_ppi < 300 def mini? # Super old devices (iPhone 4) end !device.density_ppi.nil? && device.density_ppi > 400 def triple_density? # Is the device a 3x device? (e.g. iPhone 6 Plus, iPhone X) end @device.deliver_screen_id def deliver_screen_id end @device.default_color def default_color end # rubocop:enable Require/MissingRequireStatement @device.formatted_name def device_name # Device name for a given screen size. Used to use the correct template end @device = Device.find_device_by_id_or_name(config['force_device_type'] || Frameit.config[:force_device_type]) || Device.detect_device(path, platform) platform = config['use_platform'] || platform_command || Frameit.config[:use_platform] # should override CLI parameters and fastfile global setting # - should have the highest priority, because user might set a specific value for a specific screenshot which # to Screenshot's constructor as config, i.e. we call config[key]) # - accessed via ConfigParser.fetch_value(screenshot.path)[key] (the ConfigParser's instance is passed # - both default and specific values can be entered in the file (filtered by file name) # - see Advanced usage in the doc # - gets key / values from Framefile.json # - config_parser.rb # - higher priority than options.rb (user may enter a command to override fastfile's global setting) # - they are passed via constructors to other classes # - commands entered directly to CLI (e. g. fastlane frameit android) # - commands_generator.rb # - lowest priority # - default value is either general platform from fastfile or IOS if run directly # - accessed via Frameit.config[:key] # - contains default values and validates values # - see Parameters in the doc # settings for a given project) # - gets parameters via CLI (e. g. fastlane run frameit use_platform:"android") or fastfile (Fastlane's global # - options.rb # There are three ways how we can get settings to Frameit: @size = FastImage.size(path) @path = path @color = color UI.user_error!("Couldn't find file at path '#{path}'") unless File.exist?(path) def initialize(path, color, config, platform_command) # color: Color to use for the frame # path: Path to screenshot attr_accessor :color # the color to use for the frame (from Frameit::Color) attr_accessor :device # device detected according to resolution, priority and settings attr_accessor :size # size in px array of 2 elements: height and width attr_accessor :path # path to the screenshot class Screenshot # Represents one screenshotmodule Frameitrequire_relative 'device'require_relative 'module'require_relative 'device_types'require_relative 'mac_editor'require_relative 'editor'ad Õ +·¶…<þöõãµ­¬”`XW> í ³ « ª – S K J ÿ ß Í › c [ Z I   ÷ ç ß Ù Õ Ô end end end self.path def to_s end @language ||= Pathname.new(path).parent.basename.to_s def language end return File.mtime(path) > File.mtime(output_path) return true unless File.exist?(output_path) def outdated? # then we must be outdated. # If the framed screenshot was generated *before* the screenshot file, end path.gsub('.png', '_framed.png').gsub('.PNG', '_framed.png') def output_path end return self.landscape_left? || self.landscape_right def landscape? end return (frame_orientation == :landscape_right) def landscape_right? end return (frame_orientation == :landscape_left) def landscape_left? end return (frame_orientation == :portrait) def portrait? end return :landscape_right # Default landscape orientation return :portrait if self.orientation_name == Orientation::PORTRAIT return orientation unless orientation.nil? puts("Forced orientation: #{orientation}") unless orientation.nil?