Class: MRubyPortable::BuildWorkspace
- Inherits:
-
Object
- Object
- MRubyPortable::BuildWorkspace
- 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
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#workspace ⇒ Object
readonly
Returns the value of attribute workspace.
Instance Method Summary collapse
-
#initialize(config, mode:, workspace:) ⇒ BuildWorkspace
constructor
A new instance of BuildWorkspace.
- #prepare ⇒ Object
Constructor Details
#initialize(config, mode:, workspace:) ⇒ BuildWorkspace
Returns a new instance of BuildWorkspace.
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.(workspace) raise Error, "mode must be dev or release" unless %w[dev release].include?(@mode) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
18 19 20 |
# File 'lib/mruby_portable/build_workspace.rb', line 18 def config @config end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
18 19 20 |
# File 'lib/mruby_portable/build_workspace.rb', line 18 def mode @mode end |
#workspace ⇒ Object (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
#prepare ⇒ Object
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 |