Module: Screengrab

Defined in:
lib/screengrab.rb,
lib/screengrab/setup.rb,
lib/screengrab/runner.rb,
lib/screengrab/options.rb,
lib/screengrab/version.rb,
lib/screengrab/detect_values.rb,
lib/screengrab/commands_generator.rb,
lib/screengrab/dependency_checker.rb,
lib/screengrab/android_environment.rb

Defined Under Namespace

Classes: AndroidEnvironment, CommandsGenerator, DependencyChecker, DetectValues, Options, Runner, Setup

Constant Summary collapse

Helper =

you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore

FastlaneCore::Helper
UI =
FastlaneCore::UI
ROOT =
Pathname.new(File.expand_path('../..', __FILE__))
VERSION =
determine_version.freeze
DESCRIPTION =
"Automated localized screenshots of your Android app on every device".freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.android_environmentObject

Returns the value of attribute android_environment.



17
18
19
# File 'lib/screengrab.rb', line 17

def android_environment
  @android_environment
end

.configObject

Returns the value of attribute config.



16
17
18
# File 'lib/screengrab.rb', line 16

def config
  @config
end

Class Method Details

.determine_versionObject

In order to share the tool version info between Java and Ruby from one canonical file, we’re including version.properties in the bundled Gem, and deriving the version info from it here



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/screengrab/version.rb', line 4

def self.determine_version
  version_props_file = File.join(File.dirname(__FILE__), '../../version.properties')

  # Java tends to write files as UTF-8, so we need to be resilent to the UTF-8 Byte Order Mark
  # being present
  File.open(version_props_file, 'r:bom|utf-8') do |f|
    v = {}

    # This file gets evaluated _before_ the gemspec gets built, we don't have access to loaded
    # 3rd party gems here! Thus, we'll do it simply, by hand.
    f.read.split("\n").each do |line|
      key, val = line.chomp.split('=')
      next if key.nil? || val.nil? || key.empty? || val.empty?
      v[key.strip] = val.strip
    end

    # The value of the block is returned from File.open
    [v['major'], v['minor'], v['patch']].join('.')
  end
end

.screengrabfile_nameObject



24
25
26
# File 'lib/screengrab.rb', line 24

def screengrabfile_name
  "Screengrabfile"
end