Module: Icapps::Translations

Defined in:
lib/icapps/translations.rb,
lib/icapps/translations/cli.rb,
lib/icapps/translations/http.rb,
lib/icapps/translations/version.rb,
lib/icapps/translations/import/base.rb,
lib/icapps/translations/import/xcode.rb,
lib/icapps/translations/configuration.rb,
lib/icapps/translations/import/gradle.rb

Defined Under Namespace

Modules: Import Classes: CLI, Configuration, Http

Constant Summary collapse

VERSION =
'0.2.6'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.optionsObject

Returns the value of attribute options.



9
10
11
# File 'lib/icapps/translations.rb', line 9

def options
  @options
end

Class Method Details

.android?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/icapps/translations.rb', line 31

def android?
  Dir.glob('**/*.gradle').count > 0
end

.configObject



11
12
13
# File 'lib/icapps/translations.rb', line 11

def config
  @config ||= Configuration.new
end

.importObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/icapps/translations.rb', line 15

def import
  # Validate the configuration file. Abort when invalid.
  config.validate

  # Import the files.
  if xcode?
    puts '[VERBOSE] Detected an Xcode project.'.colorize(:white) if options[:verbose]
    Import::Xcode.import
  elsif android?
    puts '[VERBOSE] Detected an Android project with a .gradle file.'.colorize(:white) if options[:verbose]
    Import::Gradle.import
  else
    abort '[ERROR] No Xcode or Android gradle file detected.'.colorize(:red) unless @project_key
  end
end

.xcode?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/icapps/translations.rb', line 35

def xcode?
  Dir.glob('**/*.xcodeproj').count > 0
end