Class: MRubyPortable::BuildWorkspace

Inherits:
Object
  • Object
show all
Defined in:
lib/mruby_portable/build_workspace.rb

Defined Under Namespace

Classes: RuntimeTemplateContext

Constant Summary collapse

RUNTIME_FILES =
%w[
  app_path.c
  app_path.h
  error_screen.c
  error_screen.h
  psp_game.rb
].freeze
RUNTIME_ASSETS =
"runtime/assets"
XMB_ASSET_KEYS =
%i[icon background preview preview_video].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, mode:, workspace:) ⇒ BuildWorkspace

Returns a new instance of BuildWorkspace.

Raises:



20
21
22
23
24
25
# File 'lib/mruby_portable/build_workspace.rb', line 20

def initialize(config, mode:, workspace:)
  @config = config
  @mode = mode.to_s
  @workspace = File.expand_path(workspace)
  raise Error, "mode must be dev or release" unless %w[dev release].include?(@mode)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



18
19
20
# File 'lib/mruby_portable/build_workspace.rb', line 18

def config
  @config
end

#modeObject (readonly)

Returns the value of attribute mode.



18
19
20
# File 'lib/mruby_portable/build_workspace.rb', line 18

def mode
  @mode
end

#workspaceObject (readonly)

Returns the value of attribute workspace.



18
19
20
# File 'lib/mruby_portable/build_workspace.rb', line 18

def workspace
  @workspace
end

Instance Method Details

#prepareObject



27
28
29
30
31
32
33
34
35
36
# File 'lib/mruby_portable/build_workspace.rb', line 27

def prepare
  FileUtils.mkdir_p(workspace)
  render_runtime_templates
  copy_runtime_files
  copy_runtime_assets
  copy_assets
  copy_xmb_assets
  mode == "dev" ? prepare_dev_files : prepare_release_files
  workspace
end