Class: Confetti::Template::WebosAppinfo

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

Instance Method Summary collapse

Methods included from JavaChecks

#convert_to_java_identifier, #is_java_identifier, #is_java_package_id

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#app_idObject



6
7
8
9
10
11
12
# File 'lib/confetti/templates/webos_appinfo.rb', line 6

def app_id
  if @config
    if is_java_package_id(@config.package)
      @config.package
    end
  end
end

#app_nameObject



14
15
16
# File 'lib/confetti/templates/webos_appinfo.rb', line 14

def app_name
  @config.name.name
end

#output_filenameObject



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

def output_filename
  "appinfo.json"
end

#vendorObject



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

def vendor
  @config.author.name
end

#versionObject



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/confetti/templates/webos_appinfo.rb', line 22

def version
  if @config.version.nil?
    '0.0.1'
  elsif @config.version.match /^(\d)+[.](\d)+[.](\d)+$/
    @config.version
  elsif @config.version.match /^((\d)+[.])*(\d)+$/
    fix_version(@config.version)
  else
    fail "need a valid version number of the form 0.0.0"
  end
end