Class: Confetti::Template::WebosAppinfo

Inherits:
Base
  • Object
show all
Includes:
JavaChecks, VersionHelper
Defined in:
lib/confetti/templates/webos_appinfo.rb

Constant Summary

Constants included from JavaChecks

JavaChecks::RESERVED_WORDS

Instance Method Summary collapse

Methods included from VersionHelper

#normalize_version

Methods included from JavaChecks

#convert_to_java_identifier, #convert_to_java_package_id, #is_java_identifier, #is_java_package_id, #reserved_word?

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Confetti::Template::Base

Instance Method Details

#app_idObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/confetti/templates/webos_appinfo.rb', line 7

def app_id
  pkg = convert_to_java_package_id(@config.package).downcase
  pkg.gsub!(/[^0-9a-z.]/,'')

  if is_java_package_id(pkg)
    pkg
  else
    'com.phonegap.app'
  end
end

#app_nameObject



18
19
20
# File 'lib/confetti/templates/webos_appinfo.rb', line 18

def app_name
  @config.name.name
end

#output_filenameObject



22
23
24
# File 'lib/confetti/templates/webos_appinfo.rb', line 22

def output_filename
  "appinfo.json"
end

#tablet_support?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/confetti/templates/webos_appinfo.rb', line 34

def tablet_support?
  true unless @config.preference("target-device")
end

#vendorObject



30
31
32
# File 'lib/confetti/templates/webos_appinfo.rb', line 30

def vendor
  @config.author.name
end

#versionObject



26
27
28
# File 'lib/confetti/templates/webos_appinfo.rb', line 26

def version
  normalize_version(@config.version_string)
end