Class: Gamefic::Sdk::Platform::Web
- Inherits:
-
Base
- Object
- Base
- Gamefic::Sdk::Platform::Web
show all
- Defined in:
- lib/gamefic-sdk/platform/web.rb
Defined Under Namespace
Classes: AppConfig
Instance Attribute Summary
Attributes inherited from Base
#config, #target
Instance Method Summary
collapse
Methods inherited from Base
#build_target, #initialize, #metadata, #name, #plot, #release_target
Instance Method Details
#app_config ⇒ Object
11
12
13
|
# File 'lib/gamefic-sdk/platform/web.rb', line 11
def app_config
@app_config ||= AppConfig.new config.source_dir, config, ["core/opal.js", "core/gamefic.js", "core/static.js", "core/scripts.js", "core/engine.js"]
end
|
#build ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/gamefic-sdk/platform/web.rb', line 15
def build
FileUtils.mkdir_p release_target
FileUtils.mkdir_p build_target
copy_html_files
build_opal_js
build_gamefic_js
build_static_js
build_scripts_js
render_index
copy_assets
copy_media
end
|
#clean ⇒ Object
28
29
30
31
|
# File 'lib/gamefic-sdk/platform/web.rb', line 28
def clean
FileUtils.remove_entry_secure build_target if File.exist?(build_target)
puts "#{name} cleaned."
end
|
#html_dir ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/gamefic-sdk/platform/web.rb', line 33
def html_dir
if @html_dir.nil?
local_dir = (target['html'] ? target['html'] : 'html')
@html_dir = Pathname.new(config.source_dir).join(local_dir).to_s
@html_dir = nil unless Dir.exist?(@html_dir)
if @html_dir.nil?
@html_dir = File.join(Gamefic::Sdk::HTML_TEMPLATE_PATH, 'skins', 'standard')
end
end
@html_dir
end
|