Class: Confetti::Template::IosInfo

Inherits:
Base
  • Object
show all
Defined in:
lib/confetti/templates/ios_info.rb

Direct Known Subclasses

IosRemotePlist

Constant Summary collapse

ORIENTATIONS_MAP =
{
  :landscape => [
    "UIInterfaceOrientationLandscapeLeft",
    "UIInterfaceOrientationLandscapeRight"
  ],
  :portrait => [
    "UIInterfaceOrientationPortrait",
    "UIInterfaceOrientationPortraitUpsideDown"
  ],
  :default => [
    "UIInterfaceOrientationPortrait",
    "UIInterfaceOrientationPortraitUpsideDown",
    "UIInterfaceOrientationLandscapeLeft",
    "UIInterfaceOrientationLandscapeRight"
  ]
}
STATUS_BARS =
{
  :default              => "UIStatusBarStyleDefault",
  :"black-translucent"  => "UIStatusBarStyleBlackTranslucent",
  :"black-opaque"       => "UIStatusBarStyleBlackOpaque"
}

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#app_orientationsObject



58
59
60
# File 'lib/confetti/templates/ios_info.rb', line 58

def app_orientations
  ORIENTATIONS_MAP[@config.orientation]
end

#bundle_identifierObject



31
32
33
# File 'lib/confetti/templates/ios_info.rb', line 31

def bundle_identifier
  @config.package
end

#bundle_versionObject



35
36
37
# File 'lib/confetti/templates/ios_info.rb', line 35

def bundle_version
  @config.version_string
end

#devicesObject



47
48
49
50
51
52
53
54
55
56
# File 'lib/confetti/templates/ios_info.rb', line 47

def devices 
  nibs = ["NSMainNibFile"]

  @config.preference_set.each do |preference|
    next unless preference.name
    nibs << "NSMainNibFile~ipad" if preference.name.match /^universal$/
  end

  nibs
end

#exit_on_suspend?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/confetti/templates/ios_info.rb', line 62

def exit_on_suspend?
   @config.preference("exit-on-suspend") == :true
end

#fullscreen?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/confetti/templates/ios_info.rb', line 66

def fullscreen?
  @config.preference(:fullscreen) == :true
end

#iconsObject



27
28
29
# File 'lib/confetti/templates/ios_info.rb', line 27

def icons
  @config.plist_icon_set
end

#output_filenameObject



43
44
45
# File 'lib/confetti/templates/ios_info.rb', line 43

def output_filename
  "Info.plist"
end

#prerendered_icon?Boolean

Returns:

  • (Boolean)


84
85
86
# File 'lib/confetti/templates/ios_info.rb', line 84

def prerendered_icon?
  @config.preference("prerendered-icon") == :true
end

#product_nameObject



39
40
41
# File 'lib/confetti/templates/ios_info.rb', line 39

def product_name
  @config.name.name
end

#statusbar_styleObject



88
89
90
91
92
93
# File 'lib/confetti/templates/ios_info.rb', line 88

def statusbar_style
  pref = @config.preference("ios-statusbarstyle")
  if pref
    STATUS_BARS[pref]
  end
end

#url_schemesObject



70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/confetti/templates/ios_info.rb', line 70

def url_schemes
  result = []
  
  @config.url_scheme_set.each { |url_scheme|
    result << {
      :name => url_scheme.name || @config.package,
      :role => %w{Editor Viewer Shell None}.find{|u| u == url_scheme.role} || "None",
      :schemes => url_scheme.schemes
    }
  }
  
  result
end