Class: Gamefic::Sdk::Platform::Gfic

Inherits:
Base
  • Object
show all
Defined in:
lib/gamefic-sdk/platform/gfic.rb

Instance Attribute Summary

Attributes inherited from Base

#config, #target

Instance Method Summary collapse

Methods inherited from Base

#build_target, #clean, #initialize, #metadata, #name, #plot, #release_target

Constructor Details

This class inherits a constructor from Gamefic::Sdk::Platform::Base

Instance Method Details

#buildObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/gamefic-sdk/platform/gfic.rb', line 8

def build
  FileUtils.rm filename if File.file?(filename)
  FileUtils.mkdir_p release_target
  Zip::File.open(filename, Zip::File::CREATE) do |zipfile|
    plot.imported_scripts.each { |script|
      zipfile.add File.join('scripts', "#{script.path}.plot.rb"), script.absolute_path
    }
    Tempfile.open('metadata.yaml') do |file|
      file.puts .to_yaml
      zipfile.add "metadata.yaml", file.path
    end
  end
end

#filenameObject



22
23
24
# File 'lib/gamefic-sdk/platform/gfic.rb', line 22

def filename
  @filename ||= File.join(release_target, (target['filename'] || 'game.gfic'))
end