Class: MRubyPortable::BuildWorkspace::RuntimeTemplateContext
- Inherits:
-
Object
- Object
- MRubyPortable::BuildWorkspace::RuntimeTemplateContext
- Defined in:
- lib/mruby_portable/build_workspace.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#xmb_asset_filenames ⇒ Object
readonly
Returns the value of attribute xmb_asset_filenames.
Instance Method Summary collapse
- #cmake_background_path ⇒ Object
- #cmake_icon_path ⇒ Object
- #cmake_preview_path ⇒ Object
- #cmake_preview_video_path ⇒ Object
- #cmake_string(value) ⇒ Object
- #cmake_title ⇒ Object
- #cmake_version ⇒ Object
- #cmake_xmb_asset_path(key) ⇒ Object
- #embedded? ⇒ Boolean
- #get_binding ⇒ Object
-
#initialize(config, mode:, xmb_asset_filenames:) ⇒ RuntimeTemplateContext
constructor
A new instance of RuntimeTemplateContext.
- #target_name ⇒ Object
Constructor Details
#initialize(config, mode:, xmb_asset_filenames:) ⇒ RuntimeTemplateContext
Returns a new instance of RuntimeTemplateContext.
135 136 137 138 139 |
# File 'lib/mruby_portable/build_workspace.rb', line 135 def initialize(config, mode:, xmb_asset_filenames:) @config = config @mode = mode @xmb_asset_filenames = xmb_asset_filenames end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
133 134 135 |
# File 'lib/mruby_portable/build_workspace.rb', line 133 def config @config end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
133 134 135 |
# File 'lib/mruby_portable/build_workspace.rb', line 133 def mode @mode end |
#xmb_asset_filenames ⇒ Object (readonly)
Returns the value of attribute xmb_asset_filenames.
133 134 135 |
# File 'lib/mruby_portable/build_workspace.rb', line 133 def xmb_asset_filenames @xmb_asset_filenames end |
Instance Method Details
#cmake_background_path ⇒ Object
170 171 172 |
# File 'lib/mruby_portable/build_workspace.rb', line 170 def cmake_background_path cmake_xmb_asset_path(:background) end |
#cmake_icon_path ⇒ Object
166 167 168 |
# File 'lib/mruby_portable/build_workspace.rb', line 166 def cmake_icon_path cmake_xmb_asset_path(:icon) end |
#cmake_preview_path ⇒ Object
174 175 176 |
# File 'lib/mruby_portable/build_workspace.rb', line 174 def cmake_preview_path cmake_xmb_asset_path(:preview) end |
#cmake_preview_video_path ⇒ Object
178 179 180 |
# File 'lib/mruby_portable/build_workspace.rb', line 178 def cmake_preview_video_path cmake_xmb_asset_path(:preview_video) end |
#cmake_string(value) ⇒ Object
153 154 155 156 |
# File 'lib/mruby_portable/build_workspace.rb', line 153 def cmake_string(value) escaped = value.to_s.gsub("\\", "/").gsub('"', '\"') "\"#{escaped}\"" end |
#cmake_title ⇒ Object
158 159 160 |
# File 'lib/mruby_portable/build_workspace.rb', line 158 def cmake_title cmake_string(config.title) end |
#cmake_version ⇒ Object
162 163 164 |
# File 'lib/mruby_portable/build_workspace.rb', line 162 def cmake_version cmake_string(config.version) end |
#cmake_xmb_asset_path(key) ⇒ Object
182 183 184 185 |
# File 'lib/mruby_portable/build_workspace.rb', line 182 def cmake_xmb_asset_path(key) filename = xmb_asset_filenames[key] filename ? cmake_string("${CMAKE_CURRENT_SOURCE_DIR}/xmb/#{filename}") : "NULL" end |
#embedded? ⇒ Boolean
145 146 147 |
# File 'lib/mruby_portable/build_workspace.rb', line 145 def mode == "release" end |
#get_binding ⇒ Object
141 142 143 |
# File 'lib/mruby_portable/build_workspace.rb', line 141 def get_binding binding end |
#target_name ⇒ Object
149 150 151 |
# File 'lib/mruby_portable/build_workspace.rb', line 149 def target_name config.target_name end |